Skip to content

Commit d54b67d

Browse files
authored
fix(efs): FileSystem deployment fails if vpcSubnets is changed (#26155)
Changing Logical IDs for EfsMountTarget While using the forEach, index will be added as a suffix to logical id of EfsMountTarget this is causing an error when the subnets array in the props has changed. Closes #25099 ---- *By submitting this pull request, I confirm that my contribution is made under the terms of the Apache-2.0 license*
1 parent 26dcc1e commit d54b67d

File tree

56 files changed

+11661
-378
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

56 files changed

+11661
-378
lines changed

packages/@aws-cdk-testing/framework-integ/test/aws-ecs/test/fargate/integ.fargate-with-efs.js.snapshot/aws-ecs-fargate-efs.assets.json

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,15 @@
11
{
2-
"version": "20.0.0",
2+
"version": "32.0.0",
33
"files": {
4-
"b1edd83a738f14bf7faf27a98a7ff437aa9b1a003f15e438e837a28247d7a45b": {
4+
"05d98682f5d66455a18d98d3c7e029a00681556556eee8d8afa4dd1f954b184a": {
55
"source": {
66
"path": "aws-ecs-fargate-efs.template.json",
77
"packaging": "file"
88
},
99
"destinations": {
1010
"current_account-current_region": {
1111
"bucketName": "cdk-hnb659fds-assets-${AWS::AccountId}-${AWS::Region}",
12-
"objectKey": "b1edd83a738f14bf7faf27a98a7ff437aa9b1a003f15e438e837a28247d7a45b.json",
12+
"objectKey": "05d98682f5d66455a18d98d3c7e029a00681556556eee8d8afa4dd1f954b184a.json",
1313
"assumeRoleArn": "arn:${AWS::Partition}:iam::${AWS::AccountId}:role/cdk-hnb659fds-file-publishing-role-${AWS::AccountId}-${AWS::Region}"
1414
}
1515
}

packages/@aws-cdk-testing/framework-integ/test/aws-ecs/test/fargate/integ.fargate-with-efs.js.snapshot/aws-ecs-fargate-efs.template.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -427,7 +427,7 @@
427427
}
428428
}
429429
},
430-
"etcdataEfsMountTarget1A2665990": {
430+
"etcdataEfsMountTargetPrivateSubnet1DF9D9372": {
431431
"Type": "AWS::EFS::MountTarget",
432432
"Properties": {
433433
"FileSystemId": {
@@ -446,7 +446,7 @@
446446
}
447447
}
448448
},
449-
"etcdataEfsMountTarget280CEA26C": {
449+
"etcdataEfsMountTargetPrivateSubnet209100FF5": {
450450
"Type": "AWS::EFS::MountTarget",
451451
"Properties": {
452452
"FileSystemId": {
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
{
2+
"version": "32.0.0",
3+
"files": {
4+
"21fbb51d7b23f6a6c262b46a9caee79d744a3ac019fd45422d988b96d44b2a22": {
5+
"source": {
6+
"path": "awsecsfargatetestDefaultTestDeployAssert78ECD46B.template.json",
7+
"packaging": "file"
8+
},
9+
"destinations": {
10+
"current_account-current_region": {
11+
"bucketName": "cdk-hnb659fds-assets-${AWS::AccountId}-${AWS::Region}",
12+
"objectKey": "21fbb51d7b23f6a6c262b46a9caee79d744a3ac019fd45422d988b96d44b2a22.json",
13+
"assumeRoleArn": "arn:${AWS::Partition}:iam::${AWS::AccountId}:role/cdk-hnb659fds-file-publishing-role-${AWS::AccountId}-${AWS::Region}"
14+
}
15+
}
16+
}
17+
},
18+
"dockerImages": {}
19+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
{
2+
"Parameters": {
3+
"BootstrapVersion": {
4+
"Type": "AWS::SSM::Parameter::Value<String>",
5+
"Default": "/cdk-bootstrap/hnb659fds/version",
6+
"Description": "Version of the CDK Bootstrap resources in this environment, automatically retrieved from SSM Parameter Store. [cdk:skip]"
7+
}
8+
},
9+
"Rules": {
10+
"CheckBootstrapVersion": {
11+
"Assertions": [
12+
{
13+
"Assert": {
14+
"Fn::Not": [
15+
{
16+
"Fn::Contains": [
17+
[
18+
"1",
19+
"2",
20+
"3",
21+
"4",
22+
"5"
23+
],
24+
{
25+
"Ref": "BootstrapVersion"
26+
}
27+
]
28+
}
29+
]
30+
},
31+
"AssertDescription": "CDK bootstrap stack version 6 required. Please run 'cdk bootstrap' with a recent version of the CDK CLI."
32+
}
33+
]
34+
}
35+
}
36+
}
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
{"version":"20.0.0"}
1+
{"version":"32.0.0"}
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,12 @@
11
{
2-
"version": "20.0.0",
2+
"version": "32.0.0",
33
"testCases": {
4-
"integ.fargate-with-efs": {
4+
"aws-ecs-fargate-test/DefaultTest": {
55
"stacks": [
66
"aws-ecs-fargate-efs"
77
],
8-
"diffAssets": false,
9-
"stackUpdateWorkflow": true
8+
"assertionStack": "aws-ecs-fargate-test/DefaultTest/DeployAssert",
9+
"assertionStackName": "awsecsfargatetestDefaultTestDeployAssert78ECD46B"
1010
}
11-
},
12-
"synthContext": {},
13-
"enableLookups": false
11+
}
1412
}

packages/@aws-cdk-testing/framework-integ/test/aws-ecs/test/fargate/integ.fargate-with-efs.js.snapshot/manifest.json

Lines changed: 59 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,6 @@
11
{
2-
"version": "20.0.0",
2+
"version": "32.0.0",
33
"artifacts": {
4-
"Tree": {
5-
"type": "cdk:tree",
6-
"properties": {
7-
"file": "tree.json"
8-
}
9-
},
104
"aws-ecs-fargate-efs.assets": {
115
"type": "cdk:asset-manifest",
126
"properties": {
@@ -23,7 +17,7 @@
2317
"validateOnSynth": false,
2418
"assumeRoleArn": "arn:${AWS::Partition}:iam::${AWS::AccountId}:role/cdk-hnb659fds-deploy-role-${AWS::AccountId}-${AWS::Region}",
2519
"cloudFormationExecutionRoleArn": "arn:${AWS::Partition}:iam::${AWS::AccountId}:role/cdk-hnb659fds-cfn-exec-role-${AWS::AccountId}-${AWS::Region}",
26-
"stackTemplateAssetObjectUrl": "s3://cdk-hnb659fds-assets-${AWS::AccountId}-${AWS::Region}/b1edd83a738f14bf7faf27a98a7ff437aa9b1a003f15e438e837a28247d7a45b.json",
20+
"stackTemplateAssetObjectUrl": "s3://cdk-hnb659fds-assets-${AWS::AccountId}-${AWS::Region}/05d98682f5d66455a18d98d3c7e029a00681556556eee8d8afa4dd1f954b184a.json",
2721
"requiresBootstrapStackVersion": 6,
2822
"bootstrapStackVersionSsmParameter": "/cdk-bootstrap/hnb659fds/version",
2923
"additionalDependencies": [
@@ -189,16 +183,16 @@
189183
"data": "etcdataEfsSecurityGroupB0A9B014"
190184
}
191185
],
192-
"/aws-ecs-fargate-efs/etcdata/EfsMountTarget1": [
186+
"/aws-ecs-fargate-efs/etcdata/EfsMountTarget-PrivateSubnet1": [
193187
{
194188
"type": "aws:cdk:logicalId",
195-
"data": "etcdataEfsMountTarget1A2665990"
189+
"data": "etcdataEfsMountTargetPrivateSubnet1DF9D9372"
196190
}
197191
],
198-
"/aws-ecs-fargate-efs/etcdata/EfsMountTarget2": [
192+
"/aws-ecs-fargate-efs/etcdata/EfsMountTarget-PrivateSubnet2": [
199193
{
200194
"type": "aws:cdk:logicalId",
201-
"data": "etcdataEfsMountTarget280CEA26C"
195+
"data": "etcdataEfsMountTargetPrivateSubnet209100FF5"
202196
}
203197
],
204198
"/aws-ecs-fargate-efs/TaskDef/TaskRole/Resource": [
@@ -227,6 +221,59 @@
227221
]
228222
},
229223
"displayName": "aws-ecs-fargate-efs"
224+
},
225+
"awsecsfargatetestDefaultTestDeployAssert78ECD46B.assets": {
226+
"type": "cdk:asset-manifest",
227+
"properties": {
228+
"file": "awsecsfargatetestDefaultTestDeployAssert78ECD46B.assets.json",
229+
"requiresBootstrapStackVersion": 6,
230+
"bootstrapStackVersionSsmParameter": "/cdk-bootstrap/hnb659fds/version"
231+
}
232+
},
233+
"awsecsfargatetestDefaultTestDeployAssert78ECD46B": {
234+
"type": "aws:cloudformation:stack",
235+
"environment": "aws://unknown-account/unknown-region",
236+
"properties": {
237+
"templateFile": "awsecsfargatetestDefaultTestDeployAssert78ECD46B.template.json",
238+
"validateOnSynth": false,
239+
"assumeRoleArn": "arn:${AWS::Partition}:iam::${AWS::AccountId}:role/cdk-hnb659fds-deploy-role-${AWS::AccountId}-${AWS::Region}",
240+
"cloudFormationExecutionRoleArn": "arn:${AWS::Partition}:iam::${AWS::AccountId}:role/cdk-hnb659fds-cfn-exec-role-${AWS::AccountId}-${AWS::Region}",
241+
"stackTemplateAssetObjectUrl": "s3://cdk-hnb659fds-assets-${AWS::AccountId}-${AWS::Region}/21fbb51d7b23f6a6c262b46a9caee79d744a3ac019fd45422d988b96d44b2a22.json",
242+
"requiresBootstrapStackVersion": 6,
243+
"bootstrapStackVersionSsmParameter": "/cdk-bootstrap/hnb659fds/version",
244+
"additionalDependencies": [
245+
"awsecsfargatetestDefaultTestDeployAssert78ECD46B.assets"
246+
],
247+
"lookupRole": {
248+
"arn": "arn:${AWS::Partition}:iam::${AWS::AccountId}:role/cdk-hnb659fds-lookup-role-${AWS::AccountId}-${AWS::Region}",
249+
"requiresBootstrapStackVersion": 8,
250+
"bootstrapStackVersionSsmParameter": "/cdk-bootstrap/hnb659fds/version"
251+
}
252+
},
253+
"dependencies": [
254+
"awsecsfargatetestDefaultTestDeployAssert78ECD46B.assets"
255+
],
256+
"metadata": {
257+
"/aws-ecs-fargate-test/DefaultTest/DeployAssert/BootstrapVersion": [
258+
{
259+
"type": "aws:cdk:logicalId",
260+
"data": "BootstrapVersion"
261+
}
262+
],
263+
"/aws-ecs-fargate-test/DefaultTest/DeployAssert/CheckBootstrapVersion": [
264+
{
265+
"type": "aws:cdk:logicalId",
266+
"data": "CheckBootstrapVersion"
267+
}
268+
]
269+
},
270+
"displayName": "aws-ecs-fargate-test/DefaultTest/DeployAssert"
271+
},
272+
"Tree": {
273+
"type": "cdk:tree",
274+
"properties": {
275+
"file": "tree.json"
276+
}
230277
}
231278
}
232279
}

0 commit comments

Comments
 (0)