Articles → AWS → AWS S3 Event Notification

AWS S3 Event Notification






Steps




  1. Create an SNS topic and subscription
  2. Create an S3 bucket
  3. Update the S3 access policy of the SNS topic
  4. Create an event notification in the S3 bucket
  5. Upload the file
  6. Email notification



Create An SNS Topic And Subscription




Picture showing the new topic created in SNS
Click to Enlarge

Picture showing the subscription created in SNS
Click to Enlarge


Create An S3 Bucket




Picture showing the new S3 bucket created in AWS
Click to Enlarge


Update The S3 Access Policy Of The SNS Topic




Picture showing the Access policy tab in S3 bucket
Click to Enlarge



Picture showing specifying the S3 ARN in bucket access policy
Click to Enlarge

{
  "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"
      ],
      "Resource": "arn:aws:sns:ap-south-1:462618770999:mytopic",
      "Condition": {
        "ArnLike": {
          "aws:SourceArn": "arn:aws:s3:::gyansangrah-bucket"
        }
      }
    }
  ]
}



Create An Event Notification In The S3 Bucket




Picture showing the Properties tab of the RDS
Click to Enlarge



Picture showing the Create event notification button for creating the new event notification
Click to Enlarge



Picture showing the screen to specify the event name, event type and destination in the create event notification screen
Click to Enlarge




Upload The File




Picture showing the image upload on the S3 bucket
Click to Enlarge


Email Notification




Picture showing the email notification received when a file is uploaded on the S3 bucket
Click to Enlarge


Posted By  -  Karan Gupta
 
Posted On  -  Tuesday, January 4, 2022

Query/Feedback


Your Email Id
 
Subject
 
Query/FeedbackCharacters remaining 250