Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: deploy-time stack tags cause synthesis to fail #32041

Merged
merged 2 commits into from
Nov 6, 2024

Commits on Nov 6, 2024

  1. fix: deploy-time stack tags cause synthesis to fail

    In #31457, we introduced a change
    that made synthesis fail if one of the stack tags was a deploy-time
    value. Since stack tags are assigned outside a CloudFormation context,
    deploy-time values cannot be evaluated, so the stack ends up with
    a tag like `{ Key: "my-tag", Value: "${Token[1234]}" }`, which is
    probably not what is intended.
    
    Worse, those tags are automatically propagated to all resources in the
    stack by CloudFormation, and some may validate the tag value and find
    that `$` or any of the other characters are not valid tag values.
    
    The intent was that customers would be alerted to these kinds of
    mistakes and apply their tags to resources, or skip stacks
    when applying tags to large scopes:
    
    ```ts
    Tags.of(this).add('my-tag', Fn.importValue('SomeExport'), {
      excludeResourceTypes: ['aws:cdk:stack'],
    });
    ```
    
    The previous change was a bit drastic in its attempts.  In this one we
    ignore the unresolved tags and add a warning instead. That way,
    synthesis still succeeds.
    rix0rrr committed Nov 6, 2024
    Configuration menu
    Copy the full SHA
    872db4f View commit details
    Browse the repository at this point in the history
  2. Configuration menu
    Copy the full SHA
    91a75e3 View commit details
    Browse the repository at this point in the history