2

I read about the new storage class S3 Glacier Instant Retrieval and I want to use it when I upload files to S3 using the AWS CLI (command line interface). I read on https://awscli.amazonaws.com/v2/documentation/api/latest/reference/s3/cp.html that the storage class options are:

--storage-class (string) The type of storage to use for the object. Valid choices are: STANDARD | REDUCED_REDUNDANCY | STANDARD_IA | ONEZONE_IA | INTELLIGENT_TIERING | GLACIER | DEEP_ARCHIVE. Defaults to ‘STANDARD’

How do I use the S3 Glacier Instant Retrieval storage class with the CLI and do I need to install a specific version of AWS CLI?

1
  • Hi, I installed aws-cli/2.4.6 and I can confirm it works there with --storage-class GLACIER_IR (cp or sync). Commented Dec 10, 2021 at 3:30

2 Answers 2

4

AWS seems to have only made it available through the S3 API-Level Commands at this time with aws s3api put-object.

When using put-object, you have the choice of using the --storage-class of GLACIER_IR. Tested this the other day for a blog post, which worked a treat. Why they haven't included it in s3 is a mystery to me.

aws s3api put-object --bucket mybucket --key folder/filename --body file --storage-class GLACIER_IR

This is the case as of aws-cli/2.4.5, but I can also see a Pull Request in the GitHub repo where someone has submitted a change to add it to aws s3, so this answer may change.

Sign up to request clarification or add additional context in comments.

Comments

1

CHANGELOG of aws-cli says updated in 2.4.4 version.

2.4.4

api-change:s3: Introduce Amazon S3 Glacier Instant Retrieval storage class and a new setting in S3 Object Ownership to disable ACLs for bucket and the objects in it.

(Document does not seem to be updated yet, though.)

4 Comments

I installed aws-cli/2.4.5 but still in its documentation (aws s3 cp help), I can't find an option for S3 Glacier Instant Retrieval. --storage-class (string) The type of storage to use for the object. Valid choices are: STANDARD | REDUCED_REDUNDANCY | STANDARD_IA | ONE-ZONE_IA | INTELLIGENT_TIERING | GLACIER | DEEP_ARCHIVE. Defaults to 'STANDARD'
Does --storage-class GLACIER_IR work? Written in aws-blog. aws.amazon.com/blogs/aws/…
It's an invalid choice with aws-cli/2.4.5. There is a PR and it will probably be available soon.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.