aws-cdk/aws-s3: cdk can generate an invalid lifecycle configuration for s3:Bucket #25824
Labels
@aws-cdk/aws-s3
Related to Amazon S3
bug
This issue is a bug.
effort/small
Small work item – less than a day of effort
good first issue
Related to contributions. See CONTRIBUTING.md
p2
Describe the bug
Synthed buckets can end up with an invalid lifecycle configuration which fails to be applied by CFN when adding the
expiredObjectDeleteMarker
configuration.For example, according to the CFN docs for ExpiredObjectDeleteMarker:
However, if the developer sets
expire
andexpiredObjectDeleteMarker
, CDK synths the code with no errors.Expected Behavior
An invalid lifecycle configuration should fail to synth.
Current Behavior
When an invalid lifecycle configuration is specified, CDK synths the artifacts without raising any warning or errors. The error only occurs when applying the template in CFN. You get this fantastically cryptic error in the CFN logs, and the stack rolls back:
Reproduction Steps
This code would generate a template that would fail to be applied in CFN:
Possible Solution
If the user adds an invalid combination of lifecycle configurations, we could do any of these:
Additional Information/Context
No response
CDK CLI Version
2.79.1
Framework Version
No response
Node.js Version
19.1.0
OS
Linux
Language
Typescript
Language Version
4.9.5
Other information
No response
The text was updated successfully, but these errors were encountered: