I set an Amazon Simple Storage Service (Amazon S3) Lifecycle configuration rule on my S3 bucket that transitions objects to the S3 Glacier storage class. However, when I checked my bucket, my objects' storage class didn't change.
Resolution
When you transition objects into the Amazon S3 Glacier storage class, there might be a delay for the following reasons:
- Objects that are in the S3 Standard-IA storage class must be in this class for 30 days before they transition to S3 Glacier. Before you check if the rule transitioned the storage class, confirm that the objects are in S3 Standard-IA for at least 30 days.
- Amazon S3 Lifecycle configuration rules run once a day. Wait until the rule runs to check if it transitioned your objects' storage class.
- The total number of objects in the bucket affects the time it takes for you to see the change in storage class. If the bucket contains a large number of objects, then it might take longer to see the change in storage class.
Note: After objects are eligible to transition to a different storage class, you incur charges based on the price of the new storage class.
After the expected waiting time, run the list-objects-v2 command in the AWS Command Line Interface (AWS CLI) to check the change in storage class:
aws s3api list-objects-v2 --bucket awsexamplebucket --prefix prefixname/ --query 'Contents[?StorageClass==`GLACIER`&&ends_with(Key, `/`) == `false`].[Key]' --output text | while read line1; do printf '\n'$line1'\n'; aws s3api head-object --bucket awsexamplebucket --key $line1 --query '[Restore]' --output text; done
Note: If you receive errors when you run AWS CLI commands, see Troubleshoot AWS CLI errors. Also, make sure that you're using the most recent AWS CLI version.
Related information
Transitioning objects using Amazon S3 Lifecycle