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

AWS::S3::Bucket LifecycleRule transition - false positive in drift detection

Open
#966 1 comment 3 reactions 0 assignees View on GitHub
bug
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

Drift detection reports a drift on a `LifecycleConfiguration Rule` when `TransitionInDays` is set to `0`, even if the resource is in sync. If the property is set to any other value, drift detection works as expected.

### Expected Behavior

A drift should not be marked when the `TransitionInDays` is `0` if that's the same value specified in the template.

### Observed Behavior

When `TransitionInDays` is set to `0`, the drift detection marks it as if a value wasn't set at all:
`Expected Value: false`
`Current Value: - `

### Test Cases

1) Deploy a stack with the following template:
```
"Type": "AWS::S3::Bucket",
"Properties": {
"BucketName": "cfn-test",
"LifecycleConfiguration": {
"Rules": [
{
"Id": "intelligent-tiering-for-all-files",
"Status": "Enabled",
"Transitions": [
{
"StorageClass": "INTELLIGENT_TIERING",
"TransitionInDays": 0
}
]}]},
```
2) Run drift detection
3) Notice that a drift is marked due to the `Current Value` of the property being reported as not set. This only happens when the value of `TransitionInDays` is `0`

### Other Details

_No response_

Contributor guide

Open the contributing guide

Research direction

Reproduce the issue with the AWS::S3::Bucket template shown, then run drift detection with TransitionInDays set to 0 and compare it with a nonzero value. Trace the drift-detection handling for LifecycleConfiguration transitions; done means an in-sync zero value is no longer reported as absent.

Written by the indexing model from the issue text.

Assessment

Tech stack
aws
Domain
cloud
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.