Just a place to put
some notes on the “AWS Essentials” course from https://linuxacademy.com
4) Simple Storage Service (S3)
4.1) S3 Basics
AWS Definition:
“Amazon S3 has a
simple web services interfaces that you can use to store and retrieve any amount of data, at any time, from anywhere on
the web. It gives any user access to the same highly scalable, reliable,
fast, inexpensive data storage infrastructure that Amazon uses to run its own
global network of web site. The service aims to maximize benefits of scale and
to pass those benefits on to users.”
Image: AWS Console
-> Services -> Storage -> S3
S3 = Simple
Storage Service
S3 is AWS’s primary storage service, and you can
store any type of file in S3.
Buckets: Root
level “Folders” you create in S3 are referred to as buckets.
Folder: Any
“subfolder” you create in a bucket is referred to as a folder.
Objects: Files
stored in a bucket are referred to as objects.
When you create a bucket, you must select a specific
region for it to exist.
Any data you upload to the S3 bucket will be physically
located in a data center in that region.
Best practice:
Select the region that is physically closed to you, to reduce transfer
latency - OR - create the bucket in a region closest to your customers.
Note: Some AWS
services only work with/communicate with each other if they are in the same AWS
region.
Free Tier use
is available for S3 (currently 5GB)
Storage Cost: Applies
to data at rest in S3, charged per GB used, price varies based on region and
storage class.
Request pricing (moving
data in/out of S3): PUT, COPY, POST, LIST, GET, Lifecycle Transitions Request,
Data Retrieval, Data Archive, Data Restore
4.2) Buckets & Objects
Bucket Naming
Rules:
Bucket names -
- must be unique across ALL of AWS (that’s for
everyone in the world)
- must be 3 to 63
characters in length
- can only contain lowercase
letters, numbers and hyphens
- must not be formatted as an IP address
For more see: Bucket Restrictions and Limitations
Image: Amazon S3
-> Create Bucket
Steps to Create Bucket
in Amazon S3:
1) Name and region
2) Set properties
3) Set permissions
4) Review
Image: Amazon S3
> {Bucket Name}: Tabs
Bucket Level
Properties: General Info, Permissions, Static Web Hosting, Logging, Events,
Versioning, Lifecycle, Cross-Region Replication, Tags, Requester Pays, Transfer
Acceleration
Folder Level
Properties: General Info, Details
Object Level
Properties: General Info, Details, Permissions, MetaData
4.3) Storage Classes
Detailed S3 pricing
based on storage class: https://aws.amazon.com/s3/pricing/
A storage class
represents the “classification” assigned to each Object in S3.
Available storage
classes in order of most -> least
expensive:
- Standard (default):
General, all-purpose storage
- Reduced
Redundancy Storage (RRS): Non-critical, reproducible objects
- Infrequent
Access (S3-IA): Accessed infrequently but immediately available
- Glacier: Long-term
archival storage (very low cost)
Each storage class
has varying attributes that dictate things like:
Storage cost,
Object availability, Object durability, Frequency of access (to the object)
Durability: 99.99999999999% for Standard, S3-IA, Glacier, and 99.99% for RRS.
Availability: 99.99% for Standard, RRS, and 99.9% for S3-IA (may take several hours for
objects stored in Glacier to be retrieved.)
Each object is
assigned a storage class, and this can be changed at any time (mostly).
Image: Example file
with ‘Storage class’ = Standard
Object Durability
= % over a one year time period that a file stored in S3 will NOT be lost.
Object
Availability = % over a one year time period that a file stored in S3 WILL be accessible.
Setting/changing
storage class:
- For new objects: set the proper settings prior to or
during the upload process, or use object lifecycle policies.
- For objects (and folders) in Standard/RRS/S3-IA you can
manually switch storage class at any time via object properties.
- To move an object to Glacier, must use object
lifecycles (may take 1 to 2 days)
4.4) Object Lifecycles
An object
lifecycle is a set of rules that
automate the migration of an object’s storage class to a different storage
class (or deletion), based on specified time intervals (to keep the S3 storage
cost as low as possible).
Lifecycle functionality is located on the bucket level. A lifecycle policy can be applied to:
- The entire bucket
- One specific folder within a bucket
- One specific object within a bucket
Image: Amazon S3
> {Your Bucket} > Management tab > + Add lifecycle rule
Steps to Create Lifecycle
Rule in Amazon S3:
1) Name and scope
2) Transitions
3) Expiration
4) Review
4.5) Permissions
On the Bucket
level, you can control:
- List (who can see the bucket name)
- Upload/Delete
- View Permissions
- Edit Permissions
On the Object
level, you can control:
- Open/Download
- View Permissions
- Edit Permissions
You can share an S3 object with the world simply by
clicking “Make Public”, and
providing the link.
Image: Amazon S3
share a file with the world (make public)
4.6) Object Versioning
S3 versioning
is a feature that keeps track of and stores all old/new versions of an object
so that you can access and use an older version if you like.
S3 Versioning
is either ON or OFF. Once ON it can only be SUSPENDED (cannot
turn off) - once suspended, all previous objects with versions will still
maintain their older versions. Versioning is set on the bucket level and
applies to ALL objects in the bucket.
Image: Amazon S3
> {Your Bucket} > Enable versioning
4.7) Quiz: S3 Essentials
Q: What feature MUST be used to change an object’s
storage class to Glacier?
A: Lifecycles
T: S3 names must be unique across all AWS accounts
worldwide, and must follow specific naming rules.
T: S3 is a bulk storage service where you can store any
type of file.
T: S3 stands for Simple Storage Service.
Q: What is the S3 feature that allows you to store and
access older iterations of objects?
A: Versioning.
T: The four S3 Storage Classes include Standard, Reduced
Redundancy, Infrequent Access and Glacier.
Q: If you have an object that is easily reproducible and
must be quickly accessible, what would be the best storage class to use for it?
A: Reduced Redundancy.
T: By setting proper permissions on the object level, you
can allow the public to download the object via a URL.
Comments
Post a Comment