Skip to content

Commit

Permalink
fix(cloudformation-include): can't use CFN intrinsics in Tags (#30515)
Browse files Browse the repository at this point in the history
### Issue # (if applicable)

Closes #27594.

### Reason for this change

Templates that use intrinsics in resource Tags cannot be used with CFN Include. 

### Description of changes

Modifed the CFN Parser to not choke on Intrinsics found in resource Tags. 

### Description of how you validated changes

Unit tests.

### Checklist
- [x] My code adheres to the [CONTRIBUTING GUIDE](https://github.com/aws/aws-cdk/blob/main/CONTRIBUTING.md) and [DESIGN GUIDELINES](https://github.com/aws/aws-cdk/blob/main/docs/DESIGN_GUIDELINES.md)

----

*By submitting this pull request, I confirm that my contribution is made under the terms of the Apache-2.0 license*
  • Loading branch information
comcalvi authored Sep 10, 2024
1 parent b7bd041 commit af9e6ba
Show file tree
Hide file tree
Showing 15 changed files with 665 additions and 1 deletion.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Original file line number Diff line number Diff line change
@@ -0,0 +1,77 @@
{
"Parameters": {
"Param": {
"Type": "CommaDelimitedList",
"Default": "key,value"
},
"BootstrapVersion": {
"Type": "AWS::SSM::Parameter::Value<String>",
"Default": "/cdk-bootstrap/hnb659fds/version",
"Description": "Version of the CDK Bootstrap resources in this environment, automatically retrieved from SSM Parameter Store. [cdk:skip]"
}
},
"Conditions": {
"ShouldIncludeTag": {
"Fn::Equals": [
2,
2
]
}
},
"Resources": {
"Bucket": {
"Type": "AWS::S3::Bucket",
"Properties": {
"BucketName": "cdk-integ-cfn-include-bucket2",
"Tags": [
{
"Fn::If": [
"ShouldIncludeTag",
{
"Key": {
"Fn::Select": [
0,
{
"Ref": "Param"
}
]
},
"Value": "TagValue"
},
{
"Ref": "AWS::NoValue"
}
]
}
]
}
}
},
"Rules": {
"CheckBootstrapVersion": {
"Assertions": [
{
"Assert": {
"Fn::Not": [
{
"Fn::Contains": [
[
"1",
"2",
"3",
"4",
"5"
],
{
"Ref": "BootstrapVersion"
}
]
}
]
},
"AssertDescription": "CDK bootstrap stack version 6 required. Please run 'cdk bootstrap' with a recent version of the CDK CLI."
}
]
}
}
}

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading

0 comments on commit af9e6ba

Please sign in to comment.