Skip to content

Commit af9e6ba

Browse files
authored
fix(cloudformation-include): can't use CFN intrinsics in Tags (#30515)
### 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*
1 parent b7bd041 commit af9e6ba

File tree

15 files changed

+665
-1
lines changed

15 files changed

+665
-1
lines changed

packages/@aws-cdk-testing/framework-integ/test/cloudformation-include/test/integ.resource-tags-wtih-intrinsics.js.snapshot/ResourceTagIntrinsicStackDefaultTestDeployAssert069A8F1A.assets.json

+19
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

packages/@aws-cdk-testing/framework-integ/test/cloudformation-include/test/integ.resource-tags-wtih-intrinsics.js.snapshot/ResourceTagIntrinsicStackDefaultTestDeployAssert069A8F1A.template.json

+36
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

packages/@aws-cdk-testing/framework-integ/test/cloudformation-include/test/integ.resource-tags-wtih-intrinsics.js.snapshot/Stack.assets.json

+19
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,77 @@
1+
{
2+
"Parameters": {
3+
"Param": {
4+
"Type": "CommaDelimitedList",
5+
"Default": "key,value"
6+
},
7+
"BootstrapVersion": {
8+
"Type": "AWS::SSM::Parameter::Value<String>",
9+
"Default": "/cdk-bootstrap/hnb659fds/version",
10+
"Description": "Version of the CDK Bootstrap resources in this environment, automatically retrieved from SSM Parameter Store. [cdk:skip]"
11+
}
12+
},
13+
"Conditions": {
14+
"ShouldIncludeTag": {
15+
"Fn::Equals": [
16+
2,
17+
2
18+
]
19+
}
20+
},
21+
"Resources": {
22+
"Bucket": {
23+
"Type": "AWS::S3::Bucket",
24+
"Properties": {
25+
"BucketName": "cdk-integ-cfn-include-bucket2",
26+
"Tags": [
27+
{
28+
"Fn::If": [
29+
"ShouldIncludeTag",
30+
{
31+
"Key": {
32+
"Fn::Select": [
33+
0,
34+
{
35+
"Ref": "Param"
36+
}
37+
]
38+
},
39+
"Value": "TagValue"
40+
},
41+
{
42+
"Ref": "AWS::NoValue"
43+
}
44+
]
45+
}
46+
]
47+
}
48+
}
49+
},
50+
"Rules": {
51+
"CheckBootstrapVersion": {
52+
"Assertions": [
53+
{
54+
"Assert": {
55+
"Fn::Not": [
56+
{
57+
"Fn::Contains": [
58+
[
59+
"1",
60+
"2",
61+
"3",
62+
"4",
63+
"5"
64+
],
65+
{
66+
"Ref": "BootstrapVersion"
67+
}
68+
]
69+
}
70+
]
71+
},
72+
"AssertDescription": "CDK bootstrap stack version 6 required. Please run 'cdk bootstrap' with a recent version of the CDK CLI."
73+
}
74+
]
75+
}
76+
}
77+
}

packages/@aws-cdk-testing/framework-integ/test/cloudformation-include/test/integ.resource-tags-wtih-intrinsics.js.snapshot/cdk.out

+1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

packages/@aws-cdk-testing/framework-integ/test/cloudformation-include/test/integ.resource-tags-wtih-intrinsics.js.snapshot/integ.json

+12
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

packages/@aws-cdk-testing/framework-integ/test/cloudformation-include/test/integ.resource-tags-wtih-intrinsics.js.snapshot/manifest.json

+131
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)