cloudformation-coverage-roadmap
cloudformation-coverage-roadmap copied to clipboard
Standalone S3 Lifecycle Rule for ExpiredObjectDeleteMarker=true does not work
Name of the resource
AWS::S3::Bucket
Resource Name
No response
Issue Description
Using the AWS console or CLI we can create a minimal S3 bucket lifecycle rule that sets ExpiredObjectDeleteMarker to true, with no other functionality included.
Console
CLI
aws s3api put-bucket-lifecycle-configuration --bucket some-test-bucket \
--lifecycle-configuration '{"Rules":[{"Expiration":{"ExpiredObjectDeleteMarker":true},"ID":"Cleanup Delete Markers","Filter":{},"Status":"Enabled"}]}'
Both methods result in the following rule creation.
Console
CLI
aws s3api get-bucket-lifecycle-configuration --bucket some-test-bucket
{
"Rules": [
{
"Expiration": {
"ExpiredObjectDeleteMarker": true
},
"ID": "Cleanup Delete Markers",
"Filter": {},
"Status": "Enabled"
}
]
}
However based on our recent experience and confirmed by AWS Support, the same standalone ExpiredObjectDeleteMarker=true lifecycle rule cannot be created using CloudFormation. Feature #132 (status: Shipped) incorrectly indicates that it can.
Expected Behavior
The CloudFormation stack creation or update succeeds and applies a minimal ExpiredObjectDeleteMarker=true lifecycle rule to the S3 bucket.
Observed Behavior
The CloudFormation stack creation or update fails with this error,
"At least one of [ExpirationDate,ExpirationInDays,AbortIncompleteMultipartUpload,Transition,Transitions,NoncurrentVersionExpirationInDays,NoncurrentVersionTransition,NoncurrentVersionTransitions,NoncurrentVersionExpiration] needs to be specified"
Test Cases
Resources:
S3Bucket:
Properties:
LifecycleConfiguration:
Rules:
- Id: Cleanup Delete Markers
ExpiredObjectDeleteMarker: true
Status: Enabled
Other Details
No response