Skip to content

Commit a09ccdb

Browse files
authored
chore(codepipeline): generate stack name in codepipeline when stack name is unresolved token (#31967)
### Issue # (if applicable) Closes #31436. ### Reason for this change When nested stack is used with CodePipeline, the stack name is actually a token which will fail regex check. We can't simply add a `Token.isUnresolved` check before the regex check because stack name must be a resolved string otherwise the template file would include `Token[xxx]`. ### Description of changes The only feasible fix would be allowing users to override the nested stack name if users provide one. Currently nested stack names are auto-generated and are a token value. Allow users to specify the stack name. ### Description of how you validated changes New integ tests pass. Existing tests pass. ### Checklist - [ ] 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 497abdc commit a09ccdb

14 files changed

+2078
-1
lines changed

packages/@aws-cdk-testing/framework-integ/test/aws-codepipeline-actions/test/integ.codepipeline-with-nested-stack.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/aws-codepipeline-actions/test/integ.codepipeline-with-nested-stack.js.snapshot/code-pipeline-nested-stack.assets.json

+34
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,57 @@
1+
{
2+
"Resources": {
3+
"PipelineCrossRegionStackNestedStackPipelineCrossRegionStackNestedStackResourceAABDCA01": {
4+
"Type": "AWS::CloudFormation::Stack",
5+
"Properties": {
6+
"TemplateURL": {
7+
"Fn::Join": [
8+
"",
9+
[
10+
"https://s3.us-east-1.",
11+
{
12+
"Ref": "AWS::URLSuffix"
13+
},
14+
"/cdk-hnb659fds-assets-123456789012-us-east-1/e9bdb2e29c996292dd4a35bf37486dfd5d453c102ecee8dd47db844ba97465d6.json"
15+
]
16+
]
17+
}
18+
},
19+
"UpdateReplacePolicy": "Delete",
20+
"DeletionPolicy": "Delete"
21+
}
22+
},
23+
"Parameters": {
24+
"BootstrapVersion": {
25+
"Type": "AWS::SSM::Parameter::Value<String>",
26+
"Default": "/cdk-bootstrap/hnb659fds/version",
27+
"Description": "Version of the CDK Bootstrap resources in this environment, automatically retrieved from SSM Parameter Store. [cdk:skip]"
28+
}
29+
},
30+
"Rules": {
31+
"CheckBootstrapVersion": {
32+
"Assertions": [
33+
{
34+
"Assert": {
35+
"Fn::Not": [
36+
{
37+
"Fn::Contains": [
38+
[
39+
"1",
40+
"2",
41+
"3",
42+
"4",
43+
"5"
44+
],
45+
{
46+
"Ref": "BootstrapVersion"
47+
}
48+
]
49+
}
50+
]
51+
},
52+
"AssertDescription": "CDK bootstrap stack version 6 required. Please run 'cdk bootstrap' with a recent version of the CDK CLI."
53+
}
54+
]
55+
}
56+
}
57+
}

0 commit comments

Comments
 (0)