How to fix the issue to allow s3 to publish message to an SNS Topic? – Explained

You may find permission issue while configuring your s3 event notification to publish a message to an SNS topic.

What’s the Issue?

AWS s3 event configuration results an error while setting up the s3 event configuration to publish a message to an SNS topic

Unable to validate the following destination configuration : Permission on the destination topic do not allow s3 to publish notification from this bucket

How to Fix?

In order to fix the issue, you need to update your SNS topic policy to allow s3 to publish a message to this topic.

1. Sign in to AWS Console (link) and open SNS Service

2. Select Your Topic and Click on Edit

3. Click on Access Policy (Optional)

4. Update your Policy with below SNS Topic policy and Save it

{
   "Id": "s3EventSNS",
   "Version": "2012-10-17",
   "Statement": [
     {
       "Sid": "s3EventSNSNotification",
       "Action": [
         "sns:Publish"
       ],
       "Effect": "Allow",
       "Resource": "<YourTopicARN>",
       "Condition": {
         "ArnLike": {
           "aws:SourceArn": "<Yours3BucketARN>"
         }
       },
       "Principal": "*"
     }
   ]
 }

5. Go to s3 Service and Save the Event Configuration for your Bucket

6. Upload an Object in s3 Bucket and Verify if the event configuration is able to publish the message to SNS topic or Not

As we observed, the message is successfully published to the SNS Topic.

Please comment below for any questions related to this article.

4 thoughts on “How to fix the issue to allow s3 to publish message to an SNS Topic? – Explained

Add yours

  1. Whether it will notify only the Key to the SNS topic or the object (data) itself can be published to the SNS topic using the Event Notifications.

    Like

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

This site uses Akismet to reduce spam. Learn how your comment data is processed.

Create a website or blog at WordPress.com

Up ↑

%d bloggers like this: