The course is part of these learning paths
This course will look at some of the management and bucket property features that Amazon S3 has to offer, and how you can use them to maintain and control your data. There are a number of different features available and you may be familiar with some of them, and others perhaps not so much, so this course has been designed to give you a full overview of what is available to you.
If you have any feedback, queries, or comments relating to this course, feel free to reach out to us at email@example.com.
The main objective of this course is to introduce and explain the available properties that are configurable at the bucket level that Amazon S3 has to offer to help you manage and administer your data effectively.
This course has been designed for:
- Storage and operations engineers responsible for maintaining and storing data within the enterprise
- AWS Architects who are designing new solutions requiring data storage capabilities
- Those who are looking to begin their certification journey with either the AWS Cloud Practitioner or one of the three Associate-level certifications
This is an intermediate level course to AWS storage services and, therefore, to get the most out of this course, you should have some basic knowledge of Amazon S3. For more information related to this service, please see our existing course entitled Introduction to Amazon S3.
Hello and welcome to this lecture which will look at how to configure your buckets to monitor specific events that may occur within them. Any events which are recorded can then be sent to either an SNS Topic, an SQS Queue or a Lambda Function.
Selecting the Events tile from bucket properties screen enables you to configure which events are to be monitored.
Firstly, you need to give your Event a name, followed by the required events that you want to monitor, as you can see there is quite a long list that can be monitored and captured within your bucket covering new objects, object removals, restores, RRS and replication events.
The Prefix element allows you to specify the events to be captured based on the objects prefix within the bucket, for example, you could capture all PUT, COPY and POST events for objects with a prefix of Logs/.
The Suffix provides a similar function of the prefix, it allows you to apply the event captures to objects with a certain suffix, for example all objects with a *.jpg file extension.
The Send to component determines where your events notifications will be sent, either to an SNS Topic, an SQS Queue or a Lambda Function.
Depending on the existing configurations of your destination of event notifications, permissions will need to be granted to your SNS Topic, SQS queue or Lambda function to enable S3 to publish events to them. The application of permissions to each of these services sits outside of this course, for more information on policies and these services, please see the existing content that we have in our library:
I will now provide a quick demonstration on configuring a bucket for Event notifications using a new SNS topic with the appropriate policy attached. I will also show you the notification that is triggered via email.
Okay so I've logged into my AWS account and I'm at the front screen. And firstly I want to go to SNS to create a new topic. So once I'm at the dashboard, if I click on topics and then create topic. I just give this a name of S3PutEvent. I'm just going to accept the rest of the defaults and then I'm going to select create topic. So now I have my S3PutEvent notification here.
Now I'm going to create a subscription to this topic and so if I click on create subscription and I want an email to be sent to myself whenever something is pushed to this topic. I'll accept all the defaults, click on create subscription. I will then get an email asking me to subscribe to this topic so I'm just gonna go ahead and subscribe to that now. You can see here, this is the topic and all I need to do is click on confirm subscription.
Okay, so that's done. If I go back to SNS I need to edit the access policy of this topic. So if I select the topic again and then go to edit and then down the access policy. This is the default access policy in there at the moment so I'm just going to delete that and I'm going to paste in my own policy.
Now what this policy does, it allows the amazon S3 principle to publish to this SNS topic. Now those permissions are needed so when I configure events on my S3 bucket S3 has the permissions to then publish whatever events I select to this amazon SNS topic. So if I go ahead and click on save changes.
Okay. So now I'm going to go over to S3. Now I have a bucket down here called stuartsdemobucket so I'm going to select that and we can see this bucket is empty. If we go across to properties and then down to events. Now here I'm going to add a notification and I want to be notified for every PUT event. So I'm just going to called this MyPutEvent and the events here I'm going to select the PUT event.
Now if I scroll down, I'm not gonna add a prefix or a suffix. On the send to I'm going to select SNS Topic and then I'm going to select my new topic that I just created, the S3PutEvent. So what happened now is every time I put an object into this bucket a notification will be sent to SNS on this topic, and because I subscribed to that topic with my email address I will get an email notification about that.
So let's try this. So if we click on save and if I now add something to this bucket. I'll just select a file and then say upload. So I've now put an object in that bucket so I now should get an email notifying me about that. So if I go across to my emails I can see here that I've had an email notification and it gives me a lot of information here about the event, the source, the region, the time, the event name. And also down here we can see the ARN of the bucket that it went to and also the file name as well. So that's how you create events for your buckets and also how you can push those notifications out to an SNS topic.
About the Author
Stuart has been working within the IT industry for two decades covering a huge range of topic areas and technologies, from data centre and network infrastructure design, to cloud architecture and implementation.
To date, Stuart has created 60++ courses relating to Cloud, most within the AWS category with a heavy focus on security and compliance
He is AWS certified and accredited in addition to being a published author covering topics across the AWS landscape.
In January 2016 Stuart was awarded ‘Expert of the Year Award 2015’ from Experts Exchange for his knowledge share within cloud services to the community.
Stuart enjoys writing about cloud technologies and you will find many of his articles within our blog pages.