Skip to content

Instantly share code, notes, and snippets.

@dreikanter
Created September 25, 2015 15:26
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save dreikanter/fa6ac9641fbbf276c0dc to your computer and use it in GitHub Desktop.
Save dreikanter/fa6ac9641fbbf276c0dc to your computer and use it in GitHub Desktop.
SNS topic policy for S3 notifications
{
"Version": "2008-10-17",
"Id": "__default_policy_ID",
"Statement": [
{
"Sid": "__default_statement_ID",
"Effect": "Allow",
"Principal": {
"AWS": "*"
},
"Action": [
"SNS:ListSubscriptionsByTopic",
"SNS:Subscribe",
"SNS:DeleteTopic",
"SNS:GetTopicAttributes",
"SNS:Publish",
"SNS:RemovePermission",
"SNS:AddPermission",
"SNS:Receive",
"SNS:SetTopicAttributes"
],
"Resource": "arn:aws:sns:us-west-1:650812809896:new-image",
"Condition": {
"StringEquals": {
"AWS:SourceOwner": "650812809896"
}
}
},
{
"Sid": "example-statement-ID",
"Effect": "Allow",
"Principal": {
"Service": "s3.amazonaws.com"
},
"Action": "SNS:Publish",
"Resource": "arn:aws:sns:us-west-1:650812809896:new-image",
"Condition": {
"ArnLike": {
"aws:SourceArn": "arn:aws:s3:*:*:*"
}
}
}
]
}
@dreikanter
Copy link
Author

Configuring Amazon S3 Event Notifications
https://docs.aws.amazon.com/AmazonS3/latest/dev/NotificationHowTo.html

Configure a Bucket for Notifications (Message Destination: SNS Topic and SQS Queue)
https://docs.aws.amazon.com/AmazonS3/latest/dev/ways-to-add-notification-config-to-bucket.html

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment