You are currently viewing How to edit storage class in AWS S3

How to edit storage class in AWS S3

Loading

In this blog you will learn how to edit storage class in AWS S3 bucket. It can be done through the AWS Management Console, AWS CLI, or programmatically using AWS SDKs. Here’s a guide on how to do it using each method:

Steps to edit storage class in AWS S3

Log in to the AWS Management Console and navigate to the S3 service.

Select the bucket containing the objects you want to change. In my case, i am selecting firstbucket0072.

Select the object(s) by clicking the checkbox next to the object name(s).

Click on the “Actions” button and choose “Change storage class”.

You can select any storage class based on your use case. Here IA stands for Infrequent access it means the file which are accessed infrequently.

Storage ClassMinimum Storage DurationRetrieval TimeUse CaseCostReal world Example
StandardNoneMillisecondsFrequently accessed data, primary storage for critical data$0.023 per GB per month (for standard region).Hosting a website or storing active data that’s accessed regularly
Intelligent-Tiering30 daysMilliseconds/minutesUnknown or unpredictable access patterns, cost optimization$0.023 per GB per month for frequent access, $0.0125 per GB per month for infrequent access (plus monitoring and automation fees).Storing data with unknown access frequency, like a data lake with varying workloads.
Standard-IA30 daysMillisecondsInfrequently accessed data, long-lived but less critical$0.0125 per GB per month (storage), $0.01 per GB retrieval fee (standard region).Backup copies or archived data that’s rarely accessed but needs to be quickly retrievable.
One Zone-IA30 daysMillisecondsInfrequently accessed data, non-critical, cost-sensitive$0.01 per GB per month (storage), $0.01 per GB retrieval fee (standard region).Data that can be easily recreated, like temporary backups or secondary copies.
Glacier90 daysMinutes to hoursLong-term archival, rarely accessed data$0.004 per GB per month (storage), retrieval fees vary ($0.03 per GB for expedited, $0.01 per GB for standard).Long-term archival of compliance data or old project files.
Deep Archive180 daysHours to daysVery long-term archival, rarely accessed data$0.00099 per GB per month (storage), retrieval fees vary ($0.02 per GB for standard retrieval).Archiving old financial records or historical data that’s seldom accessed.
Reduced RedundancyNoneMillisecondsNon-critical, reproducible dataAround $0.0125 per GB per month.Storing temporary or generated content like thumbnails of user-uploaded images or intermediate video processing files that can be regenerated.
Various types of storage classes

Once it is done click on Save changes

Now you have successfully edited the storage class.

Commands to change storage class in CloudShell

With the help of this commands you can edit the storage class in cloudshell. It consists of following this such as copying the object and specifying the storage class.

aws s3 cp s3://source-bucket/source-object s3://source-bucket/source-object --storage-class STANDARD_IA

Python code to change storage class

You can also do using Python Programming you need few things such as bucket name, and object key which is the filename location.

import boto3

s3 = boto3.client('s3')

bucket_name = 'your-bucket-name'
object_key = 'your-object-key'
new_storage_class = 'STANDARD_IA'

# Copy the object to the same location with the new storage class
s3.copy_object(
    Bucket=bucket_name,
    CopySource={'Bucket': bucket_name, 'Key': object_key},
    Key=object_key,
    StorageClass=new_storage_class
)

Conclusion

In this blog we have learned about what is storage class, various types of storage class and how to edit the storage in AWS S3 bucket.

You can tell your friends or coworkers about this blog if you like it. There are social media sites like LinkedIn, Twitter, and Instagram where you can find me.