aws-cloudformation / aws-cloudformation/cloudformation-coverage-roadmap

Standalone S3 Lifecycle Rule for ExpiredObjectDeleteMarker=true does not work

Open
#1,124 5 comments 3 reactions 0 assignees View on GitHub
bug NeedTriage
Dominant language
No language data
Stars
1.1k
Forks
62
PR merge metrics
No merged PRs in 30d

Description

### 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**

Screen Shot 2022-03-23 at 9 54 56 AM

**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**

Screen Shot 2022-03-25 at 11 03 07 AM

**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_

Contributor guide

Open the contributing guide

Research direction

Start with the AWS::S3::Bucket LifecycleConfiguration and reproduce the issue using the supplied CloudFormation template, then compare it with the AWS CLI lifecycle configuration shown. Done means stack creation or update succeeds and applies a standalone ExpiredObjectDeleteMarker=true rule without the reported validation error.

Written by the indexing model from the issue text.

Assessment

Tech stack
aws
Domain
cloud, infrastructure
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Clearly specified
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.