-In this section, we will get introduced to the S3 service in AWS.
S3 stands for Simple Storage Service.
This service provides an infinitely scalable storage solution from AWS.
It also offers high availability of data by storing it
across multiple devices and availability zones in a region.
S3 is an object based storage.
It allows us to store objects or flat files, such as documents,
images, and videos in the AWS cloud.
This is equivalent to a file share storage, such as NFS, which
is suitable to store flat files, but not suitable to install an
operating system or databases.
Data in S3 is stored in the form of an S3 bucket.
A bucket can be considered to be a container or a directory
which stores all your files.
You can create as many of these buckets as you
need in your AWS account.
Everything within a bucket is an object.
For example, let's consider a bucket called all-pets.
Within this, we can have individual files such as a
document called pets.json and image called dog and a cat video.
Besides these, you can also have files within a folder such
as the cat.jpg file under the pictures folder and a dog.mp4
file inside the videos folder.
Each of these items that you see here is an object.
In the case of the file within a folder, the path
of the file including the folder is also an object.
AWS provides a simple web interface to create an S3 bucket
via the Management Console.
When creating a bucket in AWS, there are a couple of
considerations to be followed.
The bucket name must be unique.
This is because when creating a bucket, AWS also
creates a DNS name for it.
This DNS name will be accessible from anywhere in the world.
No two buckets, not even those which are created on different
accounts, can have the same name.
Secondly, the name should also be DNS-compliant.
This means that there should not be any uppercases or underscores.
The name should be between 3 to 63 characters long, and it
should not end with a dash.
The maximum size of a file that can be uploaded is 5 terabytes.
Check out the reference documentation for the complete
list of bucket naming restrictions.
Once a bucket is created, it can be accessed via a unique
DNS name that looks like this.
For example, if we create a bucket called all-pets in
the us-west-1 region, the web address for this bucket would be
https://all-pets.us-west-1. amazonaws.com.
The objects within this bucket can now be accessed using the bucket
name and the object names like this.
Any object in an S3 bucket consists of an object data and metadata.
The data consists of a key, which is the actual name of the object,
and a value, which is the actual data referenced by that object.
Metadata are details about the object stored in a bucket.
For example, the time when the object was created, the owner,
the size of the object, et cetera.
Just like IAM users, when a bucket is created and objects
uploaded to it, by default, AWS provides it the least permissions.
This means that by default, no one can access the objects
in the bucket with the exception of the bucket owner.
Access to the bucket and its objects are governed by bucket
policies and access control lists.
Bucket policies are permissions that are granted at a bucket
level, and access control lists are more fine-grained access
that can be used to define permissions at an object level.
In this course, we will take a look at some of the basic bucket policies
to govern access to S3 buckets.
These will be used later in S3 with Terraform lecture and the S3 Lab.
To allow the IAM user called Lucy to be able to retrieve all
objects in the example bucket called all-pets, we can make use
of a bucket policy like this.
Just like IAM policies, bucket policies are JSON documents,
and when they are attached to a bucket, they can either grant or
revoke access at a bucket level.
Finally, with the bucket policy, we can provide access
to IAM users, groups, or even public access to our buckets.
We can even grant access to users from other AWS accounts.