Created
August 25, 2021 14:27
-
-
Save joawan/9d79c5d9c0ec40e74991da513086d960 to your computer and use it in GitHub Desktop.
AWS SAM for SES event pipeline
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
EventsSNS: | |
Type: AWS::SNS::Topic | |
Properties: | |
TopicName: sam-pigeon-events | |
Subscription: | |
- Endpoint: !GetAtt EventsQueue.Arn | |
Protocol: sqs | |
EventsQueue: | |
Type: AWS::SQS::Queue | |
Properties: | |
QueueName: sam-pigeon-events | |
EventsQueuePolicy: | |
Type: AWS::SQS::QueuePolicy | |
Properties: | |
Queues: | |
- !Ref EventsQueue | |
PolicyDocument: | |
Version: '2012-10-17' | |
Statement: | |
- Effect: Allow | |
Action: | |
- sqs:SendMessage | |
Resource: !GetAtt EventsQueue.Arn | |
Principal: '*' | |
Condition: | |
ArnEquals: | |
aws:SourceArn: !Ref EventsSNS | |
IngestEventLambda: | |
Type: AWS::Serverless::Function | |
Properties: | |
CodeUri: src/ingest-event/ | |
Description: Polls SQS, forwards event | |
Policies: | |
- SQSPollerPolicy: | |
QueueName: !GetAtt EventsQueue.QueueName | |
Events: | |
SQSEvent: | |
Type: SQS | |
Properties: | |
BatchSize: 10 | |
Queue: !GetAtt EventsQueue.Arn | |
Environment: | |
Variables: | |
STAGE: !Ref Stage |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment