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
已提問 1 年前檢視次數 1044 次
2 個答案
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
已回答 1 年前
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
專家
已回答 1 年前

您尚未登入。 登入 去張貼答案。

一個好的回答可以清楚地回答問題並提供建設性的意見回饋,同時有助於提問者的專業成長。

回答問題指南