30
SNS notification for S3 static website
With S3 event notification we can configure our S3 bucket to easily send out event notification mail, on every visit to our static website. We need to setup our cloudfront distribution for standard logging. Once the log data is PUT into our S3 bucket, an notification is sent out via SNS topic to the subscription of our choice.
First we need to setup our Cloudfront distribution for access logging.
Now we can configure our SNS topic to send nofication mail on every log data PUT to our S3 bucket.
Now we have to configure the SNS topic access policy to access the S3 bucket.
Go to properties tabs from inside your destination S3 bucket and create event notification.

Give an event name, and mention the optional prefix where Cloudfront log data is stored.

Check event type as

Check SNS as your destination, your topic should show up in the drop down automatically, if the topic region matches the bucket region and the SNS policy is configured correctly.

Click finish.
We are now configured to receive notifications!
Give an event name, and mention the optional prefix where Cloudfront log data is stored.
Check event type as
PUT
Check SNS as your destination, your topic should show up in the drop down automatically, if the topic region matches the bucket region and the SNS policy is configured correctly.
Click finish.
We are now configured to receive notifications!