Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save nivleshc/98a094321008253bfd2b3b70b2353f83 to your computer and use it in GitHub Desktop.
Save nivleshc/98a094321008253bfd2b3b70b2353f83 to your computer and use it in GitHub Desktop.
This gist contains the Resources section of template.yaml from the blog-create-evergreen-golden-amis repository. It shows the IAM policy for the Amazon SNS Topic resource.
# IAM role that will be attached to the AWS SNS Topic. This will allow AWS EventBridge events to publish messages to it
EvergreenAMISNSTopicPolicy:
Type: AWS::SNS::TopicPolicy
Properties:
PolicyDocument:
Version: '2012-10-17'
Statement:
- Sid: __default_statement_ID
Effect: Allow
Principal:
"AWS": "*"
Action:
- sns:GetTopicAttributes
- sns:SetTopicAttributes
- sns:AddPermission
- sns:RemovePermission
- sns:DeleteTopic
- sns:Subscribe
- sns:ListSubscriptionsByTopic
- sns:Publish
Resource: !Ref EvergreenAMISNSTopic
Condition:
StringEquals:
"AWS:SourceOwner": !Ref 'AWS::AccountId'
- Sid: Allow_CloudWatchEvents_To_Publish
Effect: Allow
Action:
- sns:Publish
Principal:
"Service": "events.amazonaws.com"
Resource: !Ref EvergreenAMISNSTopic
Topics:
- !Ref EvergreenAMISNSTopic
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment