×
Cloud Computing Cloud Services Virtualization

Steps to configure E-mail notification for S3 Bucket

In this blog, we will show you the steps to configure E-mail Notification for S3 bucket in the AWS environment.

 

ENVIRONMENT OVERVIEW

 

  • We have already created a bucket named s3-aznotification for this demo.

Steps to configure E-mail notification for S3 Bucket

 

CREATING SNS (SIMPLE NOTIFICATION SERVICE) TOPIC

 

  • Login in to your AWS account and search for SNS service.

Steps to configure E-mail notification for S3 Bucket

 

  • Select the Topics option.

 

  • Click on Create Topic button.

 

  • Provide the Name and Display Name and click on Create topic.

 

  • Under the Subscription topic, select the Create subscription option.

 

  • From the create subscription window, select the protocol as E-mail from the drop-down list.

 

  • Provide your e-mail address and click on create the subscription.

 

  • You will receive a confirmation E-mail to your inbox. Click on the confirm subscription link.

 

  • Once you confirmed the subscription, the status will be changed to confirmed in SNS.

 

  • Go to the topics section and select the topic and click on Edit.

Steps to configure E-mail notification for S3 Bucket

 

  • Expand the Access Policy menu, and paste the below policy.

Steps to configure E-mail notification for S3 Bucket

{
"Version": "2008-10-17",
"Id": "__default_policy_ID",
"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",
"SNS:Receive"
],
"Resource": "arn:aws:sns:ap-south-1:216045319100:AZ-S3-Notification", # Need to update new resource ARN
"Condition": {
"ArnLike": { "aws:SourceArn": "arn:aws:s3:*:*:s3-aznotification" }    # Need to update the S3 Bucket name
}
}
]
}

 

  • Make sure that you have updated the Resource ARN and Bucket name in the policy. You can find the Resource ARN under your topic details section.

Steps to configure E-mail notification for S3 Bucket

 

  • Once you update the access policy, click on save changes.

 

CREATING S3 EVENTS

 

  • Open the AWS services list and search for the S3 bucket.

Steps to configure E-mail notification for S3 Bucket

 

  • Click on the S3 bucket name to configure the E-mail notification. For this demo, we use s3-aznotification.

Steps to configure E-mail notification for S3 Bucket

 

  • Select the properties tab and click on Events.

Steps to configure E-mail notification for S3 Bucket

Steps to configure E-mail notification for S3 Bucket

 

  • Click on Add notification.

Steps to configure E-mail notification for S3 Bucket

 

  • Provide a name for the event and for testing purpose we select only the PUT event.

Steps to configure E-mail notification for S3 Bucket

 

  • Under sent to section, select the notification destination as SNS topic and select the corresponding Topic and click on the Save button.

Steps to configure E-mail notification for S3 Bucket

 

VERIFICATION

  • Now upload a test file in the S3.

Steps to configure E-mail notification for S3 Bucket

 

  • We received the notification once a file has been uploaded in the S3 bucket.

Steps to configure E-mail notification for S3 Bucket

 

REFERENCE

E-Mail Notification

 

Thanks for reading this blog. We hope it was useful for you to learn about the steps to configure E-mail notification for S3 Bucket.

Leave a Reply

Your email address will not be published.

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