Before Amazon S3 publish messages to a destination, you must
grant the Amazon S3 principal the necessary permissions to call the relevant
API to publish messages to an SNS topic
While creating SNS topics, we should have to provide a publish
permission to S3 buckets
Step 1 : Create SNS topic ( Select standard, currently standard
is supported by s3 notification)
Step 2: Access policy option select advanced option and
update the JSON as like below.
In the JSON Editor change JSON below
{
"Version": "2012-10-17",
"Id": "example-ID",
"Statement": [
{
"Sid": "example-statement-ID",
"Effect": "Allow",
"Principal": {
"Service":
"s3.amazonaws.com"
},
"Action": [
"SNS:Publish"
],
"Resource": "SNS-topic-ARN",
"Condition": {
"ArnLike": {
"aws:SourceArn": "arn:aws:s3:*:*:bucket-name" },
"StringEquals": {
"aws:SourceAccount": "bucket-owner-account-id" }
}
}
]
}
Step3: Create the topic and subscribe the topics.
Step 4: Go the S3 bucket and create event notification.
Step5: Select SNS option, select created SNS topic and save changes
No comments:
Post a Comment