aws-cloudformation / cfn-language-discussion

Language discussions for CloudFormation template language
https://aws.amazon.com/cloudformation/
Apache License 2.0
142 stars 13 forks source link

AWS::LanguageExtensions not supporting RetainExceptOnCreate #139

Open ZalmnS opened 1 year ago

ZalmnS commented 1 year ago

Community Note

Tell us about the bug

Recently, CloudFormation released support for RetainExceptOnCreate as a new value for the DeletionPolicy Attribute. https://aws.amazon.com/about-aws/whats-new/2023/07/aws-cloudformation-deletion-policies-dev-test-cycle/

When attempting to use the AWS::LanguageExtensions within the Template below including the "RetainExceptOnCreate" Value for the DeletionPolicy Attribute, you encounter the following error: Template:

Transform: 'AWS::LanguageExtensions'
Resources:
  S3:
    DeletionPolicy: RetainExceptOnCreate
    Type: AWS::S3::Bucket

Error:

Transform AWS::LanguageExtensions failed with: Unrecognized DeletionPolicy RetainExceptOnCreate for resource S3. Rollback requested by user.

Expected behavior

The expected behavior is that the AWS::LanguageExtensions Transform would be able to interpret RetainExceptOnCreate as a valid string to be used within the DeletionPolicy Attribute.

I suspect that there is a list of strings anticipated for the DeletionPolicy Attribute, and "RetainExceptOnCreate" needs to be added into the list of strings

Observed behavior

Currently the Language Extension throws the error below:

Transform AWS::LanguageExtensions failed with: Unrecognized DeletionPolicy RetainExceptOnCreate for resource S3. Rollback requested by user.

Test cases

Please include a minimal CloudFormation template here that reproduces the issue

Transform: 'AWS::LanguageExtensions'
Resources:
  S3:
    DeletionPolicy: RetainExceptOnCreate
    Type: AWS::S3::Bucket

You'll be met with the error right away within the Stack Events.

Additional context

Anything else we should know? N/A

kallu commented 9 months ago

Have you tested this recently? For me it did work today.

derekps commented 9 months ago

@kallu It does indeed work now. I guess the feature was added but this Issue was ignored.