Skip to content

Commit f15ed23

Browse files
authored
feat(aws-cdk-lib): use new L1 codegen (#26318)
Replaces the existing `cfn2ts` code generator with the new `spec2cdk` generator based on `@cdklabs/typewriter` and the separately published service spec database `@aws-cdk/aws-service-spec`. Other neccesary changes are: - Lowered coverage threshold for branches to 35% since the newly generated code is more expressive. Arguably we should not include generated files in the coverage calculation, but that's a bigger change. - Asset hashes in `cfn-include` test changed due to props now being ordered alphabetic. I've manually verified that the templates are otherwise identical. - Removing `port` property from `neptune-alpha` as this has been removed upstream and is not functional according to the service team. - Switched `synthetics-alpha` tests to use `testDeprecated()` for anything using the `Canary`. This is due to the removal of the `deleteLambdaResourcesOnCanaryDeletion` prop in the CFN spec. The new codegen marks removed props as deprecated. We will replace this feature with a custom resource soon. ---- *By submitting this pull request, I confirm that my contribution is made under the terms of the Apache-2.0 license*
1 parent 3e9dfb2 commit f15ed23

File tree

144 files changed

+5067
-5084
lines changed

Some content is hidden

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

144 files changed

+5067
-5084
lines changed

packages/@aws-cdk-testing/framework-integ/test/aws-dynamodb/test/integ.global-replicas-provisioned.js.snapshot/aws-cdk-dynamodb-global-replicas-provisioned.assets.json

+4-4
Original file line numberDiff line numberDiff line change
@@ -27,28 +27,28 @@
2727
}
2828
}
2929
},
30-
"9f5b5c07b59d14129fb944d5873e7123bd1d5503291b842d691d7f3deb40f917": {
30+
"08c25f680a202dc8635a9be1cb4f95b91c4155f46e7a6857b11eaf621a4b35c7": {
3131
"source": {
3232
"path": "awscdkdynamodbglobalreplicasprovisionedawscdkawsdynamodbReplicaProviderEA32CB30.nested.template.json",
3333
"packaging": "file"
3434
},
3535
"destinations": {
3636
"current_account-current_region": {
3737
"bucketName": "cdk-hnb659fds-assets-${AWS::AccountId}-${AWS::Region}",
38-
"objectKey": "9f5b5c07b59d14129fb944d5873e7123bd1d5503291b842d691d7f3deb40f917.json",
38+
"objectKey": "08c25f680a202dc8635a9be1cb4f95b91c4155f46e7a6857b11eaf621a4b35c7.json",
3939
"assumeRoleArn": "arn:${AWS::Partition}:iam::${AWS::AccountId}:role/cdk-hnb659fds-file-publishing-role-${AWS::AccountId}-${AWS::Region}"
4040
}
4141
}
4242
},
43-
"d81aa5f1c458333209741287a5755fe92d4fcb92f27c01afe0df806cb9fa343f": {
43+
"108400a7d890987dd303c4b58b4e8313c7f496d2f7445eac124a87d660d1052b": {
4444
"source": {
4545
"path": "aws-cdk-dynamodb-global-replicas-provisioned.template.json",
4646
"packaging": "file"
4747
},
4848
"destinations": {
4949
"current_account-current_region": {
5050
"bucketName": "cdk-hnb659fds-assets-${AWS::AccountId}-${AWS::Region}",
51-
"objectKey": "d81aa5f1c458333209741287a5755fe92d4fcb92f27c01afe0df806cb9fa343f.json",
51+
"objectKey": "108400a7d890987dd303c4b58b4e8313c7f496d2f7445eac124a87d660d1052b.json",
5252
"assumeRoleArn": "arn:${AWS::Partition}:iam::${AWS::AccountId}:role/cdk-hnb659fds-file-publishing-role-${AWS::AccountId}-${AWS::Region}"
5353
}
5454
}

packages/@aws-cdk-testing/framework-integ/test/aws-dynamodb/test/integ.global-replicas-provisioned.js.snapshot/aws-cdk-dynamodb-global-replicas-provisioned.template.json

+37-37
Original file line numberDiff line numberDiff line change
@@ -3,16 +3,16 @@
33
"TableCD117FA1": {
44
"Type": "AWS::DynamoDB::Table",
55
"Properties": {
6-
"KeySchema": [
6+
"AttributeDefinitions": [
77
{
88
"AttributeName": "hashKey",
9-
"KeyType": "HASH"
9+
"AttributeType": "S"
1010
}
1111
],
12-
"AttributeDefinitions": [
12+
"KeySchema": [
1313
{
1414
"AttributeName": "hashKey",
15-
"AttributeType": "S"
15+
"KeyType": "HASH"
1616
}
1717
],
1818
"ProvisionedThroughput": {
@@ -29,6 +29,18 @@
2929
"TableSourceTableAttachedManagedPolicyawscdkdynamodbglobalreplicasprovisionedawscdkawsdynamodbReplicaProviderOnEventHandlerServiceRoleD9856B771F8F2CCB": {
3030
"Type": "AWS::IAM::ManagedPolicy",
3131
"Properties": {
32+
"Description": {
33+
"Fn::Join": [
34+
"",
35+
[
36+
"DynamoDB replication managed policy for table ",
37+
{
38+
"Ref": "TableCD117FA1"
39+
}
40+
]
41+
]
42+
},
43+
"Path": "/",
3244
"PolicyDocument": {
3345
"Statement": [
3446
{
@@ -87,18 +99,6 @@
8799
],
88100
"Version": "2012-10-17"
89101
},
90-
"Description": {
91-
"Fn::Join": [
92-
"",
93-
[
94-
"DynamoDB replication managed policy for table ",
95-
{
96-
"Ref": "TableCD117FA1"
97-
}
98-
]
99-
]
100-
},
101-
"Path": "/",
102102
"Roles": [
103103
{
104104
"Fn::GetAtt": [
@@ -112,6 +112,18 @@
112112
"TableSourceTableAttachedManagedPolicyawscdkdynamodbglobalreplicasprovisionedawscdkawsdynamodbReplicaProviderIsCompleteHandlerServiceRoleBE2B1C1A5DC546D2": {
113113
"Type": "AWS::IAM::ManagedPolicy",
114114
"Properties": {
115+
"Description": {
116+
"Fn::Join": [
117+
"",
118+
[
119+
"DynamoDB replication managed policy for table ",
120+
{
121+
"Ref": "TableCD117FA1"
122+
}
123+
]
124+
]
125+
},
126+
"Path": "/",
115127
"PolicyDocument": {
116128
"Statement": [
117129
{
@@ -132,18 +144,6 @@
132144
],
133145
"Version": "2012-10-17"
134146
},
135-
"Description": {
136-
"Fn::Join": [
137-
"",
138-
[
139-
"DynamoDB replication managed policy for table ",
140-
{
141-
"Ref": "TableCD117FA1"
142-
}
143-
]
144-
]
145-
},
146-
"Path": "/",
147147
"Roles": [
148148
{
149149
"Fn::GetAtt": [
@@ -231,8 +231,6 @@
231231
]
232232
]
233233
},
234-
"ScalableDimension": "dynamodb:table:WriteCapacityUnits",
235-
"ServiceNamespace": "dynamodb",
236234
"RoleARN": {
237235
"Fn::Join": [
238236
"",
@@ -248,7 +246,9 @@
248246
":role/aws-service-role/dynamodb.application-autoscaling.amazonaws.com/AWSServiceRoleForApplicationAutoScaling_DynamoDBTable"
249247
]
250248
]
251-
}
249+
},
250+
"ScalableDimension": "dynamodb:table:WriteCapacityUnits",
251+
"ServiceNamespace": "dynamodb"
252252
}
253253
},
254254
"TableWriteScalingTargetTrackingD78DCCD8": {
@@ -270,6 +270,11 @@
270270
"awscdkawsdynamodbReplicaProviderNestedStackawscdkawsdynamodbReplicaProviderNestedStackResource18E3F12D": {
271271
"Type": "AWS::CloudFormation::Stack",
272272
"Properties": {
273+
"Parameters": {
274+
"referencetoawscdkdynamodbglobalreplicasprovisionedTable12280A12Ref": {
275+
"Ref": "TableCD117FA1"
276+
}
277+
},
273278
"TemplateURL": {
274279
"Fn::Join": [
275280
"",
@@ -286,14 +291,9 @@
286291
{
287292
"Fn::Sub": "cdk-hnb659fds-assets-${AWS::AccountId}-${AWS::Region}"
288293
},
289-
"/9f5b5c07b59d14129fb944d5873e7123bd1d5503291b842d691d7f3deb40f917.json"
294+
"/08c25f680a202dc8635a9be1cb4f95b91c4155f46e7a6857b11eaf621a4b35c7.json"
290295
]
291296
]
292-
},
293-
"Parameters": {
294-
"referencetoawscdkdynamodbglobalreplicasprovisionedTable12280A12Ref": {
295-
"Ref": "TableCD117FA1"
296-
}
297297
}
298298
},
299299
"UpdateReplacePolicy": "Delete",

packages/@aws-cdk-testing/framework-integ/test/aws-dynamodb/test/integ.global-replicas-provisioned.js.snapshot/awscdkdynamodbglobalreplicasprovisionedawscdkawsdynamodbReplicaProviderEA32CB30.nested.template.json

+20-20
Original file line numberDiff line numberDiff line change
@@ -128,13 +128,13 @@
128128
},
129129
"S3Key": "760886bc5e09df8d8ecf794d3b9604739062c355e50ca5ae1b07e70ec9233e8b.zip"
130130
},
131+
"Handler": "index.onEventHandler",
131132
"Role": {
132133
"Fn::GetAtt": [
133134
"OnEventHandlerServiceRole15A26729",
134135
"Arn"
135136
]
136137
},
137-
"Handler": "index.onEventHandler",
138138
"Runtime": "nodejs18.x",
139139
"Timeout": 300
140140
},
@@ -183,13 +183,13 @@
183183
},
184184
"S3Key": "760886bc5e09df8d8ecf794d3b9604739062c355e50ca5ae1b07e70ec9233e8b.zip"
185185
},
186+
"Handler": "index.isCompleteHandler",
186187
"Role": {
187188
"Fn::GetAtt": [
188189
"IsCompleteHandlerServiceRole5810CC58",
189190
"Arn"
190191
]
191192
},
192-
"Handler": "index.isCompleteHandler",
193193
"Runtime": "nodejs18.x",
194194
"Timeout": 30
195195
},
@@ -306,12 +306,6 @@
306306
},
307307
"S3Key": "73b60c2cf141bf58c33cfaa33858f5c84103a0232ba7192d696536488f7731c4.zip"
308308
},
309-
"Role": {
310-
"Fn::GetAtt": [
311-
"ProviderframeworkonEventServiceRole9FF04296",
312-
"Arn"
313-
]
314-
},
315309
"Description": "AWS CDK resource provider framework - onEvent (aws-cdk-dynamodb-global-replicas-provisioned/@aws-cdk--aws-dynamodb.ReplicaProvider/Provider)",
316310
"Environment": {
317311
"Variables": {
@@ -333,6 +327,12 @@
333327
}
334328
},
335329
"Handler": "framework.onEvent",
330+
"Role": {
331+
"Fn::GetAtt": [
332+
"ProviderframeworkonEventServiceRole9FF04296",
333+
"Arn"
334+
]
335+
},
336336
"Runtime": "nodejs18.x",
337337
"Timeout": 900
338338
},
@@ -443,12 +443,6 @@
443443
},
444444
"S3Key": "73b60c2cf141bf58c33cfaa33858f5c84103a0232ba7192d696536488f7731c4.zip"
445445
},
446-
"Role": {
447-
"Fn::GetAtt": [
448-
"ProviderframeworkisCompleteServiceRoleB1087139",
449-
"Arn"
450-
]
451-
},
452446
"Description": "AWS CDK resource provider framework - isComplete (aws-cdk-dynamodb-global-replicas-provisioned/@aws-cdk--aws-dynamodb.ReplicaProvider/Provider)",
453447
"Environment": {
454448
"Variables": {
@@ -467,6 +461,12 @@
467461
}
468462
},
469463
"Handler": "framework.isComplete",
464+
"Role": {
465+
"Fn::GetAtt": [
466+
"ProviderframeworkisCompleteServiceRoleB1087139",
467+
"Arn"
468+
]
469+
},
470470
"Runtime": "nodejs18.x",
471471
"Timeout": 900
472472
},
@@ -577,12 +577,6 @@
577577
},
578578
"S3Key": "73b60c2cf141bf58c33cfaa33858f5c84103a0232ba7192d696536488f7731c4.zip"
579579
},
580-
"Role": {
581-
"Fn::GetAtt": [
582-
"ProviderframeworkonTimeoutServiceRole28643D26",
583-
"Arn"
584-
]
585-
},
586580
"Description": "AWS CDK resource provider framework - onTimeout (aws-cdk-dynamodb-global-replicas-provisioned/@aws-cdk--aws-dynamodb.ReplicaProvider/Provider)",
587581
"Environment": {
588582
"Variables": {
@@ -601,6 +595,12 @@
601595
}
602596
},
603597
"Handler": "framework.onTimeout",
598+
"Role": {
599+
"Fn::GetAtt": [
600+
"ProviderframeworkonTimeoutServiceRole28643D26",
601+
"Arn"
602+
]
603+
},
604604
"Runtime": "nodejs18.x",
605605
"Timeout": 900
606606
},

packages/@aws-cdk-testing/framework-integ/test/aws-dynamodb/test/integ.global-replicas-provisioned.js.snapshot/integ.json

+1
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55
"stacks": [
66
"aws-cdk-dynamodb-global-replicas-provisioned"
77
],
8+
"diffAssets": true,
89
"assertionStack": "aws-cdk-dynamodb-global-replicas-provisioned-test/DefaultTest/DeployAssert",
910
"assertionStackName": "awscdkdynamodbglobalreplicasprovisionedtestDefaultTestDeployAssertE7F91F54"
1011
}

packages/@aws-cdk-testing/framework-integ/test/aws-dynamodb/test/integ.global-replicas-provisioned.js.snapshot/manifest.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717
"validateOnSynth": false,
1818
"assumeRoleArn": "arn:${AWS::Partition}:iam::${AWS::AccountId}:role/cdk-hnb659fds-deploy-role-${AWS::AccountId}-${AWS::Region}",
1919
"cloudFormationExecutionRoleArn": "arn:${AWS::Partition}:iam::${AWS::AccountId}:role/cdk-hnb659fds-cfn-exec-role-${AWS::AccountId}-${AWS::Region}",
20-
"stackTemplateAssetObjectUrl": "s3://cdk-hnb659fds-assets-${AWS::AccountId}-${AWS::Region}/d81aa5f1c458333209741287a5755fe92d4fcb92f27c01afe0df806cb9fa343f.json",
20+
"stackTemplateAssetObjectUrl": "s3://cdk-hnb659fds-assets-${AWS::AccountId}-${AWS::Region}/108400a7d890987dd303c4b58b4e8313c7f496d2f7445eac124a87d660d1052b.json",
2121
"requiresBootstrapStackVersion": 6,
2222
"bootstrapStackVersionSsmParameter": "/cdk-bootstrap/hnb659fds/version",
2323
"additionalDependencies": [

0 commit comments

Comments
 (0)