skyfire123
skyfire123

Reputation: 31

AWS S3 Lifecycle Rules Not Transitioning into Glacier, not sure what the issue is?

I have this CFT that creates a S3 bucket with lifecycle rule to transition into Glacier immediately but it's not working they are still in standard after a couple of days. Any help would be appreciated thanks.

AWSTemplateFormatVersion: 2010-09-09

Description: Template to setup lifecycle configuration

Parameters:

  BucketName:

    Type: String

    Description: Name of the bucket on which lifecycle configuration will apply

    Default: lifecycle-config-testing-bucket

Resources:

  DemoBucket:

    Type: 'AWS::S3::Bucket'

    Properties:

      BucketName: !Ref BucketName

      LifecycleConfiguration:

        Rules:

          - Id: Transition all objects in the bucket after immediately 

            # Prefix: "" 

            Status: Enabled

            Transitions:

              - TransitionInDays: 0

                StorageClass: GLACIER

            ExpirationInDays: 365

Outputs:

  BucketName:

    Value: !Ref DemoBucket

    Description: Name of the sample Amazon S3 bucket with a lifecycle configuration.

Upvotes: 0

Views: 1964

Answers (1)

Hussain Mansoor
Hussain Mansoor

Reputation: 3124

S3 lifecycle transitions have minimum age rules which needs to be true for each object. You can't immediately move a file directly to glacier after uploading it in S3.

Generic lifecycle policy could be S3 (standard) -> 30days -> S3 (Infrequent Access) -> 60days -> Glacier

Check the details on the minimum number of days from the documentation.

https://docs.aws.amazon.com/AmazonS3/latest/userguide/lifecycle-transition-general-considerations.html

Upvotes: 2

Related Questions