100 Days of AWS — Day 13 — Getting an alert when someone deletes any object in the S3 bucket

To view the complete course, please enroll it using the below link(it’s free)

https://www.101daysofdevops.com/courses/100-days-of-aws/

Welcome to Day 13 of 100 Days of AWS. The topic for today is Getting an alert when someone deletes any object in the S3 bucket

Sometimes our requirement is when anyone deletes any object in S3 bucket we should receive an alert.

What is S3 Event?

The Amazon S3 notification feature enables you to receive notifications(SNS/SQS/Lambda) when certain events(mentioned below)happen in your bucket. Some of the examples of these events

Just to re-iterate the same thing S3 events work at the object level, so if something happens to the object, in this case, maybe PUT, POST, COPY or DELETE then the event is generated and that event will be delivered to the target(SNS, SQS or LAMBDA)

To Configure S3 events

{
"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:us-west-2:XXXXXX:my-test-topic", <--SNS topic
"Condition": {
"ArnLike": {
"AWS:SourceArn": "arn:aws:s3:::XXXXXX" <--S3 Bucket ARN
}
}
}
]
}

--

--

AWS Community Builder, Ex-Redhat, Author, Blogger, YouTuber, RHCA, RHCDS, RHCE, Docker Certified,4XAWS, CCNA, MCP, Certified Jenkins, Terraform Certified, 1XGCP

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store
Prashant Lakhera

AWS Community Builder, Ex-Redhat, Author, Blogger, YouTuber, RHCA, RHCDS, RHCE, Docker Certified,4XAWS, CCNA, MCP, Certified Jenkins, Terraform Certified, 1XGCP