Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Lifecycle policy on S3 not working

I have simply enabled a file cycle policy on a bucket in Amazon S3. This is the configuration:

root@iserver:~# aws s3api get-bucket-lifecycle-configuration --bucket ee-shares --profile s3toglacier
{
"Rules": [
{
"Status": "Enabled",
"Prefix": "",
"Transitions": [
{
"Days": 180,
"StorageClass": "GLACIER"
}
],
"ID": "test"
}
]
}

But I cannot see data on Glacier and objects older then 180 days do not show "Initial Restore" option in S3.

like image 634
Mudasar Yasin Avatar asked Apr 20 '16 12:04

Mudasar Yasin


People also ask

How long does it take for S3 lifecycle policy to take effect?

It almost takes 48 hours to flag the objects with the new storage class.

How do I enable life cycle rules to S3 bucket folders?

Sign in to the AWS Management Console and open the Amazon S3 console at https://console.aws.amazon.com/s3/ . In the Buckets list, choose the name of the bucket that you want to create a lifecycle rule for. Choose the Management tab, and choose Create lifecycle rule. In Lifecycle rule name, enter a name for your rule.

How often do S3 lifecycle rules run?

Amazon S3 Lifecycle configuration rules run once a day. Check and confirm whether the rule has transitioned the storage class. The total number of objects in the bucket affects the time it takes for you to see the change in storage class.

Do S3 lifecycle rules apply retroactively?

S3 bucket lifecycle rules apply to both existing and new data in S3. In addiiton to Mircea answer: New lifecycle rules can take up to 48 hours to complete the first run. If there are millions of objects for the rule, then it might take a few runs for all the objects to be transitioned into another storage class.

What are life cycle policies in S3?

An S3 Lifecycle configuration is an XML file that consists of a set of rules with predefined actions that you want Amazon S3 to perform on objects during their lifetime. You can also configure the lifecycle by using the Amazon S3 console, REST API, AWS SDKs, and the AWS Command Line Interface (AWS CLI).


1 Answers

Amazon S3 lifecycle policies do not execute immediately. Allow up to 24 hours for them to archive content.

Once archived, the objects will still appear in Amazon S3, but their storage class will be set to Glacier.

like image 108
John Rotenstein Avatar answered Sep 19 '22 19:09

John Rotenstein