Shawn
Shawn

Reputation: 108

Upload a file to S3 and set its storage class with boto

I want to upload a file to S3 and set its storage class with boto, but I can't find the list of strings/constants to use to specify the storage class. I want to do something like:

s3_client.upload_file(file, bucket, key, ExtraArgs={'StorageClass': 'GLACIER'})

What is the list of possible strings I can use in the place of 'GLACIER' above? It must be documented somewhere, but I can't find it.

Upvotes: 0

Views: 1570

Answers (1)

Tupteq
Tupteq

Reputation: 3095

You can find it in aws-cli help online or from command line:

aws s3 cp help

Related command line parameter is --storage-class and (as of today) documentation says:

--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'

Upvotes: 3

Related Questions