-
Notifications
You must be signed in to change notification settings - Fork 1.2k
Adds SQS events to zappa #1617
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Adds SQS events to zappa #1617
Changes from all commits
04a6819
ae37072
8f23a20
8e54cb5
c387305
e9f1e30
a028da4
09687a4
2ac20b8
14c1c8a
4892dbe
6d8d0c7
8c0d465
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -458,7 +458,7 @@ However, it's now far easier to use Route 53-based DNS authentication, which wil | |
|
|
||
| ## Executing in Response to AWS Events | ||
|
|
||
| Similarly, you can have your functions execute in response to events that happen in the AWS ecosystem, such as S3 uploads, DynamoDB entries, Kinesis streams, and SNS messages. | ||
| Similarly, you can have your functions execute in response to events that happen in the AWS ecosystem, such as S3 uploads, DynamoDB entries, Kinesis streams, SNS messages, and SQS queues. | ||
|
|
||
| In your *zappa_settings.json* file, define your [event sources](http://docs.aws.amazon.com/lambda/latest/dg/invoking-lambda-function.html) and the function you wish to execute. For instance, this will execute `your_module.process_upload_function` in response to new objects in your `my-bucket` S3 bucket. Note that `process_upload_function` must accept `event` and `context` parameters. | ||
|
|
||
|
|
@@ -556,6 +556,21 @@ Optionally you can add [SNS message filters](http://docs.aws.amazon.com/sns/late | |
| ] | ||
| ``` | ||
|
|
||
| [SQS](https://docs.aws.amazon.com/lambda/latest/dg/with-sqs.html) is also pulling messages from a stream. At this time, [only "Standard" queues can trigger lambda events, not "FIFO" queues](https://docs.aws.amazon.com/lambda/latest/dg/with-sqs.html). Read the AWS Documentation carefully since Lambda calls the SQS DeleteMessage API on your behalf once your function completes successfully. | ||
|
|
||
| ```javascript | ||
| "events": [ | ||
| { | ||
| "function": "your_module.process_messages", | ||
| "event_source": { | ||
| "arn": "arn:aws:sqs:us-east-1:12341234:your-queue-name-arn", | ||
| "batch_size": 10, // Max: 10. Use 1 to trigger immediate processing | ||
| "enabled": true // Default is false | ||
|
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Why is this needed? We don't have an enabled field for other event sources. If they are present, they are enabled.
Collaborator
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Probably isn't going to test without it and clean up if it works. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Strangely, none of the event sources have the 'enabled' knob built into the AWS configuration. See 'Enabled' parameter at end of documentation: https://docs.aws.amazon.com/lambda/latest/dg/with-sqs.html I suspect it's probably some sort of throttling mechanism that typical SQS event sinks have control over. Agree that it's a little wonky, but I would recommend to leave it.
Collaborator
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. @mcrowson enabled is false by default on push events - we also have the same behaviour for the other push events (dynamodb and kinesis). Without enabled you need to turn it on in the console, which makes some sense to me if you want to control/test when a consumer is "consuming" information from a queue. |
||
| } | ||
| } | ||
| ] | ||
| ``` | ||
|
|
||
| For configuring Lex Bot's intent triggered events: | ||
| ```javascript | ||
| "bot_events": [ | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do we need to update the default IAM stuff to include SQS perms?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
No, it's a push event.