logo
Save cost by directly uploading objects in S3 Glacier

Save cost by directly uploading objects in S3 Glacier

Understanding the ways to put objects directly in S3 Glacier storage and save cost and reduce management overhead.

D
Divyanshi
Amazon Employee
Published Jan 2, 2024
Amazon Simple Storage Service (Amazon S3) is an object storage service that offers industry-leading scalability, data availability, security, and performance. Amazon S3 provides management features so that you can optimize, organize, and configure access to your data to meet your specific business, organizational, and compliance requirements. Amazon S3 has several features which can be used to optimize your costs based on your usage needs.

As data is growing day by day, the need of cloud storage is also growing. Amazon S3 storage classes provide the flexibility to customers to store and retrieve data as per their business needs. As an SA I work with a variety of AWS customers and many of them wanted to know how to store data directly in Glacier.
The challenge is to put data directly to S3 Glacier storage without keeping data in S3 Standard and not using lifecycle rule to move data between the storage classes. Keeping data in S3 standard incurs unnecessary cost as business requirement is to store the data in S3 Glacier storage. This existing process of putting data in S3 standard first and then move to S3 Glacier using lifecycle rule is very tedious and adds an overhead of management and cost.

To solve this problem, in this blog post I will explain how you can store data directly in Glacier . You can opt any of the options of your choice listed below to directly put the data in S3 Glacier.

  • Upload a file
  • Go to properties and select Glacier instant retrieval
  • Click on Upload
  • Finally the object is uploaded on S3 Glacier storage class

  • Configure your CLI with AWS
  • Enter the below command in CLI by putting source file and destination bucket name and storage option as GLACIER
1
aws s3 cp <source> <target> [--options]
example:
1
aws s3 cp filename.txt s3://bucket-name –storage-class GlACIER

  • You can put below code snippet within your code to put objects directly to S3 Glacier.
  • You need to mention bucket name and file name in the code snippet below.
1
2
3
4
5
response = client.put_object(
Body=b'bytes'|file,
Bucket='string',
Key='string',
ServerSideEncryption='AES256', StorageClass='GLACIER')

This blog will help customers to adopt the efficient way of storing objects in S3 Glacier. This will help to optimize the cost and minimize the overhead of management.
Many of our customers were able to achieve their business objective following this process and save cost. This motivated me to write blog on this topic.

Any opinions in this post are those of the individual author and may not reflect the opinions of AWS.