How to change storage class of object in s3 bucket?

Gugan Abu picture Gugan Abu · Mar 21, 2016 · Viewed 9.2k times · Source

I need to change storage class of a s3 object from STANDARD class into STANDARD_IA using s3cmd. Can anybody help me to do this task. Thanks in advance.

Answer

Mark B picture Mark B · Mar 21, 2016

Using s3cmd:

s3cmd cp s3://BUCKET/KEY s3://BUCKET/KEY --storage-class=STANDARD_IA

Using AWS CLI:

aws s3 cp s3://BUCKET/KEY s3://BUCKET/KEY --storage-class STANDARD_IA

WARNING: If Versioning is on, this does not change the storage class of the object. It creates a new object with the requested storage class (e.g. STANDARD_IA), but keeps the original version in whatever storage class it was uploaded (e.g. STANDARD). You'll be paying for both copies.

Two versions of the object with different storage classes