@aws-solutions-constructs/aws-apigateway-dynamodb 2.61.0 → 2.63.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (22) hide show
  1. package/.jsii +128 -27
  2. package/README.md +4 -0
  3. package/lib/index.d.ts +76 -0
  4. package/lib/index.js +15 -7
  5. package/package.json +6 -6
  6. package/test/apigateway-dynamodb.test.js +102 -1
  7. package/test/integ.apiddb-additional-request-templates-custom-resource-name.js +2 -2
  8. package/test/integ.apiddb-additional-request-templates.js +2 -2
  9. package/test/integ.apiddb-apigateway-dynamodb-CRUD.js +2 -2
  10. package/test/integ.apiddb-apigateway-dynamodb-existing-table.js +2 -2
  11. package/test/integ.apiddb-custom-integration-responses.js +2 -2
  12. package/test/integ.apiddb-custom-method-response.d.ts +13 -0
  13. package/test/integ.apiddb-custom-method-response.js +63 -0
  14. package/test/integ.apiddb-custom-method-response.js.snapshot/apiddb-custom-method-response.assets.json +19 -0
  15. package/test/integ.apiddb-custom-method-response.js.snapshot/apiddb-custom-method-response.template.json +489 -0
  16. package/test/integ.apiddb-custom-method-response.js.snapshot/apiddbcustommethodresponseIntegDefaultTestDeployAssertAC6F68EC.assets.json +19 -0
  17. package/test/integ.apiddb-custom-method-response.js.snapshot/apiddbcustommethodresponseIntegDefaultTestDeployAssertAC6F68EC.template.json +36 -0
  18. package/test/integ.apiddb-custom-method-response.js.snapshot/cdk.out +1 -0
  19. package/test/integ.apiddb-custom-method-response.js.snapshot/integ.json +12 -0
  20. package/test/integ.apiddb-custom-method-response.js.snapshot/manifest.json +191 -0
  21. package/test/integ.apiddb-custom-method-response.js.snapshot/tree.json +764 -0
  22. package/test/integ.apiddb-no-arguments.js +2 -2
@@ -0,0 +1,63 @@
1
+ "use strict";
2
+ /**
3
+ * Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
4
+ *
5
+ * Licensed under the Apache License, Version 2.0 (the "License"). You may not use this file except in compliance
6
+ * with the License. A copy of the License is located at
7
+ *
8
+ * http://www.apache.org/licenses/LICENSE-2.0
9
+ *
10
+ * or in the 'license' file accompanying this file. This file is distributed on an 'AS IS' BASIS, WITHOUT WARRANTIES
11
+ * OR CONDITIONS OF ANY KIND, express or implied. See the License for the specific language governing permissions
12
+ * and limitations under the License.
13
+ */
14
+ Object.defineProperty(exports, "__esModule", { value: true });
15
+ // Imports
16
+ const aws_cdk_lib_1 = require("aws-cdk-lib");
17
+ const lib_1 = require("../lib");
18
+ const core_1 = require("@aws-solutions-constructs/core");
19
+ const integ_tests_alpha_1 = require("@aws-cdk/integ-tests-alpha");
20
+ const dynamodb = require("aws-cdk-lib/aws-dynamodb");
21
+ // Setup
22
+ const app = new aws_cdk_lib_1.App();
23
+ const stack = new aws_cdk_lib_1.Stack(app, (0, core_1.generateIntegStackName)(__filename));
24
+ stack.templateOptions.description = 'Integration Test for aws-apigateway-dynamodb';
25
+ const partitionKeyName = 'id';
26
+ const existingTableObj = new dynamodb.Table(stack, 'existing-table', {
27
+ partitionKey: {
28
+ name: partitionKeyName,
29
+ type: dynamodb.AttributeType.STRING,
30
+ },
31
+ pointInTimeRecovery: true,
32
+ encryption: dynamodb.TableEncryption.AWS_MANAGED,
33
+ billingMode: dynamodb.BillingMode.PAY_PER_REQUEST
34
+ });
35
+ new lib_1.ApiGatewayToDynamoDB(stack, 'test-api-gateway-dynamodb-additional-request-templates', {
36
+ existingTableObj,
37
+ allowDeleteOperation: true,
38
+ deleteIntegrationResponses: [
39
+ {
40
+ statusCode: '200',
41
+ responseTemplates: {
42
+ 'text/html': 'OK'
43
+ }
44
+ },
45
+ {
46
+ statusCode: '400',
47
+ responseTemplates: {
48
+ 'text/html': 'IntegrationTestError'
49
+ }
50
+ }
51
+ ],
52
+ deleteMethodResponses: [{
53
+ statusCode: "200"
54
+ },
55
+ {
56
+ statusCode: "400"
57
+ }]
58
+ });
59
+ // Synth
60
+ new integ_tests_alpha_1.IntegTest(stack, 'Integ', { testCases: [
61
+ stack
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VxufSk7XG5cbi8vIFN5bnRoXG5uZXcgSW50ZWdUZXN0KHN0YWNrLCAnSW50ZWcnLCB7IHRlc3RDYXNlczogW1xuICBzdGFja1xuXSB9KTtcbiJdfQ==
@@ -0,0 +1,19 @@
1
+ {
2
+ "version": "36.0.0",
3
+ "files": {
4
+ "7913a7050e5c393d80027306c7e295d8910401b542b654afce863313ba52d253": {
5
+ "source": {
6
+ "path": "apiddb-custom-method-response.template.json",
7
+ "packaging": "file"
8
+ },
9
+ "destinations": {
10
+ "current_account-current_region": {
11
+ "bucketName": "cdk-hnb659fds-assets-${AWS::AccountId}-${AWS::Region}",
12
+ "objectKey": "7913a7050e5c393d80027306c7e295d8910401b542b654afce863313ba52d253.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
+ }
@@ -0,0 +1,489 @@
1
+ {
2
+ "Description": "Integration Test for aws-apigateway-dynamodb",
3
+ "Resources": {
4
+ "existingtableE51CCC93": {
5
+ "Type": "AWS::DynamoDB::Table",
6
+ "Properties": {
7
+ "AttributeDefinitions": [
8
+ {
9
+ "AttributeName": "id",
10
+ "AttributeType": "S"
11
+ }
12
+ ],
13
+ "BillingMode": "PAY_PER_REQUEST",
14
+ "KeySchema": [
15
+ {
16
+ "AttributeName": "id",
17
+ "KeyType": "HASH"
18
+ }
19
+ ],
20
+ "PointInTimeRecoverySpecification": {
21
+ "PointInTimeRecoveryEnabled": true
22
+ },
23
+ "SSESpecification": {
24
+ "SSEEnabled": true
25
+ }
26
+ },
27
+ "UpdateReplacePolicy": "Retain",
28
+ "DeletionPolicy": "Retain"
29
+ },
30
+ "testapigatewaydynamodbadditionalrequesttemplatesApiAccessLogGroupAF75D750": {
31
+ "Type": "AWS::Logs::LogGroup",
32
+ "UpdateReplacePolicy": "Retain",
33
+ "DeletionPolicy": "Retain",
34
+ "Metadata": {
35
+ "cfn_nag": {
36
+ "rules_to_suppress": [
37
+ {
38
+ "id": "W86",
39
+ "reason": "Retention period for CloudWatchLogs LogGroups are set to 'Never Expire' to preserve customer data indefinitely"
40
+ },
41
+ {
42
+ "id": "W84",
43
+ "reason": "By default CloudWatchLogs LogGroups data is encrypted using the CloudWatch server-side encryption keys (AWS Managed Keys)"
44
+ }
45
+ ]
46
+ }
47
+ }
48
+ },
49
+ "testapigatewaydynamodbadditionalrequesttemplatesRestApi03F6484C": {
50
+ "Type": "AWS::ApiGateway::RestApi",
51
+ "Properties": {
52
+ "EndpointConfiguration": {
53
+ "Types": [
54
+ "EDGE"
55
+ ]
56
+ },
57
+ "Name": "RestApi"
58
+ }
59
+ },
60
+ "testapigatewaydynamodbadditionalrequesttemplatesRestApiDeployment0AE7C47799d5eb6ebbe5fc8402f3118bd7d77b35": {
61
+ "Type": "AWS::ApiGateway::Deployment",
62
+ "Properties": {
63
+ "Description": "Automatically created by the RestApi construct",
64
+ "RestApiId": {
65
+ "Ref": "testapigatewaydynamodbadditionalrequesttemplatesRestApi03F6484C"
66
+ }
67
+ },
68
+ "DependsOn": [
69
+ "testapigatewaydynamodbadditionalrequesttemplatesRestApiidDELETEF6A7D04D",
70
+ "testapigatewaydynamodbadditionalrequesttemplatesRestApiidGET05129D15",
71
+ "testapigatewaydynamodbadditionalrequesttemplatesRestApiidA77CCE90"
72
+ ],
73
+ "Metadata": {
74
+ "cfn_nag": {
75
+ "rules_to_suppress": [
76
+ {
77
+ "id": "W45",
78
+ "reason": "ApiGateway has AccessLogging enabled in AWS::ApiGateway::Stage resource, but cfn_nag checks for it in AWS::ApiGateway::Deployment resource"
79
+ }
80
+ ]
81
+ }
82
+ }
83
+ },
84
+ "testapigatewaydynamodbadditionalrequesttemplatesRestApiDeploymentStageprod33ED5D23": {
85
+ "Type": "AWS::ApiGateway::Stage",
86
+ "Properties": {
87
+ "AccessLogSetting": {
88
+ "DestinationArn": {
89
+ "Fn::GetAtt": [
90
+ "testapigatewaydynamodbadditionalrequesttemplatesApiAccessLogGroupAF75D750",
91
+ "Arn"
92
+ ]
93
+ },
94
+ "Format": "{\"requestId\":\"$context.requestId\",\"ip\":\"$context.identity.sourceIp\",\"user\":\"$context.identity.user\",\"caller\":\"$context.identity.caller\",\"requestTime\":\"$context.requestTime\",\"httpMethod\":\"$context.httpMethod\",\"resourcePath\":\"$context.resourcePath\",\"status\":\"$context.status\",\"protocol\":\"$context.protocol\",\"responseLength\":\"$context.responseLength\"}"
95
+ },
96
+ "DeploymentId": {
97
+ "Ref": "testapigatewaydynamodbadditionalrequesttemplatesRestApiDeployment0AE7C47799d5eb6ebbe5fc8402f3118bd7d77b35"
98
+ },
99
+ "MethodSettings": [
100
+ {
101
+ "DataTraceEnabled": false,
102
+ "HttpMethod": "*",
103
+ "LoggingLevel": "INFO",
104
+ "ResourcePath": "/*"
105
+ }
106
+ ],
107
+ "RestApiId": {
108
+ "Ref": "testapigatewaydynamodbadditionalrequesttemplatesRestApi03F6484C"
109
+ },
110
+ "StageName": "prod",
111
+ "TracingEnabled": true
112
+ }
113
+ },
114
+ "testapigatewaydynamodbadditionalrequesttemplatesRestApiidA77CCE90": {
115
+ "Type": "AWS::ApiGateway::Resource",
116
+ "Properties": {
117
+ "ParentId": {
118
+ "Fn::GetAtt": [
119
+ "testapigatewaydynamodbadditionalrequesttemplatesRestApi03F6484C",
120
+ "RootResourceId"
121
+ ]
122
+ },
123
+ "PathPart": "{id}",
124
+ "RestApiId": {
125
+ "Ref": "testapigatewaydynamodbadditionalrequesttemplatesRestApi03F6484C"
126
+ }
127
+ }
128
+ },
129
+ "testapigatewaydynamodbadditionalrequesttemplatesRestApiidGET05129D15": {
130
+ "Type": "AWS::ApiGateway::Method",
131
+ "Properties": {
132
+ "AuthorizationType": "AWS_IAM",
133
+ "HttpMethod": "GET",
134
+ "Integration": {
135
+ "Credentials": {
136
+ "Fn::GetAtt": [
137
+ "testapigatewaydynamodbadditionalrequesttemplatesapigatewayroleFDAECAC6",
138
+ "Arn"
139
+ ]
140
+ },
141
+ "IntegrationHttpMethod": "POST",
142
+ "IntegrationResponses": [
143
+ {
144
+ "StatusCode": "200"
145
+ },
146
+ {
147
+ "ResponseTemplates": {
148
+ "text/html": "Error"
149
+ },
150
+ "SelectionPattern": "500",
151
+ "StatusCode": "500"
152
+ }
153
+ ],
154
+ "PassthroughBehavior": "NEVER",
155
+ "RequestParameters": {
156
+ "integration.request.header.Content-Type": "'application/json'"
157
+ },
158
+ "RequestTemplates": {
159
+ "application/json": {
160
+ "Fn::Join": [
161
+ "",
162
+ [
163
+ "{ \"TableName\": \"",
164
+ {
165
+ "Ref": "existingtableE51CCC93"
166
+ },
167
+ "\", \"KeyConditionExpression\": \"id = :v1\", \"ExpressionAttributeValues\": { \":v1\": { \"S\": \"$input.params('id')\" } } }"
168
+ ]
169
+ ]
170
+ }
171
+ },
172
+ "Type": "AWS",
173
+ "Uri": {
174
+ "Fn::Join": [
175
+ "",
176
+ [
177
+ "arn:",
178
+ {
179
+ "Ref": "AWS::Partition"
180
+ },
181
+ ":apigateway:",
182
+ {
183
+ "Ref": "AWS::Region"
184
+ },
185
+ ":dynamodb:action/Query"
186
+ ]
187
+ ]
188
+ }
189
+ },
190
+ "MethodResponses": [
191
+ {
192
+ "ResponseParameters": {
193
+ "method.response.header.Content-Type": true
194
+ },
195
+ "StatusCode": "200"
196
+ },
197
+ {
198
+ "ResponseParameters": {
199
+ "method.response.header.Content-Type": true
200
+ },
201
+ "StatusCode": "500"
202
+ }
203
+ ],
204
+ "ResourceId": {
205
+ "Ref": "testapigatewaydynamodbadditionalrequesttemplatesRestApiidA77CCE90"
206
+ },
207
+ "RestApiId": {
208
+ "Ref": "testapigatewaydynamodbadditionalrequesttemplatesRestApi03F6484C"
209
+ }
210
+ }
211
+ },
212
+ "testapigatewaydynamodbadditionalrequesttemplatesRestApiidDELETEF6A7D04D": {
213
+ "Type": "AWS::ApiGateway::Method",
214
+ "Properties": {
215
+ "AuthorizationType": "AWS_IAM",
216
+ "HttpMethod": "DELETE",
217
+ "Integration": {
218
+ "Credentials": {
219
+ "Fn::GetAtt": [
220
+ "testapigatewaydynamodbadditionalrequesttemplatesapigatewayroleFDAECAC6",
221
+ "Arn"
222
+ ]
223
+ },
224
+ "IntegrationHttpMethod": "POST",
225
+ "IntegrationResponses": [
226
+ {
227
+ "ResponseTemplates": {
228
+ "text/html": "OK"
229
+ },
230
+ "StatusCode": "200"
231
+ },
232
+ {
233
+ "ResponseTemplates": {
234
+ "text/html": "IntegrationTestError"
235
+ },
236
+ "StatusCode": "400"
237
+ }
238
+ ],
239
+ "PassthroughBehavior": "NEVER",
240
+ "RequestParameters": {
241
+ "integration.request.header.Content-Type": "'application/json'"
242
+ },
243
+ "RequestTemplates": {
244
+ "application/json": {
245
+ "Fn::Join": [
246
+ "",
247
+ [
248
+ "{ \"TableName\": \"",
249
+ {
250
+ "Ref": "existingtableE51CCC93"
251
+ },
252
+ "\", \"Key\": { \"id\": { \"S\": \"$input.params('id')\" } }, \"ReturnValues\": \"ALL_OLD\" }"
253
+ ]
254
+ ]
255
+ }
256
+ },
257
+ "Type": "AWS",
258
+ "Uri": {
259
+ "Fn::Join": [
260
+ "",
261
+ [
262
+ "arn:",
263
+ {
264
+ "Ref": "AWS::Partition"
265
+ },
266
+ ":apigateway:",
267
+ {
268
+ "Ref": "AWS::Region"
269
+ },
270
+ ":dynamodb:action/DeleteItem"
271
+ ]
272
+ ]
273
+ }
274
+ },
275
+ "MethodResponses": [
276
+ {
277
+ "StatusCode": "200"
278
+ },
279
+ {
280
+ "StatusCode": "400"
281
+ }
282
+ ],
283
+ "ResourceId": {
284
+ "Ref": "testapigatewaydynamodbadditionalrequesttemplatesRestApiidA77CCE90"
285
+ },
286
+ "RestApiId": {
287
+ "Ref": "testapigatewaydynamodbadditionalrequesttemplatesRestApi03F6484C"
288
+ }
289
+ }
290
+ },
291
+ "testapigatewaydynamodbadditionalrequesttemplatesRestApiUsagePlan905D10C7": {
292
+ "Type": "AWS::ApiGateway::UsagePlan",
293
+ "Properties": {
294
+ "ApiStages": [
295
+ {
296
+ "ApiId": {
297
+ "Ref": "testapigatewaydynamodbadditionalrequesttemplatesRestApi03F6484C"
298
+ },
299
+ "Stage": {
300
+ "Ref": "testapigatewaydynamodbadditionalrequesttemplatesRestApiDeploymentStageprod33ED5D23"
301
+ },
302
+ "Throttle": {}
303
+ }
304
+ ]
305
+ }
306
+ },
307
+ "testapigatewaydynamodbadditionalrequesttemplatesLambdaRestApiCloudWatchRole51265771": {
308
+ "Type": "AWS::IAM::Role",
309
+ "Properties": {
310
+ "AssumeRolePolicyDocument": {
311
+ "Statement": [
312
+ {
313
+ "Action": "sts:AssumeRole",
314
+ "Effect": "Allow",
315
+ "Principal": {
316
+ "Service": "apigateway.amazonaws.com"
317
+ }
318
+ }
319
+ ],
320
+ "Version": "2012-10-17"
321
+ },
322
+ "Policies": [
323
+ {
324
+ "PolicyDocument": {
325
+ "Statement": [
326
+ {
327
+ "Action": [
328
+ "logs:CreateLogGroup",
329
+ "logs:CreateLogStream",
330
+ "logs:DescribeLogGroups",
331
+ "logs:DescribeLogStreams",
332
+ "logs:FilterLogEvents",
333
+ "logs:GetLogEvents",
334
+ "logs:PutLogEvents"
335
+ ],
336
+ "Effect": "Allow",
337
+ "Resource": {
338
+ "Fn::Join": [
339
+ "",
340
+ [
341
+ "arn:",
342
+ {
343
+ "Ref": "AWS::Partition"
344
+ },
345
+ ":logs:",
346
+ {
347
+ "Ref": "AWS::Region"
348
+ },
349
+ ":",
350
+ {
351
+ "Ref": "AWS::AccountId"
352
+ },
353
+ ":*"
354
+ ]
355
+ ]
356
+ }
357
+ }
358
+ ],
359
+ "Version": "2012-10-17"
360
+ },
361
+ "PolicyName": "LambdaRestApiCloudWatchRolePolicy"
362
+ }
363
+ ]
364
+ }
365
+ },
366
+ "testapigatewaydynamodbadditionalrequesttemplatesLambdaRestApiAccount8891474D": {
367
+ "Type": "AWS::ApiGateway::Account",
368
+ "Properties": {
369
+ "CloudWatchRoleArn": {
370
+ "Fn::GetAtt": [
371
+ "testapigatewaydynamodbadditionalrequesttemplatesLambdaRestApiCloudWatchRole51265771",
372
+ "Arn"
373
+ ]
374
+ }
375
+ },
376
+ "DependsOn": [
377
+ "testapigatewaydynamodbadditionalrequesttemplatesRestApi03F6484C"
378
+ ]
379
+ },
380
+ "testapigatewaydynamodbadditionalrequesttemplatesapigatewayroleFDAECAC6": {
381
+ "Type": "AWS::IAM::Role",
382
+ "Properties": {
383
+ "AssumeRolePolicyDocument": {
384
+ "Statement": [
385
+ {
386
+ "Action": "sts:AssumeRole",
387
+ "Effect": "Allow",
388
+ "Principal": {
389
+ "Service": "apigateway.amazonaws.com"
390
+ }
391
+ }
392
+ ],
393
+ "Version": "2012-10-17"
394
+ }
395
+ }
396
+ },
397
+ "testapigatewaydynamodbadditionalrequesttemplatesapigatewayroleDefaultPolicy4C47B35E": {
398
+ "Type": "AWS::IAM::Policy",
399
+ "Properties": {
400
+ "PolicyDocument": {
401
+ "Statement": [
402
+ {
403
+ "Action": [
404
+ "dynamodb:DeleteItem",
405
+ "dynamodb:Query"
406
+ ],
407
+ "Effect": "Allow",
408
+ "Resource": {
409
+ "Fn::GetAtt": [
410
+ "existingtableE51CCC93",
411
+ "Arn"
412
+ ]
413
+ }
414
+ }
415
+ ],
416
+ "Version": "2012-10-17"
417
+ },
418
+ "PolicyName": "testapigatewaydynamodbadditionalrequesttemplatesapigatewayroleDefaultPolicy4C47B35E",
419
+ "Roles": [
420
+ {
421
+ "Ref": "testapigatewaydynamodbadditionalrequesttemplatesapigatewayroleFDAECAC6"
422
+ }
423
+ ]
424
+ }
425
+ }
426
+ },
427
+ "Outputs": {
428
+ "testapigatewaydynamodbadditionalrequesttemplatesRestApiEndpoint855E7762": {
429
+ "Value": {
430
+ "Fn::Join": [
431
+ "",
432
+ [
433
+ "https://",
434
+ {
435
+ "Ref": "testapigatewaydynamodbadditionalrequesttemplatesRestApi03F6484C"
436
+ },
437
+ ".execute-api.",
438
+ {
439
+ "Ref": "AWS::Region"
440
+ },
441
+ ".",
442
+ {
443
+ "Ref": "AWS::URLSuffix"
444
+ },
445
+ "/",
446
+ {
447
+ "Ref": "testapigatewaydynamodbadditionalrequesttemplatesRestApiDeploymentStageprod33ED5D23"
448
+ },
449
+ "/"
450
+ ]
451
+ ]
452
+ }
453
+ }
454
+ },
455
+ "Parameters": {
456
+ "BootstrapVersion": {
457
+ "Type": "AWS::SSM::Parameter::Value<String>",
458
+ "Default": "/cdk-bootstrap/hnb659fds/version",
459
+ "Description": "Version of the CDK Bootstrap resources in this environment, automatically retrieved from SSM Parameter Store. [cdk:skip]"
460
+ }
461
+ },
462
+ "Rules": {
463
+ "CheckBootstrapVersion": {
464
+ "Assertions": [
465
+ {
466
+ "Assert": {
467
+ "Fn::Not": [
468
+ {
469
+ "Fn::Contains": [
470
+ [
471
+ "1",
472
+ "2",
473
+ "3",
474
+ "4",
475
+ "5"
476
+ ],
477
+ {
478
+ "Ref": "BootstrapVersion"
479
+ }
480
+ ]
481
+ }
482
+ ]
483
+ },
484
+ "AssertDescription": "CDK bootstrap stack version 6 required. Please run 'cdk bootstrap' with a recent version of the CDK CLI."
485
+ }
486
+ ]
487
+ }
488
+ }
489
+ }
@@ -0,0 +1,19 @@
1
+ {
2
+ "version": "36.0.0",
3
+ "files": {
4
+ "21fbb51d7b23f6a6c262b46a9caee79d744a3ac019fd45422d988b96d44b2a22": {
5
+ "source": {
6
+ "path": "apiddbcustommethodresponseIntegDefaultTestDeployAssertAC6F68EC.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
+ }
@@ -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
+ }
@@ -0,0 +1 @@
1
+ {"version":"36.0.0"}
@@ -0,0 +1,12 @@
1
+ {
2
+ "version": "36.0.0",
3
+ "testCases": {
4
+ "apiddb-custom-method-response/Integ/DefaultTest": {
5
+ "stacks": [
6
+ "apiddb-custom-method-response"
7
+ ],
8
+ "assertionStack": "apiddb-custom-method-response/Integ/DefaultTest/DeployAssert",
9
+ "assertionStackName": "apiddbcustommethodresponseIntegDefaultTestDeployAssertAC6F68EC"
10
+ }
11
+ }
12
+ }