Skip to content

Commit 0591c44

Browse files
authored
fix(s3-deployment): broken cross stack reference when using Source.data (#34916)
### Issue #22843 Closes #22843. ### Reason for this change The s3-deployment construct implementation had its own implmenetation of resolving references. This is unnecessary as these references should be resolved in the synthesis stage. Furthermore, this implementation did not support cross-stack references. ### Description of changes The construct will now pass the tokens as is and let the app synthesis take care of resolving the references instead as expected. Non-tokens will not use markers. Note: Credits to @smnrd who has written the reproduction steps here: #22843 This has helped in writing the nested stack integration test. ### Describe any new or updated permissions being added No new permissions are added. ### Description of how you validated changes Unit tests, Integrations tests, and manually via the AWS console. ### 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 7f2cca7 commit 0591c44

File tree

33 files changed

+66029
-150
lines changed

33 files changed

+66029
-150
lines changed

packages/@aws-cdk-testing/framework-integ/test/aws-s3-deployment/test/integ.bucket-deployment-cross-nested-stack-source.js.snapshot/MainStack.assets.json

Lines changed: 90 additions & 0 deletions
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,124 @@
1+
{
2+
"Resources": {
3+
"ResourceNestedStackNestedStackResourceNestedStackNestedStackResourceCDDDB2BF": {
4+
"Type": "AWS::CloudFormation::Stack",
5+
"Properties": {
6+
"TemplateURL": {
7+
"Fn::Join": [
8+
"",
9+
[
10+
"https://s3.",
11+
{
12+
"Ref": "AWS::Region"
13+
},
14+
".",
15+
{
16+
"Ref": "AWS::URLSuffix"
17+
},
18+
"/",
19+
{
20+
"Fn::Sub": "cdk-hnb659fds-assets-${AWS::AccountId}-${AWS::Region}"
21+
},
22+
"/282f7ca89f4d69565f870176145606e98aae219403e3316310fa6dcbce6faf56.json"
23+
]
24+
]
25+
}
26+
},
27+
"UpdateReplacePolicy": "Delete",
28+
"DeletionPolicy": "Delete"
29+
},
30+
"DeploymentNestedStackNestedStackDeploymentNestedStackNestedStackResource3980C4F4": {
31+
"Type": "AWS::CloudFormation::Stack",
32+
"Properties": {
33+
"Parameters": {
34+
"referencetoMainStackResourceNestedStackNestedStackResourceNestedStackNestedStackResource185D699DOutputsMainStackResourceNestedStackUserPoolEB3BCBB9Ref": {
35+
"Fn::GetAtt": [
36+
"ResourceNestedStackNestedStackResourceNestedStackNestedStackResourceCDDDB2BF",
37+
"Outputs.MainStackResourceNestedStackUserPoolEB3BCBB9Ref"
38+
]
39+
}
40+
},
41+
"TemplateURL": {
42+
"Fn::Join": [
43+
"",
44+
[
45+
"https://s3.",
46+
{
47+
"Ref": "AWS::Region"
48+
},
49+
".",
50+
{
51+
"Ref": "AWS::URLSuffix"
52+
},
53+
"/",
54+
{
55+
"Fn::Sub": "cdk-hnb659fds-assets-${AWS::AccountId}-${AWS::Region}"
56+
},
57+
"/e580ff1585485acea05a42ed74cd2fa5acc0c03edb16cd91af77818c8d8919d2.json"
58+
]
59+
]
60+
}
61+
},
62+
"UpdateReplacePolicy": "Delete",
63+
"DeletionPolicy": "Delete"
64+
}
65+
},
66+
"Outputs": {
67+
"ExportsOutputFnGetAttResourceNestedStackNestedStackResourceNestedStackNestedStackResourceCDDDB2BFOutputsMainStackResourceNestedStackUserPoolEB3BCBB9Ref75ED0C95": {
68+
"Value": {
69+
"Fn::GetAtt": [
70+
"ResourceNestedStackNestedStackResourceNestedStackNestedStackResourceCDDDB2BF",
71+
"Outputs.MainStackResourceNestedStackUserPoolEB3BCBB9Ref"
72+
]
73+
},
74+
"Export": {
75+
"Name": "MainStack:ExportsOutputFnGetAttResourceNestedStackNestedStackResourceNestedStackNestedStackResourceCDDDB2BFOutputsMainStackResourceNestedStackUserPoolEB3BCBB9Ref75ED0C95"
76+
}
77+
},
78+
"ExportsOutputFnGetAttDeploymentNestedStackNestedStackDeploymentNestedStackNestedStackResource3980C4F4OutputsMainStackDeploymentNestedStackBucket171013D4Ref5463A51D": {
79+
"Value": {
80+
"Fn::GetAtt": [
81+
"DeploymentNestedStackNestedStackDeploymentNestedStackNestedStackResource3980C4F4",
82+
"Outputs.MainStackDeploymentNestedStackBucket171013D4Ref"
83+
]
84+
},
85+
"Export": {
86+
"Name": "MainStack:ExportsOutputFnGetAttDeploymentNestedStackNestedStackDeploymentNestedStackNestedStackResource3980C4F4OutputsMainStackDeploymentNestedStackBucket171013D4Ref5463A51D"
87+
}
88+
}
89+
},
90+
"Parameters": {
91+
"BootstrapVersion": {
92+
"Type": "AWS::SSM::Parameter::Value<String>",
93+
"Default": "/cdk-bootstrap/hnb659fds/version",
94+
"Description": "Version of the CDK Bootstrap resources in this environment, automatically retrieved from SSM Parameter Store. [cdk:skip]"
95+
}
96+
},
97+
"Rules": {
98+
"CheckBootstrapVersion": {
99+
"Assertions": [
100+
{
101+
"Assert": {
102+
"Fn::Not": [
103+
{
104+
"Fn::Contains": [
105+
[
106+
"1",
107+
"2",
108+
"3",
109+
"4",
110+
"5"
111+
],
112+
{
113+
"Ref": "BootstrapVersion"
114+
}
115+
]
116+
}
117+
]
118+
},
119+
"AssertDescription": "CDK bootstrap stack version 6 required. Please run 'cdk bootstrap' with a recent version of the CDK CLI."
120+
}
121+
]
122+
}
123+
}
124+
}

0 commit comments

Comments
 (0)