Skip to content

Commit ebb8aa1

Browse files
authored
fix(cdk): only make Outputs Exports when necessary (#1624)
Export names must be unique and can conflict, so automatically turning every Output into an Export can lead to problems for customers who deploy the same template multiple times. Especially when the outputs are created for them and they have no control over them. We'll turn Outputs into exports on-demand (when .makeImportValue() is called). Fixes #903, fixes #1611.
1 parent 09e216a commit ebb8aa1

24 files changed

+96
-167
lines changed

packages/@aws-cdk/assets/test/integ.assets.refs.lit.expected.json

Lines changed: 1 addition & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -13,9 +13,6 @@
1313
"S3BucketName": {
1414
"Value": {
1515
"Ref": "SampleAssetS3BucketE6B2908E"
16-
},
17-
"Export": {
18-
"Name": "aws-cdk-asset-refs:S3BucketName"
1916
}
2017
},
2118
"S3ObjectKey": {
@@ -51,9 +48,6 @@
5148
}
5249
]
5350
]
54-
},
55-
"Export": {
56-
"Name": "aws-cdk-asset-refs:S3ObjectKey"
5751
}
5852
},
5953
"S3URL": {
@@ -102,9 +96,6 @@
10296
}
10397
]
10498
]
105-
},
106-
"Export": {
107-
"Name": "aws-cdk-asset-refs:S3URL"
10899
}
109100
}
110101
},
@@ -184,4 +175,4 @@
184175
}
185176
}
186177
}
187-
}
178+
}

packages/@aws-cdk/aws-apigateway/test/integ.restapi.books.expected.json

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -847,10 +847,7 @@
847847
"/"
848848
]
849849
]
850-
},
851-
"Export": {
852-
"Name": "restapi-books-example:booksapiEndpointE230E8D5"
853850
}
854851
}
855852
}
856-
}
853+
}

packages/@aws-cdk/aws-apigateway/test/integ.restapi.defaults.expected.json

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -120,10 +120,7 @@
120120
"/"
121121
]
122122
]
123-
},
124-
"Export": {
125-
"Name": "test-apigateway-restapi-defaults:myapiEndpoint3628AFE3"
126123
}
127124
}
128125
}
129-
}
126+
}

packages/@aws-cdk/aws-apigateway/test/integ.restapi.expected.json

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -612,10 +612,7 @@
612612
"/"
613613
]
614614
]
615-
},
616-
"Export": {
617-
"Name": "test-apigateway-restapi:myapiEndpoint3628AFE3"
618615
}
619616
}
620617
}
621-
}
618+
}

packages/@aws-cdk/aws-apigateway/test/test.restapi.ts

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -92,8 +92,7 @@ export = {
9292
{ Ref: "myapiDeploymentStageprod298F01AF" },
9393
"/"
9494
]]
95-
},
96-
Export: { Name: "myapiEndpoint3628AFE3" }
95+
}
9796
}
9897
}
9998
});

packages/@aws-cdk/aws-cloudformation/test/integ.trivial-lambda-resource.expected.json

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -72,9 +72,6 @@
7272
"DemoResource5B5C546C",
7373
"Response"
7474
]
75-
},
76-
"Export": {
77-
"Name": "SucceedingStack:ResponseMessage"
7875
}
7976
}
8077
}

packages/@aws-cdk/aws-ec2/test/integ.import-default-vpc.expected.json

Lines changed: 0 additions & 33 deletions
This file was deleted.

packages/@aws-cdk/aws-ec2/test/integ.import-default-vpc.lit.expected.json

Lines changed: 3 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -18,16 +18,10 @@
1818
},
1919
"Outputs": {
2020
"PublicSubnets": {
21-
"Value": "ids:subnet-e19455ca,subnet-e0c24797,subnet-ccd77395",
22-
"Export": {
23-
"Name": "aws-cdk-ec2-import:PublicSubnets"
24-
}
21+
"Value": "ids:subnet-e19455ca,subnet-e0c24797,subnet-ccd77395"
2522
},
2623
"PrivateSubnets": {
27-
"Value": "ids:",
28-
"Export": {
29-
"Name": "aws-cdk-ec2-import:PrivateSubnets"
30-
}
24+
"Value": "ids:"
3125
}
3226
}
33-
}
27+
}

packages/@aws-cdk/aws-ecr/test/integ.basic.expected.json

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -54,10 +54,7 @@
5454
}
5555
]
5656
]
57-
},
58-
"Export": {
59-
"Name": "aws-ecr-integ-stack:RepositoryURI"
6057
}
6158
}
6259
}
63-
}
60+
}

packages/@aws-cdk/aws-ecs/test/ec2/integ.lb-awsvpc-nw.expected.json

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -953,9 +953,6 @@
953953
"LB8A12904C",
954954
"DNSName"
955955
]
956-
},
957-
"Export": {
958-
"Name": "aws-ecs-integ:LoadBalancerDNS"
959956
}
960957
}
961958
}

0 commit comments

Comments
 (0)