Created
December 11, 2014 13:34
-
-
Save kenoir/b52c83a7fa2884321129 to your computer and use it in GitHub Desktop.
SNS topic with subscriptions from external account.
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
{ | |
"AWSTemplateFormatVersion": "2010-09-09", | |
"Description": "Publish or be damned.", | |
"Parameters": { | |
"SubscriberPrincipals": { | |
"Type": "CommaDelimitedList", | |
"Description": "Account IDs to allow subscription from." | |
} | |
}, | |
"Resources": { | |
"SNSTopic": { | |
"Type": "AWS::SNS::Topic", | |
"Properties": {} | |
}, | |
"SNSTopicPolicy": { | |
"Type": "AWS::SNS::TopicPolicy", | |
"Properties": { | |
"PolicyDocument": { | |
"Version": "2012-10-17", | |
"Id": "MyTopicSubscribePolicy", | |
"Statement": [ | |
{ | |
"Sid": "Allow-other-account-to-subscribe-to-topic", | |
"Effect": "Allow", | |
"Principal": { | |
"AWS": { "Ref" : "SubscriberPrincipals" } | |
}, | |
"Action": "sns:Subscribe", | |
"Resource": { | |
"Ref": "SNSTopic" | |
} | |
} | |
] | |
}, | |
"Topics": [ | |
{ | |
"Ref": "SNSTopic" | |
} | |
] | |
} | |
} | |
}, | |
"Outputs": { | |
"SNSTopicTopicARN": { | |
"Value": { | |
"Ref": "SNSTopic" | |
} | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment