-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add SNS topic and configure event configuration for it
- Loading branch information
1 parent
b19d308
commit d722bcb
Showing
4 changed files
with
57 additions
and
4 deletions.
There are no files selected for viewing
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
template: | ||
path: sns-topic.yaml | ||
stack_name: "{{ stack_group_config.namespace }}-sns-input-to-sqs" | ||
parameters: | ||
S3SourceBucketArn: !stack_output_external recover-dev-input-bucket::BucketArn | ||
stack_tags: | ||
{{ stack_group_config.default_stack_tags }} |
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,45 @@ | ||
AWSTemplateFormatVersion: "2010-09-09" | ||
|
||
Description: > | ||
Creates a Standard SNS queue which can be used with S3 event notifications. | ||
Parameters: | ||
|
||
S3SourceBucketArn: | ||
Type: String | ||
Description: Arn of the S3 bucket where source data are stored. | ||
|
||
Resources: | ||
|
||
SnsTopic: | ||
Type: "AWS::SNS::Topic" | ||
Properties: | ||
TopicName: !Sub "${AWS::StackName}-Topic" | ||
FifoTopic: false | ||
|
||
SnsTopicPolicy: | ||
Type: AWS::SNS::TopicPolicy | ||
Properties: | ||
PolicyDocument: | ||
Version: "2012-10-17" | ||
Statement: | ||
- Sid: Input S3 bucket event notification to SNS | ||
Effect: Allow | ||
Principal: | ||
Service: s3.amazonaws.com | ||
AWS: !Sub '${AWS::AccountId}' | ||
Action: | ||
- sns:Publish | ||
Resource: !Ref SnsTopic | ||
#Condition: | ||
#ArnLike: | ||
# "aws:SourceArn": !Ref S3SourceBucketArn | ||
Topics: | ||
- !Ref SnsTopic | ||
|
||
Outputs: | ||
|
||
SnsTopicArn: | ||
Value: !Ref SnsTopic | ||
Export: | ||
Name: !Sub "${AWS::Region}-${AWS::StackName}-SnsTopicArn" |