Created
December 11, 2018 15:32
-
-
Save tkeeber/74ae3cb39e2a12090fdbb8fce4140891 to your computer and use it in GitHub Desktop.
This file contains hidden or 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
AWSTemplateFormatVersion: '2010-09-09' | |
Transform: AWS::Serverless-2016-10-31 | |
Description: AWS SNS topic to SQS Queue Filtered | |
Resources: | |
StatsTopic: | |
Type: AWS::SNS::Topic | |
StatsPersistQueue: | |
Type: AWS::SQS::Queue | |
Properties: | |
VisibilityTimeout: 60 # 1 minute | |
MessageRetentionPeriod: 300 # 5 mins. | |
StatsProcessQueue: | |
Type: AWS::SQS::Queue | |
Properties: | |
VisibilityTimeout: 60 # 1 minute | |
MessageRetentionPeriod: 300 # 5 mins. | |
StatsPersistQueueSubscription: | |
Type: AWS::SNS::Subscription | |
Properties: | |
TopicArn: !Ref StatsTopic | |
Endpoint: !GetAtt StatsPersistQueue.Arn | |
Protocol: sqs | |
JustSomeStatsProcessQueueSubscription: | |
Type: AWS::SNS::Subscription | |
Properties: | |
TopicArn: !Ref StatsTopic | |
Endpoint: !GetAtt StatsProcessQueue.Arn | |
Protocol: sqs | |
FilterPolicy: | |
statsType: | |
- SomeStatsType | |
RawMessageDelivery: true | |
FilteredStatsUpdatesPolicy: | |
Type: AWS::SQS::QueuePolicy | |
Properties: | |
PolicyDocument: | |
Id: StatsQueuePolicy | |
Statement: | |
- Sid: 'Allow-SendMessage-To-Queues-From-SNS-Topic' | |
Effect: Allow | |
Principal: | |
AWS: '*' | |
Action: | |
- 'sqs:SendMessage' | |
Resource: '*' | |
Condition: | |
ArnEquals: | |
'aws:SourceArn': | |
Ref: StatsTopic | |
Queues: | |
- !Ref StatsPersistQueue | |
- !Ref StatsProcessQueue |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment