How to delete expired object delete markers in S3 with a rule in cloudformation S3 template ?

0

How to script lifecyle rule action in a S3 cloudformation template to apply the same rule as in the screen shot ?

Enter image description here

profile picture
ST Team
asked a year ago974 views
2 Answers
0

@ST Team, you can use the ExpiredObjectDeleteMarker in the rule section of a lifecycle policy in CloudFormation - more info at https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-s3-bucket-lifecycleconfig-rule.html#cfn-s3-bucket-rule-expiredobjectdeletemarker

profile picture
answered a year ago
0

Hi,

You should set these values:

Resources:
  S3Bucket:
    Type: AWS::S3::Bucket
    Properties:
      LifecycleConfiguration:
        Rules:
          - Id: MyRule
            Status: Enabled
            NoncurrentVersionExpiration:
              NoncurrentDays: 30
            ExpiredObjectDeleteMarker: true
profile picture
EXPERT
answered a year ago

You are not logged in. Log in to post an answer.

A good answer clearly answers the question and provides constructive feedback and encourages professional growth in the question asker.

Guidelines for Answering Questions