Skip to content
Menu
Cloud Gal 42
  • Home
Cloud Gal 42

Creating a notification for every time a file is uploaded to an S3 bucket

June 4, 2021June 9, 2021 by admin

Step 1 – Create S3 bucket

  1. Navigate to Amazon S3 dashboard
  2. Click on Create bucket
  3. Bucket name: provide a unique name
  4. Leave everything else as default
  5. Click on Create bucket

Step 2 – Create SNS Topic

  1. Navigate to Amazon SNS dashboard
  2. Click on Topics on the left menu
  3. Click on Create Topic
  4. Select Standard
  5. Topic name: s3topic
  6. Leave everything else as default
  7. Click on Create Topic

Step 3 – Modify SNS Access Policy

  1. Click on Edit on the s3topic screen
  2. Expand Access Policy
  3. Select the entire JSON text and delete it
  4. Paste the following in the JSON editor and click on Save Changes
{
"Version": "2012-10-17",
"Id": "example-ID",
"Statement": [
{
"Sid": "example-statement-ID",
"Effect": "Allow",
"Principal": {
"AWS":"*"
},
"Action": [
"SNS:Publish"
],
"Resource": "<sns-topic-arn>",
"Condition": {
"ArnLike": { "aws:SourceArn": "arn:aws:s3:*:*:<bucketname>" },
"StringEquals": { "aws:SourceAccount": "<your-account-id>" }
}
}
]
}

Note: Your account id can be found on the top right corner. Expand the account name drop down and there should be a 12 or so digit number next to “My Account”

Step 4 – Create Event Notification for S3

  1. Navigate to Amazon S3 dashboard
  2. Click on your bucket
  3. Click on Properties tab
  4. Scroll down to Event notifications
  5. Click on Create event notification
  6. Event name: s3putevent
  7. Under Event Types, select Put
  8. Under Destination, select SNS topic
  9. Select the previously created s3topic from the drop down
  10. Click on Save changes

Step 5 – Create Subscription to SNS Topic

  1. Click on Create subscription
  2. Select the protocol you want to use, for instance, Email or HTTP
  3. If you chose Email, provide an email you have access to as the Endpoint or if you chose HTTP, provide a web server that can receive SNS notifications
  4. If you used an email, make sure you confirm subscription. If you used an HTTP endpoint, grab the Subscription URL that pops up in your application server logs and confirm subscription on the SNS console.

Step 6 – Test the integration by uploading a file to S3

  1. Navigate to Amazon S3 dashboard
  2. Click on your bucket
  3. Click on Upload
  4. You should have received an email!

Related

Leave a Reply Cancel reply

Your email address will not be published. Required fields are marked *

Recent Posts

  • Role of AI/ML in Cybersecurity
  • QuickGuide: Security on OCI
  • The Cloud Management Plane
  • Secure Installation and Configuration of Virtualized Cloud Datacenters
  • Cloud Datacenter: Hardware-specific Security Configuration Requirements

Recent Comments

  • Rafael on Installing Debian on OCI
  • Jorge on Installing Debian on OCI
  • admin on Installing Debian on OCI
  • Andreas on Installing Debian on OCI
  • admin on Installing Debian on OCI

Archives

  • December 2022
  • February 2022
  • September 2021
  • July 2021
  • June 2021
  • May 2021
  • April 2021
  • February 2021
  • January 2021
  • November 2020
  • October 2020

Categories

  • aws
  • bcdr
  • cloud
  • cloudsecurity
  • compliance
  • informationsecurity
  • oracle
  • pci
  • QuickGuide
  • security
©2026 Cloud Gal 42 | Powered by WordPress and Superb Themes!