Amazon Simple Storage Service (S3), is an object storage service that offers industry-leading
scalability, data availability, security, and performance. In this demo, we’re going to
learn how to create and configure our first Amazon S3 bucket, how to upload, view, copy,
and delete objects, and finally, how to delete our example bucket when we’re through with it.
To get started, let’s open up the AWS Management Console, visit the S3 dashboard,
and click “Create bucket”. Let’s call this one “getting-started-with-s3-demo”.
S3 bucket names must be globally unique, so a very short, generic name like “demo” would be rejected as
already being in use. There are a few other rules about how S3 buckets can be named, and you can visit the
link in the form to learn more. When selecting a region for an S3 bucket, we generally want
to choose the region closest to where our clients who will be accessing it are located. Clients can
include human users, servers like Amazon EC2 instances, or even other AWS managed
services. We’ll just use the default “US East (N. Virginia)” selection for this demo.
Next, there’s a section for “Block Public Access”. By default, Amazon S3 will block ALL public access to our
newly created S3 bucket and the objects we upload to it, and it will prevent us from accidentally granting
access to them later via access control lists or S3 bucket policies. We strongly recommend
that customers leave the “Block all public access” setting turned ON. Enabling public access in an
S3 bucket should only be done as a last resort for use cases where it’s absolutely necessary
Instead, we recommend using S3 Bucket Policies or S3 Access Points to grant limited access
to S3 buckets and the individual objects within. You can learn more about those by visiting the
links provided in the video description. Finally, under Advanced Settings,
we have the “Object Lock” option, which prevents uploaded objects from ever being deleted.
We can enable this if needed to comply with any regulatory requirements that we might have.
To keep things simple for our “Getting Started” demo, let’s leave this option disabled and click “Create bucket”.
OK, our bucket was successfully created! Let’s click on the name and take a look inside.
Amazon S3 is powerful, feature-rich service with a wide variety of different settings you can configure
for a number of use cases, including things like object versioning, encryption, lifecycle policies,
inventory reports, and access points. When you’ve got the basics down, we encourage you to explore
the documentation linked in the video description to learn more about these capabilities. For now, though
Let’s upload some files to our new bucket. We’re going to upload these Amazon S3 and AWS logos.
If we needed to upload a lot of small files or a very large file, we could also use the AWS command-line interface
or AWS software development kit to do so. Next, we’re given the option to set permissions on our uploaded
objects. With the default settings, any AWS user or role within this account will be able to access
these files as long as their AWS Identity and Access Management policy allows it.
That’s enough for this demo, but we could also use this to grant the same type access to other
specific AWS accounts if we wanted to. There’s a section for managing public permissions too, but
since we left “Block all public access” checked when creating this bucket earlier, we’re not
allowed to change these settings now. And finally, we can choose to configure some other properties
like the object’s storage class or enabling encryption at rest. Amazon S3 offers a range of storage classes
designed for different use cases - from analytics to archiving - with different access patterns and
costs, but for this demo, we’ll go with the Standard storage class and move on.
After clicking “Upload”, we can click on one of our files to see more details. The “Object URL” link
that we see here at the bottom is in fact the correct Amazon S3 URL for this uploaded object, but since
we’ve disabled public access to our bucket, we’re not allowed to use it.
In this case, the way to view an uploaded object would be through the “Open”, “Download”, or “Download as”
buttons, which automatically generate a temporary signed URL that grants us access to an object
for 5 minutes before expiring. Since the file doesn’t have public access enabled, this is the only way for
us to access it using our browser. Let’s head back to the object
listing and pretend that we didn’t actually mean to upload these files at the “root” level of our
bucket, and we instead want to group them somehow. Amazon S3 uses a flat structure to organize objects,
rather than a folder hierarchy like we’re used to seeing in a file system. It does let us use naming
prefixes though to simulate the concept of folders and help us keep things organized.
Let’s create a folder called “logos”, and then move our two files there.
We could then organize our bucket further by creating additional folders if we wanted to, or, if we change our
minds, we could simply use the “Delete” action on a folder or object to remove it.
Before concluding this demo, let’s return to the main S3 bucket listing and delete the example
bucket we created. Since the bucket isn’t empty, S3 won’t let us delete it without first using “Empty bucket”
to delete all of the objects in it. We enter the full name of the bucket to confirm, then click the “Empty” button.
Now, we can click “Exit”, and try to delete the bucket again, which the console will let us do after confirming and clicking
“Delete bucket”. To learn more about Amazon S3, including how to manage access, secure your data, and optimize costs
using storage classes and lifecycle policies, please visit the links in the video description below.
Thanks for watching!