Managing storage lifecycle
- To manage objects so that they are stored cost effectively, we use lifecycle
- An S3 lifecycle configuration is a set of rule that define actions that applies to group of objects
-
Transition action:
- defines when the objects transition to from one storage class to other
- There are costs associated with the lifecycle transition requests
- Supported transitions

-
Expiration action: Define when the object expires
-
- Lets create a life cycle configuration

Replicating Objects
-
Replication enables automatic, asynchronous copying of objects across S3 buckets.
-
Buckets that are configured for object replicated
- can be owned by same AWS account or different
- Can be replicated into different AWS regions.
- Can be replicated to one S3 bucket or multiple S3
-
To enable object replication, we need to provide the following details
- The destination bucket(s)
- AWS IAM role that Amazon s3 can assume to replicate objects on your behalf
-
Setting up replication

Using S3 Versioning
- Versioning in S3 means keeping multiple variants of the objects in the same bucket

Exercise
- Create an s3 bucket
- Add a folder called as images
- upload 10 images
- Find the storage class of any image
- Add one more folder called as docs
- upload a file called as Readme.txt
- Enable Versioning for the bucket
- Upload two more versions and verify the presence of versions
- Create a life cycle rule to
- move all the objects older than 60 days to Standard-IA
AWS CLI
- Installing AWS CLI Refer Here
- create IAM User Refer Here
- Configure AWS CLI
aws configure
# region : us-west-2
- Verify the access
aws s3 ls
- AWS CLI commands
aws <service> <action> <--parameter1 value1>...<--parametern valuen>
- To find the s3 command line options
- s3 Refer Here
aws s3 <commands>- s3api Refer Here
aws s3api <commands>- s3control Refer Here
- s3outposts Refer Here
AWS S3 CLI
- S3URI: The format for s3 bucket and object naming
s3://<bucket-name>
Eg:
s3://qts3bucket
- Commands
- ls => listing
- cp => copying
- mb => create bucket
- mv => moving the objects
- rb => removing bucket
- rm => removing the objects
- Listing buckets and its contents

- Listing s3 buckets folder contents

