From 8a9046952d84c56e1d036922e8e93ceea8cf20b2 Mon Sep 17 00:00:00 2001 From: tttol Date: Tue, 15 Apr 2025 06:12:18 +0900 Subject: [PATCH 01/16] add mode property --- .../aws-cdk-lib/aws-apigateway/lib/restapi.ts | 28 +++++++++++++++++-- 1 file changed, 26 insertions(+), 2 deletions(-) diff --git a/packages/aws-cdk-lib/aws-apigateway/lib/restapi.ts b/packages/aws-cdk-lib/aws-apigateway/lib/restapi.ts index 12541570c6f15..23f27fa5f228d 100644 --- a/packages/aws-cdk-lib/aws-apigateway/lib/restapi.ts +++ b/packages/aws-cdk-lib/aws-apigateway/lib/restapi.ts @@ -169,7 +169,7 @@ export interface RestApiBaseProps { /** * The removal policy applied to the AWS CloudWatch role when this resource * is removed from the application. - * Requires `cloudWatchRole` to be enabled. + * Requires `cloudWatchRole` to be enabled. * * @default - RemovalPolicy.RETAIN */ @@ -226,7 +226,7 @@ export interface RestApiOptions extends RestApiBaseProps, ResourceOptions { /** * Props to create a new instance of RestApi */ -export interface RestApiProps extends RestApiOptions { +export interface RestApiProps extends RestApiBaseProps, ResourceOptions { /** * The list of binary media mime-types that are supported by the RestApi @@ -275,6 +275,30 @@ export interface RestApiProps extends RestApiOptions { * @default - Metering is disabled. */ readonly apiKeySourceType?: ApiKeySourceType; + + /** + * This property applies only when you use OpenAPI to define your REST API. + * The Mode determines how API Gateway handles resource updates. + * + * Valid values are `overwrite` or `merge`. + * + * For `overwrite`, the new API definition replaces the existing one. + * The existing API identifier remains unchanged. + * + * For `merge`, the new API definition is merged with the existing API. + * + * If you don't specify this property, a default value is chosen: + * - For REST APIs created before March 29, 2021, the default is `overwrite` + * - For REST APIs created after March 29, 2021, the new API definition takes precedence, + * but any container types such as endpoint configurations and binary media types + * are merged with the existing API. + * + * Use the default mode to define top-level RestApi properties in addition to using OpenAPI. + * Generally, it's preferred to use API Gateway's OpenAPI extensions to model these properties. + * + * @default - `merge` for REST APIs created after March 29, 2021, otherwise `overwrite` + */ + readonly mode?: 'overwrite' | 'merge'; } /** From 581504347117175ece616032553e12178bf450f1 Mon Sep 17 00:00:00 2001 From: tttol Date: Wed, 16 Apr 2025 06:33:45 +0900 Subject: [PATCH 02/16] add Enum --- packages/aws-cdk-lib/aws-apigateway/lib/restapi.ts | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/packages/aws-cdk-lib/aws-apigateway/lib/restapi.ts b/packages/aws-cdk-lib/aws-apigateway/lib/restapi.ts index 23f27fa5f228d..f6be7f22c575d 100644 --- a/packages/aws-cdk-lib/aws-apigateway/lib/restapi.ts +++ b/packages/aws-cdk-lib/aws-apigateway/lib/restapi.ts @@ -298,7 +298,7 @@ export interface RestApiProps extends RestApiBaseProps, ResourceOptions { * * @default - `merge` for REST APIs created after March 29, 2021, otherwise `overwrite` */ - readonly mode?: 'overwrite' | 'merge'; + readonly mode?: RestApiMode; } /** @@ -1130,3 +1130,15 @@ class RootResource extends ResourceBase { function ignore(_x: any) { return; } + +export enum RestApiMode { + /** + * The new API definition replaces the existing one. + */ + OVERWRITE = 'overwrite', + + /** + * The new API definition is merged with the existing API. + */ + MERGE = 'merge', +} From 96812ebaf0e5f95c8d339075cc5f63625ba1a7e2 Mon Sep 17 00:00:00 2001 From: tttol Date: Wed, 16 Apr 2025 07:23:08 +0900 Subject: [PATCH 03/16] add unit test&fix JSDoc --- .../aws-cdk-lib/aws-apigateway/lib/restapi.ts | 5 +-- .../aws-apigateway/test/restapi.test.ts | 41 ++++++++++++++++++- 2 files changed, 42 insertions(+), 4 deletions(-) diff --git a/packages/aws-cdk-lib/aws-apigateway/lib/restapi.ts b/packages/aws-cdk-lib/aws-apigateway/lib/restapi.ts index f6be7f22c575d..79577bc0db858 100644 --- a/packages/aws-cdk-lib/aws-apigateway/lib/restapi.ts +++ b/packages/aws-cdk-lib/aws-apigateway/lib/restapi.ts @@ -289,9 +289,7 @@ export interface RestApiProps extends RestApiBaseProps, ResourceOptions { * * If you don't specify this property, a default value is chosen: * - For REST APIs created before March 29, 2021, the default is `overwrite` - * - For REST APIs created after March 29, 2021, the new API definition takes precedence, - * but any container types such as endpoint configurations and binary media types - * are merged with the existing API. + * - For REST APIs created after March 29, 2021, the new API definition takes precedence, but any container types such as endpoint configurations and binary media types are merged with the existing API. * * Use the default mode to define top-level RestApi properties in addition to using OpenAPI. * Generally, it's preferred to use API Gateway's OpenAPI extensions to model these properties. @@ -930,6 +928,7 @@ export class RestApi extends RestApiBase { cloneFrom: props.cloneFrom?.restApiId, parameters: props.parameters, disableExecuteApiEndpoint: props.disableExecuteApiEndpoint, + mode: props.mode, }); this.node.defaultChild = resource; this.restApiId = resource.ref; diff --git a/packages/aws-cdk-lib/aws-apigateway/test/restapi.test.ts b/packages/aws-cdk-lib/aws-apigateway/test/restapi.test.ts index 511c40b80219e..cfb1eca01eca5 100644 --- a/packages/aws-cdk-lib/aws-apigateway/test/restapi.test.ts +++ b/packages/aws-cdk-lib/aws-apigateway/test/restapi.test.ts @@ -1,6 +1,6 @@ import { testDeprecated } from '@aws-cdk/cdk-build-tools'; import { cx_api } from '../..'; -import { Template } from '../../assertions'; +import { Template, Match } from '../../assertions'; import { UserPool } from '../../aws-cognito'; import { GatewayVpcEndpoint } from '../../aws-ec2'; import * as ec2 from '../../aws-ec2'; @@ -915,6 +915,45 @@ describe('restapi', () => { }); }).toThrow(/'cloudWatchRole' must be enabled for 'cloudWatchRoleRemovalPolicy' to be applied./); }); + + test('mode property is set correctly', () => { + // WHEN + const apiWithOverwrite = new apigw.RestApi(stack, 'api-overwrite', { + mode: apigw.RestApiMode.OVERWRITE, + }); + apiWithOverwrite.root.addMethod('GET'); + + const apiWithMerge = new apigw.RestApi(stack, 'api-merge', { + mode: apigw.RestApiMode.MERGE, + }); + apiWithMerge.root.addMethod('GET'); + + // THEN + Template.fromStack(stack).hasResourceProperties('AWS::ApiGateway::RestApi', { + Name: 'api-overwrite', + Mode: 'overwrite', + }); + + Template.fromStack(stack).hasResourceProperties('AWS::ApiGateway::RestApi', { + Name: 'api-merge', + Mode: 'merge', + }); + }); + + test('mode property is optional', () => { + // WHEN + const api = new apigw.RestApi(stack, 'api'); + api.root.addMethod('GET'); + + // THEN + Template.fromStack(stack).hasResourceProperties('AWS::ApiGateway::RestApi', { + Name: 'api', + }); + // Mode should not be present in the template when not specified + Template.fromStack(stack).hasResourceProperties('AWS::ApiGateway::RestApi', { + Mode: Match.absent(), + }); + }); }); describe('Import', () => { From 8547cda7f4a5ed4527e5108559114ea164c6ec1c Mon Sep 17 00:00:00 2001 From: tttol Date: Fri, 18 Apr 2025 15:35:19 +0900 Subject: [PATCH 04/16] update integ test --- ...efaultTestDeployAssert6A9696A7.assets.json | 3 +- .../test/integ.restapi.js.snapshot/cdk.out | 2 +- .../test/integ.restapi.js.snapshot/integ.json | 2 +- .../integ.restapi.js.snapshot/manifest.json | 395 +++++- .../test-apigateway-restapi.assets.json | 7 +- .../test-apigateway-restapi.template.json | 9 +- .../test/integ.restapi.js.snapshot/tree.json | 1261 +---------------- .../test/aws-apigateway/test/integ.restapi.ts | 1 + .../aws-cdk-lib/aws-apigateway/lib/restapi.ts | 16 +- 9 files changed, 402 insertions(+), 1294 deletions(-) diff --git a/packages/@aws-cdk-testing/framework-integ/test/aws-apigateway/test/integ.restapi.js.snapshot/apigatewayrestapiDefaultTestDeployAssert6A9696A7.assets.json b/packages/@aws-cdk-testing/framework-integ/test/aws-apigateway/test/integ.restapi.js.snapshot/apigatewayrestapiDefaultTestDeployAssert6A9696A7.assets.json index 773bb2a695143..4eb5cd5059897 100644 --- a/packages/@aws-cdk-testing/framework-integ/test/aws-apigateway/test/integ.restapi.js.snapshot/apigatewayrestapiDefaultTestDeployAssert6A9696A7.assets.json +++ b/packages/@aws-cdk-testing/framework-integ/test/aws-apigateway/test/integ.restapi.js.snapshot/apigatewayrestapiDefaultTestDeployAssert6A9696A7.assets.json @@ -1,7 +1,8 @@ { - "version": "34.0.0", + "version": "41.0.0", "files": { "21fbb51d7b23f6a6c262b46a9caee79d744a3ac019fd45422d988b96d44b2a22": { + "displayName": "apigatewayrestapiDefaultTestDeployAssert6A9696A7 Template", "source": { "path": "apigatewayrestapiDefaultTestDeployAssert6A9696A7.template.json", "packaging": "file" diff --git a/packages/@aws-cdk-testing/framework-integ/test/aws-apigateway/test/integ.restapi.js.snapshot/cdk.out b/packages/@aws-cdk-testing/framework-integ/test/aws-apigateway/test/integ.restapi.js.snapshot/cdk.out index 2313ab5436501..188478b55560e 100644 --- a/packages/@aws-cdk-testing/framework-integ/test/aws-apigateway/test/integ.restapi.js.snapshot/cdk.out +++ b/packages/@aws-cdk-testing/framework-integ/test/aws-apigateway/test/integ.restapi.js.snapshot/cdk.out @@ -1 +1 @@ -{"version":"34.0.0"} \ No newline at end of file +{"version":"41.0.0"} \ No newline at end of file diff --git a/packages/@aws-cdk-testing/framework-integ/test/aws-apigateway/test/integ.restapi.js.snapshot/integ.json b/packages/@aws-cdk-testing/framework-integ/test/aws-apigateway/test/integ.restapi.js.snapshot/integ.json index 9a8797a143b55..ecc5b356fe7c5 100644 --- a/packages/@aws-cdk-testing/framework-integ/test/aws-apigateway/test/integ.restapi.js.snapshot/integ.json +++ b/packages/@aws-cdk-testing/framework-integ/test/aws-apigateway/test/integ.restapi.js.snapshot/integ.json @@ -1,5 +1,5 @@ { - "version": "34.0.0", + "version": "41.0.0", "testCases": { "apigateway-restapi/DefaultTest": { "stacks": [ diff --git a/packages/@aws-cdk-testing/framework-integ/test/aws-apigateway/test/integ.restapi.js.snapshot/manifest.json b/packages/@aws-cdk-testing/framework-integ/test/aws-apigateway/test/integ.restapi.js.snapshot/manifest.json index 8bf532b3ad1a7..fdd58eb32bb12 100644 --- a/packages/@aws-cdk-testing/framework-integ/test/aws-apigateway/test/integ.restapi.js.snapshot/manifest.json +++ b/packages/@aws-cdk-testing/framework-integ/test/aws-apigateway/test/integ.restapi.js.snapshot/manifest.json @@ -1,5 +1,5 @@ { - "version": "34.0.0", + "version": "42.0.0", "artifacts": { "test-apigateway-restapi.assets": { "type": "cdk:asset-manifest", @@ -18,7 +18,7 @@ "validateOnSynth": false, "assumeRoleArn": "arn:${AWS::Partition}:iam::${AWS::AccountId}:role/cdk-hnb659fds-deploy-role-${AWS::AccountId}-${AWS::Region}", "cloudFormationExecutionRoleArn": "arn:${AWS::Partition}:iam::${AWS::AccountId}:role/cdk-hnb659fds-cfn-exec-role-${AWS::AccountId}-${AWS::Region}", - "stackTemplateAssetObjectUrl": "s3://cdk-hnb659fds-assets-${AWS::AccountId}-${AWS::Region}/7730a7574bd54d8b8cc5ce3a8fc74a2b2cec7fa63897f605899d3a225bd67bda.json", + "stackTemplateAssetObjectUrl": "s3://cdk-hnb659fds-assets-${AWS::AccountId}-${AWS::Region}/ac325b57f8665b951b07b14609f1e04395e21874cd7c66b275943ab867d813f1.json", "requiresBootstrapStackVersion": 6, "bootstrapStackVersionSsmParameter": "/cdk-bootstrap/hnb659fds/version", "additionalDependencies": [ @@ -34,12 +34,61 @@ "test-apigateway-restapi.assets" ], "metadata": { + "/test-apigateway-restapi/my-api": [ + { + "type": "aws:cdk:analytics:construct", + "data": { + "retainDeployments": true, + "cloudWatchRole": true, + "minCompressionSize": "*", + "description": "*", + "deployOptions": { + "cacheClusterEnabled": true, + "stageName": "*", + "description": "*", + "loggingLevel": "INFO", + "dataTraceEnabled": true, + "methodOptions": "*" + } + } + } + ], "/test-apigateway-restapi/my-api/Resource": [ { "type": "aws:cdk:logicalId", "data": "myapi4C7BF186" } ], + "/test-apigateway-restapi/my-api/CloudWatchRole": [ + { + "type": "aws:cdk:analytics:construct", + "data": { + "assumedBy": { + "principalAccount": "*", + "assumeRoleAction": "*" + }, + "managedPolicies": [ + { + "managedPolicyArn": "*" + } + ] + } + }, + { + "type": "aws:cdk:analytics:method", + "data": { + "applyRemovalPolicy": [ + "retain" + ] + } + } + ], + "/test-apigateway-restapi/my-api/CloudWatchRole/ImportCloudWatchRole": [ + { + "type": "aws:cdk:analytics:construct", + "data": "*" + } + ], "/test-apigateway-restapi/my-api/CloudWatchRole/Resource": [ { "type": "aws:cdk:logicalId", @@ -52,10 +101,114 @@ "data": "myapiAccountEC421A0A" } ], + "/test-apigateway-restapi/my-api/Deployment": [ + { + "type": "aws:cdk:analytics:construct", + "data": { + "description": "*", + "api": "*", + "retainDeployments": true + } + }, + { + "type": "aws:cdk:analytics:method", + "data": { + "addToLogicalId": [ + {} + ] + } + }, + { + "type": "aws:cdk:analytics:method", + "data": { + "addToLogicalId": [ + {} + ] + } + }, + { + "type": "aws:cdk:analytics:method", + "data": { + "addToLogicalId": [ + {} + ] + } + }, + { + "type": "aws:cdk:analytics:method", + "data": { + "addToLogicalId": [ + {} + ] + } + }, + { + "type": "aws:cdk:analytics:method", + "data": { + "addToLogicalId": [ + {} + ] + } + }, + { + "type": "aws:cdk:analytics:method", + "data": { + "addToLogicalId": [ + {} + ] + } + }, + { + "type": "aws:cdk:analytics:method", + "data": { + "addToLogicalId": [ + {} + ] + } + }, + { + "type": "aws:cdk:analytics:method", + "data": { + "addToLogicalId": [ + {} + ] + } + }, + { + "type": "aws:cdk:analytics:method", + "data": { + "addToLogicalId": [ + {} + ] + } + }, + { + "type": "aws:cdk:analytics:method", + "data": { + "addToLogicalId": [ + {} + ] + } + } + ], "/test-apigateway-restapi/my-api/Deployment/Resource": [ { "type": "aws:cdk:logicalId", - "data": "myapiDeployment92F2CB49069d16df09c59427069eb74581a0403d" + "data": "myapiDeployment92F2CB4938b9b1875924477d0c57bcd0fac1cbdf" + } + ], + "/test-apigateway-restapi/my-api/DeploymentStage.beta": [ + { + "type": "aws:cdk:analytics:construct", + "data": { + "deployment": "*", + "cacheClusterEnabled": true, + "stageName": "*", + "description": "*", + "loggingLevel": "INFO", + "dataTraceEnabled": true, + "methodOptions": "*" + } } ], "/test-apigateway-restapi/my-api/DeploymentStage.beta/Resource": [ @@ -70,18 +223,55 @@ "data": "myapiEndpoint3628AFE3" } ], + "/test-apigateway-restapi/my-api/Default": [ + { + "type": "aws:cdk:analytics:construct", + "data": "*" + } + ], + "/test-apigateway-restapi/my-api/Default/v1": [ + { + "type": "aws:cdk:analytics:construct", + "data": { + "parent": "*", + "pathPart": "*" + } + } + ], "/test-apigateway-restapi/my-api/Default/v1/Resource": [ { "type": "aws:cdk:logicalId", "data": "myapiv113487378" } ], + "/test-apigateway-restapi/my-api/Default/v1/toys": [ + { + "type": "aws:cdk:analytics:construct", + "data": { + "parent": "*", + "pathPart": "*" + } + } + ], "/test-apigateway-restapi/my-api/Default/v1/toys/Resource": [ { "type": "aws:cdk:logicalId", "data": "myapiv1toysA55FCBC4" } ], + "/test-apigateway-restapi/my-api/Default/v1/toys/GET": [ + { + "type": "aws:cdk:analytics:construct", + "data": { + "resource": "*", + "httpMethod": "*", + "integration": "*", + "options": { + "apiKeyRequired": true + } + } + } + ], "/test-apigateway-restapi/my-api/Default/v1/toys/GET/ApiPermission.testapigatewayrestapimyapi1AE401C4.GET..v1.toys": [ { "type": "aws:cdk:logicalId", @@ -100,36 +290,98 @@ "data": "myapiv1toysGET7348114D" } ], + "/test-apigateway-restapi/my-api/Default/v1/toys/POST": [ + { + "type": "aws:cdk:analytics:construct", + "data": { + "resource": "*", + "httpMethod": "*", + "integration": "*", + "options": "*" + } + } + ], "/test-apigateway-restapi/my-api/Default/v1/toys/POST/Resource": [ { "type": "aws:cdk:logicalId", "data": "myapiv1toysPOST55128058" } ], + "/test-apigateway-restapi/my-api/Default/v1/toys/PUT": [ + { + "type": "aws:cdk:analytics:construct", + "data": { + "resource": "*", + "httpMethod": "*", + "integration": "*", + "options": "*" + } + } + ], "/test-apigateway-restapi/my-api/Default/v1/toys/PUT/Resource": [ { "type": "aws:cdk:logicalId", "data": "myapiv1toysPUT59AFBBC2" } ], + "/test-apigateway-restapi/my-api/Default/v1/$appliances:all": [ + { + "type": "aws:cdk:analytics:construct", + "data": { + "parent": "*", + "pathPart": "*" + } + } + ], "/test-apigateway-restapi/my-api/Default/v1/$appliances:all/Resource": [ { "type": "aws:cdk:logicalId", "data": "myapiv1appliancesallD279897B" } ], + "/test-apigateway-restapi/my-api/Default/v1/$appliances:all/GET": [ + { + "type": "aws:cdk:analytics:construct", + "data": { + "resource": "*", + "httpMethod": "*", + "integration": "*", + "options": "*" + } + } + ], "/test-apigateway-restapi/my-api/Default/v1/$appliances:all/GET/Resource": [ { "type": "aws:cdk:logicalId", "data": "myapiv1appliancesallGETB8EB1B77" } ], + "/test-apigateway-restapi/my-api/Default/v1/books": [ + { + "type": "aws:cdk:analytics:construct", + "data": { + "parent": "*", + "pathPart": "*" + } + } + ], "/test-apigateway-restapi/my-api/Default/v1/books/Resource": [ { "type": "aws:cdk:logicalId", "data": "myapiv1books1D4BE6C1" } ], + "/test-apigateway-restapi/my-api/Default/v1/books/GET": [ + { + "type": "aws:cdk:analytics:construct", + "data": { + "resource": "*", + "httpMethod": "*", + "integration": "*", + "options": "*" + } + } + ], "/test-apigateway-restapi/my-api/Default/v1/books/GET/ApiPermission.testapigatewayrestapimyapi1AE401C4.GET..v1.books": [ { "type": "aws:cdk:logicalId", @@ -148,6 +400,17 @@ "data": "myapiv1booksGETC6B996D0" } ], + "/test-apigateway-restapi/my-api/Default/v1/books/POST": [ + { + "type": "aws:cdk:analytics:construct", + "data": { + "resource": "*", + "httpMethod": "*", + "integration": "*", + "options": "*" + } + } + ], "/test-apigateway-restapi/my-api/Default/v1/books/POST/ApiPermission.testapigatewayrestapimyapi1AE401C4.POST..v1.books": [ { "type": "aws:cdk:logicalId", @@ -166,12 +429,57 @@ "data": "myapiv1booksPOST53E2832E" } ], + "/test-apigateway-restapi/my-api/ApiKey": [ + { + "type": "aws:cdk:analytics:construct", + "data": { + "stages": [ + "*" + ] + } + } + ], "/test-apigateway-restapi/my-api/ApiKey/Resource": [ { "type": "aws:cdk:logicalId", "data": "myapiApiKey43446CCF" } ], + "/test-apigateway-restapi/my-api/UsagePlan": [ + { + "type": "aws:cdk:analytics:construct", + "data": { + "name": "*", + "apiKey": "*", + "description": "*", + "throttle": { + "rateLimit": "*" + }, + "quota": { + "limit": "*", + "period": "MONTH" + } + } + }, + { + "type": "aws:cdk:analytics:method", + "data": { + "addApiStage": [ + { + "throttle": [ + { + "method": "*", + "throttle": { + "rateLimit": "*", + "burstLimit": "*" + } + } + ] + } + ] + } + } + ], "/test-apigateway-restapi/my-api/UsagePlan/Resource": [ { "type": "aws:cdk:logicalId", @@ -184,6 +492,38 @@ "data": "myapiUsagePlanUsagePlanKeyResourcetestapigatewayrestapimyapiApiKeyC43601CB600D112D" } ], + "/test-apigateway-restapi/MyHandler": [ + { + "type": "aws:cdk:analytics:construct", + "data": { + "runtime": "*", + "code": "*", + "handler": "*" + } + } + ], + "/test-apigateway-restapi/MyHandler/ServiceRole": [ + { + "type": "aws:cdk:analytics:construct", + "data": { + "assumedBy": { + "principalAccount": "*", + "assumeRoleAction": "*" + }, + "managedPolicies": [ + { + "managedPolicyArn": "*" + } + ] + } + } + ], + "/test-apigateway-restapi/MyHandler/ServiceRole/ImportServiceRole": [ + { + "type": "aws:cdk:analytics:construct", + "data": "*" + } + ], "/test-apigateway-restapi/MyHandler/ServiceRole/Resource": [ { "type": "aws:cdk:logicalId", @@ -196,10 +536,27 @@ "data": "MyHandler6B74D312" } ], + "/test-apigateway-restapi/TestDeployment": [ + { + "type": "aws:cdk:analytics:construct", + "data": { + "api": "*", + "retainDeployments": false + } + } + ], "/test-apigateway-restapi/TestDeployment/Resource": [ { "type": "aws:cdk:logicalId", - "data": "TestDeploymentD77B56865531eba1e8fde4b8e6988d5af7b2efd6" + "data": "TestDeploymentD77B5686a15807100799563057d10920f3cb5b73" + } + ], + "/test-apigateway-restapi/TestStage": [ + { + "type": "aws:cdk:analytics:construct", + "data": { + "deployment": "*" + } } ], "/test-apigateway-restapi/TestStage/Resource": [ @@ -208,6 +565,16 @@ "data": "TestStage3097EB68" } ], + "/test-apigateway-restapi/TestStage/MyTestApiKey": [ + { + "type": "aws:cdk:analytics:construct", + "data": { + "stages": [ + "*" + ] + } + } + ], "/test-apigateway-restapi/TestStage/MyTestApiKey/Resource": [ { "type": "aws:cdk:logicalId", @@ -226,28 +593,19 @@ "data": "CheckBootstrapVersion" } ], - "myapiDeployment92F2CB4993c0f175ba8d5964f5e1cc7bc64fe6e6": [ - { - "type": "aws:cdk:logicalId", - "data": "myapiDeployment92F2CB4993c0f175ba8d5964f5e1cc7bc64fe6e6", - "trace": [ - "!!DESTRUCTIVE_CHANGES: WILL_DESTROY" - ] - } - ], - "myapiv1appliancesallCF8C6A16": [ + "myapiDeployment92F2CB49069d16df09c59427069eb74581a0403d": [ { "type": "aws:cdk:logicalId", - "data": "myapiv1appliancesallCF8C6A16", + "data": "myapiDeployment92F2CB49069d16df09c59427069eb74581a0403d", "trace": [ "!!DESTRUCTIVE_CHANGES: WILL_DESTROY" ] } ], - "myapiv1appliancesallGETC4DF552D": [ + "TestDeploymentD77B56865531eba1e8fde4b8e6988d5af7b2efd6": [ { "type": "aws:cdk:logicalId", - "data": "myapiv1appliancesallGETC4DF552D", + "data": "TestDeploymentD77B56865531eba1e8fde4b8e6988d5af7b2efd6", "trace": [ "!!DESTRUCTIVE_CHANGES: WILL_DESTROY" ] @@ -310,5 +668,6 @@ "file": "tree.json" } } - } + }, + "minimumCliVersion": "2.1006.0" } \ No newline at end of file diff --git a/packages/@aws-cdk-testing/framework-integ/test/aws-apigateway/test/integ.restapi.js.snapshot/test-apigateway-restapi.assets.json b/packages/@aws-cdk-testing/framework-integ/test/aws-apigateway/test/integ.restapi.js.snapshot/test-apigateway-restapi.assets.json index 3efe69ea00eec..4862695b82d20 100644 --- a/packages/@aws-cdk-testing/framework-integ/test/aws-apigateway/test/integ.restapi.js.snapshot/test-apigateway-restapi.assets.json +++ b/packages/@aws-cdk-testing/framework-integ/test/aws-apigateway/test/integ.restapi.js.snapshot/test-apigateway-restapi.assets.json @@ -1,7 +1,8 @@ { - "version": "34.0.0", + "version": "41.0.0", "files": { - "7730a7574bd54d8b8cc5ce3a8fc74a2b2cec7fa63897f605899d3a225bd67bda": { + "ac325b57f8665b951b07b14609f1e04395e21874cd7c66b275943ab867d813f1": { + "displayName": "test-apigateway-restapi Template", "source": { "path": "test-apigateway-restapi.template.json", "packaging": "file" @@ -9,7 +10,7 @@ "destinations": { "current_account-current_region": { "bucketName": "cdk-hnb659fds-assets-${AWS::AccountId}-${AWS::Region}", - "objectKey": "7730a7574bd54d8b8cc5ce3a8fc74a2b2cec7fa63897f605899d3a225bd67bda.json", + "objectKey": "ac325b57f8665b951b07b14609f1e04395e21874cd7c66b275943ab867d813f1.json", "assumeRoleArn": "arn:${AWS::Partition}:iam::${AWS::AccountId}:role/cdk-hnb659fds-file-publishing-role-${AWS::AccountId}-${AWS::Region}" } } diff --git a/packages/@aws-cdk-testing/framework-integ/test/aws-apigateway/test/integ.restapi.js.snapshot/test-apigateway-restapi.template.json b/packages/@aws-cdk-testing/framework-integ/test/aws-apigateway/test/integ.restapi.js.snapshot/test-apigateway-restapi.template.json index 4da24fb620a2d..d1517b89d62a4 100644 --- a/packages/@aws-cdk-testing/framework-integ/test/aws-apigateway/test/integ.restapi.js.snapshot/test-apigateway-restapi.template.json +++ b/packages/@aws-cdk-testing/framework-integ/test/aws-apigateway/test/integ.restapi.js.snapshot/test-apigateway-restapi.template.json @@ -5,6 +5,7 @@ "Properties": { "Description": "api description", "MinimumCompressionSize": 1024, + "Mode": "merge", "Name": "my-api" } }, @@ -57,7 +58,7 @@ "UpdateReplacePolicy": "Retain", "DeletionPolicy": "Retain" }, - "myapiDeployment92F2CB49069d16df09c59427069eb74581a0403d": { + "myapiDeployment92F2CB4938b9b1875924477d0c57bcd0fac1cbdf": { "Type": "AWS::ApiGateway::Deployment", "Properties": { "Description": "beta stage", @@ -86,7 +87,7 @@ "CacheClusterEnabled": true, "CacheClusterSize": "0.5", "DeploymentId": { - "Ref": "myapiDeployment92F2CB49069d16df09c59427069eb74581a0403d" + "Ref": "myapiDeployment92F2CB4938b9b1875924477d0c57bcd0fac1cbdf" }, "Description": "beta stage", "MethodSettings": [ @@ -674,7 +675,7 @@ "MyHandlerServiceRoleFFA06653" ] }, - "TestDeploymentD77B56865531eba1e8fde4b8e6988d5af7b2efd6": { + "TestDeploymentD77B5686a15807100799563057d10920f3cb5b73": { "Type": "AWS::ApiGateway::Deployment", "Properties": { "RestApiId": { @@ -694,7 +695,7 @@ "Type": "AWS::ApiGateway::Stage", "Properties": { "DeploymentId": { - "Ref": "TestDeploymentD77B56865531eba1e8fde4b8e6988d5af7b2efd6" + "Ref": "TestDeploymentD77B5686a15807100799563057d10920f3cb5b73" }, "RestApiId": { "Ref": "myapi4C7BF186" diff --git a/packages/@aws-cdk-testing/framework-integ/test/aws-apigateway/test/integ.restapi.js.snapshot/tree.json b/packages/@aws-cdk-testing/framework-integ/test/aws-apigateway/test/integ.restapi.js.snapshot/tree.json index ff7900f722740..1c6c64e1881a6 100644 --- a/packages/@aws-cdk-testing/framework-integ/test/aws-apigateway/test/integ.restapi.js.snapshot/tree.json +++ b/packages/@aws-cdk-testing/framework-integ/test/aws-apigateway/test/integ.restapi.js.snapshot/tree.json @@ -1,1260 +1 @@ -{ - "version": "tree-0.1", - "tree": { - "id": "App", - "path": "", - "children": { - "test-apigateway-restapi": { - "id": "test-apigateway-restapi", - "path": "test-apigateway-restapi", - "children": { - "my-api": { - "id": "my-api", - "path": "test-apigateway-restapi/my-api", - "children": { - "Resource": { - "id": "Resource", - "path": "test-apigateway-restapi/my-api/Resource", - "attributes": { - "aws:cdk:cloudformation:type": "AWS::ApiGateway::RestApi", - "aws:cdk:cloudformation:props": { - "description": "api description", - "minimumCompressionSize": 1024, - "name": "my-api" - } - }, - "constructInfo": { - "fqn": "aws-cdk-lib.aws_apigateway.CfnRestApi", - "version": "0.0.0" - } - }, - "CloudWatchRole": { - "id": "CloudWatchRole", - "path": "test-apigateway-restapi/my-api/CloudWatchRole", - "children": { - "ImportCloudWatchRole": { - "id": "ImportCloudWatchRole", - "path": "test-apigateway-restapi/my-api/CloudWatchRole/ImportCloudWatchRole", - "constructInfo": { - "fqn": "aws-cdk-lib.Resource", - "version": "0.0.0" - } - }, - "Resource": { - "id": "Resource", - "path": "test-apigateway-restapi/my-api/CloudWatchRole/Resource", - "attributes": { - "aws:cdk:cloudformation:type": "AWS::IAM::Role", - "aws:cdk:cloudformation:props": { - "assumeRolePolicyDocument": { - "Statement": [ - { - "Action": "sts:AssumeRole", - "Effect": "Allow", - "Principal": { - "Service": "apigateway.amazonaws.com" - } - } - ], - "Version": "2012-10-17" - }, - "managedPolicyArns": [ - { - "Fn::Join": [ - "", - [ - "arn:", - { - "Ref": "AWS::Partition" - }, - ":iam::aws:policy/service-role/AmazonAPIGatewayPushToCloudWatchLogs" - ] - ] - } - ] - } - }, - "constructInfo": { - "fqn": "aws-cdk-lib.aws_iam.CfnRole", - "version": "0.0.0" - } - } - }, - "constructInfo": { - "fqn": "aws-cdk-lib.aws_iam.Role", - "version": "0.0.0" - } - }, - "Account": { - "id": "Account", - "path": "test-apigateway-restapi/my-api/Account", - "attributes": { - "aws:cdk:cloudformation:type": "AWS::ApiGateway::Account", - "aws:cdk:cloudformation:props": { - "cloudWatchRoleArn": { - "Fn::GetAtt": [ - "myapiCloudWatchRole095452E5", - "Arn" - ] - } - } - }, - "constructInfo": { - "fqn": "aws-cdk-lib.aws_apigateway.CfnAccount", - "version": "0.0.0" - } - }, - "Deployment": { - "id": "Deployment", - "path": "test-apigateway-restapi/my-api/Deployment", - "children": { - "Resource": { - "id": "Resource", - "path": "test-apigateway-restapi/my-api/Deployment/Resource", - "attributes": { - "aws:cdk:cloudformation:type": "AWS::ApiGateway::Deployment", - "aws:cdk:cloudformation:props": { - "description": "beta stage", - "restApiId": { - "Ref": "myapi4C7BF186" - } - } - }, - "constructInfo": { - "fqn": "aws-cdk-lib.aws_apigateway.CfnDeployment", - "version": "0.0.0" - } - } - }, - "constructInfo": { - "fqn": "aws-cdk-lib.aws_apigateway.Deployment", - "version": "0.0.0" - } - }, - "DeploymentStage.beta": { - "id": "DeploymentStage.beta", - "path": "test-apigateway-restapi/my-api/DeploymentStage.beta", - "children": { - "Resource": { - "id": "Resource", - "path": "test-apigateway-restapi/my-api/DeploymentStage.beta/Resource", - "attributes": { - "aws:cdk:cloudformation:type": "AWS::ApiGateway::Stage", - "aws:cdk:cloudformation:props": { - "cacheClusterEnabled": true, - "cacheClusterSize": "0.5", - "deploymentId": { - "Ref": "myapiDeployment92F2CB49069d16df09c59427069eb74581a0403d" - }, - "description": "beta stage", - "methodSettings": [ - { - "httpMethod": "*", - "resourcePath": "/*", - "dataTraceEnabled": true, - "loggingLevel": "INFO" - }, - { - "httpMethod": "GET", - "resourcePath": "/~1api~1appliances", - "cachingEnabled": true, - "dataTraceEnabled": false - } - ], - "restApiId": { - "Ref": "myapi4C7BF186" - }, - "stageName": "beta" - } - }, - "constructInfo": { - "fqn": "aws-cdk-lib.aws_apigateway.CfnStage", - "version": "0.0.0" - } - } - }, - "constructInfo": { - "fqn": "aws-cdk-lib.aws_apigateway.Stage", - "version": "0.0.0" - } - }, - "Endpoint": { - "id": "Endpoint", - "path": "test-apigateway-restapi/my-api/Endpoint", - "constructInfo": { - "fqn": "aws-cdk-lib.CfnOutput", - "version": "0.0.0" - } - }, - "Default": { - "id": "Default", - "path": "test-apigateway-restapi/my-api/Default", - "children": { - "v1": { - "id": "v1", - "path": "test-apigateway-restapi/my-api/Default/v1", - "children": { - "Resource": { - "id": "Resource", - "path": "test-apigateway-restapi/my-api/Default/v1/Resource", - "attributes": { - "aws:cdk:cloudformation:type": "AWS::ApiGateway::Resource", - "aws:cdk:cloudformation:props": { - "parentId": { - "Fn::GetAtt": [ - "myapi4C7BF186", - "RootResourceId" - ] - }, - "pathPart": "v1", - "restApiId": { - "Ref": "myapi4C7BF186" - } - } - }, - "constructInfo": { - "fqn": "aws-cdk-lib.aws_apigateway.CfnResource", - "version": "0.0.0" - } - }, - "toys": { - "id": "toys", - "path": "test-apigateway-restapi/my-api/Default/v1/toys", - "children": { - "Resource": { - "id": "Resource", - "path": "test-apigateway-restapi/my-api/Default/v1/toys/Resource", - "attributes": { - "aws:cdk:cloudformation:type": "AWS::ApiGateway::Resource", - "aws:cdk:cloudformation:props": { - "parentId": { - "Ref": "myapiv113487378" - }, - "pathPart": "toys", - "restApiId": { - "Ref": "myapi4C7BF186" - } - } - }, - "constructInfo": { - "fqn": "aws-cdk-lib.aws_apigateway.CfnResource", - "version": "0.0.0" - } - }, - "GET": { - "id": "GET", - "path": "test-apigateway-restapi/my-api/Default/v1/toys/GET", - "children": { - "ApiPermission.testapigatewayrestapimyapi1AE401C4.GET..v1.toys": { - "id": "ApiPermission.testapigatewayrestapimyapi1AE401C4.GET..v1.toys", - "path": "test-apigateway-restapi/my-api/Default/v1/toys/GET/ApiPermission.testapigatewayrestapimyapi1AE401C4.GET..v1.toys", - "attributes": { - "aws:cdk:cloudformation:type": "AWS::Lambda::Permission", - "aws:cdk:cloudformation:props": { - "action": "lambda:InvokeFunction", - "functionName": { - "Fn::GetAtt": [ - "MyHandler6B74D312", - "Arn" - ] - }, - "principal": "apigateway.amazonaws.com", - "sourceArn": { - "Fn::Join": [ - "", - [ - "arn:", - { - "Ref": "AWS::Partition" - }, - ":execute-api:", - { - "Ref": "AWS::Region" - }, - ":", - { - "Ref": "AWS::AccountId" - }, - ":", - { - "Ref": "myapi4C7BF186" - }, - "/", - { - "Ref": "myapiDeploymentStagebeta96434BEB" - }, - "/GET/v1/toys" - ] - ] - } - } - }, - "constructInfo": { - "fqn": "aws-cdk-lib.aws_lambda.CfnPermission", - "version": "0.0.0" - } - }, - "ApiPermission.Test.testapigatewayrestapimyapi1AE401C4.GET..v1.toys": { - "id": "ApiPermission.Test.testapigatewayrestapimyapi1AE401C4.GET..v1.toys", - "path": "test-apigateway-restapi/my-api/Default/v1/toys/GET/ApiPermission.Test.testapigatewayrestapimyapi1AE401C4.GET..v1.toys", - "attributes": { - "aws:cdk:cloudformation:type": "AWS::Lambda::Permission", - "aws:cdk:cloudformation:props": { - "action": "lambda:InvokeFunction", - "functionName": { - "Fn::GetAtt": [ - "MyHandler6B74D312", - "Arn" - ] - }, - "principal": "apigateway.amazonaws.com", - "sourceArn": { - "Fn::Join": [ - "", - [ - "arn:", - { - "Ref": "AWS::Partition" - }, - ":execute-api:", - { - "Ref": "AWS::Region" - }, - ":", - { - "Ref": "AWS::AccountId" - }, - ":", - { - "Ref": "myapi4C7BF186" - }, - "/test-invoke-stage/GET/v1/toys" - ] - ] - } - } - }, - "constructInfo": { - "fqn": "aws-cdk-lib.aws_lambda.CfnPermission", - "version": "0.0.0" - } - }, - "Resource": { - "id": "Resource", - "path": "test-apigateway-restapi/my-api/Default/v1/toys/GET/Resource", - "attributes": { - "aws:cdk:cloudformation:type": "AWS::ApiGateway::Method", - "aws:cdk:cloudformation:props": { - "apiKeyRequired": true, - "authorizationType": "NONE", - "httpMethod": "GET", - "integration": { - "type": "AWS_PROXY", - "uri": { - "Fn::Join": [ - "", - [ - "arn:", - { - "Ref": "AWS::Partition" - }, - ":apigateway:", - { - "Ref": "AWS::Region" - }, - ":lambda:path/2015-03-31/functions/", - { - "Fn::GetAtt": [ - "MyHandler6B74D312", - "Arn" - ] - }, - "/invocations" - ] - ] - }, - "integrationHttpMethod": "POST" - }, - "resourceId": { - "Ref": "myapiv1toysA55FCBC4" - }, - "restApiId": { - "Ref": "myapi4C7BF186" - } - } - }, - "constructInfo": { - "fqn": "aws-cdk-lib.aws_apigateway.CfnMethod", - "version": "0.0.0" - } - } - }, - "constructInfo": { - "fqn": "aws-cdk-lib.aws_apigateway.Method", - "version": "0.0.0" - } - }, - "POST": { - "id": "POST", - "path": "test-apigateway-restapi/my-api/Default/v1/toys/POST", - "children": { - "Resource": { - "id": "Resource", - "path": "test-apigateway-restapi/my-api/Default/v1/toys/POST/Resource", - "attributes": { - "aws:cdk:cloudformation:type": "AWS::ApiGateway::Method", - "aws:cdk:cloudformation:props": { - "authorizationType": "NONE", - "httpMethod": "POST", - "integration": { - "type": "MOCK" - }, - "resourceId": { - "Ref": "myapiv1toysA55FCBC4" - }, - "restApiId": { - "Ref": "myapi4C7BF186" - } - } - }, - "constructInfo": { - "fqn": "aws-cdk-lib.aws_apigateway.CfnMethod", - "version": "0.0.0" - } - } - }, - "constructInfo": { - "fqn": "aws-cdk-lib.aws_apigateway.Method", - "version": "0.0.0" - } - }, - "PUT": { - "id": "PUT", - "path": "test-apigateway-restapi/my-api/Default/v1/toys/PUT", - "children": { - "Resource": { - "id": "Resource", - "path": "test-apigateway-restapi/my-api/Default/v1/toys/PUT/Resource", - "attributes": { - "aws:cdk:cloudformation:type": "AWS::ApiGateway::Method", - "aws:cdk:cloudformation:props": { - "authorizationType": "NONE", - "httpMethod": "PUT", - "integration": { - "type": "MOCK" - }, - "resourceId": { - "Ref": "myapiv1toysA55FCBC4" - }, - "restApiId": { - "Ref": "myapi4C7BF186" - } - } - }, - "constructInfo": { - "fqn": "aws-cdk-lib.aws_apigateway.CfnMethod", - "version": "0.0.0" - } - } - }, - "constructInfo": { - "fqn": "aws-cdk-lib.aws_apigateway.Method", - "version": "0.0.0" - } - } - }, - "constructInfo": { - "fqn": "aws-cdk-lib.aws_apigateway.Resource", - "version": "0.0.0" - } - }, - "$appliances:all": { - "id": "$appliances:all", - "path": "test-apigateway-restapi/my-api/Default/v1/$appliances:all", - "children": { - "Resource": { - "id": "Resource", - "path": "test-apigateway-restapi/my-api/Default/v1/$appliances:all/Resource", - "attributes": { - "aws:cdk:cloudformation:type": "AWS::ApiGateway::Resource", - "aws:cdk:cloudformation:props": { - "parentId": { - "Ref": "myapiv113487378" - }, - "pathPart": "$appliances:all", - "restApiId": { - "Ref": "myapi4C7BF186" - } - } - }, - "constructInfo": { - "fqn": "aws-cdk-lib.aws_apigateway.CfnResource", - "version": "0.0.0" - } - }, - "GET": { - "id": "GET", - "path": "test-apigateway-restapi/my-api/Default/v1/$appliances:all/GET", - "children": { - "Resource": { - "id": "Resource", - "path": "test-apigateway-restapi/my-api/Default/v1/$appliances:all/GET/Resource", - "attributes": { - "aws:cdk:cloudformation:type": "AWS::ApiGateway::Method", - "aws:cdk:cloudformation:props": { - "authorizationType": "NONE", - "httpMethod": "GET", - "integration": { - "type": "MOCK" - }, - "resourceId": { - "Ref": "myapiv1appliancesallD279897B" - }, - "restApiId": { - "Ref": "myapi4C7BF186" - } - } - }, - "constructInfo": { - "fqn": "aws-cdk-lib.aws_apigateway.CfnMethod", - "version": "0.0.0" - } - } - }, - "constructInfo": { - "fqn": "aws-cdk-lib.aws_apigateway.Method", - "version": "0.0.0" - } - } - }, - "constructInfo": { - "fqn": "aws-cdk-lib.aws_apigateway.Resource", - "version": "0.0.0" - } - }, - "books": { - "id": "books", - "path": "test-apigateway-restapi/my-api/Default/v1/books", - "children": { - "Resource": { - "id": "Resource", - "path": "test-apigateway-restapi/my-api/Default/v1/books/Resource", - "attributes": { - "aws:cdk:cloudformation:type": "AWS::ApiGateway::Resource", - "aws:cdk:cloudformation:props": { - "parentId": { - "Ref": "myapiv113487378" - }, - "pathPart": "books", - "restApiId": { - "Ref": "myapi4C7BF186" - } - } - }, - "constructInfo": { - "fqn": "aws-cdk-lib.aws_apigateway.CfnResource", - "version": "0.0.0" - } - }, - "GET": { - "id": "GET", - "path": "test-apigateway-restapi/my-api/Default/v1/books/GET", - "children": { - "ApiPermission.testapigatewayrestapimyapi1AE401C4.GET..v1.books": { - "id": "ApiPermission.testapigatewayrestapimyapi1AE401C4.GET..v1.books", - "path": "test-apigateway-restapi/my-api/Default/v1/books/GET/ApiPermission.testapigatewayrestapimyapi1AE401C4.GET..v1.books", - "attributes": { - "aws:cdk:cloudformation:type": "AWS::Lambda::Permission", - "aws:cdk:cloudformation:props": { - "action": "lambda:InvokeFunction", - "functionName": { - "Fn::GetAtt": [ - "MyHandler6B74D312", - "Arn" - ] - }, - "principal": "apigateway.amazonaws.com", - "sourceArn": { - "Fn::Join": [ - "", - [ - "arn:", - { - "Ref": "AWS::Partition" - }, - ":execute-api:", - { - "Ref": "AWS::Region" - }, - ":", - { - "Ref": "AWS::AccountId" - }, - ":", - { - "Ref": "myapi4C7BF186" - }, - "/", - { - "Ref": "myapiDeploymentStagebeta96434BEB" - }, - "/GET/v1/books" - ] - ] - } - } - }, - "constructInfo": { - "fqn": "aws-cdk-lib.aws_lambda.CfnPermission", - "version": "0.0.0" - } - }, - "ApiPermission.Test.testapigatewayrestapimyapi1AE401C4.GET..v1.books": { - "id": "ApiPermission.Test.testapigatewayrestapimyapi1AE401C4.GET..v1.books", - "path": "test-apigateway-restapi/my-api/Default/v1/books/GET/ApiPermission.Test.testapigatewayrestapimyapi1AE401C4.GET..v1.books", - "attributes": { - "aws:cdk:cloudformation:type": "AWS::Lambda::Permission", - "aws:cdk:cloudformation:props": { - "action": "lambda:InvokeFunction", - "functionName": { - "Fn::GetAtt": [ - "MyHandler6B74D312", - "Arn" - ] - }, - "principal": "apigateway.amazonaws.com", - "sourceArn": { - "Fn::Join": [ - "", - [ - "arn:", - { - "Ref": "AWS::Partition" - }, - ":execute-api:", - { - "Ref": "AWS::Region" - }, - ":", - { - "Ref": "AWS::AccountId" - }, - ":", - { - "Ref": "myapi4C7BF186" - }, - "/test-invoke-stage/GET/v1/books" - ] - ] - } - } - }, - "constructInfo": { - "fqn": "aws-cdk-lib.aws_lambda.CfnPermission", - "version": "0.0.0" - } - }, - "Resource": { - "id": "Resource", - "path": "test-apigateway-restapi/my-api/Default/v1/books/GET/Resource", - "attributes": { - "aws:cdk:cloudformation:type": "AWS::ApiGateway::Method", - "aws:cdk:cloudformation:props": { - "authorizationType": "NONE", - "httpMethod": "GET", - "integration": { - "type": "AWS_PROXY", - "uri": { - "Fn::Join": [ - "", - [ - "arn:", - { - "Ref": "AWS::Partition" - }, - ":apigateway:", - { - "Ref": "AWS::Region" - }, - ":lambda:path/2015-03-31/functions/", - { - "Fn::GetAtt": [ - "MyHandler6B74D312", - "Arn" - ] - }, - "/invocations" - ] - ] - }, - "integrationHttpMethod": "POST" - }, - "resourceId": { - "Ref": "myapiv1books1D4BE6C1" - }, - "restApiId": { - "Ref": "myapi4C7BF186" - } - } - }, - "constructInfo": { - "fqn": "aws-cdk-lib.aws_apigateway.CfnMethod", - "version": "0.0.0" - } - } - }, - "constructInfo": { - "fqn": "aws-cdk-lib.aws_apigateway.Method", - "version": "0.0.0" - } - }, - "POST": { - "id": "POST", - "path": "test-apigateway-restapi/my-api/Default/v1/books/POST", - "children": { - "ApiPermission.testapigatewayrestapimyapi1AE401C4.POST..v1.books": { - "id": "ApiPermission.testapigatewayrestapimyapi1AE401C4.POST..v1.books", - "path": "test-apigateway-restapi/my-api/Default/v1/books/POST/ApiPermission.testapigatewayrestapimyapi1AE401C4.POST..v1.books", - "attributes": { - "aws:cdk:cloudformation:type": "AWS::Lambda::Permission", - "aws:cdk:cloudformation:props": { - "action": "lambda:InvokeFunction", - "functionName": { - "Fn::GetAtt": [ - "MyHandler6B74D312", - "Arn" - ] - }, - "principal": "apigateway.amazonaws.com", - "sourceArn": { - "Fn::Join": [ - "", - [ - "arn:", - { - "Ref": "AWS::Partition" - }, - ":execute-api:", - { - "Ref": "AWS::Region" - }, - ":", - { - "Ref": "AWS::AccountId" - }, - ":", - { - "Ref": "myapi4C7BF186" - }, - "/", - { - "Ref": "myapiDeploymentStagebeta96434BEB" - }, - "/POST/v1/books" - ] - ] - } - } - }, - "constructInfo": { - "fqn": "aws-cdk-lib.aws_lambda.CfnPermission", - "version": "0.0.0" - } - }, - "ApiPermission.Test.testapigatewayrestapimyapi1AE401C4.POST..v1.books": { - "id": "ApiPermission.Test.testapigatewayrestapimyapi1AE401C4.POST..v1.books", - "path": "test-apigateway-restapi/my-api/Default/v1/books/POST/ApiPermission.Test.testapigatewayrestapimyapi1AE401C4.POST..v1.books", - "attributes": { - "aws:cdk:cloudformation:type": "AWS::Lambda::Permission", - "aws:cdk:cloudformation:props": { - "action": "lambda:InvokeFunction", - "functionName": { - "Fn::GetAtt": [ - "MyHandler6B74D312", - "Arn" - ] - }, - "principal": "apigateway.amazonaws.com", - "sourceArn": { - "Fn::Join": [ - "", - [ - "arn:", - { - "Ref": "AWS::Partition" - }, - ":execute-api:", - { - "Ref": "AWS::Region" - }, - ":", - { - "Ref": "AWS::AccountId" - }, - ":", - { - "Ref": "myapi4C7BF186" - }, - "/test-invoke-stage/POST/v1/books" - ] - ] - } - } - }, - "constructInfo": { - "fqn": "aws-cdk-lib.aws_lambda.CfnPermission", - "version": "0.0.0" - } - }, - "Resource": { - "id": "Resource", - "path": "test-apigateway-restapi/my-api/Default/v1/books/POST/Resource", - "attributes": { - "aws:cdk:cloudformation:type": "AWS::ApiGateway::Method", - "aws:cdk:cloudformation:props": { - "authorizationType": "NONE", - "httpMethod": "POST", - "integration": { - "type": "AWS_PROXY", - "uri": { - "Fn::Join": [ - "", - [ - "arn:", - { - "Ref": "AWS::Partition" - }, - ":apigateway:", - { - "Ref": "AWS::Region" - }, - ":lambda:path/2015-03-31/functions/", - { - "Fn::GetAtt": [ - "MyHandler6B74D312", - "Arn" - ] - }, - "/invocations" - ] - ] - }, - "integrationHttpMethod": "POST" - }, - "resourceId": { - "Ref": "myapiv1books1D4BE6C1" - }, - "restApiId": { - "Ref": "myapi4C7BF186" - } - } - }, - "constructInfo": { - "fqn": "aws-cdk-lib.aws_apigateway.CfnMethod", - "version": "0.0.0" - } - } - }, - "constructInfo": { - "fqn": "aws-cdk-lib.aws_apigateway.Method", - "version": "0.0.0" - } - } - }, - "constructInfo": { - "fqn": "aws-cdk-lib.aws_apigateway.Resource", - "version": "0.0.0" - } - } - }, - "constructInfo": { - "fqn": "aws-cdk-lib.aws_apigateway.Resource", - "version": "0.0.0" - } - } - }, - "constructInfo": { - "fqn": "aws-cdk-lib.aws_apigateway.ResourceBase", - "version": "0.0.0" - } - }, - "ApiKey": { - "id": "ApiKey", - "path": "test-apigateway-restapi/my-api/ApiKey", - "children": { - "Resource": { - "id": "Resource", - "path": "test-apigateway-restapi/my-api/ApiKey/Resource", - "attributes": { - "aws:cdk:cloudformation:type": "AWS::ApiGateway::ApiKey", - "aws:cdk:cloudformation:props": { - "enabled": true, - "stageKeys": [ - { - "restApiId": { - "Ref": "myapi4C7BF186" - }, - "stageName": { - "Ref": "myapiDeploymentStagebeta96434BEB" - } - } - ] - } - }, - "constructInfo": { - "fqn": "aws-cdk-lib.aws_apigateway.CfnApiKey", - "version": "0.0.0" - } - } - }, - "constructInfo": { - "fqn": "aws-cdk-lib.aws_apigateway.ApiKey", - "version": "0.0.0" - } - }, - "UsagePlan": { - "id": "UsagePlan", - "path": "test-apigateway-restapi/my-api/UsagePlan", - "children": { - "Resource": { - "id": "Resource", - "path": "test-apigateway-restapi/my-api/UsagePlan/Resource", - "attributes": { - "aws:cdk:cloudformation:type": "AWS::ApiGateway::UsagePlan", - "aws:cdk:cloudformation:props": { - "apiStages": [ - { - "apiId": { - "Ref": "myapi4C7BF186" - }, - "stage": { - "Ref": "myapiDeploymentStagebeta96434BEB" - }, - "throttle": { - "/v1/toys/GET": { - "burstLimit": 2, - "rateLimit": 10 - } - } - } - ], - "description": "Free tier monthly usage plan", - "quota": { - "limit": 10000, - "period": "MONTH" - }, - "throttle": { - "rateLimit": 5 - }, - "usagePlanName": "Basic" - } - }, - "constructInfo": { - "fqn": "aws-cdk-lib.aws_apigateway.CfnUsagePlan", - "version": "0.0.0" - } - }, - "UsagePlanKeyResource:testapigatewayrestapimyapiApiKeyC43601CB": { - "id": "UsagePlanKeyResource:testapigatewayrestapimyapiApiKeyC43601CB", - "path": "test-apigateway-restapi/my-api/UsagePlan/UsagePlanKeyResource:testapigatewayrestapimyapiApiKeyC43601CB", - "attributes": { - "aws:cdk:cloudformation:type": "AWS::ApiGateway::UsagePlanKey", - "aws:cdk:cloudformation:props": { - "keyId": { - "Ref": "myapiApiKey43446CCF" - }, - "keyType": "API_KEY", - "usagePlanId": { - "Ref": "myapiUsagePlan56F9C4F2" - } - } - }, - "constructInfo": { - "fqn": "aws-cdk-lib.aws_apigateway.CfnUsagePlanKey", - "version": "0.0.0" - } - } - }, - "constructInfo": { - "fqn": "aws-cdk-lib.aws_apigateway.UsagePlan", - "version": "0.0.0" - } - } - }, - "constructInfo": { - "fqn": "aws-cdk-lib.aws_apigateway.RestApi", - "version": "0.0.0" - } - }, - "MyHandler": { - "id": "MyHandler", - "path": "test-apigateway-restapi/MyHandler", - "children": { - "ServiceRole": { - "id": "ServiceRole", - "path": "test-apigateway-restapi/MyHandler/ServiceRole", - "children": { - "ImportServiceRole": { - "id": "ImportServiceRole", - "path": "test-apigateway-restapi/MyHandler/ServiceRole/ImportServiceRole", - "constructInfo": { - "fqn": "aws-cdk-lib.Resource", - "version": "0.0.0" - } - }, - "Resource": { - "id": "Resource", - "path": "test-apigateway-restapi/MyHandler/ServiceRole/Resource", - "attributes": { - "aws:cdk:cloudformation:type": "AWS::IAM::Role", - "aws:cdk:cloudformation:props": { - "assumeRolePolicyDocument": { - "Statement": [ - { - "Action": "sts:AssumeRole", - "Effect": "Allow", - "Principal": { - "Service": "lambda.amazonaws.com" - } - } - ], - "Version": "2012-10-17" - }, - "managedPolicyArns": [ - { - "Fn::Join": [ - "", - [ - "arn:", - { - "Ref": "AWS::Partition" - }, - ":iam::aws:policy/service-role/AWSLambdaBasicExecutionRole" - ] - ] - } - ] - } - }, - "constructInfo": { - "fqn": "aws-cdk-lib.aws_iam.CfnRole", - "version": "0.0.0" - } - } - }, - "constructInfo": { - "fqn": "aws-cdk-lib.aws_iam.Role", - "version": "0.0.0" - } - }, - "Resource": { - "id": "Resource", - "path": "test-apigateway-restapi/MyHandler/Resource", - "attributes": { - "aws:cdk:cloudformation:type": "AWS::Lambda::Function", - "aws:cdk:cloudformation:props": { - "code": { - "zipFile": "exports.handler = function handlerCode(event, _, callback) {\n return callback(undefined, {\n isBase64Encoded: false,\n statusCode: 200,\n headers: { 'content-type': 'application/json' },\n body: JSON.stringify(event),\n });\n }" - }, - "handler": "index.handler", - "role": { - "Fn::GetAtt": [ - "MyHandlerServiceRoleFFA06653", - "Arn" - ] - }, - "runtime": "nodejs18.x" - } - }, - "constructInfo": { - "fqn": "aws-cdk-lib.aws_lambda.CfnFunction", - "version": "0.0.0" - } - } - }, - "constructInfo": { - "fqn": "aws-cdk-lib.aws_lambda.Function", - "version": "0.0.0" - } - }, - "TestDeployment": { - "id": "TestDeployment", - "path": "test-apigateway-restapi/TestDeployment", - "children": { - "Resource": { - "id": "Resource", - "path": "test-apigateway-restapi/TestDeployment/Resource", - "attributes": { - "aws:cdk:cloudformation:type": "AWS::ApiGateway::Deployment", - "aws:cdk:cloudformation:props": { - "restApiId": { - "Ref": "myapi4C7BF186" - } - } - }, - "constructInfo": { - "fqn": "aws-cdk-lib.aws_apigateway.CfnDeployment", - "version": "0.0.0" - } - } - }, - "constructInfo": { - "fqn": "aws-cdk-lib.aws_apigateway.Deployment", - "version": "0.0.0" - } - }, - "TestStage": { - "id": "TestStage", - "path": "test-apigateway-restapi/TestStage", - "children": { - "Resource": { - "id": "Resource", - "path": "test-apigateway-restapi/TestStage/Resource", - "attributes": { - "aws:cdk:cloudformation:type": "AWS::ApiGateway::Stage", - "aws:cdk:cloudformation:props": { - "deploymentId": { - "Ref": "TestDeploymentD77B56865531eba1e8fde4b8e6988d5af7b2efd6" - }, - "restApiId": { - "Ref": "myapi4C7BF186" - }, - "stageName": "prod" - } - }, - "constructInfo": { - "fqn": "aws-cdk-lib.aws_apigateway.CfnStage", - "version": "0.0.0" - } - }, - "MyTestApiKey": { - "id": "MyTestApiKey", - "path": "test-apigateway-restapi/TestStage/MyTestApiKey", - "children": { - "Resource": { - "id": "Resource", - "path": "test-apigateway-restapi/TestStage/MyTestApiKey/Resource", - "attributes": { - "aws:cdk:cloudformation:type": "AWS::ApiGateway::ApiKey", - "aws:cdk:cloudformation:props": { - "enabled": true, - "stageKeys": [ - { - "restApiId": { - "Ref": "myapi4C7BF186" - }, - "stageName": { - "Ref": "TestStage3097EB68" - } - } - ] - } - }, - "constructInfo": { - "fqn": "aws-cdk-lib.aws_apigateway.CfnApiKey", - "version": "0.0.0" - } - } - }, - "constructInfo": { - "fqn": "aws-cdk-lib.aws_apigateway.ApiKey", - "version": "0.0.0" - } - } - }, - "constructInfo": { - "fqn": "aws-cdk-lib.aws_apigateway.Stage", - "version": "0.0.0" - } - }, - "BootstrapVersion": { - "id": "BootstrapVersion", - "path": "test-apigateway-restapi/BootstrapVersion", - "constructInfo": { - "fqn": "aws-cdk-lib.CfnParameter", - "version": "0.0.0" - } - }, - "CheckBootstrapVersion": { - "id": "CheckBootstrapVersion", - "path": "test-apigateway-restapi/CheckBootstrapVersion", - "constructInfo": { - "fqn": "aws-cdk-lib.CfnRule", - "version": "0.0.0" - } - } - }, - "constructInfo": { - "fqn": "aws-cdk-lib.Stack", - "version": "0.0.0" - } - }, - "apigateway-restapi": { - "id": "apigateway-restapi", - "path": "apigateway-restapi", - "children": { - "DefaultTest": { - "id": "DefaultTest", - "path": "apigateway-restapi/DefaultTest", - "children": { - "Default": { - "id": "Default", - "path": "apigateway-restapi/DefaultTest/Default", - "constructInfo": { - "fqn": "constructs.Construct", - "version": "10.2.70" - } - }, - "DeployAssert": { - "id": "DeployAssert", - "path": "apigateway-restapi/DefaultTest/DeployAssert", - "children": { - "BootstrapVersion": { - "id": "BootstrapVersion", - "path": "apigateway-restapi/DefaultTest/DeployAssert/BootstrapVersion", - "constructInfo": { - "fqn": "aws-cdk-lib.CfnParameter", - "version": "0.0.0" - } - }, - "CheckBootstrapVersion": { - "id": "CheckBootstrapVersion", - "path": "apigateway-restapi/DefaultTest/DeployAssert/CheckBootstrapVersion", - "constructInfo": { - "fqn": "aws-cdk-lib.CfnRule", - "version": "0.0.0" - } - } - }, - "constructInfo": { - "fqn": "aws-cdk-lib.Stack", - "version": "0.0.0" - } - } - }, - "constructInfo": { - "fqn": "@aws-cdk/integ-tests-alpha.IntegTestCase", - "version": "0.0.0" - } - } - }, - "constructInfo": { - "fqn": "@aws-cdk/integ-tests-alpha.IntegTest", - "version": "0.0.0" - } - }, - "Tree": { - "id": "Tree", - "path": "Tree", - "constructInfo": { - "fqn": "constructs.Construct", - "version": "10.2.70" - } - } - }, - "constructInfo": { - "fqn": "aws-cdk-lib.App", - "version": "0.0.0" - } - } -} \ No newline at end of file +{"version":"tree-0.1","tree":{"id":"App","path":"","children":{"test-apigateway-restapi":{"id":"test-apigateway-restapi","path":"test-apigateway-restapi","children":{"my-api":{"id":"my-api","path":"test-apigateway-restapi/my-api","children":{"Resource":{"id":"Resource","path":"test-apigateway-restapi/my-api/Resource","attributes":{"aws:cdk:cloudformation:type":"AWS::ApiGateway::RestApi","aws:cdk:cloudformation:props":{"description":"api description","minimumCompressionSize":1024,"mode":"merge","name":"my-api"}},"constructInfo":{"fqn":"aws-cdk-lib.aws_apigateway.CfnRestApi","version":"0.0.0"}},"CloudWatchRole":{"id":"CloudWatchRole","path":"test-apigateway-restapi/my-api/CloudWatchRole","children":{"ImportCloudWatchRole":{"id":"ImportCloudWatchRole","path":"test-apigateway-restapi/my-api/CloudWatchRole/ImportCloudWatchRole","constructInfo":{"fqn":"aws-cdk-lib.Resource","version":"0.0.0","metadata":["*"]}},"Resource":{"id":"Resource","path":"test-apigateway-restapi/my-api/CloudWatchRole/Resource","attributes":{"aws:cdk:cloudformation:type":"AWS::IAM::Role","aws:cdk:cloudformation:props":{"assumeRolePolicyDocument":{"Statement":[{"Action":"sts:AssumeRole","Effect":"Allow","Principal":{"Service":"apigateway.amazonaws.com"}}],"Version":"2012-10-17"},"managedPolicyArns":[{"Fn::Join":["",["arn:",{"Ref":"AWS::Partition"},":iam::aws:policy/service-role/AmazonAPIGatewayPushToCloudWatchLogs"]]}]}},"constructInfo":{"fqn":"aws-cdk-lib.aws_iam.CfnRole","version":"0.0.0"}}},"constructInfo":{"fqn":"aws-cdk-lib.aws_iam.Role","version":"0.0.0","metadata":[{"assumedBy":{"principalAccount":"*","assumeRoleAction":"*"},"managedPolicies":[{"managedPolicyArn":"*"}]},{"applyRemovalPolicy":["retain"]}]}},"Account":{"id":"Account","path":"test-apigateway-restapi/my-api/Account","attributes":{"aws:cdk:cloudformation:type":"AWS::ApiGateway::Account","aws:cdk:cloudformation:props":{"cloudWatchRoleArn":{"Fn::GetAtt":["myapiCloudWatchRole095452E5","Arn"]}}},"constructInfo":{"fqn":"aws-cdk-lib.aws_apigateway.CfnAccount","version":"0.0.0"}},"Deployment":{"id":"Deployment","path":"test-apigateway-restapi/my-api/Deployment","children":{"Resource":{"id":"Resource","path":"test-apigateway-restapi/my-api/Deployment/Resource","attributes":{"aws:cdk:cloudformation:type":"AWS::ApiGateway::Deployment","aws:cdk:cloudformation:props":{"description":"beta stage","restApiId":{"Ref":"myapi4C7BF186"}}},"constructInfo":{"fqn":"aws-cdk-lib.aws_apigateway.CfnDeployment","version":"0.0.0"}}},"constructInfo":{"fqn":"aws-cdk-lib.aws_apigateway.Deployment","version":"0.0.0","metadata":[{"description":"*","api":"*","retainDeployments":true},{"addToLogicalId":[{}]},{"addToLogicalId":[{}]},{"addToLogicalId":[{}]},{"addToLogicalId":[{}]},{"addToLogicalId":[{}]},{"addToLogicalId":[{}]},{"addToLogicalId":[{}]},{"addToLogicalId":[{}]},{"addToLogicalId":[{}]},{"addToLogicalId":[{}]}]}},"DeploymentStage.beta":{"id":"DeploymentStage.beta","path":"test-apigateway-restapi/my-api/DeploymentStage.beta","children":{"Resource":{"id":"Resource","path":"test-apigateway-restapi/my-api/DeploymentStage.beta/Resource","attributes":{"aws:cdk:cloudformation:type":"AWS::ApiGateway::Stage","aws:cdk:cloudformation:props":{"cacheClusterEnabled":true,"cacheClusterSize":"0.5","deploymentId":{"Ref":"myapiDeployment92F2CB4938b9b1875924477d0c57bcd0fac1cbdf"},"description":"beta stage","methodSettings":[{"httpMethod":"*","resourcePath":"/*","dataTraceEnabled":true,"loggingLevel":"INFO"},{"httpMethod":"GET","resourcePath":"/~1api~1appliances","cachingEnabled":true,"dataTraceEnabled":false}],"restApiId":{"Ref":"myapi4C7BF186"},"stageName":"beta"}},"constructInfo":{"fqn":"aws-cdk-lib.aws_apigateway.CfnStage","version":"0.0.0"}}},"constructInfo":{"fqn":"aws-cdk-lib.aws_apigateway.Stage","version":"0.0.0","metadata":[{"deployment":"*","cacheClusterEnabled":true,"stageName":"*","description":"*","loggingLevel":"INFO","dataTraceEnabled":true,"methodOptions":"*"}]}},"Endpoint":{"id":"Endpoint","path":"test-apigateway-restapi/my-api/Endpoint","constructInfo":{"fqn":"aws-cdk-lib.CfnOutput","version":"0.0.0"}},"Default":{"id":"Default","path":"test-apigateway-restapi/my-api/Default","children":{"v1":{"id":"v1","path":"test-apigateway-restapi/my-api/Default/v1","children":{"Resource":{"id":"Resource","path":"test-apigateway-restapi/my-api/Default/v1/Resource","attributes":{"aws:cdk:cloudformation:type":"AWS::ApiGateway::Resource","aws:cdk:cloudformation:props":{"parentId":{"Fn::GetAtt":["myapi4C7BF186","RootResourceId"]},"pathPart":"v1","restApiId":{"Ref":"myapi4C7BF186"}}},"constructInfo":{"fqn":"aws-cdk-lib.aws_apigateway.CfnResource","version":"0.0.0"}},"toys":{"id":"toys","path":"test-apigateway-restapi/my-api/Default/v1/toys","children":{"Resource":{"id":"Resource","path":"test-apigateway-restapi/my-api/Default/v1/toys/Resource","attributes":{"aws:cdk:cloudformation:type":"AWS::ApiGateway::Resource","aws:cdk:cloudformation:props":{"parentId":{"Ref":"myapiv113487378"},"pathPart":"toys","restApiId":{"Ref":"myapi4C7BF186"}}},"constructInfo":{"fqn":"aws-cdk-lib.aws_apigateway.CfnResource","version":"0.0.0"}},"GET":{"id":"GET","path":"test-apigateway-restapi/my-api/Default/v1/toys/GET","children":{"ApiPermission.testapigatewayrestapimyapi1AE401C4.GET..v1.toys":{"id":"ApiPermission.testapigatewayrestapimyapi1AE401C4.GET..v1.toys","path":"test-apigateway-restapi/my-api/Default/v1/toys/GET/ApiPermission.testapigatewayrestapimyapi1AE401C4.GET..v1.toys","attributes":{"aws:cdk:cloudformation:type":"AWS::Lambda::Permission","aws:cdk:cloudformation:props":{"action":"lambda:InvokeFunction","functionName":{"Fn::GetAtt":["MyHandler6B74D312","Arn"]},"principal":"apigateway.amazonaws.com","sourceArn":{"Fn::Join":["",["arn:",{"Ref":"AWS::Partition"},":execute-api:",{"Ref":"AWS::Region"},":",{"Ref":"AWS::AccountId"},":",{"Ref":"myapi4C7BF186"},"/",{"Ref":"myapiDeploymentStagebeta96434BEB"},"/GET/v1/toys"]]}}},"constructInfo":{"fqn":"aws-cdk-lib.aws_lambda.CfnPermission","version":"0.0.0"}},"ApiPermission.Test.testapigatewayrestapimyapi1AE401C4.GET..v1.toys":{"id":"ApiPermission.Test.testapigatewayrestapimyapi1AE401C4.GET..v1.toys","path":"test-apigateway-restapi/my-api/Default/v1/toys/GET/ApiPermission.Test.testapigatewayrestapimyapi1AE401C4.GET..v1.toys","attributes":{"aws:cdk:cloudformation:type":"AWS::Lambda::Permission","aws:cdk:cloudformation:props":{"action":"lambda:InvokeFunction","functionName":{"Fn::GetAtt":["MyHandler6B74D312","Arn"]},"principal":"apigateway.amazonaws.com","sourceArn":{"Fn::Join":["",["arn:",{"Ref":"AWS::Partition"},":execute-api:",{"Ref":"AWS::Region"},":",{"Ref":"AWS::AccountId"},":",{"Ref":"myapi4C7BF186"},"/test-invoke-stage/GET/v1/toys"]]}}},"constructInfo":{"fqn":"aws-cdk-lib.aws_lambda.CfnPermission","version":"0.0.0"}},"Resource":{"id":"Resource","path":"test-apigateway-restapi/my-api/Default/v1/toys/GET/Resource","attributes":{"aws:cdk:cloudformation:type":"AWS::ApiGateway::Method","aws:cdk:cloudformation:props":{"apiKeyRequired":true,"authorizationType":"NONE","httpMethod":"GET","integration":{"type":"AWS_PROXY","uri":{"Fn::Join":["",["arn:",{"Ref":"AWS::Partition"},":apigateway:",{"Ref":"AWS::Region"},":lambda:path/2015-03-31/functions/",{"Fn::GetAtt":["MyHandler6B74D312","Arn"]},"/invocations"]]},"integrationHttpMethod":"POST"},"resourceId":{"Ref":"myapiv1toysA55FCBC4"},"restApiId":{"Ref":"myapi4C7BF186"}}},"constructInfo":{"fqn":"aws-cdk-lib.aws_apigateway.CfnMethod","version":"0.0.0"}}},"constructInfo":{"fqn":"aws-cdk-lib.aws_apigateway.Method","version":"0.0.0","metadata":[{"resource":"*","httpMethod":"*","integration":"*","options":{"apiKeyRequired":true}}]}},"POST":{"id":"POST","path":"test-apigateway-restapi/my-api/Default/v1/toys/POST","children":{"Resource":{"id":"Resource","path":"test-apigateway-restapi/my-api/Default/v1/toys/POST/Resource","attributes":{"aws:cdk:cloudformation:type":"AWS::ApiGateway::Method","aws:cdk:cloudformation:props":{"authorizationType":"NONE","httpMethod":"POST","integration":{"type":"MOCK"},"resourceId":{"Ref":"myapiv1toysA55FCBC4"},"restApiId":{"Ref":"myapi4C7BF186"}}},"constructInfo":{"fqn":"aws-cdk-lib.aws_apigateway.CfnMethod","version":"0.0.0"}}},"constructInfo":{"fqn":"aws-cdk-lib.aws_apigateway.Method","version":"0.0.0","metadata":[{"resource":"*","httpMethod":"*","integration":"*","options":"*"}]}},"PUT":{"id":"PUT","path":"test-apigateway-restapi/my-api/Default/v1/toys/PUT","children":{"Resource":{"id":"Resource","path":"test-apigateway-restapi/my-api/Default/v1/toys/PUT/Resource","attributes":{"aws:cdk:cloudformation:type":"AWS::ApiGateway::Method","aws:cdk:cloudformation:props":{"authorizationType":"NONE","httpMethod":"PUT","integration":{"type":"MOCK"},"resourceId":{"Ref":"myapiv1toysA55FCBC4"},"restApiId":{"Ref":"myapi4C7BF186"}}},"constructInfo":{"fqn":"aws-cdk-lib.aws_apigateway.CfnMethod","version":"0.0.0"}}},"constructInfo":{"fqn":"aws-cdk-lib.aws_apigateway.Method","version":"0.0.0","metadata":[{"resource":"*","httpMethod":"*","integration":"*","options":"*"}]}}},"constructInfo":{"fqn":"aws-cdk-lib.aws_apigateway.Resource","version":"0.0.0","metadata":[{"pathPart":"*"}]}},"$appliances:all":{"id":"$appliances:all","path":"test-apigateway-restapi/my-api/Default/v1/$appliances:all","children":{"Resource":{"id":"Resource","path":"test-apigateway-restapi/my-api/Default/v1/$appliances:all/Resource","attributes":{"aws:cdk:cloudformation:type":"AWS::ApiGateway::Resource","aws:cdk:cloudformation:props":{"parentId":{"Ref":"myapiv113487378"},"pathPart":"$appliances:all","restApiId":{"Ref":"myapi4C7BF186"}}},"constructInfo":{"fqn":"aws-cdk-lib.aws_apigateway.CfnResource","version":"0.0.0"}},"GET":{"id":"GET","path":"test-apigateway-restapi/my-api/Default/v1/$appliances:all/GET","children":{"Resource":{"id":"Resource","path":"test-apigateway-restapi/my-api/Default/v1/$appliances:all/GET/Resource","attributes":{"aws:cdk:cloudformation:type":"AWS::ApiGateway::Method","aws:cdk:cloudformation:props":{"authorizationType":"NONE","httpMethod":"GET","integration":{"type":"MOCK"},"resourceId":{"Ref":"myapiv1appliancesallD279897B"},"restApiId":{"Ref":"myapi4C7BF186"}}},"constructInfo":{"fqn":"aws-cdk-lib.aws_apigateway.CfnMethod","version":"0.0.0"}}},"constructInfo":{"fqn":"aws-cdk-lib.aws_apigateway.Method","version":"0.0.0","metadata":[{"resource":"*","httpMethod":"*","integration":"*","options":"*"}]}}},"constructInfo":{"fqn":"aws-cdk-lib.aws_apigateway.Resource","version":"0.0.0","metadata":[{"pathPart":"*"}]}},"books":{"id":"books","path":"test-apigateway-restapi/my-api/Default/v1/books","children":{"Resource":{"id":"Resource","path":"test-apigateway-restapi/my-api/Default/v1/books/Resource","attributes":{"aws:cdk:cloudformation:type":"AWS::ApiGateway::Resource","aws:cdk:cloudformation:props":{"parentId":{"Ref":"myapiv113487378"},"pathPart":"books","restApiId":{"Ref":"myapi4C7BF186"}}},"constructInfo":{"fqn":"aws-cdk-lib.aws_apigateway.CfnResource","version":"0.0.0"}},"GET":{"id":"GET","path":"test-apigateway-restapi/my-api/Default/v1/books/GET","children":{"ApiPermission.testapigatewayrestapimyapi1AE401C4.GET..v1.books":{"id":"ApiPermission.testapigatewayrestapimyapi1AE401C4.GET..v1.books","path":"test-apigateway-restapi/my-api/Default/v1/books/GET/ApiPermission.testapigatewayrestapimyapi1AE401C4.GET..v1.books","attributes":{"aws:cdk:cloudformation:type":"AWS::Lambda::Permission","aws:cdk:cloudformation:props":{"action":"lambda:InvokeFunction","functionName":{"Fn::GetAtt":["MyHandler6B74D312","Arn"]},"principal":"apigateway.amazonaws.com","sourceArn":{"Fn::Join":["",["arn:",{"Ref":"AWS::Partition"},":execute-api:",{"Ref":"AWS::Region"},":",{"Ref":"AWS::AccountId"},":",{"Ref":"myapi4C7BF186"},"/",{"Ref":"myapiDeploymentStagebeta96434BEB"},"/GET/v1/books"]]}}},"constructInfo":{"fqn":"aws-cdk-lib.aws_lambda.CfnPermission","version":"0.0.0"}},"ApiPermission.Test.testapigatewayrestapimyapi1AE401C4.GET..v1.books":{"id":"ApiPermission.Test.testapigatewayrestapimyapi1AE401C4.GET..v1.books","path":"test-apigateway-restapi/my-api/Default/v1/books/GET/ApiPermission.Test.testapigatewayrestapimyapi1AE401C4.GET..v1.books","attributes":{"aws:cdk:cloudformation:type":"AWS::Lambda::Permission","aws:cdk:cloudformation:props":{"action":"lambda:InvokeFunction","functionName":{"Fn::GetAtt":["MyHandler6B74D312","Arn"]},"principal":"apigateway.amazonaws.com","sourceArn":{"Fn::Join":["",["arn:",{"Ref":"AWS::Partition"},":execute-api:",{"Ref":"AWS::Region"},":",{"Ref":"AWS::AccountId"},":",{"Ref":"myapi4C7BF186"},"/test-invoke-stage/GET/v1/books"]]}}},"constructInfo":{"fqn":"aws-cdk-lib.aws_lambda.CfnPermission","version":"0.0.0"}},"Resource":{"id":"Resource","path":"test-apigateway-restapi/my-api/Default/v1/books/GET/Resource","attributes":{"aws:cdk:cloudformation:type":"AWS::ApiGateway::Method","aws:cdk:cloudformation:props":{"authorizationType":"NONE","httpMethod":"GET","integration":{"type":"AWS_PROXY","uri":{"Fn::Join":["",["arn:",{"Ref":"AWS::Partition"},":apigateway:",{"Ref":"AWS::Region"},":lambda:path/2015-03-31/functions/",{"Fn::GetAtt":["MyHandler6B74D312","Arn"]},"/invocations"]]},"integrationHttpMethod":"POST"},"resourceId":{"Ref":"myapiv1books1D4BE6C1"},"restApiId":{"Ref":"myapi4C7BF186"}}},"constructInfo":{"fqn":"aws-cdk-lib.aws_apigateway.CfnMethod","version":"0.0.0"}}},"constructInfo":{"fqn":"aws-cdk-lib.aws_apigateway.Method","version":"0.0.0","metadata":[{"resource":"*","httpMethod":"*","integration":"*","options":"*"}]}},"POST":{"id":"POST","path":"test-apigateway-restapi/my-api/Default/v1/books/POST","children":{"ApiPermission.testapigatewayrestapimyapi1AE401C4.POST..v1.books":{"id":"ApiPermission.testapigatewayrestapimyapi1AE401C4.POST..v1.books","path":"test-apigateway-restapi/my-api/Default/v1/books/POST/ApiPermission.testapigatewayrestapimyapi1AE401C4.POST..v1.books","attributes":{"aws:cdk:cloudformation:type":"AWS::Lambda::Permission","aws:cdk:cloudformation:props":{"action":"lambda:InvokeFunction","functionName":{"Fn::GetAtt":["MyHandler6B74D312","Arn"]},"principal":"apigateway.amazonaws.com","sourceArn":{"Fn::Join":["",["arn:",{"Ref":"AWS::Partition"},":execute-api:",{"Ref":"AWS::Region"},":",{"Ref":"AWS::AccountId"},":",{"Ref":"myapi4C7BF186"},"/",{"Ref":"myapiDeploymentStagebeta96434BEB"},"/POST/v1/books"]]}}},"constructInfo":{"fqn":"aws-cdk-lib.aws_lambda.CfnPermission","version":"0.0.0"}},"ApiPermission.Test.testapigatewayrestapimyapi1AE401C4.POST..v1.books":{"id":"ApiPermission.Test.testapigatewayrestapimyapi1AE401C4.POST..v1.books","path":"test-apigateway-restapi/my-api/Default/v1/books/POST/ApiPermission.Test.testapigatewayrestapimyapi1AE401C4.POST..v1.books","attributes":{"aws:cdk:cloudformation:type":"AWS::Lambda::Permission","aws:cdk:cloudformation:props":{"action":"lambda:InvokeFunction","functionName":{"Fn::GetAtt":["MyHandler6B74D312","Arn"]},"principal":"apigateway.amazonaws.com","sourceArn":{"Fn::Join":["",["arn:",{"Ref":"AWS::Partition"},":execute-api:",{"Ref":"AWS::Region"},":",{"Ref":"AWS::AccountId"},":",{"Ref":"myapi4C7BF186"},"/test-invoke-stage/POST/v1/books"]]}}},"constructInfo":{"fqn":"aws-cdk-lib.aws_lambda.CfnPermission","version":"0.0.0"}},"Resource":{"id":"Resource","path":"test-apigateway-restapi/my-api/Default/v1/books/POST/Resource","attributes":{"aws:cdk:cloudformation:type":"AWS::ApiGateway::Method","aws:cdk:cloudformation:props":{"authorizationType":"NONE","httpMethod":"POST","integration":{"type":"AWS_PROXY","uri":{"Fn::Join":["",["arn:",{"Ref":"AWS::Partition"},":apigateway:",{"Ref":"AWS::Region"},":lambda:path/2015-03-31/functions/",{"Fn::GetAtt":["MyHandler6B74D312","Arn"]},"/invocations"]]},"integrationHttpMethod":"POST"},"resourceId":{"Ref":"myapiv1books1D4BE6C1"},"restApiId":{"Ref":"myapi4C7BF186"}}},"constructInfo":{"fqn":"aws-cdk-lib.aws_apigateway.CfnMethod","version":"0.0.0"}}},"constructInfo":{"fqn":"aws-cdk-lib.aws_apigateway.Method","version":"0.0.0","metadata":[{"resource":"*","httpMethod":"*","integration":"*","options":"*"}]}}},"constructInfo":{"fqn":"aws-cdk-lib.aws_apigateway.Resource","version":"0.0.0","metadata":[{"pathPart":"*"}]}}},"constructInfo":{"fqn":"aws-cdk-lib.aws_apigateway.Resource","version":"0.0.0","metadata":[{"pathPart":"*"}]}}},"constructInfo":{"fqn":"aws-cdk-lib.aws_apigateway.ResourceBase","version":"0.0.0","metadata":["*"]}},"ApiKey":{"id":"ApiKey","path":"test-apigateway-restapi/my-api/ApiKey","children":{"Resource":{"id":"Resource","path":"test-apigateway-restapi/my-api/ApiKey/Resource","attributes":{"aws:cdk:cloudformation:type":"AWS::ApiGateway::ApiKey","aws:cdk:cloudformation:props":{"enabled":true,"stageKeys":[{"restApiId":{"Ref":"myapi4C7BF186"},"stageName":{"Ref":"myapiDeploymentStagebeta96434BEB"}}]}},"constructInfo":{"fqn":"aws-cdk-lib.aws_apigateway.CfnApiKey","version":"0.0.0"}}},"constructInfo":{"fqn":"aws-cdk-lib.aws_apigateway.ApiKey","version":"0.0.0","metadata":[{"stages":["*"]}]}},"UsagePlan":{"id":"UsagePlan","path":"test-apigateway-restapi/my-api/UsagePlan","children":{"Resource":{"id":"Resource","path":"test-apigateway-restapi/my-api/UsagePlan/Resource","attributes":{"aws:cdk:cloudformation:type":"AWS::ApiGateway::UsagePlan","aws:cdk:cloudformation:props":{"apiStages":[{"apiId":{"Ref":"myapi4C7BF186"},"stage":{"Ref":"myapiDeploymentStagebeta96434BEB"},"throttle":{"/v1/toys/GET":{"burstLimit":2,"rateLimit":10}}}],"description":"Free tier monthly usage plan","quota":{"limit":10000,"period":"MONTH"},"throttle":{"rateLimit":5},"usagePlanName":"Basic"}},"constructInfo":{"fqn":"aws-cdk-lib.aws_apigateway.CfnUsagePlan","version":"0.0.0"}},"UsagePlanKeyResource:testapigatewayrestapimyapiApiKeyC43601CB":{"id":"UsagePlanKeyResource:testapigatewayrestapimyapiApiKeyC43601CB","path":"test-apigateway-restapi/my-api/UsagePlan/UsagePlanKeyResource:testapigatewayrestapimyapiApiKeyC43601CB","attributes":{"aws:cdk:cloudformation:type":"AWS::ApiGateway::UsagePlanKey","aws:cdk:cloudformation:props":{"keyId":{"Ref":"myapiApiKey43446CCF"},"keyType":"API_KEY","usagePlanId":{"Ref":"myapiUsagePlan56F9C4F2"}}},"constructInfo":{"fqn":"aws-cdk-lib.aws_apigateway.CfnUsagePlanKey","version":"0.0.0"}}},"constructInfo":{"fqn":"aws-cdk-lib.aws_apigateway.UsagePlan","version":"0.0.0","metadata":[{"name":"*","apiKey":"*","description":"*","throttle":{"rateLimit":"*"},"quota":{"limit":"*","period":"MONTH"}},{"addApiStage":[{"throttle":[{"method":"*","throttle":{"rateLimit":"*","burstLimit":"*"}}]}]}]}}},"constructInfo":{"fqn":"aws-cdk-lib.aws_apigateway.RestApi","version":"0.0.0","metadata":[{"retainDeployments":true,"cloudWatchRole":true,"minCompressionSize":"*","description":"*","deployOptions":{"cacheClusterEnabled":true,"stageName":"*","description":"*","loggingLevel":"INFO","dataTraceEnabled":true,"methodOptions":"*"}}]}},"MyHandler":{"id":"MyHandler","path":"test-apigateway-restapi/MyHandler","children":{"ServiceRole":{"id":"ServiceRole","path":"test-apigateway-restapi/MyHandler/ServiceRole","children":{"ImportServiceRole":{"id":"ImportServiceRole","path":"test-apigateway-restapi/MyHandler/ServiceRole/ImportServiceRole","constructInfo":{"fqn":"aws-cdk-lib.Resource","version":"0.0.0","metadata":["*"]}},"Resource":{"id":"Resource","path":"test-apigateway-restapi/MyHandler/ServiceRole/Resource","attributes":{"aws:cdk:cloudformation:type":"AWS::IAM::Role","aws:cdk:cloudformation:props":{"assumeRolePolicyDocument":{"Statement":[{"Action":"sts:AssumeRole","Effect":"Allow","Principal":{"Service":"lambda.amazonaws.com"}}],"Version":"2012-10-17"},"managedPolicyArns":[{"Fn::Join":["",["arn:",{"Ref":"AWS::Partition"},":iam::aws:policy/service-role/AWSLambdaBasicExecutionRole"]]}]}},"constructInfo":{"fqn":"aws-cdk-lib.aws_iam.CfnRole","version":"0.0.0"}}},"constructInfo":{"fqn":"aws-cdk-lib.aws_iam.Role","version":"0.0.0","metadata":[{"assumedBy":{"principalAccount":"*","assumeRoleAction":"*"},"managedPolicies":[{"managedPolicyArn":"*"}]}]}},"Resource":{"id":"Resource","path":"test-apigateway-restapi/MyHandler/Resource","attributes":{"aws:cdk:cloudformation:type":"AWS::Lambda::Function","aws:cdk:cloudformation:props":{"code":{"zipFile":"exports.handler = function handlerCode(event, _, callback) {\n return callback(undefined, {\n isBase64Encoded: false,\n statusCode: 200,\n headers: { 'content-type': 'application/json' },\n body: JSON.stringify(event),\n });\n }"},"handler":"index.handler","role":{"Fn::GetAtt":["MyHandlerServiceRoleFFA06653","Arn"]},"runtime":"nodejs18.x"}},"constructInfo":{"fqn":"aws-cdk-lib.aws_lambda.CfnFunction","version":"0.0.0"}}},"constructInfo":{"fqn":"aws-cdk-lib.aws_lambda.Function","version":"0.0.0","metadata":[{"runtime":"*","code":"*","handler":"*"}]}},"TestDeployment":{"id":"TestDeployment","path":"test-apigateway-restapi/TestDeployment","children":{"Resource":{"id":"Resource","path":"test-apigateway-restapi/TestDeployment/Resource","attributes":{"aws:cdk:cloudformation:type":"AWS::ApiGateway::Deployment","aws:cdk:cloudformation:props":{"restApiId":{"Ref":"myapi4C7BF186"}}},"constructInfo":{"fqn":"aws-cdk-lib.aws_apigateway.CfnDeployment","version":"0.0.0"}}},"constructInfo":{"fqn":"aws-cdk-lib.aws_apigateway.Deployment","version":"0.0.0","metadata":[{"api":"*","retainDeployments":false}]}},"TestStage":{"id":"TestStage","path":"test-apigateway-restapi/TestStage","children":{"Resource":{"id":"Resource","path":"test-apigateway-restapi/TestStage/Resource","attributes":{"aws:cdk:cloudformation:type":"AWS::ApiGateway::Stage","aws:cdk:cloudformation:props":{"deploymentId":{"Ref":"TestDeploymentD77B5686a15807100799563057d10920f3cb5b73"},"restApiId":{"Ref":"myapi4C7BF186"},"stageName":"prod"}},"constructInfo":{"fqn":"aws-cdk-lib.aws_apigateway.CfnStage","version":"0.0.0"}},"MyTestApiKey":{"id":"MyTestApiKey","path":"test-apigateway-restapi/TestStage/MyTestApiKey","children":{"Resource":{"id":"Resource","path":"test-apigateway-restapi/TestStage/MyTestApiKey/Resource","attributes":{"aws:cdk:cloudformation:type":"AWS::ApiGateway::ApiKey","aws:cdk:cloudformation:props":{"enabled":true,"stageKeys":[{"restApiId":{"Ref":"myapi4C7BF186"},"stageName":{"Ref":"TestStage3097EB68"}}]}},"constructInfo":{"fqn":"aws-cdk-lib.aws_apigateway.CfnApiKey","version":"0.0.0"}}},"constructInfo":{"fqn":"aws-cdk-lib.aws_apigateway.ApiKey","version":"0.0.0","metadata":[{"stages":["*"]}]}}},"constructInfo":{"fqn":"aws-cdk-lib.aws_apigateway.Stage","version":"0.0.0","metadata":[{"deployment":"*"}]}},"BootstrapVersion":{"id":"BootstrapVersion","path":"test-apigateway-restapi/BootstrapVersion","constructInfo":{"fqn":"aws-cdk-lib.CfnParameter","version":"0.0.0"}},"CheckBootstrapVersion":{"id":"CheckBootstrapVersion","path":"test-apigateway-restapi/CheckBootstrapVersion","constructInfo":{"fqn":"aws-cdk-lib.CfnRule","version":"0.0.0"}}},"constructInfo":{"fqn":"aws-cdk-lib.Stack","version":"0.0.0"}},"apigateway-restapi":{"id":"apigateway-restapi","path":"apigateway-restapi","children":{"DefaultTest":{"id":"DefaultTest","path":"apigateway-restapi/DefaultTest","children":{"Default":{"id":"Default","path":"apigateway-restapi/DefaultTest/Default","constructInfo":{"fqn":"constructs.Construct","version":"10.4.2"}},"DeployAssert":{"id":"DeployAssert","path":"apigateway-restapi/DefaultTest/DeployAssert","children":{"BootstrapVersion":{"id":"BootstrapVersion","path":"apigateway-restapi/DefaultTest/DeployAssert/BootstrapVersion","constructInfo":{"fqn":"aws-cdk-lib.CfnParameter","version":"0.0.0"}},"CheckBootstrapVersion":{"id":"CheckBootstrapVersion","path":"apigateway-restapi/DefaultTest/DeployAssert/CheckBootstrapVersion","constructInfo":{"fqn":"aws-cdk-lib.CfnRule","version":"0.0.0"}}},"constructInfo":{"fqn":"aws-cdk-lib.Stack","version":"0.0.0"}}},"constructInfo":{"fqn":"@aws-cdk/integ-tests-alpha.IntegTestCase","version":"0.0.0"}}},"constructInfo":{"fqn":"@aws-cdk/integ-tests-alpha.IntegTest","version":"0.0.0"}},"Tree":{"id":"Tree","path":"Tree","constructInfo":{"fqn":"constructs.Construct","version":"10.4.2"}}},"constructInfo":{"fqn":"aws-cdk-lib.App","version":"0.0.0"}}} \ No newline at end of file diff --git a/packages/@aws-cdk-testing/framework-integ/test/aws-apigateway/test/integ.restapi.ts b/packages/@aws-cdk-testing/framework-integ/test/aws-apigateway/test/integ.restapi.ts index c255f1c64d75a..889d78e147acf 100644 --- a/packages/@aws-cdk-testing/framework-integ/test/aws-apigateway/test/integ.restapi.ts +++ b/packages/@aws-cdk-testing/framework-integ/test/aws-apigateway/test/integ.restapi.ts @@ -26,6 +26,7 @@ class Test extends cdk.Stack { }, }, }, + mode: apigateway.RestApiMode.MERGE, }); const handler = new lambda.Function(this, 'MyHandler', { diff --git a/packages/aws-cdk-lib/aws-apigateway/lib/restapi.ts b/packages/aws-cdk-lib/aws-apigateway/lib/restapi.ts index 79577bc0db858..e1e3c828bc492 100644 --- a/packages/aws-cdk-lib/aws-apigateway/lib/restapi.ts +++ b/packages/aws-cdk-lib/aws-apigateway/lib/restapi.ts @@ -279,21 +279,21 @@ export interface RestApiProps extends RestApiBaseProps, ResourceOptions { /** * This property applies only when you use OpenAPI to define your REST API. * The Mode determines how API Gateway handles resource updates. - * + * * Valid values are `overwrite` or `merge`. - * + * * For `overwrite`, the new API definition replaces the existing one. * The existing API identifier remains unchanged. - * + * * For `merge`, the new API definition is merged with the existing API. - * + * * If you don't specify this property, a default value is chosen: * - For REST APIs created before March 29, 2021, the default is `overwrite` * - For REST APIs created after March 29, 2021, the new API definition takes precedence, but any container types such as endpoint configurations and binary media types are merged with the existing API. - * + * * Use the default mode to define top-level RestApi properties in addition to using OpenAPI. * Generally, it's preferred to use API Gateway's OpenAPI extensions to model these properties. - * + * * @default - `merge` for REST APIs created after March 29, 2021, otherwise `overwrite` */ readonly mode?: RestApiMode; @@ -1130,6 +1130,10 @@ function ignore(_x: any) { return; } +/** + * Specifies how API Gateway handles resource updates when importing an OpenAPI definition. + * This property applies only when you use OpenAPI to define your REST API. + */ export enum RestApiMode { /** * The new API definition replaces the existing one. From 7f0055ecfa5ad40535f6354d66cc269364c7c916 Mon Sep 17 00:00:00 2001 From: tttol Date: Fri, 18 Apr 2025 16:02:09 +0900 Subject: [PATCH 05/16] update README --- packages/aws-cdk-lib/aws-apigateway/README.md | 26 +++++++++++++++++++ 1 file changed, 26 insertions(+) diff --git a/packages/aws-cdk-lib/aws-apigateway/README.md b/packages/aws-cdk-lib/aws-apigateway/README.md index 76dc92b71aa8b..623d6761ef052 100644 --- a/packages/aws-cdk-lib/aws-apigateway/README.md +++ b/packages/aws-cdk-lib/aws-apigateway/README.md @@ -30,6 +30,10 @@ running on AWS Lambda, or any web application. - [Cognito User Pools authorizer](#cognito-user-pools-authorizer) - [Mutual TLS (mTLS)](#mutual-tls-mtls) - [Deployments](#deployments) + - [Deploying to an existing stage](#deploying-to-an-existing-stage) + - [Using RestApi](#using-restapi) + - [Using SpecRestApi](#using-specrestapi) + - [Controlled triggering of deployments](#controlled-triggering-of-deployments) - [Deep dive: Invalidation of deployments](#deep-dive-invalidation-of-deployments) - [Custom Domains](#custom-domains) - [Custom Domains with multi-level api mapping](#custom-domains-with-multi-level-api-mapping) @@ -66,6 +70,24 @@ book.addMethod('GET'); book.addMethod('DELETE'); ``` +When using OpenAPI to define your REST API, you can control how API Gateway handles resource updates using the `mode` property. Valid values are: + +* `overwrite` - The new API definition replaces the existing one. The existing API identifier remains unchanged. +* `merge` - The new API definition is merged with the existing API. + +If you don't specify this property, a default value is chosen: +* For REST APIs created before March 29, 2021, the default is `overwrite` +* For REST APIs created after March 29, 2021, the new API definition takes precedence, but any container types such as endpoint configurations and binary media types are merged with the existing API. + +Use the default mode to define top-level RestApi properties in addition to using OpenAPI. +Generally, it's preferred to use API Gateway's OpenAPI extensions to model these properties. + +```ts +const api = new apigateway.RestApi(this, 'books-api', { + mode: apigateway.RestApiMode.MERGE +}); +``` + To give an IAM User or Role permission to invoke a method, use `grantExecute`: ```ts @@ -1668,3 +1690,7 @@ Move to using `aws-apigatewayv2` to get the latest APIs and updates. ---- This module is part of the [AWS Cloud Development Kit](https://github.com/aws/aws-cdk) project. + +---- + +This module is part of the [AWS Cloud Development Kit](https://github.com/aws/aws-cdk) project. From 6998dbdc5f17021f2212a5aa124c18b7efefc3dd Mon Sep 17 00:00:00 2001 From: tttol Date: Mon, 21 Apr 2025 08:07:59 +0900 Subject: [PATCH 06/16] update codecov.yml --- .github/workflows/codecov.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/codecov.yml b/.github/workflows/codecov.yml index d629a7b014042..1297bb49a9198 100644 --- a/.github/workflows/codecov.yml +++ b/.github/workflows/codecov.yml @@ -18,7 +18,7 @@ jobs: runs-on: ubuntu-latest permissions: id-token: write - contents: read + contents: write pages: write steps: - name: Checkout From bdbf377c4782ae22624e4b634d3569c100811d7c Mon Sep 17 00:00:00 2001 From: tttol Date: Mon, 21 Apr 2025 08:24:14 +0900 Subject: [PATCH 07/16] Revert "update codecov.yml" This reverts commit 6998dbdc5f17021f2212a5aa124c18b7efefc3dd. --- .github/workflows/codecov.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/codecov.yml b/.github/workflows/codecov.yml index 1297bb49a9198..d629a7b014042 100644 --- a/.github/workflows/codecov.yml +++ b/.github/workflows/codecov.yml @@ -18,7 +18,7 @@ jobs: runs-on: ubuntu-latest permissions: id-token: write - contents: write + contents: read pages: write steps: - name: Checkout From f25fd802014111eb2703cd5a7df7f689268dbab9 Mon Sep 17 00:00:00 2001 From: tttol Date: Tue, 22 Apr 2025 06:24:19 +0900 Subject: [PATCH 08/16] fix for the pr comment --- ...efaultTestDeployAssert6A9696A7.assets.json | 3 +- .../test/integ.restapi.js.snapshot/cdk.out | 2 +- .../test/integ.restapi.js.snapshot/integ.json | 2 +- .../integ.restapi.js.snapshot/manifest.json | 395 +----- .../test-apigateway-restapi.assets.json | 7 +- .../test-apigateway-restapi.template.json | 9 +- .../test/integ.restapi.js.snapshot/tree.json | 1261 ++++++++++++++++- .../test/aws-apigateway/test/integ.restapi.ts | 1 - packages/aws-cdk-lib/aws-apigateway/README.md | 43 +- .../aws-cdk-lib/aws-apigateway/lib/restapi.ts | 79 +- .../aws-apigateway/test/restapi.test.ts | 58 +- 11 files changed, 1368 insertions(+), 492 deletions(-) diff --git a/packages/@aws-cdk-testing/framework-integ/test/aws-apigateway/test/integ.restapi.js.snapshot/apigatewayrestapiDefaultTestDeployAssert6A9696A7.assets.json b/packages/@aws-cdk-testing/framework-integ/test/aws-apigateway/test/integ.restapi.js.snapshot/apigatewayrestapiDefaultTestDeployAssert6A9696A7.assets.json index 4eb5cd5059897..773bb2a695143 100644 --- a/packages/@aws-cdk-testing/framework-integ/test/aws-apigateway/test/integ.restapi.js.snapshot/apigatewayrestapiDefaultTestDeployAssert6A9696A7.assets.json +++ b/packages/@aws-cdk-testing/framework-integ/test/aws-apigateway/test/integ.restapi.js.snapshot/apigatewayrestapiDefaultTestDeployAssert6A9696A7.assets.json @@ -1,8 +1,7 @@ { - "version": "41.0.0", + "version": "34.0.0", "files": { "21fbb51d7b23f6a6c262b46a9caee79d744a3ac019fd45422d988b96d44b2a22": { - "displayName": "apigatewayrestapiDefaultTestDeployAssert6A9696A7 Template", "source": { "path": "apigatewayrestapiDefaultTestDeployAssert6A9696A7.template.json", "packaging": "file" diff --git a/packages/@aws-cdk-testing/framework-integ/test/aws-apigateway/test/integ.restapi.js.snapshot/cdk.out b/packages/@aws-cdk-testing/framework-integ/test/aws-apigateway/test/integ.restapi.js.snapshot/cdk.out index 188478b55560e..2313ab5436501 100644 --- a/packages/@aws-cdk-testing/framework-integ/test/aws-apigateway/test/integ.restapi.js.snapshot/cdk.out +++ b/packages/@aws-cdk-testing/framework-integ/test/aws-apigateway/test/integ.restapi.js.snapshot/cdk.out @@ -1 +1 @@ -{"version":"41.0.0"} \ No newline at end of file +{"version":"34.0.0"} \ No newline at end of file diff --git a/packages/@aws-cdk-testing/framework-integ/test/aws-apigateway/test/integ.restapi.js.snapshot/integ.json b/packages/@aws-cdk-testing/framework-integ/test/aws-apigateway/test/integ.restapi.js.snapshot/integ.json index ecc5b356fe7c5..9a8797a143b55 100644 --- a/packages/@aws-cdk-testing/framework-integ/test/aws-apigateway/test/integ.restapi.js.snapshot/integ.json +++ b/packages/@aws-cdk-testing/framework-integ/test/aws-apigateway/test/integ.restapi.js.snapshot/integ.json @@ -1,5 +1,5 @@ { - "version": "41.0.0", + "version": "34.0.0", "testCases": { "apigateway-restapi/DefaultTest": { "stacks": [ diff --git a/packages/@aws-cdk-testing/framework-integ/test/aws-apigateway/test/integ.restapi.js.snapshot/manifest.json b/packages/@aws-cdk-testing/framework-integ/test/aws-apigateway/test/integ.restapi.js.snapshot/manifest.json index fdd58eb32bb12..8bf532b3ad1a7 100644 --- a/packages/@aws-cdk-testing/framework-integ/test/aws-apigateway/test/integ.restapi.js.snapshot/manifest.json +++ b/packages/@aws-cdk-testing/framework-integ/test/aws-apigateway/test/integ.restapi.js.snapshot/manifest.json @@ -1,5 +1,5 @@ { - "version": "42.0.0", + "version": "34.0.0", "artifacts": { "test-apigateway-restapi.assets": { "type": "cdk:asset-manifest", @@ -18,7 +18,7 @@ "validateOnSynth": false, "assumeRoleArn": "arn:${AWS::Partition}:iam::${AWS::AccountId}:role/cdk-hnb659fds-deploy-role-${AWS::AccountId}-${AWS::Region}", "cloudFormationExecutionRoleArn": "arn:${AWS::Partition}:iam::${AWS::AccountId}:role/cdk-hnb659fds-cfn-exec-role-${AWS::AccountId}-${AWS::Region}", - "stackTemplateAssetObjectUrl": "s3://cdk-hnb659fds-assets-${AWS::AccountId}-${AWS::Region}/ac325b57f8665b951b07b14609f1e04395e21874cd7c66b275943ab867d813f1.json", + "stackTemplateAssetObjectUrl": "s3://cdk-hnb659fds-assets-${AWS::AccountId}-${AWS::Region}/7730a7574bd54d8b8cc5ce3a8fc74a2b2cec7fa63897f605899d3a225bd67bda.json", "requiresBootstrapStackVersion": 6, "bootstrapStackVersionSsmParameter": "/cdk-bootstrap/hnb659fds/version", "additionalDependencies": [ @@ -34,61 +34,12 @@ "test-apigateway-restapi.assets" ], "metadata": { - "/test-apigateway-restapi/my-api": [ - { - "type": "aws:cdk:analytics:construct", - "data": { - "retainDeployments": true, - "cloudWatchRole": true, - "minCompressionSize": "*", - "description": "*", - "deployOptions": { - "cacheClusterEnabled": true, - "stageName": "*", - "description": "*", - "loggingLevel": "INFO", - "dataTraceEnabled": true, - "methodOptions": "*" - } - } - } - ], "/test-apigateway-restapi/my-api/Resource": [ { "type": "aws:cdk:logicalId", "data": "myapi4C7BF186" } ], - "/test-apigateway-restapi/my-api/CloudWatchRole": [ - { - "type": "aws:cdk:analytics:construct", - "data": { - "assumedBy": { - "principalAccount": "*", - "assumeRoleAction": "*" - }, - "managedPolicies": [ - { - "managedPolicyArn": "*" - } - ] - } - }, - { - "type": "aws:cdk:analytics:method", - "data": { - "applyRemovalPolicy": [ - "retain" - ] - } - } - ], - "/test-apigateway-restapi/my-api/CloudWatchRole/ImportCloudWatchRole": [ - { - "type": "aws:cdk:analytics:construct", - "data": "*" - } - ], "/test-apigateway-restapi/my-api/CloudWatchRole/Resource": [ { "type": "aws:cdk:logicalId", @@ -101,114 +52,10 @@ "data": "myapiAccountEC421A0A" } ], - "/test-apigateway-restapi/my-api/Deployment": [ - { - "type": "aws:cdk:analytics:construct", - "data": { - "description": "*", - "api": "*", - "retainDeployments": true - } - }, - { - "type": "aws:cdk:analytics:method", - "data": { - "addToLogicalId": [ - {} - ] - } - }, - { - "type": "aws:cdk:analytics:method", - "data": { - "addToLogicalId": [ - {} - ] - } - }, - { - "type": "aws:cdk:analytics:method", - "data": { - "addToLogicalId": [ - {} - ] - } - }, - { - "type": "aws:cdk:analytics:method", - "data": { - "addToLogicalId": [ - {} - ] - } - }, - { - "type": "aws:cdk:analytics:method", - "data": { - "addToLogicalId": [ - {} - ] - } - }, - { - "type": "aws:cdk:analytics:method", - "data": { - "addToLogicalId": [ - {} - ] - } - }, - { - "type": "aws:cdk:analytics:method", - "data": { - "addToLogicalId": [ - {} - ] - } - }, - { - "type": "aws:cdk:analytics:method", - "data": { - "addToLogicalId": [ - {} - ] - } - }, - { - "type": "aws:cdk:analytics:method", - "data": { - "addToLogicalId": [ - {} - ] - } - }, - { - "type": "aws:cdk:analytics:method", - "data": { - "addToLogicalId": [ - {} - ] - } - } - ], "/test-apigateway-restapi/my-api/Deployment/Resource": [ { "type": "aws:cdk:logicalId", - "data": "myapiDeployment92F2CB4938b9b1875924477d0c57bcd0fac1cbdf" - } - ], - "/test-apigateway-restapi/my-api/DeploymentStage.beta": [ - { - "type": "aws:cdk:analytics:construct", - "data": { - "deployment": "*", - "cacheClusterEnabled": true, - "stageName": "*", - "description": "*", - "loggingLevel": "INFO", - "dataTraceEnabled": true, - "methodOptions": "*" - } + "data": "myapiDeployment92F2CB49069d16df09c59427069eb74581a0403d" } ], "/test-apigateway-restapi/my-api/DeploymentStage.beta/Resource": [ @@ -223,55 +70,18 @@ "data": "myapiEndpoint3628AFE3" } ], - "/test-apigateway-restapi/my-api/Default": [ - { - "type": "aws:cdk:analytics:construct", - "data": "*" - } - ], - "/test-apigateway-restapi/my-api/Default/v1": [ - { - "type": "aws:cdk:analytics:construct", - "data": { - "parent": "*", - "pathPart": "*" - } - } - ], "/test-apigateway-restapi/my-api/Default/v1/Resource": [ { "type": "aws:cdk:logicalId", "data": "myapiv113487378" } ], - "/test-apigateway-restapi/my-api/Default/v1/toys": [ - { - "type": "aws:cdk:analytics:construct", - "data": { - "parent": "*", - "pathPart": "*" - } - } - ], "/test-apigateway-restapi/my-api/Default/v1/toys/Resource": [ { "type": "aws:cdk:logicalId", "data": "myapiv1toysA55FCBC4" } ], - "/test-apigateway-restapi/my-api/Default/v1/toys/GET": [ - { - "type": "aws:cdk:analytics:construct", - "data": { - "resource": "*", - "httpMethod": "*", - "integration": "*", - "options": { - "apiKeyRequired": true - } - } - } - ], "/test-apigateway-restapi/my-api/Default/v1/toys/GET/ApiPermission.testapigatewayrestapimyapi1AE401C4.GET..v1.toys": [ { "type": "aws:cdk:logicalId", @@ -290,98 +100,36 @@ "data": "myapiv1toysGET7348114D" } ], - "/test-apigateway-restapi/my-api/Default/v1/toys/POST": [ - { - "type": "aws:cdk:analytics:construct", - "data": { - "resource": "*", - "httpMethod": "*", - "integration": "*", - "options": "*" - } - } - ], "/test-apigateway-restapi/my-api/Default/v1/toys/POST/Resource": [ { "type": "aws:cdk:logicalId", "data": "myapiv1toysPOST55128058" } ], - "/test-apigateway-restapi/my-api/Default/v1/toys/PUT": [ - { - "type": "aws:cdk:analytics:construct", - "data": { - "resource": "*", - "httpMethod": "*", - "integration": "*", - "options": "*" - } - } - ], "/test-apigateway-restapi/my-api/Default/v1/toys/PUT/Resource": [ { "type": "aws:cdk:logicalId", "data": "myapiv1toysPUT59AFBBC2" } ], - "/test-apigateway-restapi/my-api/Default/v1/$appliances:all": [ - { - "type": "aws:cdk:analytics:construct", - "data": { - "parent": "*", - "pathPart": "*" - } - } - ], "/test-apigateway-restapi/my-api/Default/v1/$appliances:all/Resource": [ { "type": "aws:cdk:logicalId", "data": "myapiv1appliancesallD279897B" } ], - "/test-apigateway-restapi/my-api/Default/v1/$appliances:all/GET": [ - { - "type": "aws:cdk:analytics:construct", - "data": { - "resource": "*", - "httpMethod": "*", - "integration": "*", - "options": "*" - } - } - ], "/test-apigateway-restapi/my-api/Default/v1/$appliances:all/GET/Resource": [ { "type": "aws:cdk:logicalId", "data": "myapiv1appliancesallGETB8EB1B77" } ], - "/test-apigateway-restapi/my-api/Default/v1/books": [ - { - "type": "aws:cdk:analytics:construct", - "data": { - "parent": "*", - "pathPart": "*" - } - } - ], "/test-apigateway-restapi/my-api/Default/v1/books/Resource": [ { "type": "aws:cdk:logicalId", "data": "myapiv1books1D4BE6C1" } ], - "/test-apigateway-restapi/my-api/Default/v1/books/GET": [ - { - "type": "aws:cdk:analytics:construct", - "data": { - "resource": "*", - "httpMethod": "*", - "integration": "*", - "options": "*" - } - } - ], "/test-apigateway-restapi/my-api/Default/v1/books/GET/ApiPermission.testapigatewayrestapimyapi1AE401C4.GET..v1.books": [ { "type": "aws:cdk:logicalId", @@ -400,17 +148,6 @@ "data": "myapiv1booksGETC6B996D0" } ], - "/test-apigateway-restapi/my-api/Default/v1/books/POST": [ - { - "type": "aws:cdk:analytics:construct", - "data": { - "resource": "*", - "httpMethod": "*", - "integration": "*", - "options": "*" - } - } - ], "/test-apigateway-restapi/my-api/Default/v1/books/POST/ApiPermission.testapigatewayrestapimyapi1AE401C4.POST..v1.books": [ { "type": "aws:cdk:logicalId", @@ -429,57 +166,12 @@ "data": "myapiv1booksPOST53E2832E" } ], - "/test-apigateway-restapi/my-api/ApiKey": [ - { - "type": "aws:cdk:analytics:construct", - "data": { - "stages": [ - "*" - ] - } - } - ], "/test-apigateway-restapi/my-api/ApiKey/Resource": [ { "type": "aws:cdk:logicalId", "data": "myapiApiKey43446CCF" } ], - "/test-apigateway-restapi/my-api/UsagePlan": [ - { - "type": "aws:cdk:analytics:construct", - "data": { - "name": "*", - "apiKey": "*", - "description": "*", - "throttle": { - "rateLimit": "*" - }, - "quota": { - "limit": "*", - "period": "MONTH" - } - } - }, - { - "type": "aws:cdk:analytics:method", - "data": { - "addApiStage": [ - { - "throttle": [ - { - "method": "*", - "throttle": { - "rateLimit": "*", - "burstLimit": "*" - } - } - ] - } - ] - } - } - ], "/test-apigateway-restapi/my-api/UsagePlan/Resource": [ { "type": "aws:cdk:logicalId", @@ -492,38 +184,6 @@ "data": "myapiUsagePlanUsagePlanKeyResourcetestapigatewayrestapimyapiApiKeyC43601CB600D112D" } ], - "/test-apigateway-restapi/MyHandler": [ - { - "type": "aws:cdk:analytics:construct", - "data": { - "runtime": "*", - "code": "*", - "handler": "*" - } - } - ], - "/test-apigateway-restapi/MyHandler/ServiceRole": [ - { - "type": "aws:cdk:analytics:construct", - "data": { - "assumedBy": { - "principalAccount": "*", - "assumeRoleAction": "*" - }, - "managedPolicies": [ - { - "managedPolicyArn": "*" - } - ] - } - } - ], - "/test-apigateway-restapi/MyHandler/ServiceRole/ImportServiceRole": [ - { - "type": "aws:cdk:analytics:construct", - "data": "*" - } - ], "/test-apigateway-restapi/MyHandler/ServiceRole/Resource": [ { "type": "aws:cdk:logicalId", @@ -536,27 +196,10 @@ "data": "MyHandler6B74D312" } ], - "/test-apigateway-restapi/TestDeployment": [ - { - "type": "aws:cdk:analytics:construct", - "data": { - "api": "*", - "retainDeployments": false - } - } - ], "/test-apigateway-restapi/TestDeployment/Resource": [ { "type": "aws:cdk:logicalId", - "data": "TestDeploymentD77B5686a15807100799563057d10920f3cb5b73" - } - ], - "/test-apigateway-restapi/TestStage": [ - { - "type": "aws:cdk:analytics:construct", - "data": { - "deployment": "*" - } + "data": "TestDeploymentD77B56865531eba1e8fde4b8e6988d5af7b2efd6" } ], "/test-apigateway-restapi/TestStage/Resource": [ @@ -565,16 +208,6 @@ "data": "TestStage3097EB68" } ], - "/test-apigateway-restapi/TestStage/MyTestApiKey": [ - { - "type": "aws:cdk:analytics:construct", - "data": { - "stages": [ - "*" - ] - } - } - ], "/test-apigateway-restapi/TestStage/MyTestApiKey/Resource": [ { "type": "aws:cdk:logicalId", @@ -593,19 +226,28 @@ "data": "CheckBootstrapVersion" } ], - "myapiDeployment92F2CB49069d16df09c59427069eb74581a0403d": [ + "myapiDeployment92F2CB4993c0f175ba8d5964f5e1cc7bc64fe6e6": [ + { + "type": "aws:cdk:logicalId", + "data": "myapiDeployment92F2CB4993c0f175ba8d5964f5e1cc7bc64fe6e6", + "trace": [ + "!!DESTRUCTIVE_CHANGES: WILL_DESTROY" + ] + } + ], + "myapiv1appliancesallCF8C6A16": [ { "type": "aws:cdk:logicalId", - "data": "myapiDeployment92F2CB49069d16df09c59427069eb74581a0403d", + "data": "myapiv1appliancesallCF8C6A16", "trace": [ "!!DESTRUCTIVE_CHANGES: WILL_DESTROY" ] } ], - "TestDeploymentD77B56865531eba1e8fde4b8e6988d5af7b2efd6": [ + "myapiv1appliancesallGETC4DF552D": [ { "type": "aws:cdk:logicalId", - "data": "TestDeploymentD77B56865531eba1e8fde4b8e6988d5af7b2efd6", + "data": "myapiv1appliancesallGETC4DF552D", "trace": [ "!!DESTRUCTIVE_CHANGES: WILL_DESTROY" ] @@ -668,6 +310,5 @@ "file": "tree.json" } } - }, - "minimumCliVersion": "2.1006.0" + } } \ No newline at end of file diff --git a/packages/@aws-cdk-testing/framework-integ/test/aws-apigateway/test/integ.restapi.js.snapshot/test-apigateway-restapi.assets.json b/packages/@aws-cdk-testing/framework-integ/test/aws-apigateway/test/integ.restapi.js.snapshot/test-apigateway-restapi.assets.json index 4862695b82d20..3efe69ea00eec 100644 --- a/packages/@aws-cdk-testing/framework-integ/test/aws-apigateway/test/integ.restapi.js.snapshot/test-apigateway-restapi.assets.json +++ b/packages/@aws-cdk-testing/framework-integ/test/aws-apigateway/test/integ.restapi.js.snapshot/test-apigateway-restapi.assets.json @@ -1,8 +1,7 @@ { - "version": "41.0.0", + "version": "34.0.0", "files": { - "ac325b57f8665b951b07b14609f1e04395e21874cd7c66b275943ab867d813f1": { - "displayName": "test-apigateway-restapi Template", + "7730a7574bd54d8b8cc5ce3a8fc74a2b2cec7fa63897f605899d3a225bd67bda": { "source": { "path": "test-apigateway-restapi.template.json", "packaging": "file" @@ -10,7 +9,7 @@ "destinations": { "current_account-current_region": { "bucketName": "cdk-hnb659fds-assets-${AWS::AccountId}-${AWS::Region}", - "objectKey": "ac325b57f8665b951b07b14609f1e04395e21874cd7c66b275943ab867d813f1.json", + "objectKey": "7730a7574bd54d8b8cc5ce3a8fc74a2b2cec7fa63897f605899d3a225bd67bda.json", "assumeRoleArn": "arn:${AWS::Partition}:iam::${AWS::AccountId}:role/cdk-hnb659fds-file-publishing-role-${AWS::AccountId}-${AWS::Region}" } } diff --git a/packages/@aws-cdk-testing/framework-integ/test/aws-apigateway/test/integ.restapi.js.snapshot/test-apigateway-restapi.template.json b/packages/@aws-cdk-testing/framework-integ/test/aws-apigateway/test/integ.restapi.js.snapshot/test-apigateway-restapi.template.json index d1517b89d62a4..4da24fb620a2d 100644 --- a/packages/@aws-cdk-testing/framework-integ/test/aws-apigateway/test/integ.restapi.js.snapshot/test-apigateway-restapi.template.json +++ b/packages/@aws-cdk-testing/framework-integ/test/aws-apigateway/test/integ.restapi.js.snapshot/test-apigateway-restapi.template.json @@ -5,7 +5,6 @@ "Properties": { "Description": "api description", "MinimumCompressionSize": 1024, - "Mode": "merge", "Name": "my-api" } }, @@ -58,7 +57,7 @@ "UpdateReplacePolicy": "Retain", "DeletionPolicy": "Retain" }, - "myapiDeployment92F2CB4938b9b1875924477d0c57bcd0fac1cbdf": { + "myapiDeployment92F2CB49069d16df09c59427069eb74581a0403d": { "Type": "AWS::ApiGateway::Deployment", "Properties": { "Description": "beta stage", @@ -87,7 +86,7 @@ "CacheClusterEnabled": true, "CacheClusterSize": "0.5", "DeploymentId": { - "Ref": "myapiDeployment92F2CB4938b9b1875924477d0c57bcd0fac1cbdf" + "Ref": "myapiDeployment92F2CB49069d16df09c59427069eb74581a0403d" }, "Description": "beta stage", "MethodSettings": [ @@ -675,7 +674,7 @@ "MyHandlerServiceRoleFFA06653" ] }, - "TestDeploymentD77B5686a15807100799563057d10920f3cb5b73": { + "TestDeploymentD77B56865531eba1e8fde4b8e6988d5af7b2efd6": { "Type": "AWS::ApiGateway::Deployment", "Properties": { "RestApiId": { @@ -695,7 +694,7 @@ "Type": "AWS::ApiGateway::Stage", "Properties": { "DeploymentId": { - "Ref": "TestDeploymentD77B5686a15807100799563057d10920f3cb5b73" + "Ref": "TestDeploymentD77B56865531eba1e8fde4b8e6988d5af7b2efd6" }, "RestApiId": { "Ref": "myapi4C7BF186" diff --git a/packages/@aws-cdk-testing/framework-integ/test/aws-apigateway/test/integ.restapi.js.snapshot/tree.json b/packages/@aws-cdk-testing/framework-integ/test/aws-apigateway/test/integ.restapi.js.snapshot/tree.json index 1c6c64e1881a6..ff7900f722740 100644 --- a/packages/@aws-cdk-testing/framework-integ/test/aws-apigateway/test/integ.restapi.js.snapshot/tree.json +++ b/packages/@aws-cdk-testing/framework-integ/test/aws-apigateway/test/integ.restapi.js.snapshot/tree.json @@ -1 +1,1260 @@ -{"version":"tree-0.1","tree":{"id":"App","path":"","children":{"test-apigateway-restapi":{"id":"test-apigateway-restapi","path":"test-apigateway-restapi","children":{"my-api":{"id":"my-api","path":"test-apigateway-restapi/my-api","children":{"Resource":{"id":"Resource","path":"test-apigateway-restapi/my-api/Resource","attributes":{"aws:cdk:cloudformation:type":"AWS::ApiGateway::RestApi","aws:cdk:cloudformation:props":{"description":"api description","minimumCompressionSize":1024,"mode":"merge","name":"my-api"}},"constructInfo":{"fqn":"aws-cdk-lib.aws_apigateway.CfnRestApi","version":"0.0.0"}},"CloudWatchRole":{"id":"CloudWatchRole","path":"test-apigateway-restapi/my-api/CloudWatchRole","children":{"ImportCloudWatchRole":{"id":"ImportCloudWatchRole","path":"test-apigateway-restapi/my-api/CloudWatchRole/ImportCloudWatchRole","constructInfo":{"fqn":"aws-cdk-lib.Resource","version":"0.0.0","metadata":["*"]}},"Resource":{"id":"Resource","path":"test-apigateway-restapi/my-api/CloudWatchRole/Resource","attributes":{"aws:cdk:cloudformation:type":"AWS::IAM::Role","aws:cdk:cloudformation:props":{"assumeRolePolicyDocument":{"Statement":[{"Action":"sts:AssumeRole","Effect":"Allow","Principal":{"Service":"apigateway.amazonaws.com"}}],"Version":"2012-10-17"},"managedPolicyArns":[{"Fn::Join":["",["arn:",{"Ref":"AWS::Partition"},":iam::aws:policy/service-role/AmazonAPIGatewayPushToCloudWatchLogs"]]}]}},"constructInfo":{"fqn":"aws-cdk-lib.aws_iam.CfnRole","version":"0.0.0"}}},"constructInfo":{"fqn":"aws-cdk-lib.aws_iam.Role","version":"0.0.0","metadata":[{"assumedBy":{"principalAccount":"*","assumeRoleAction":"*"},"managedPolicies":[{"managedPolicyArn":"*"}]},{"applyRemovalPolicy":["retain"]}]}},"Account":{"id":"Account","path":"test-apigateway-restapi/my-api/Account","attributes":{"aws:cdk:cloudformation:type":"AWS::ApiGateway::Account","aws:cdk:cloudformation:props":{"cloudWatchRoleArn":{"Fn::GetAtt":["myapiCloudWatchRole095452E5","Arn"]}}},"constructInfo":{"fqn":"aws-cdk-lib.aws_apigateway.CfnAccount","version":"0.0.0"}},"Deployment":{"id":"Deployment","path":"test-apigateway-restapi/my-api/Deployment","children":{"Resource":{"id":"Resource","path":"test-apigateway-restapi/my-api/Deployment/Resource","attributes":{"aws:cdk:cloudformation:type":"AWS::ApiGateway::Deployment","aws:cdk:cloudformation:props":{"description":"beta stage","restApiId":{"Ref":"myapi4C7BF186"}}},"constructInfo":{"fqn":"aws-cdk-lib.aws_apigateway.CfnDeployment","version":"0.0.0"}}},"constructInfo":{"fqn":"aws-cdk-lib.aws_apigateway.Deployment","version":"0.0.0","metadata":[{"description":"*","api":"*","retainDeployments":true},{"addToLogicalId":[{}]},{"addToLogicalId":[{}]},{"addToLogicalId":[{}]},{"addToLogicalId":[{}]},{"addToLogicalId":[{}]},{"addToLogicalId":[{}]},{"addToLogicalId":[{}]},{"addToLogicalId":[{}]},{"addToLogicalId":[{}]},{"addToLogicalId":[{}]}]}},"DeploymentStage.beta":{"id":"DeploymentStage.beta","path":"test-apigateway-restapi/my-api/DeploymentStage.beta","children":{"Resource":{"id":"Resource","path":"test-apigateway-restapi/my-api/DeploymentStage.beta/Resource","attributes":{"aws:cdk:cloudformation:type":"AWS::ApiGateway::Stage","aws:cdk:cloudformation:props":{"cacheClusterEnabled":true,"cacheClusterSize":"0.5","deploymentId":{"Ref":"myapiDeployment92F2CB4938b9b1875924477d0c57bcd0fac1cbdf"},"description":"beta stage","methodSettings":[{"httpMethod":"*","resourcePath":"/*","dataTraceEnabled":true,"loggingLevel":"INFO"},{"httpMethod":"GET","resourcePath":"/~1api~1appliances","cachingEnabled":true,"dataTraceEnabled":false}],"restApiId":{"Ref":"myapi4C7BF186"},"stageName":"beta"}},"constructInfo":{"fqn":"aws-cdk-lib.aws_apigateway.CfnStage","version":"0.0.0"}}},"constructInfo":{"fqn":"aws-cdk-lib.aws_apigateway.Stage","version":"0.0.0","metadata":[{"deployment":"*","cacheClusterEnabled":true,"stageName":"*","description":"*","loggingLevel":"INFO","dataTraceEnabled":true,"methodOptions":"*"}]}},"Endpoint":{"id":"Endpoint","path":"test-apigateway-restapi/my-api/Endpoint","constructInfo":{"fqn":"aws-cdk-lib.CfnOutput","version":"0.0.0"}},"Default":{"id":"Default","path":"test-apigateway-restapi/my-api/Default","children":{"v1":{"id":"v1","path":"test-apigateway-restapi/my-api/Default/v1","children":{"Resource":{"id":"Resource","path":"test-apigateway-restapi/my-api/Default/v1/Resource","attributes":{"aws:cdk:cloudformation:type":"AWS::ApiGateway::Resource","aws:cdk:cloudformation:props":{"parentId":{"Fn::GetAtt":["myapi4C7BF186","RootResourceId"]},"pathPart":"v1","restApiId":{"Ref":"myapi4C7BF186"}}},"constructInfo":{"fqn":"aws-cdk-lib.aws_apigateway.CfnResource","version":"0.0.0"}},"toys":{"id":"toys","path":"test-apigateway-restapi/my-api/Default/v1/toys","children":{"Resource":{"id":"Resource","path":"test-apigateway-restapi/my-api/Default/v1/toys/Resource","attributes":{"aws:cdk:cloudformation:type":"AWS::ApiGateway::Resource","aws:cdk:cloudformation:props":{"parentId":{"Ref":"myapiv113487378"},"pathPart":"toys","restApiId":{"Ref":"myapi4C7BF186"}}},"constructInfo":{"fqn":"aws-cdk-lib.aws_apigateway.CfnResource","version":"0.0.0"}},"GET":{"id":"GET","path":"test-apigateway-restapi/my-api/Default/v1/toys/GET","children":{"ApiPermission.testapigatewayrestapimyapi1AE401C4.GET..v1.toys":{"id":"ApiPermission.testapigatewayrestapimyapi1AE401C4.GET..v1.toys","path":"test-apigateway-restapi/my-api/Default/v1/toys/GET/ApiPermission.testapigatewayrestapimyapi1AE401C4.GET..v1.toys","attributes":{"aws:cdk:cloudformation:type":"AWS::Lambda::Permission","aws:cdk:cloudformation:props":{"action":"lambda:InvokeFunction","functionName":{"Fn::GetAtt":["MyHandler6B74D312","Arn"]},"principal":"apigateway.amazonaws.com","sourceArn":{"Fn::Join":["",["arn:",{"Ref":"AWS::Partition"},":execute-api:",{"Ref":"AWS::Region"},":",{"Ref":"AWS::AccountId"},":",{"Ref":"myapi4C7BF186"},"/",{"Ref":"myapiDeploymentStagebeta96434BEB"},"/GET/v1/toys"]]}}},"constructInfo":{"fqn":"aws-cdk-lib.aws_lambda.CfnPermission","version":"0.0.0"}},"ApiPermission.Test.testapigatewayrestapimyapi1AE401C4.GET..v1.toys":{"id":"ApiPermission.Test.testapigatewayrestapimyapi1AE401C4.GET..v1.toys","path":"test-apigateway-restapi/my-api/Default/v1/toys/GET/ApiPermission.Test.testapigatewayrestapimyapi1AE401C4.GET..v1.toys","attributes":{"aws:cdk:cloudformation:type":"AWS::Lambda::Permission","aws:cdk:cloudformation:props":{"action":"lambda:InvokeFunction","functionName":{"Fn::GetAtt":["MyHandler6B74D312","Arn"]},"principal":"apigateway.amazonaws.com","sourceArn":{"Fn::Join":["",["arn:",{"Ref":"AWS::Partition"},":execute-api:",{"Ref":"AWS::Region"},":",{"Ref":"AWS::AccountId"},":",{"Ref":"myapi4C7BF186"},"/test-invoke-stage/GET/v1/toys"]]}}},"constructInfo":{"fqn":"aws-cdk-lib.aws_lambda.CfnPermission","version":"0.0.0"}},"Resource":{"id":"Resource","path":"test-apigateway-restapi/my-api/Default/v1/toys/GET/Resource","attributes":{"aws:cdk:cloudformation:type":"AWS::ApiGateway::Method","aws:cdk:cloudformation:props":{"apiKeyRequired":true,"authorizationType":"NONE","httpMethod":"GET","integration":{"type":"AWS_PROXY","uri":{"Fn::Join":["",["arn:",{"Ref":"AWS::Partition"},":apigateway:",{"Ref":"AWS::Region"},":lambda:path/2015-03-31/functions/",{"Fn::GetAtt":["MyHandler6B74D312","Arn"]},"/invocations"]]},"integrationHttpMethod":"POST"},"resourceId":{"Ref":"myapiv1toysA55FCBC4"},"restApiId":{"Ref":"myapi4C7BF186"}}},"constructInfo":{"fqn":"aws-cdk-lib.aws_apigateway.CfnMethod","version":"0.0.0"}}},"constructInfo":{"fqn":"aws-cdk-lib.aws_apigateway.Method","version":"0.0.0","metadata":[{"resource":"*","httpMethod":"*","integration":"*","options":{"apiKeyRequired":true}}]}},"POST":{"id":"POST","path":"test-apigateway-restapi/my-api/Default/v1/toys/POST","children":{"Resource":{"id":"Resource","path":"test-apigateway-restapi/my-api/Default/v1/toys/POST/Resource","attributes":{"aws:cdk:cloudformation:type":"AWS::ApiGateway::Method","aws:cdk:cloudformation:props":{"authorizationType":"NONE","httpMethod":"POST","integration":{"type":"MOCK"},"resourceId":{"Ref":"myapiv1toysA55FCBC4"},"restApiId":{"Ref":"myapi4C7BF186"}}},"constructInfo":{"fqn":"aws-cdk-lib.aws_apigateway.CfnMethod","version":"0.0.0"}}},"constructInfo":{"fqn":"aws-cdk-lib.aws_apigateway.Method","version":"0.0.0","metadata":[{"resource":"*","httpMethod":"*","integration":"*","options":"*"}]}},"PUT":{"id":"PUT","path":"test-apigateway-restapi/my-api/Default/v1/toys/PUT","children":{"Resource":{"id":"Resource","path":"test-apigateway-restapi/my-api/Default/v1/toys/PUT/Resource","attributes":{"aws:cdk:cloudformation:type":"AWS::ApiGateway::Method","aws:cdk:cloudformation:props":{"authorizationType":"NONE","httpMethod":"PUT","integration":{"type":"MOCK"},"resourceId":{"Ref":"myapiv1toysA55FCBC4"},"restApiId":{"Ref":"myapi4C7BF186"}}},"constructInfo":{"fqn":"aws-cdk-lib.aws_apigateway.CfnMethod","version":"0.0.0"}}},"constructInfo":{"fqn":"aws-cdk-lib.aws_apigateway.Method","version":"0.0.0","metadata":[{"resource":"*","httpMethod":"*","integration":"*","options":"*"}]}}},"constructInfo":{"fqn":"aws-cdk-lib.aws_apigateway.Resource","version":"0.0.0","metadata":[{"pathPart":"*"}]}},"$appliances:all":{"id":"$appliances:all","path":"test-apigateway-restapi/my-api/Default/v1/$appliances:all","children":{"Resource":{"id":"Resource","path":"test-apigateway-restapi/my-api/Default/v1/$appliances:all/Resource","attributes":{"aws:cdk:cloudformation:type":"AWS::ApiGateway::Resource","aws:cdk:cloudformation:props":{"parentId":{"Ref":"myapiv113487378"},"pathPart":"$appliances:all","restApiId":{"Ref":"myapi4C7BF186"}}},"constructInfo":{"fqn":"aws-cdk-lib.aws_apigateway.CfnResource","version":"0.0.0"}},"GET":{"id":"GET","path":"test-apigateway-restapi/my-api/Default/v1/$appliances:all/GET","children":{"Resource":{"id":"Resource","path":"test-apigateway-restapi/my-api/Default/v1/$appliances:all/GET/Resource","attributes":{"aws:cdk:cloudformation:type":"AWS::ApiGateway::Method","aws:cdk:cloudformation:props":{"authorizationType":"NONE","httpMethod":"GET","integration":{"type":"MOCK"},"resourceId":{"Ref":"myapiv1appliancesallD279897B"},"restApiId":{"Ref":"myapi4C7BF186"}}},"constructInfo":{"fqn":"aws-cdk-lib.aws_apigateway.CfnMethod","version":"0.0.0"}}},"constructInfo":{"fqn":"aws-cdk-lib.aws_apigateway.Method","version":"0.0.0","metadata":[{"resource":"*","httpMethod":"*","integration":"*","options":"*"}]}}},"constructInfo":{"fqn":"aws-cdk-lib.aws_apigateway.Resource","version":"0.0.0","metadata":[{"pathPart":"*"}]}},"books":{"id":"books","path":"test-apigateway-restapi/my-api/Default/v1/books","children":{"Resource":{"id":"Resource","path":"test-apigateway-restapi/my-api/Default/v1/books/Resource","attributes":{"aws:cdk:cloudformation:type":"AWS::ApiGateway::Resource","aws:cdk:cloudformation:props":{"parentId":{"Ref":"myapiv113487378"},"pathPart":"books","restApiId":{"Ref":"myapi4C7BF186"}}},"constructInfo":{"fqn":"aws-cdk-lib.aws_apigateway.CfnResource","version":"0.0.0"}},"GET":{"id":"GET","path":"test-apigateway-restapi/my-api/Default/v1/books/GET","children":{"ApiPermission.testapigatewayrestapimyapi1AE401C4.GET..v1.books":{"id":"ApiPermission.testapigatewayrestapimyapi1AE401C4.GET..v1.books","path":"test-apigateway-restapi/my-api/Default/v1/books/GET/ApiPermission.testapigatewayrestapimyapi1AE401C4.GET..v1.books","attributes":{"aws:cdk:cloudformation:type":"AWS::Lambda::Permission","aws:cdk:cloudformation:props":{"action":"lambda:InvokeFunction","functionName":{"Fn::GetAtt":["MyHandler6B74D312","Arn"]},"principal":"apigateway.amazonaws.com","sourceArn":{"Fn::Join":["",["arn:",{"Ref":"AWS::Partition"},":execute-api:",{"Ref":"AWS::Region"},":",{"Ref":"AWS::AccountId"},":",{"Ref":"myapi4C7BF186"},"/",{"Ref":"myapiDeploymentStagebeta96434BEB"},"/GET/v1/books"]]}}},"constructInfo":{"fqn":"aws-cdk-lib.aws_lambda.CfnPermission","version":"0.0.0"}},"ApiPermission.Test.testapigatewayrestapimyapi1AE401C4.GET..v1.books":{"id":"ApiPermission.Test.testapigatewayrestapimyapi1AE401C4.GET..v1.books","path":"test-apigateway-restapi/my-api/Default/v1/books/GET/ApiPermission.Test.testapigatewayrestapimyapi1AE401C4.GET..v1.books","attributes":{"aws:cdk:cloudformation:type":"AWS::Lambda::Permission","aws:cdk:cloudformation:props":{"action":"lambda:InvokeFunction","functionName":{"Fn::GetAtt":["MyHandler6B74D312","Arn"]},"principal":"apigateway.amazonaws.com","sourceArn":{"Fn::Join":["",["arn:",{"Ref":"AWS::Partition"},":execute-api:",{"Ref":"AWS::Region"},":",{"Ref":"AWS::AccountId"},":",{"Ref":"myapi4C7BF186"},"/test-invoke-stage/GET/v1/books"]]}}},"constructInfo":{"fqn":"aws-cdk-lib.aws_lambda.CfnPermission","version":"0.0.0"}},"Resource":{"id":"Resource","path":"test-apigateway-restapi/my-api/Default/v1/books/GET/Resource","attributes":{"aws:cdk:cloudformation:type":"AWS::ApiGateway::Method","aws:cdk:cloudformation:props":{"authorizationType":"NONE","httpMethod":"GET","integration":{"type":"AWS_PROXY","uri":{"Fn::Join":["",["arn:",{"Ref":"AWS::Partition"},":apigateway:",{"Ref":"AWS::Region"},":lambda:path/2015-03-31/functions/",{"Fn::GetAtt":["MyHandler6B74D312","Arn"]},"/invocations"]]},"integrationHttpMethod":"POST"},"resourceId":{"Ref":"myapiv1books1D4BE6C1"},"restApiId":{"Ref":"myapi4C7BF186"}}},"constructInfo":{"fqn":"aws-cdk-lib.aws_apigateway.CfnMethod","version":"0.0.0"}}},"constructInfo":{"fqn":"aws-cdk-lib.aws_apigateway.Method","version":"0.0.0","metadata":[{"resource":"*","httpMethod":"*","integration":"*","options":"*"}]}},"POST":{"id":"POST","path":"test-apigateway-restapi/my-api/Default/v1/books/POST","children":{"ApiPermission.testapigatewayrestapimyapi1AE401C4.POST..v1.books":{"id":"ApiPermission.testapigatewayrestapimyapi1AE401C4.POST..v1.books","path":"test-apigateway-restapi/my-api/Default/v1/books/POST/ApiPermission.testapigatewayrestapimyapi1AE401C4.POST..v1.books","attributes":{"aws:cdk:cloudformation:type":"AWS::Lambda::Permission","aws:cdk:cloudformation:props":{"action":"lambda:InvokeFunction","functionName":{"Fn::GetAtt":["MyHandler6B74D312","Arn"]},"principal":"apigateway.amazonaws.com","sourceArn":{"Fn::Join":["",["arn:",{"Ref":"AWS::Partition"},":execute-api:",{"Ref":"AWS::Region"},":",{"Ref":"AWS::AccountId"},":",{"Ref":"myapi4C7BF186"},"/",{"Ref":"myapiDeploymentStagebeta96434BEB"},"/POST/v1/books"]]}}},"constructInfo":{"fqn":"aws-cdk-lib.aws_lambda.CfnPermission","version":"0.0.0"}},"ApiPermission.Test.testapigatewayrestapimyapi1AE401C4.POST..v1.books":{"id":"ApiPermission.Test.testapigatewayrestapimyapi1AE401C4.POST..v1.books","path":"test-apigateway-restapi/my-api/Default/v1/books/POST/ApiPermission.Test.testapigatewayrestapimyapi1AE401C4.POST..v1.books","attributes":{"aws:cdk:cloudformation:type":"AWS::Lambda::Permission","aws:cdk:cloudformation:props":{"action":"lambda:InvokeFunction","functionName":{"Fn::GetAtt":["MyHandler6B74D312","Arn"]},"principal":"apigateway.amazonaws.com","sourceArn":{"Fn::Join":["",["arn:",{"Ref":"AWS::Partition"},":execute-api:",{"Ref":"AWS::Region"},":",{"Ref":"AWS::AccountId"},":",{"Ref":"myapi4C7BF186"},"/test-invoke-stage/POST/v1/books"]]}}},"constructInfo":{"fqn":"aws-cdk-lib.aws_lambda.CfnPermission","version":"0.0.0"}},"Resource":{"id":"Resource","path":"test-apigateway-restapi/my-api/Default/v1/books/POST/Resource","attributes":{"aws:cdk:cloudformation:type":"AWS::ApiGateway::Method","aws:cdk:cloudformation:props":{"authorizationType":"NONE","httpMethod":"POST","integration":{"type":"AWS_PROXY","uri":{"Fn::Join":["",["arn:",{"Ref":"AWS::Partition"},":apigateway:",{"Ref":"AWS::Region"},":lambda:path/2015-03-31/functions/",{"Fn::GetAtt":["MyHandler6B74D312","Arn"]},"/invocations"]]},"integrationHttpMethod":"POST"},"resourceId":{"Ref":"myapiv1books1D4BE6C1"},"restApiId":{"Ref":"myapi4C7BF186"}}},"constructInfo":{"fqn":"aws-cdk-lib.aws_apigateway.CfnMethod","version":"0.0.0"}}},"constructInfo":{"fqn":"aws-cdk-lib.aws_apigateway.Method","version":"0.0.0","metadata":[{"resource":"*","httpMethod":"*","integration":"*","options":"*"}]}}},"constructInfo":{"fqn":"aws-cdk-lib.aws_apigateway.Resource","version":"0.0.0","metadata":[{"pathPart":"*"}]}}},"constructInfo":{"fqn":"aws-cdk-lib.aws_apigateway.Resource","version":"0.0.0","metadata":[{"pathPart":"*"}]}}},"constructInfo":{"fqn":"aws-cdk-lib.aws_apigateway.ResourceBase","version":"0.0.0","metadata":["*"]}},"ApiKey":{"id":"ApiKey","path":"test-apigateway-restapi/my-api/ApiKey","children":{"Resource":{"id":"Resource","path":"test-apigateway-restapi/my-api/ApiKey/Resource","attributes":{"aws:cdk:cloudformation:type":"AWS::ApiGateway::ApiKey","aws:cdk:cloudformation:props":{"enabled":true,"stageKeys":[{"restApiId":{"Ref":"myapi4C7BF186"},"stageName":{"Ref":"myapiDeploymentStagebeta96434BEB"}}]}},"constructInfo":{"fqn":"aws-cdk-lib.aws_apigateway.CfnApiKey","version":"0.0.0"}}},"constructInfo":{"fqn":"aws-cdk-lib.aws_apigateway.ApiKey","version":"0.0.0","metadata":[{"stages":["*"]}]}},"UsagePlan":{"id":"UsagePlan","path":"test-apigateway-restapi/my-api/UsagePlan","children":{"Resource":{"id":"Resource","path":"test-apigateway-restapi/my-api/UsagePlan/Resource","attributes":{"aws:cdk:cloudformation:type":"AWS::ApiGateway::UsagePlan","aws:cdk:cloudformation:props":{"apiStages":[{"apiId":{"Ref":"myapi4C7BF186"},"stage":{"Ref":"myapiDeploymentStagebeta96434BEB"},"throttle":{"/v1/toys/GET":{"burstLimit":2,"rateLimit":10}}}],"description":"Free tier monthly usage plan","quota":{"limit":10000,"period":"MONTH"},"throttle":{"rateLimit":5},"usagePlanName":"Basic"}},"constructInfo":{"fqn":"aws-cdk-lib.aws_apigateway.CfnUsagePlan","version":"0.0.0"}},"UsagePlanKeyResource:testapigatewayrestapimyapiApiKeyC43601CB":{"id":"UsagePlanKeyResource:testapigatewayrestapimyapiApiKeyC43601CB","path":"test-apigateway-restapi/my-api/UsagePlan/UsagePlanKeyResource:testapigatewayrestapimyapiApiKeyC43601CB","attributes":{"aws:cdk:cloudformation:type":"AWS::ApiGateway::UsagePlanKey","aws:cdk:cloudformation:props":{"keyId":{"Ref":"myapiApiKey43446CCF"},"keyType":"API_KEY","usagePlanId":{"Ref":"myapiUsagePlan56F9C4F2"}}},"constructInfo":{"fqn":"aws-cdk-lib.aws_apigateway.CfnUsagePlanKey","version":"0.0.0"}}},"constructInfo":{"fqn":"aws-cdk-lib.aws_apigateway.UsagePlan","version":"0.0.0","metadata":[{"name":"*","apiKey":"*","description":"*","throttle":{"rateLimit":"*"},"quota":{"limit":"*","period":"MONTH"}},{"addApiStage":[{"throttle":[{"method":"*","throttle":{"rateLimit":"*","burstLimit":"*"}}]}]}]}}},"constructInfo":{"fqn":"aws-cdk-lib.aws_apigateway.RestApi","version":"0.0.0","metadata":[{"retainDeployments":true,"cloudWatchRole":true,"minCompressionSize":"*","description":"*","deployOptions":{"cacheClusterEnabled":true,"stageName":"*","description":"*","loggingLevel":"INFO","dataTraceEnabled":true,"methodOptions":"*"}}]}},"MyHandler":{"id":"MyHandler","path":"test-apigateway-restapi/MyHandler","children":{"ServiceRole":{"id":"ServiceRole","path":"test-apigateway-restapi/MyHandler/ServiceRole","children":{"ImportServiceRole":{"id":"ImportServiceRole","path":"test-apigateway-restapi/MyHandler/ServiceRole/ImportServiceRole","constructInfo":{"fqn":"aws-cdk-lib.Resource","version":"0.0.0","metadata":["*"]}},"Resource":{"id":"Resource","path":"test-apigateway-restapi/MyHandler/ServiceRole/Resource","attributes":{"aws:cdk:cloudformation:type":"AWS::IAM::Role","aws:cdk:cloudformation:props":{"assumeRolePolicyDocument":{"Statement":[{"Action":"sts:AssumeRole","Effect":"Allow","Principal":{"Service":"lambda.amazonaws.com"}}],"Version":"2012-10-17"},"managedPolicyArns":[{"Fn::Join":["",["arn:",{"Ref":"AWS::Partition"},":iam::aws:policy/service-role/AWSLambdaBasicExecutionRole"]]}]}},"constructInfo":{"fqn":"aws-cdk-lib.aws_iam.CfnRole","version":"0.0.0"}}},"constructInfo":{"fqn":"aws-cdk-lib.aws_iam.Role","version":"0.0.0","metadata":[{"assumedBy":{"principalAccount":"*","assumeRoleAction":"*"},"managedPolicies":[{"managedPolicyArn":"*"}]}]}},"Resource":{"id":"Resource","path":"test-apigateway-restapi/MyHandler/Resource","attributes":{"aws:cdk:cloudformation:type":"AWS::Lambda::Function","aws:cdk:cloudformation:props":{"code":{"zipFile":"exports.handler = function handlerCode(event, _, callback) {\n return callback(undefined, {\n isBase64Encoded: false,\n statusCode: 200,\n headers: { 'content-type': 'application/json' },\n body: JSON.stringify(event),\n });\n }"},"handler":"index.handler","role":{"Fn::GetAtt":["MyHandlerServiceRoleFFA06653","Arn"]},"runtime":"nodejs18.x"}},"constructInfo":{"fqn":"aws-cdk-lib.aws_lambda.CfnFunction","version":"0.0.0"}}},"constructInfo":{"fqn":"aws-cdk-lib.aws_lambda.Function","version":"0.0.0","metadata":[{"runtime":"*","code":"*","handler":"*"}]}},"TestDeployment":{"id":"TestDeployment","path":"test-apigateway-restapi/TestDeployment","children":{"Resource":{"id":"Resource","path":"test-apigateway-restapi/TestDeployment/Resource","attributes":{"aws:cdk:cloudformation:type":"AWS::ApiGateway::Deployment","aws:cdk:cloudformation:props":{"restApiId":{"Ref":"myapi4C7BF186"}}},"constructInfo":{"fqn":"aws-cdk-lib.aws_apigateway.CfnDeployment","version":"0.0.0"}}},"constructInfo":{"fqn":"aws-cdk-lib.aws_apigateway.Deployment","version":"0.0.0","metadata":[{"api":"*","retainDeployments":false}]}},"TestStage":{"id":"TestStage","path":"test-apigateway-restapi/TestStage","children":{"Resource":{"id":"Resource","path":"test-apigateway-restapi/TestStage/Resource","attributes":{"aws:cdk:cloudformation:type":"AWS::ApiGateway::Stage","aws:cdk:cloudformation:props":{"deploymentId":{"Ref":"TestDeploymentD77B5686a15807100799563057d10920f3cb5b73"},"restApiId":{"Ref":"myapi4C7BF186"},"stageName":"prod"}},"constructInfo":{"fqn":"aws-cdk-lib.aws_apigateway.CfnStage","version":"0.0.0"}},"MyTestApiKey":{"id":"MyTestApiKey","path":"test-apigateway-restapi/TestStage/MyTestApiKey","children":{"Resource":{"id":"Resource","path":"test-apigateway-restapi/TestStage/MyTestApiKey/Resource","attributes":{"aws:cdk:cloudformation:type":"AWS::ApiGateway::ApiKey","aws:cdk:cloudformation:props":{"enabled":true,"stageKeys":[{"restApiId":{"Ref":"myapi4C7BF186"},"stageName":{"Ref":"TestStage3097EB68"}}]}},"constructInfo":{"fqn":"aws-cdk-lib.aws_apigateway.CfnApiKey","version":"0.0.0"}}},"constructInfo":{"fqn":"aws-cdk-lib.aws_apigateway.ApiKey","version":"0.0.0","metadata":[{"stages":["*"]}]}}},"constructInfo":{"fqn":"aws-cdk-lib.aws_apigateway.Stage","version":"0.0.0","metadata":[{"deployment":"*"}]}},"BootstrapVersion":{"id":"BootstrapVersion","path":"test-apigateway-restapi/BootstrapVersion","constructInfo":{"fqn":"aws-cdk-lib.CfnParameter","version":"0.0.0"}},"CheckBootstrapVersion":{"id":"CheckBootstrapVersion","path":"test-apigateway-restapi/CheckBootstrapVersion","constructInfo":{"fqn":"aws-cdk-lib.CfnRule","version":"0.0.0"}}},"constructInfo":{"fqn":"aws-cdk-lib.Stack","version":"0.0.0"}},"apigateway-restapi":{"id":"apigateway-restapi","path":"apigateway-restapi","children":{"DefaultTest":{"id":"DefaultTest","path":"apigateway-restapi/DefaultTest","children":{"Default":{"id":"Default","path":"apigateway-restapi/DefaultTest/Default","constructInfo":{"fqn":"constructs.Construct","version":"10.4.2"}},"DeployAssert":{"id":"DeployAssert","path":"apigateway-restapi/DefaultTest/DeployAssert","children":{"BootstrapVersion":{"id":"BootstrapVersion","path":"apigateway-restapi/DefaultTest/DeployAssert/BootstrapVersion","constructInfo":{"fqn":"aws-cdk-lib.CfnParameter","version":"0.0.0"}},"CheckBootstrapVersion":{"id":"CheckBootstrapVersion","path":"apigateway-restapi/DefaultTest/DeployAssert/CheckBootstrapVersion","constructInfo":{"fqn":"aws-cdk-lib.CfnRule","version":"0.0.0"}}},"constructInfo":{"fqn":"aws-cdk-lib.Stack","version":"0.0.0"}}},"constructInfo":{"fqn":"@aws-cdk/integ-tests-alpha.IntegTestCase","version":"0.0.0"}}},"constructInfo":{"fqn":"@aws-cdk/integ-tests-alpha.IntegTest","version":"0.0.0"}},"Tree":{"id":"Tree","path":"Tree","constructInfo":{"fqn":"constructs.Construct","version":"10.4.2"}}},"constructInfo":{"fqn":"aws-cdk-lib.App","version":"0.0.0"}}} \ No newline at end of file +{ + "version": "tree-0.1", + "tree": { + "id": "App", + "path": "", + "children": { + "test-apigateway-restapi": { + "id": "test-apigateway-restapi", + "path": "test-apigateway-restapi", + "children": { + "my-api": { + "id": "my-api", + "path": "test-apigateway-restapi/my-api", + "children": { + "Resource": { + "id": "Resource", + "path": "test-apigateway-restapi/my-api/Resource", + "attributes": { + "aws:cdk:cloudformation:type": "AWS::ApiGateway::RestApi", + "aws:cdk:cloudformation:props": { + "description": "api description", + "minimumCompressionSize": 1024, + "name": "my-api" + } + }, + "constructInfo": { + "fqn": "aws-cdk-lib.aws_apigateway.CfnRestApi", + "version": "0.0.0" + } + }, + "CloudWatchRole": { + "id": "CloudWatchRole", + "path": "test-apigateway-restapi/my-api/CloudWatchRole", + "children": { + "ImportCloudWatchRole": { + "id": "ImportCloudWatchRole", + "path": "test-apigateway-restapi/my-api/CloudWatchRole/ImportCloudWatchRole", + "constructInfo": { + "fqn": "aws-cdk-lib.Resource", + "version": "0.0.0" + } + }, + "Resource": { + "id": "Resource", + "path": "test-apigateway-restapi/my-api/CloudWatchRole/Resource", + "attributes": { + "aws:cdk:cloudformation:type": "AWS::IAM::Role", + "aws:cdk:cloudformation:props": { + "assumeRolePolicyDocument": { + "Statement": [ + { + "Action": "sts:AssumeRole", + "Effect": "Allow", + "Principal": { + "Service": "apigateway.amazonaws.com" + } + } + ], + "Version": "2012-10-17" + }, + "managedPolicyArns": [ + { + "Fn::Join": [ + "", + [ + "arn:", + { + "Ref": "AWS::Partition" + }, + ":iam::aws:policy/service-role/AmazonAPIGatewayPushToCloudWatchLogs" + ] + ] + } + ] + } + }, + "constructInfo": { + "fqn": "aws-cdk-lib.aws_iam.CfnRole", + "version": "0.0.0" + } + } + }, + "constructInfo": { + "fqn": "aws-cdk-lib.aws_iam.Role", + "version": "0.0.0" + } + }, + "Account": { + "id": "Account", + "path": "test-apigateway-restapi/my-api/Account", + "attributes": { + "aws:cdk:cloudformation:type": "AWS::ApiGateway::Account", + "aws:cdk:cloudformation:props": { + "cloudWatchRoleArn": { + "Fn::GetAtt": [ + "myapiCloudWatchRole095452E5", + "Arn" + ] + } + } + }, + "constructInfo": { + "fqn": "aws-cdk-lib.aws_apigateway.CfnAccount", + "version": "0.0.0" + } + }, + "Deployment": { + "id": "Deployment", + "path": "test-apigateway-restapi/my-api/Deployment", + "children": { + "Resource": { + "id": "Resource", + "path": "test-apigateway-restapi/my-api/Deployment/Resource", + "attributes": { + "aws:cdk:cloudformation:type": "AWS::ApiGateway::Deployment", + "aws:cdk:cloudformation:props": { + "description": "beta stage", + "restApiId": { + "Ref": "myapi4C7BF186" + } + } + }, + "constructInfo": { + "fqn": "aws-cdk-lib.aws_apigateway.CfnDeployment", + "version": "0.0.0" + } + } + }, + "constructInfo": { + "fqn": "aws-cdk-lib.aws_apigateway.Deployment", + "version": "0.0.0" + } + }, + "DeploymentStage.beta": { + "id": "DeploymentStage.beta", + "path": "test-apigateway-restapi/my-api/DeploymentStage.beta", + "children": { + "Resource": { + "id": "Resource", + "path": "test-apigateway-restapi/my-api/DeploymentStage.beta/Resource", + "attributes": { + "aws:cdk:cloudformation:type": "AWS::ApiGateway::Stage", + "aws:cdk:cloudformation:props": { + "cacheClusterEnabled": true, + "cacheClusterSize": "0.5", + "deploymentId": { + "Ref": "myapiDeployment92F2CB49069d16df09c59427069eb74581a0403d" + }, + "description": "beta stage", + "methodSettings": [ + { + "httpMethod": "*", + "resourcePath": "/*", + "dataTraceEnabled": true, + "loggingLevel": "INFO" + }, + { + "httpMethod": "GET", + "resourcePath": "/~1api~1appliances", + "cachingEnabled": true, + "dataTraceEnabled": false + } + ], + "restApiId": { + "Ref": "myapi4C7BF186" + }, + "stageName": "beta" + } + }, + "constructInfo": { + "fqn": "aws-cdk-lib.aws_apigateway.CfnStage", + "version": "0.0.0" + } + } + }, + "constructInfo": { + "fqn": "aws-cdk-lib.aws_apigateway.Stage", + "version": "0.0.0" + } + }, + "Endpoint": { + "id": "Endpoint", + "path": "test-apigateway-restapi/my-api/Endpoint", + "constructInfo": { + "fqn": "aws-cdk-lib.CfnOutput", + "version": "0.0.0" + } + }, + "Default": { + "id": "Default", + "path": "test-apigateway-restapi/my-api/Default", + "children": { + "v1": { + "id": "v1", + "path": "test-apigateway-restapi/my-api/Default/v1", + "children": { + "Resource": { + "id": "Resource", + "path": "test-apigateway-restapi/my-api/Default/v1/Resource", + "attributes": { + "aws:cdk:cloudformation:type": "AWS::ApiGateway::Resource", + "aws:cdk:cloudformation:props": { + "parentId": { + "Fn::GetAtt": [ + "myapi4C7BF186", + "RootResourceId" + ] + }, + "pathPart": "v1", + "restApiId": { + "Ref": "myapi4C7BF186" + } + } + }, + "constructInfo": { + "fqn": "aws-cdk-lib.aws_apigateway.CfnResource", + "version": "0.0.0" + } + }, + "toys": { + "id": "toys", + "path": "test-apigateway-restapi/my-api/Default/v1/toys", + "children": { + "Resource": { + "id": "Resource", + "path": "test-apigateway-restapi/my-api/Default/v1/toys/Resource", + "attributes": { + "aws:cdk:cloudformation:type": "AWS::ApiGateway::Resource", + "aws:cdk:cloudformation:props": { + "parentId": { + "Ref": "myapiv113487378" + }, + "pathPart": "toys", + "restApiId": { + "Ref": "myapi4C7BF186" + } + } + }, + "constructInfo": { + "fqn": "aws-cdk-lib.aws_apigateway.CfnResource", + "version": "0.0.0" + } + }, + "GET": { + "id": "GET", + "path": "test-apigateway-restapi/my-api/Default/v1/toys/GET", + "children": { + "ApiPermission.testapigatewayrestapimyapi1AE401C4.GET..v1.toys": { + "id": "ApiPermission.testapigatewayrestapimyapi1AE401C4.GET..v1.toys", + "path": "test-apigateway-restapi/my-api/Default/v1/toys/GET/ApiPermission.testapigatewayrestapimyapi1AE401C4.GET..v1.toys", + "attributes": { + "aws:cdk:cloudformation:type": "AWS::Lambda::Permission", + "aws:cdk:cloudformation:props": { + "action": "lambda:InvokeFunction", + "functionName": { + "Fn::GetAtt": [ + "MyHandler6B74D312", + "Arn" + ] + }, + "principal": "apigateway.amazonaws.com", + "sourceArn": { + "Fn::Join": [ + "", + [ + "arn:", + { + "Ref": "AWS::Partition" + }, + ":execute-api:", + { + "Ref": "AWS::Region" + }, + ":", + { + "Ref": "AWS::AccountId" + }, + ":", + { + "Ref": "myapi4C7BF186" + }, + "/", + { + "Ref": "myapiDeploymentStagebeta96434BEB" + }, + "/GET/v1/toys" + ] + ] + } + } + }, + "constructInfo": { + "fqn": "aws-cdk-lib.aws_lambda.CfnPermission", + "version": "0.0.0" + } + }, + "ApiPermission.Test.testapigatewayrestapimyapi1AE401C4.GET..v1.toys": { + "id": "ApiPermission.Test.testapigatewayrestapimyapi1AE401C4.GET..v1.toys", + "path": "test-apigateway-restapi/my-api/Default/v1/toys/GET/ApiPermission.Test.testapigatewayrestapimyapi1AE401C4.GET..v1.toys", + "attributes": { + "aws:cdk:cloudformation:type": "AWS::Lambda::Permission", + "aws:cdk:cloudformation:props": { + "action": "lambda:InvokeFunction", + "functionName": { + "Fn::GetAtt": [ + "MyHandler6B74D312", + "Arn" + ] + }, + "principal": "apigateway.amazonaws.com", + "sourceArn": { + "Fn::Join": [ + "", + [ + "arn:", + { + "Ref": "AWS::Partition" + }, + ":execute-api:", + { + "Ref": "AWS::Region" + }, + ":", + { + "Ref": "AWS::AccountId" + }, + ":", + { + "Ref": "myapi4C7BF186" + }, + "/test-invoke-stage/GET/v1/toys" + ] + ] + } + } + }, + "constructInfo": { + "fqn": "aws-cdk-lib.aws_lambda.CfnPermission", + "version": "0.0.0" + } + }, + "Resource": { + "id": "Resource", + "path": "test-apigateway-restapi/my-api/Default/v1/toys/GET/Resource", + "attributes": { + "aws:cdk:cloudformation:type": "AWS::ApiGateway::Method", + "aws:cdk:cloudformation:props": { + "apiKeyRequired": true, + "authorizationType": "NONE", + "httpMethod": "GET", + "integration": { + "type": "AWS_PROXY", + "uri": { + "Fn::Join": [ + "", + [ + "arn:", + { + "Ref": "AWS::Partition" + }, + ":apigateway:", + { + "Ref": "AWS::Region" + }, + ":lambda:path/2015-03-31/functions/", + { + "Fn::GetAtt": [ + "MyHandler6B74D312", + "Arn" + ] + }, + "/invocations" + ] + ] + }, + "integrationHttpMethod": "POST" + }, + "resourceId": { + "Ref": "myapiv1toysA55FCBC4" + }, + "restApiId": { + "Ref": "myapi4C7BF186" + } + } + }, + "constructInfo": { + "fqn": "aws-cdk-lib.aws_apigateway.CfnMethod", + "version": "0.0.0" + } + } + }, + "constructInfo": { + "fqn": "aws-cdk-lib.aws_apigateway.Method", + "version": "0.0.0" + } + }, + "POST": { + "id": "POST", + "path": "test-apigateway-restapi/my-api/Default/v1/toys/POST", + "children": { + "Resource": { + "id": "Resource", + "path": "test-apigateway-restapi/my-api/Default/v1/toys/POST/Resource", + "attributes": { + "aws:cdk:cloudformation:type": "AWS::ApiGateway::Method", + "aws:cdk:cloudformation:props": { + "authorizationType": "NONE", + "httpMethod": "POST", + "integration": { + "type": "MOCK" + }, + "resourceId": { + "Ref": "myapiv1toysA55FCBC4" + }, + "restApiId": { + "Ref": "myapi4C7BF186" + } + } + }, + "constructInfo": { + "fqn": "aws-cdk-lib.aws_apigateway.CfnMethod", + "version": "0.0.0" + } + } + }, + "constructInfo": { + "fqn": "aws-cdk-lib.aws_apigateway.Method", + "version": "0.0.0" + } + }, + "PUT": { + "id": "PUT", + "path": "test-apigateway-restapi/my-api/Default/v1/toys/PUT", + "children": { + "Resource": { + "id": "Resource", + "path": "test-apigateway-restapi/my-api/Default/v1/toys/PUT/Resource", + "attributes": { + "aws:cdk:cloudformation:type": "AWS::ApiGateway::Method", + "aws:cdk:cloudformation:props": { + "authorizationType": "NONE", + "httpMethod": "PUT", + "integration": { + "type": "MOCK" + }, + "resourceId": { + "Ref": "myapiv1toysA55FCBC4" + }, + "restApiId": { + "Ref": "myapi4C7BF186" + } + } + }, + "constructInfo": { + "fqn": "aws-cdk-lib.aws_apigateway.CfnMethod", + "version": "0.0.0" + } + } + }, + "constructInfo": { + "fqn": "aws-cdk-lib.aws_apigateway.Method", + "version": "0.0.0" + } + } + }, + "constructInfo": { + "fqn": "aws-cdk-lib.aws_apigateway.Resource", + "version": "0.0.0" + } + }, + "$appliances:all": { + "id": "$appliances:all", + "path": "test-apigateway-restapi/my-api/Default/v1/$appliances:all", + "children": { + "Resource": { + "id": "Resource", + "path": "test-apigateway-restapi/my-api/Default/v1/$appliances:all/Resource", + "attributes": { + "aws:cdk:cloudformation:type": "AWS::ApiGateway::Resource", + "aws:cdk:cloudformation:props": { + "parentId": { + "Ref": "myapiv113487378" + }, + "pathPart": "$appliances:all", + "restApiId": { + "Ref": "myapi4C7BF186" + } + } + }, + "constructInfo": { + "fqn": "aws-cdk-lib.aws_apigateway.CfnResource", + "version": "0.0.0" + } + }, + "GET": { + "id": "GET", + "path": "test-apigateway-restapi/my-api/Default/v1/$appliances:all/GET", + "children": { + "Resource": { + "id": "Resource", + "path": "test-apigateway-restapi/my-api/Default/v1/$appliances:all/GET/Resource", + "attributes": { + "aws:cdk:cloudformation:type": "AWS::ApiGateway::Method", + "aws:cdk:cloudformation:props": { + "authorizationType": "NONE", + "httpMethod": "GET", + "integration": { + "type": "MOCK" + }, + "resourceId": { + "Ref": "myapiv1appliancesallD279897B" + }, + "restApiId": { + "Ref": "myapi4C7BF186" + } + } + }, + "constructInfo": { + "fqn": "aws-cdk-lib.aws_apigateway.CfnMethod", + "version": "0.0.0" + } + } + }, + "constructInfo": { + "fqn": "aws-cdk-lib.aws_apigateway.Method", + "version": "0.0.0" + } + } + }, + "constructInfo": { + "fqn": "aws-cdk-lib.aws_apigateway.Resource", + "version": "0.0.0" + } + }, + "books": { + "id": "books", + "path": "test-apigateway-restapi/my-api/Default/v1/books", + "children": { + "Resource": { + "id": "Resource", + "path": "test-apigateway-restapi/my-api/Default/v1/books/Resource", + "attributes": { + "aws:cdk:cloudformation:type": "AWS::ApiGateway::Resource", + "aws:cdk:cloudformation:props": { + "parentId": { + "Ref": "myapiv113487378" + }, + "pathPart": "books", + "restApiId": { + "Ref": "myapi4C7BF186" + } + } + }, + "constructInfo": { + "fqn": "aws-cdk-lib.aws_apigateway.CfnResource", + "version": "0.0.0" + } + }, + "GET": { + "id": "GET", + "path": "test-apigateway-restapi/my-api/Default/v1/books/GET", + "children": { + "ApiPermission.testapigatewayrestapimyapi1AE401C4.GET..v1.books": { + "id": "ApiPermission.testapigatewayrestapimyapi1AE401C4.GET..v1.books", + "path": "test-apigateway-restapi/my-api/Default/v1/books/GET/ApiPermission.testapigatewayrestapimyapi1AE401C4.GET..v1.books", + "attributes": { + "aws:cdk:cloudformation:type": "AWS::Lambda::Permission", + "aws:cdk:cloudformation:props": { + "action": "lambda:InvokeFunction", + "functionName": { + "Fn::GetAtt": [ + "MyHandler6B74D312", + "Arn" + ] + }, + "principal": "apigateway.amazonaws.com", + "sourceArn": { + "Fn::Join": [ + "", + [ + "arn:", + { + "Ref": "AWS::Partition" + }, + ":execute-api:", + { + "Ref": "AWS::Region" + }, + ":", + { + "Ref": "AWS::AccountId" + }, + ":", + { + "Ref": "myapi4C7BF186" + }, + "/", + { + "Ref": "myapiDeploymentStagebeta96434BEB" + }, + "/GET/v1/books" + ] + ] + } + } + }, + "constructInfo": { + "fqn": "aws-cdk-lib.aws_lambda.CfnPermission", + "version": "0.0.0" + } + }, + "ApiPermission.Test.testapigatewayrestapimyapi1AE401C4.GET..v1.books": { + "id": "ApiPermission.Test.testapigatewayrestapimyapi1AE401C4.GET..v1.books", + "path": "test-apigateway-restapi/my-api/Default/v1/books/GET/ApiPermission.Test.testapigatewayrestapimyapi1AE401C4.GET..v1.books", + "attributes": { + "aws:cdk:cloudformation:type": "AWS::Lambda::Permission", + "aws:cdk:cloudformation:props": { + "action": "lambda:InvokeFunction", + "functionName": { + "Fn::GetAtt": [ + "MyHandler6B74D312", + "Arn" + ] + }, + "principal": "apigateway.amazonaws.com", + "sourceArn": { + "Fn::Join": [ + "", + [ + "arn:", + { + "Ref": "AWS::Partition" + }, + ":execute-api:", + { + "Ref": "AWS::Region" + }, + ":", + { + "Ref": "AWS::AccountId" + }, + ":", + { + "Ref": "myapi4C7BF186" + }, + "/test-invoke-stage/GET/v1/books" + ] + ] + } + } + }, + "constructInfo": { + "fqn": "aws-cdk-lib.aws_lambda.CfnPermission", + "version": "0.0.0" + } + }, + "Resource": { + "id": "Resource", + "path": "test-apigateway-restapi/my-api/Default/v1/books/GET/Resource", + "attributes": { + "aws:cdk:cloudformation:type": "AWS::ApiGateway::Method", + "aws:cdk:cloudformation:props": { + "authorizationType": "NONE", + "httpMethod": "GET", + "integration": { + "type": "AWS_PROXY", + "uri": { + "Fn::Join": [ + "", + [ + "arn:", + { + "Ref": "AWS::Partition" + }, + ":apigateway:", + { + "Ref": "AWS::Region" + }, + ":lambda:path/2015-03-31/functions/", + { + "Fn::GetAtt": [ + "MyHandler6B74D312", + "Arn" + ] + }, + "/invocations" + ] + ] + }, + "integrationHttpMethod": "POST" + }, + "resourceId": { + "Ref": "myapiv1books1D4BE6C1" + }, + "restApiId": { + "Ref": "myapi4C7BF186" + } + } + }, + "constructInfo": { + "fqn": "aws-cdk-lib.aws_apigateway.CfnMethod", + "version": "0.0.0" + } + } + }, + "constructInfo": { + "fqn": "aws-cdk-lib.aws_apigateway.Method", + "version": "0.0.0" + } + }, + "POST": { + "id": "POST", + "path": "test-apigateway-restapi/my-api/Default/v1/books/POST", + "children": { + "ApiPermission.testapigatewayrestapimyapi1AE401C4.POST..v1.books": { + "id": "ApiPermission.testapigatewayrestapimyapi1AE401C4.POST..v1.books", + "path": "test-apigateway-restapi/my-api/Default/v1/books/POST/ApiPermission.testapigatewayrestapimyapi1AE401C4.POST..v1.books", + "attributes": { + "aws:cdk:cloudformation:type": "AWS::Lambda::Permission", + "aws:cdk:cloudformation:props": { + "action": "lambda:InvokeFunction", + "functionName": { + "Fn::GetAtt": [ + "MyHandler6B74D312", + "Arn" + ] + }, + "principal": "apigateway.amazonaws.com", + "sourceArn": { + "Fn::Join": [ + "", + [ + "arn:", + { + "Ref": "AWS::Partition" + }, + ":execute-api:", + { + "Ref": "AWS::Region" + }, + ":", + { + "Ref": "AWS::AccountId" + }, + ":", + { + "Ref": "myapi4C7BF186" + }, + "/", + { + "Ref": "myapiDeploymentStagebeta96434BEB" + }, + "/POST/v1/books" + ] + ] + } + } + }, + "constructInfo": { + "fqn": "aws-cdk-lib.aws_lambda.CfnPermission", + "version": "0.0.0" + } + }, + "ApiPermission.Test.testapigatewayrestapimyapi1AE401C4.POST..v1.books": { + "id": "ApiPermission.Test.testapigatewayrestapimyapi1AE401C4.POST..v1.books", + "path": "test-apigateway-restapi/my-api/Default/v1/books/POST/ApiPermission.Test.testapigatewayrestapimyapi1AE401C4.POST..v1.books", + "attributes": { + "aws:cdk:cloudformation:type": "AWS::Lambda::Permission", + "aws:cdk:cloudformation:props": { + "action": "lambda:InvokeFunction", + "functionName": { + "Fn::GetAtt": [ + "MyHandler6B74D312", + "Arn" + ] + }, + "principal": "apigateway.amazonaws.com", + "sourceArn": { + "Fn::Join": [ + "", + [ + "arn:", + { + "Ref": "AWS::Partition" + }, + ":execute-api:", + { + "Ref": "AWS::Region" + }, + ":", + { + "Ref": "AWS::AccountId" + }, + ":", + { + "Ref": "myapi4C7BF186" + }, + "/test-invoke-stage/POST/v1/books" + ] + ] + } + } + }, + "constructInfo": { + "fqn": "aws-cdk-lib.aws_lambda.CfnPermission", + "version": "0.0.0" + } + }, + "Resource": { + "id": "Resource", + "path": "test-apigateway-restapi/my-api/Default/v1/books/POST/Resource", + "attributes": { + "aws:cdk:cloudformation:type": "AWS::ApiGateway::Method", + "aws:cdk:cloudformation:props": { + "authorizationType": "NONE", + "httpMethod": "POST", + "integration": { + "type": "AWS_PROXY", + "uri": { + "Fn::Join": [ + "", + [ + "arn:", + { + "Ref": "AWS::Partition" + }, + ":apigateway:", + { + "Ref": "AWS::Region" + }, + ":lambda:path/2015-03-31/functions/", + { + "Fn::GetAtt": [ + "MyHandler6B74D312", + "Arn" + ] + }, + "/invocations" + ] + ] + }, + "integrationHttpMethod": "POST" + }, + "resourceId": { + "Ref": "myapiv1books1D4BE6C1" + }, + "restApiId": { + "Ref": "myapi4C7BF186" + } + } + }, + "constructInfo": { + "fqn": "aws-cdk-lib.aws_apigateway.CfnMethod", + "version": "0.0.0" + } + } + }, + "constructInfo": { + "fqn": "aws-cdk-lib.aws_apigateway.Method", + "version": "0.0.0" + } + } + }, + "constructInfo": { + "fqn": "aws-cdk-lib.aws_apigateway.Resource", + "version": "0.0.0" + } + } + }, + "constructInfo": { + "fqn": "aws-cdk-lib.aws_apigateway.Resource", + "version": "0.0.0" + } + } + }, + "constructInfo": { + "fqn": "aws-cdk-lib.aws_apigateway.ResourceBase", + "version": "0.0.0" + } + }, + "ApiKey": { + "id": "ApiKey", + "path": "test-apigateway-restapi/my-api/ApiKey", + "children": { + "Resource": { + "id": "Resource", + "path": "test-apigateway-restapi/my-api/ApiKey/Resource", + "attributes": { + "aws:cdk:cloudformation:type": "AWS::ApiGateway::ApiKey", + "aws:cdk:cloudformation:props": { + "enabled": true, + "stageKeys": [ + { + "restApiId": { + "Ref": "myapi4C7BF186" + }, + "stageName": { + "Ref": "myapiDeploymentStagebeta96434BEB" + } + } + ] + } + }, + "constructInfo": { + "fqn": "aws-cdk-lib.aws_apigateway.CfnApiKey", + "version": "0.0.0" + } + } + }, + "constructInfo": { + "fqn": "aws-cdk-lib.aws_apigateway.ApiKey", + "version": "0.0.0" + } + }, + "UsagePlan": { + "id": "UsagePlan", + "path": "test-apigateway-restapi/my-api/UsagePlan", + "children": { + "Resource": { + "id": "Resource", + "path": "test-apigateway-restapi/my-api/UsagePlan/Resource", + "attributes": { + "aws:cdk:cloudformation:type": "AWS::ApiGateway::UsagePlan", + "aws:cdk:cloudformation:props": { + "apiStages": [ + { + "apiId": { + "Ref": "myapi4C7BF186" + }, + "stage": { + "Ref": "myapiDeploymentStagebeta96434BEB" + }, + "throttle": { + "/v1/toys/GET": { + "burstLimit": 2, + "rateLimit": 10 + } + } + } + ], + "description": "Free tier monthly usage plan", + "quota": { + "limit": 10000, + "period": "MONTH" + }, + "throttle": { + "rateLimit": 5 + }, + "usagePlanName": "Basic" + } + }, + "constructInfo": { + "fqn": "aws-cdk-lib.aws_apigateway.CfnUsagePlan", + "version": "0.0.0" + } + }, + "UsagePlanKeyResource:testapigatewayrestapimyapiApiKeyC43601CB": { + "id": "UsagePlanKeyResource:testapigatewayrestapimyapiApiKeyC43601CB", + "path": "test-apigateway-restapi/my-api/UsagePlan/UsagePlanKeyResource:testapigatewayrestapimyapiApiKeyC43601CB", + "attributes": { + "aws:cdk:cloudformation:type": "AWS::ApiGateway::UsagePlanKey", + "aws:cdk:cloudformation:props": { + "keyId": { + "Ref": "myapiApiKey43446CCF" + }, + "keyType": "API_KEY", + "usagePlanId": { + "Ref": "myapiUsagePlan56F9C4F2" + } + } + }, + "constructInfo": { + "fqn": "aws-cdk-lib.aws_apigateway.CfnUsagePlanKey", + "version": "0.0.0" + } + } + }, + "constructInfo": { + "fqn": "aws-cdk-lib.aws_apigateway.UsagePlan", + "version": "0.0.0" + } + } + }, + "constructInfo": { + "fqn": "aws-cdk-lib.aws_apigateway.RestApi", + "version": "0.0.0" + } + }, + "MyHandler": { + "id": "MyHandler", + "path": "test-apigateway-restapi/MyHandler", + "children": { + "ServiceRole": { + "id": "ServiceRole", + "path": "test-apigateway-restapi/MyHandler/ServiceRole", + "children": { + "ImportServiceRole": { + "id": "ImportServiceRole", + "path": "test-apigateway-restapi/MyHandler/ServiceRole/ImportServiceRole", + "constructInfo": { + "fqn": "aws-cdk-lib.Resource", + "version": "0.0.0" + } + }, + "Resource": { + "id": "Resource", + "path": "test-apigateway-restapi/MyHandler/ServiceRole/Resource", + "attributes": { + "aws:cdk:cloudformation:type": "AWS::IAM::Role", + "aws:cdk:cloudformation:props": { + "assumeRolePolicyDocument": { + "Statement": [ + { + "Action": "sts:AssumeRole", + "Effect": "Allow", + "Principal": { + "Service": "lambda.amazonaws.com" + } + } + ], + "Version": "2012-10-17" + }, + "managedPolicyArns": [ + { + "Fn::Join": [ + "", + [ + "arn:", + { + "Ref": "AWS::Partition" + }, + ":iam::aws:policy/service-role/AWSLambdaBasicExecutionRole" + ] + ] + } + ] + } + }, + "constructInfo": { + "fqn": "aws-cdk-lib.aws_iam.CfnRole", + "version": "0.0.0" + } + } + }, + "constructInfo": { + "fqn": "aws-cdk-lib.aws_iam.Role", + "version": "0.0.0" + } + }, + "Resource": { + "id": "Resource", + "path": "test-apigateway-restapi/MyHandler/Resource", + "attributes": { + "aws:cdk:cloudformation:type": "AWS::Lambda::Function", + "aws:cdk:cloudformation:props": { + "code": { + "zipFile": "exports.handler = function handlerCode(event, _, callback) {\n return callback(undefined, {\n isBase64Encoded: false,\n statusCode: 200,\n headers: { 'content-type': 'application/json' },\n body: JSON.stringify(event),\n });\n }" + }, + "handler": "index.handler", + "role": { + "Fn::GetAtt": [ + "MyHandlerServiceRoleFFA06653", + "Arn" + ] + }, + "runtime": "nodejs18.x" + } + }, + "constructInfo": { + "fqn": "aws-cdk-lib.aws_lambda.CfnFunction", + "version": "0.0.0" + } + } + }, + "constructInfo": { + "fqn": "aws-cdk-lib.aws_lambda.Function", + "version": "0.0.0" + } + }, + "TestDeployment": { + "id": "TestDeployment", + "path": "test-apigateway-restapi/TestDeployment", + "children": { + "Resource": { + "id": "Resource", + "path": "test-apigateway-restapi/TestDeployment/Resource", + "attributes": { + "aws:cdk:cloudformation:type": "AWS::ApiGateway::Deployment", + "aws:cdk:cloudformation:props": { + "restApiId": { + "Ref": "myapi4C7BF186" + } + } + }, + "constructInfo": { + "fqn": "aws-cdk-lib.aws_apigateway.CfnDeployment", + "version": "0.0.0" + } + } + }, + "constructInfo": { + "fqn": "aws-cdk-lib.aws_apigateway.Deployment", + "version": "0.0.0" + } + }, + "TestStage": { + "id": "TestStage", + "path": "test-apigateway-restapi/TestStage", + "children": { + "Resource": { + "id": "Resource", + "path": "test-apigateway-restapi/TestStage/Resource", + "attributes": { + "aws:cdk:cloudformation:type": "AWS::ApiGateway::Stage", + "aws:cdk:cloudformation:props": { + "deploymentId": { + "Ref": "TestDeploymentD77B56865531eba1e8fde4b8e6988d5af7b2efd6" + }, + "restApiId": { + "Ref": "myapi4C7BF186" + }, + "stageName": "prod" + } + }, + "constructInfo": { + "fqn": "aws-cdk-lib.aws_apigateway.CfnStage", + "version": "0.0.0" + } + }, + "MyTestApiKey": { + "id": "MyTestApiKey", + "path": "test-apigateway-restapi/TestStage/MyTestApiKey", + "children": { + "Resource": { + "id": "Resource", + "path": "test-apigateway-restapi/TestStage/MyTestApiKey/Resource", + "attributes": { + "aws:cdk:cloudformation:type": "AWS::ApiGateway::ApiKey", + "aws:cdk:cloudformation:props": { + "enabled": true, + "stageKeys": [ + { + "restApiId": { + "Ref": "myapi4C7BF186" + }, + "stageName": { + "Ref": "TestStage3097EB68" + } + } + ] + } + }, + "constructInfo": { + "fqn": "aws-cdk-lib.aws_apigateway.CfnApiKey", + "version": "0.0.0" + } + } + }, + "constructInfo": { + "fqn": "aws-cdk-lib.aws_apigateway.ApiKey", + "version": "0.0.0" + } + } + }, + "constructInfo": { + "fqn": "aws-cdk-lib.aws_apigateway.Stage", + "version": "0.0.0" + } + }, + "BootstrapVersion": { + "id": "BootstrapVersion", + "path": "test-apigateway-restapi/BootstrapVersion", + "constructInfo": { + "fqn": "aws-cdk-lib.CfnParameter", + "version": "0.0.0" + } + }, + "CheckBootstrapVersion": { + "id": "CheckBootstrapVersion", + "path": "test-apigateway-restapi/CheckBootstrapVersion", + "constructInfo": { + "fqn": "aws-cdk-lib.CfnRule", + "version": "0.0.0" + } + } + }, + "constructInfo": { + "fqn": "aws-cdk-lib.Stack", + "version": "0.0.0" + } + }, + "apigateway-restapi": { + "id": "apigateway-restapi", + "path": "apigateway-restapi", + "children": { + "DefaultTest": { + "id": "DefaultTest", + "path": "apigateway-restapi/DefaultTest", + "children": { + "Default": { + "id": "Default", + "path": "apigateway-restapi/DefaultTest/Default", + "constructInfo": { + "fqn": "constructs.Construct", + "version": "10.2.70" + } + }, + "DeployAssert": { + "id": "DeployAssert", + "path": "apigateway-restapi/DefaultTest/DeployAssert", + "children": { + "BootstrapVersion": { + "id": "BootstrapVersion", + "path": "apigateway-restapi/DefaultTest/DeployAssert/BootstrapVersion", + "constructInfo": { + "fqn": "aws-cdk-lib.CfnParameter", + "version": "0.0.0" + } + }, + "CheckBootstrapVersion": { + "id": "CheckBootstrapVersion", + "path": "apigateway-restapi/DefaultTest/DeployAssert/CheckBootstrapVersion", + "constructInfo": { + "fqn": "aws-cdk-lib.CfnRule", + "version": "0.0.0" + } + } + }, + "constructInfo": { + "fqn": "aws-cdk-lib.Stack", + "version": "0.0.0" + } + } + }, + "constructInfo": { + "fqn": "@aws-cdk/integ-tests-alpha.IntegTestCase", + "version": "0.0.0" + } + } + }, + "constructInfo": { + "fqn": "@aws-cdk/integ-tests-alpha.IntegTest", + "version": "0.0.0" + } + }, + "Tree": { + "id": "Tree", + "path": "Tree", + "constructInfo": { + "fqn": "constructs.Construct", + "version": "10.2.70" + } + } + }, + "constructInfo": { + "fqn": "aws-cdk-lib.App", + "version": "0.0.0" + } + } +} \ No newline at end of file diff --git a/packages/@aws-cdk-testing/framework-integ/test/aws-apigateway/test/integ.restapi.ts b/packages/@aws-cdk-testing/framework-integ/test/aws-apigateway/test/integ.restapi.ts index 889d78e147acf..c255f1c64d75a 100644 --- a/packages/@aws-cdk-testing/framework-integ/test/aws-apigateway/test/integ.restapi.ts +++ b/packages/@aws-cdk-testing/framework-integ/test/aws-apigateway/test/integ.restapi.ts @@ -26,7 +26,6 @@ class Test extends cdk.Stack { }, }, }, - mode: apigateway.RestApiMode.MERGE, }); const handler = new lambda.Function(this, 'MyHandler', { diff --git a/packages/aws-cdk-lib/aws-apigateway/README.md b/packages/aws-cdk-lib/aws-apigateway/README.md index 623d6761ef052..7b309c47af5d8 100644 --- a/packages/aws-cdk-lib/aws-apigateway/README.md +++ b/packages/aws-cdk-lib/aws-apigateway/README.md @@ -70,24 +70,6 @@ book.addMethod('GET'); book.addMethod('DELETE'); ``` -When using OpenAPI to define your REST API, you can control how API Gateway handles resource updates using the `mode` property. Valid values are: - -* `overwrite` - The new API definition replaces the existing one. The existing API identifier remains unchanged. -* `merge` - The new API definition is merged with the existing API. - -If you don't specify this property, a default value is chosen: -* For REST APIs created before March 29, 2021, the default is `overwrite` -* For REST APIs created after March 29, 2021, the new API definition takes precedence, but any container types such as endpoint configurations and binary media types are merged with the existing API. - -Use the default mode to define top-level RestApi properties in addition to using OpenAPI. -Generally, it's preferred to use API Gateway's OpenAPI extensions to model these properties. - -```ts -const api = new apigateway.RestApi(this, 'books-api', { - mode: apigateway.RestApiMode.MERGE -}); -``` - To give an IAM User or Role permission to invoke a method, use `grantExecute`: ```ts @@ -1622,6 +1604,25 @@ booksResource.addMethod('GET', integration); It is possible to use the `addResource()` API to define additional API Gateway Resources. +You can control how API Gateway handles resource updates using the `mode` property. Valid values are: + +* `overwrite` - The new API definition replaces the existing one. The existing API identifier remains unchanged. +* `merge` - The new API definition is merged with the existing API. + +If you don't specify this property, a default value is chosen: +* For REST APIs created before March 29, 2021, the default is `overwrite` +* For REST APIs created after March 29, 2021, the new API definition takes precedence, but any container types such as endpoint configurations and binary media types are merged with the existing API. + +Use the default mode to define top-level RestApi properties in addition to using OpenAPI. +Generally, it's preferred to use API Gateway's OpenAPI extensions to model these properties. + +```ts +const api = new apigateway.SpecRestApi(this, 'books-api', { + apiDefinition: apigateway.ApiDefinition.fromAsset('path-to-file.json'), + mode: apigateway.RestApiMode.MERGE +}); +``` + **Note:** Deployment will fail if a Resource of the same name is already defined in the Open API specification. **Note:** Any default properties configured, such as `defaultIntegration`, `defaultMethodOptions`, etc. will only be @@ -1689,8 +1690,4 @@ Move to using `aws-apigatewayv2` to get the latest APIs and updates. ---- -This module is part of the [AWS Cloud Development Kit](https://github.com/aws/aws-cdk) project. - ----- - -This module is part of the [AWS Cloud Development Kit](https://github.com/aws/aws-cdk) project. +This module is part of the [AWS Cloud Development Kit](https://github.com/aws/aws-cdk) project. \ No newline at end of file diff --git a/packages/aws-cdk-lib/aws-apigateway/lib/restapi.ts b/packages/aws-cdk-lib/aws-apigateway/lib/restapi.ts index e1e3c828bc492..1078862742827 100644 --- a/packages/aws-cdk-lib/aws-apigateway/lib/restapi.ts +++ b/packages/aws-cdk-lib/aws-apigateway/lib/restapi.ts @@ -226,7 +226,7 @@ export interface RestApiOptions extends RestApiBaseProps, ResourceOptions { /** * Props to create a new instance of RestApi */ -export interface RestApiProps extends RestApiBaseProps, ResourceOptions { +export interface RestApiProps extends RestApiOptions { /** * The list of binary media mime-types that are supported by the RestApi @@ -276,27 +276,6 @@ export interface RestApiProps extends RestApiBaseProps, ResourceOptions { */ readonly apiKeySourceType?: ApiKeySourceType; - /** - * This property applies only when you use OpenAPI to define your REST API. - * The Mode determines how API Gateway handles resource updates. - * - * Valid values are `overwrite` or `merge`. - * - * For `overwrite`, the new API definition replaces the existing one. - * The existing API identifier remains unchanged. - * - * For `merge`, the new API definition is merged with the existing API. - * - * If you don't specify this property, a default value is chosen: - * - For REST APIs created before March 29, 2021, the default is `overwrite` - * - For REST APIs created after March 29, 2021, the new API definition takes precedence, but any container types such as endpoint configurations and binary media types are merged with the existing API. - * - * Use the default mode to define top-level RestApi properties in addition to using OpenAPI. - * Generally, it's preferred to use API Gateway's OpenAPI extensions to model these properties. - * - * @default - `merge` for REST APIs created after March 29, 2021, otherwise `overwrite` - */ - readonly mode?: RestApiMode; } /** @@ -320,6 +299,28 @@ export interface SpecRestApiProps extends RestApiBaseProps { * @default - Compression is disabled. */ readonly minCompressionSize?: Size; + + /** + * This property applies only when you use OpenAPI to define your REST API. + * The Mode determines how API Gateway handles resource updates. + * + * Valid values are `overwrite` or `merge`. + * + * For `overwrite`, the new API definition replaces the existing one. + * The existing API identifier remains unchanged. + * + * For `merge`, the new API definition is merged with the existing API. + * + * If you don't specify this property, a default value is chosen: + * - For REST APIs created before March 29, 2021, the default is `overwrite` + * - For REST APIs created after March 29, 2021, the new API definition takes precedence, but any container types such as endpoint configurations and binary media types are merged with the existing API. + * + * Use the default mode to define top-level RestApi properties in addition to using OpenAPI. + * Generally, it's preferred to use API Gateway's OpenAPI extensions to model these properties. + * + * @default - `merge` for REST APIs created after March 29, 2021, otherwise `overwrite` + */ + readonly mode?: RestApiMode; } /** @@ -776,6 +777,7 @@ export class SpecRestApi extends RestApiBase { endpointConfiguration: this._configureEndpoints(props), parameters: props.parameters, disableExecuteApiEndpoint: props.disableExecuteApiEndpoint, + mode: props.mode, }); props.apiDefinition.bindAfterCreate(this, this); @@ -928,7 +930,6 @@ export class RestApi extends RestApiBase { cloneFrom: props.cloneFrom?.restApiId, parameters: props.parameters, disableExecuteApiEndpoint: props.disableExecuteApiEndpoint, - mode: props.mode, }); this.node.defaultChild = resource; this.restApiId = resource.ref; @@ -1081,6 +1082,22 @@ export enum EndpointType { PRIVATE = 'PRIVATE', } +/** + * Specifies how API Gateway handles resource updates when importing an OpenAPI definition. + * This property applies only when you use OpenAPI to define your REST API. + */ +export enum RestApiMode { + /** + * The new API definition replaces the existing one. + */ + OVERWRITE = 'overwrite', + + /** + * The new API definition is merged with the existing API. + */ + MERGE = 'merge', +} + class RootResource extends ResourceBase { public readonly parentResource?: IResource; public readonly api: RestApiBase; @@ -1129,19 +1146,3 @@ class RootResource extends ResourceBase { function ignore(_x: any) { return; } - -/** - * Specifies how API Gateway handles resource updates when importing an OpenAPI definition. - * This property applies only when you use OpenAPI to define your REST API. - */ -export enum RestApiMode { - /** - * The new API definition replaces the existing one. - */ - OVERWRITE = 'overwrite', - - /** - * The new API definition is merged with the existing API. - */ - MERGE = 'merge', -} diff --git a/packages/aws-cdk-lib/aws-apigateway/test/restapi.test.ts b/packages/aws-cdk-lib/aws-apigateway/test/restapi.test.ts index cfb1eca01eca5..920ef42a5a39b 100644 --- a/packages/aws-cdk-lib/aws-apigateway/test/restapi.test.ts +++ b/packages/aws-cdk-lib/aws-apigateway/test/restapi.test.ts @@ -916,44 +916,6 @@ describe('restapi', () => { }).toThrow(/'cloudWatchRole' must be enabled for 'cloudWatchRoleRemovalPolicy' to be applied./); }); - test('mode property is set correctly', () => { - // WHEN - const apiWithOverwrite = new apigw.RestApi(stack, 'api-overwrite', { - mode: apigw.RestApiMode.OVERWRITE, - }); - apiWithOverwrite.root.addMethod('GET'); - - const apiWithMerge = new apigw.RestApi(stack, 'api-merge', { - mode: apigw.RestApiMode.MERGE, - }); - apiWithMerge.root.addMethod('GET'); - - // THEN - Template.fromStack(stack).hasResourceProperties('AWS::ApiGateway::RestApi', { - Name: 'api-overwrite', - Mode: 'overwrite', - }); - - Template.fromStack(stack).hasResourceProperties('AWS::ApiGateway::RestApi', { - Name: 'api-merge', - Mode: 'merge', - }); - }); - - test('mode property is optional', () => { - // WHEN - const api = new apigw.RestApi(stack, 'api'); - api.root.addMethod('GET'); - - // THEN - Template.fromStack(stack).hasResourceProperties('AWS::ApiGateway::RestApi', { - Name: 'api', - }); - // Mode should not be present in the template when not specified - Template.fromStack(stack).hasResourceProperties('AWS::ApiGateway::RestApi', { - Mode: Match.absent(), - }); - }); }); describe('Import', () => { @@ -1455,6 +1417,26 @@ describe('SpecRestApi', () => { }); }); + test.each([ + [apigw.RestApiMode.OVERWRITE, 'overwrite'], + [apigw.RestApiMode.MERGE, 'merge'], + [undefined, Match.absent()], + ])('mode property is set (%s)', (mode, expectedMode) => { + // WHEN + const api = new apigw.SpecRestApi(stack, 'api', { + apiDefinition: apigw.ApiDefinition.fromInline({ foo: 'bar' }), + mode, + }); + + api.root.addMethod('GET'); + + // THEN + Template.fromStack(stack).hasResourceProperties('AWS::ApiGateway::RestApi', { + Name: 'api', + Mode: expectedMode ?? Match.absent(), + }); + }); + describe('addToResourcePolicy', () => { test('add a statement to the resource policy for RestApi', () => { // GIVEN From e7c9b0e872ea85650cd5054514507402edb3f571 Mon Sep 17 00:00:00 2001 From: tttol Date: Tue, 22 Apr 2025 06:33:55 +0900 Subject: [PATCH 09/16] update integ.spec-restapi.ts --- ...efaultTestDeployAssertD16AA485.assets.json | 3 +- .../integ.spec-restapi.js.snapshot/cdk.out | 2 +- .../integ.spec-restapi.js.snapshot/integ.json | 2 +- .../manifest.json | 361 ++++- .../test-apigateway-spec-restapi.assets.json | 8 +- ...test-apigateway-spec-restapi.template.json | 5 +- .../integ.spec-restapi.js.snapshot/tree.json | 1203 +---------------- .../aws-apigateway/test/integ.spec-restapi.ts | 1 + 8 files changed, 371 insertions(+), 1214 deletions(-) diff --git a/packages/@aws-cdk-testing/framework-integ/test/aws-apigateway/test/integ.spec-restapi.js.snapshot/apigatewayspecrestapiDefaultTestDeployAssertD16AA485.assets.json b/packages/@aws-cdk-testing/framework-integ/test/aws-apigateway/test/integ.spec-restapi.js.snapshot/apigatewayspecrestapiDefaultTestDeployAssertD16AA485.assets.json index 27f5ec03972de..99ebf07f4a89f 100644 --- a/packages/@aws-cdk-testing/framework-integ/test/aws-apigateway/test/integ.spec-restapi.js.snapshot/apigatewayspecrestapiDefaultTestDeployAssertD16AA485.assets.json +++ b/packages/@aws-cdk-testing/framework-integ/test/aws-apigateway/test/integ.spec-restapi.js.snapshot/apigatewayspecrestapiDefaultTestDeployAssertD16AA485.assets.json @@ -1,7 +1,8 @@ { - "version": "34.0.0", + "version": "41.0.0", "files": { "21fbb51d7b23f6a6c262b46a9caee79d744a3ac019fd45422d988b96d44b2a22": { + "displayName": "apigatewayspecrestapiDefaultTestDeployAssertD16AA485 Template", "source": { "path": "apigatewayspecrestapiDefaultTestDeployAssertD16AA485.template.json", "packaging": "file" diff --git a/packages/@aws-cdk-testing/framework-integ/test/aws-apigateway/test/integ.spec-restapi.js.snapshot/cdk.out b/packages/@aws-cdk-testing/framework-integ/test/aws-apigateway/test/integ.spec-restapi.js.snapshot/cdk.out index 2313ab5436501..188478b55560e 100644 --- a/packages/@aws-cdk-testing/framework-integ/test/aws-apigateway/test/integ.spec-restapi.js.snapshot/cdk.out +++ b/packages/@aws-cdk-testing/framework-integ/test/aws-apigateway/test/integ.spec-restapi.js.snapshot/cdk.out @@ -1 +1 @@ -{"version":"34.0.0"} \ No newline at end of file +{"version":"41.0.0"} \ No newline at end of file diff --git a/packages/@aws-cdk-testing/framework-integ/test/aws-apigateway/test/integ.spec-restapi.js.snapshot/integ.json b/packages/@aws-cdk-testing/framework-integ/test/aws-apigateway/test/integ.spec-restapi.js.snapshot/integ.json index d401a0fa6fcee..5eeea76c4439c 100644 --- a/packages/@aws-cdk-testing/framework-integ/test/aws-apigateway/test/integ.spec-restapi.js.snapshot/integ.json +++ b/packages/@aws-cdk-testing/framework-integ/test/aws-apigateway/test/integ.spec-restapi.js.snapshot/integ.json @@ -1,5 +1,5 @@ { - "version": "34.0.0", + "version": "41.0.0", "testCases": { "apigateway-spec-restapi/DefaultTest": { "stacks": [ diff --git a/packages/@aws-cdk-testing/framework-integ/test/aws-apigateway/test/integ.spec-restapi.js.snapshot/manifest.json b/packages/@aws-cdk-testing/framework-integ/test/aws-apigateway/test/integ.spec-restapi.js.snapshot/manifest.json index c10755d235358..b8d0d2d1c86ba 100644 --- a/packages/@aws-cdk-testing/framework-integ/test/aws-apigateway/test/integ.spec-restapi.js.snapshot/manifest.json +++ b/packages/@aws-cdk-testing/framework-integ/test/aws-apigateway/test/integ.spec-restapi.js.snapshot/manifest.json @@ -1,5 +1,5 @@ { - "version": "34.0.0", + "version": "42.0.0", "artifacts": { "test-apigateway-spec-restapi.assets": { "type": "cdk:asset-manifest", @@ -14,10 +14,11 @@ "environment": "aws://unknown-account/unknown-region", "properties": { "templateFile": "test-apigateway-spec-restapi.template.json", + "terminationProtection": false, "validateOnSynth": false, "assumeRoleArn": "arn:${AWS::Partition}:iam::${AWS::AccountId}:role/cdk-hnb659fds-deploy-role-${AWS::AccountId}-${AWS::Region}", "cloudFormationExecutionRoleArn": "arn:${AWS::Partition}:iam::${AWS::AccountId}:role/cdk-hnb659fds-cfn-exec-role-${AWS::AccountId}-${AWS::Region}", - "stackTemplateAssetObjectUrl": "s3://cdk-hnb659fds-assets-${AWS::AccountId}-${AWS::Region}/b37d9cf6d676a3d4144a75463a718fe69a9e07193a9c7cd15b0880949da273e0.json", + "stackTemplateAssetObjectUrl": "s3://cdk-hnb659fds-assets-${AWS::AccountId}-${AWS::Region}/5ad2f9597f2cb5f0fea7242dcb36cf87a6314bc8c3d860324b4d428bf428f286.json", "requiresBootstrapStackVersion": 6, "bootstrapStackVersionSsmParameter": "/cdk-bootstrap/hnb659fds/version", "additionalDependencies": [ @@ -33,24 +34,81 @@ "test-apigateway-spec-restapi.assets" ], "metadata": { + "/test-apigateway-spec-restapi/my-api": [ + { + "type": "aws:cdk:analytics:construct", + "data": { + "apiDefinition": "*", + "disableExecuteApiEndpoint": true, + "minCompressionSize": "*", + "retainDeployments": true, + "cloudWatchRole": true, + "deployOptions": { + "cacheClusterEnabled": true, + "stageName": "*", + "description": "*", + "loggingLevel": "INFO", + "dataTraceEnabled": true, + "methodOptions": "*" + } + } + } + ], "/test-apigateway-spec-restapi/my-api/Resource": [ { "type": "aws:cdk:logicalId", "data": "myapi4C7BF186" } ], + "/test-apigateway-spec-restapi/my-api/Default": [ + { + "type": "aws:cdk:analytics:construct", + "data": "*" + } + ], + "/test-apigateway-spec-restapi/my-api/Default/v1": [ + { + "type": "aws:cdk:analytics:construct", + "data": { + "parent": "*", + "pathPart": "*" + } + } + ], "/test-apigateway-spec-restapi/my-api/Default/v1/Resource": [ { "type": "aws:cdk:logicalId", "data": "myapiv113487378" } ], + "/test-apigateway-spec-restapi/my-api/Default/v1/toys": [ + { + "type": "aws:cdk:analytics:construct", + "data": { + "parent": "*", + "pathPart": "*" + } + } + ], "/test-apigateway-spec-restapi/my-api/Default/v1/toys/Resource": [ { "type": "aws:cdk:logicalId", "data": "myapiv1toysA55FCBC4" } ], + "/test-apigateway-spec-restapi/my-api/Default/v1/toys/GET": [ + { + "type": "aws:cdk:analytics:construct", + "data": { + "resource": "*", + "httpMethod": "*", + "integration": "*", + "options": { + "apiKeyRequired": true + } + } + } + ], "/test-apigateway-spec-restapi/my-api/Default/v1/toys/GET/ApiPermission.testapigatewayspecrestapimyapiA4A36FD7.GET..v1.toys": [ { "type": "aws:cdk:logicalId", @@ -69,36 +127,98 @@ "data": "myapiv1toysGET7348114D" } ], + "/test-apigateway-spec-restapi/my-api/Default/v1/toys/POST": [ + { + "type": "aws:cdk:analytics:construct", + "data": { + "resource": "*", + "httpMethod": "*", + "integration": "*", + "options": "*" + } + } + ], "/test-apigateway-spec-restapi/my-api/Default/v1/toys/POST/Resource": [ { "type": "aws:cdk:logicalId", "data": "myapiv1toysPOST55128058" } ], + "/test-apigateway-spec-restapi/my-api/Default/v1/toys/PUT": [ + { + "type": "aws:cdk:analytics:construct", + "data": { + "resource": "*", + "httpMethod": "*", + "integration": "*", + "options": "*" + } + } + ], "/test-apigateway-spec-restapi/my-api/Default/v1/toys/PUT/Resource": [ { "type": "aws:cdk:logicalId", "data": "myapiv1toysPUT59AFBBC2" } ], + "/test-apigateway-spec-restapi/my-api/Default/v1/appliances": [ + { + "type": "aws:cdk:analytics:construct", + "data": { + "parent": "*", + "pathPart": "*" + } + } + ], "/test-apigateway-spec-restapi/my-api/Default/v1/appliances/Resource": [ { "type": "aws:cdk:logicalId", "data": "myapiv1appliances507FEFF4" } ], + "/test-apigateway-spec-restapi/my-api/Default/v1/appliances/GET": [ + { + "type": "aws:cdk:analytics:construct", + "data": { + "resource": "*", + "httpMethod": "*", + "integration": "*", + "options": "*" + } + } + ], "/test-apigateway-spec-restapi/my-api/Default/v1/appliances/GET/Resource": [ { "type": "aws:cdk:logicalId", "data": "myapiv1appliancesGET8FE872EC" } ], + "/test-apigateway-spec-restapi/my-api/Default/v1/books": [ + { + "type": "aws:cdk:analytics:construct", + "data": { + "parent": "*", + "pathPart": "*" + } + } + ], "/test-apigateway-spec-restapi/my-api/Default/v1/books/Resource": [ { "type": "aws:cdk:logicalId", "data": "myapiv1books1D4BE6C1" } ], + "/test-apigateway-spec-restapi/my-api/Default/v1/books/GET": [ + { + "type": "aws:cdk:analytics:construct", + "data": { + "resource": "*", + "httpMethod": "*", + "integration": "*", + "options": "*" + } + } + ], "/test-apigateway-spec-restapi/my-api/Default/v1/books/GET/ApiPermission.testapigatewayspecrestapimyapiA4A36FD7.GET..v1.books": [ { "type": "aws:cdk:logicalId", @@ -117,6 +237,17 @@ "data": "myapiv1booksGETC6B996D0" } ], + "/test-apigateway-spec-restapi/my-api/Default/v1/books/POST": [ + { + "type": "aws:cdk:analytics:construct", + "data": { + "resource": "*", + "httpMethod": "*", + "integration": "*", + "options": "*" + } + } + ], "/test-apigateway-spec-restapi/my-api/Default/v1/books/POST/ApiPermission.testapigatewayspecrestapimyapiA4A36FD7.POST..v1.books": [ { "type": "aws:cdk:logicalId", @@ -135,6 +266,36 @@ "data": "myapiv1booksPOST53E2832E" } ], + "/test-apigateway-spec-restapi/my-api/CloudWatchRole": [ + { + "type": "aws:cdk:analytics:construct", + "data": { + "assumedBy": { + "principalAccount": "*", + "assumeRoleAction": "*" + }, + "managedPolicies": [ + { + "managedPolicyArn": "*" + } + ] + } + }, + { + "type": "aws:cdk:analytics:method", + "data": { + "applyRemovalPolicy": [ + "retain" + ] + } + } + ], + "/test-apigateway-spec-restapi/my-api/CloudWatchRole/ImportCloudWatchRole": [ + { + "type": "aws:cdk:analytics:construct", + "data": "*" + } + ], "/test-apigateway-spec-restapi/my-api/CloudWatchRole/Resource": [ { "type": "aws:cdk:logicalId", @@ -147,10 +308,114 @@ "data": "myapiAccountEC421A0A" } ], + "/test-apigateway-spec-restapi/my-api/Deployment": [ + { + "type": "aws:cdk:analytics:construct", + "data": { + "description": "*", + "api": "*", + "retainDeployments": true + } + }, + { + "type": "aws:cdk:analytics:method", + "data": { + "addToLogicalId": [ + {} + ] + } + }, + { + "type": "aws:cdk:analytics:method", + "data": { + "addToLogicalId": [ + {} + ] + } + }, + { + "type": "aws:cdk:analytics:method", + "data": { + "addToLogicalId": [ + {} + ] + } + }, + { + "type": "aws:cdk:analytics:method", + "data": { + "addToLogicalId": [ + {} + ] + } + }, + { + "type": "aws:cdk:analytics:method", + "data": { + "addToLogicalId": [ + {} + ] + } + }, + { + "type": "aws:cdk:analytics:method", + "data": { + "addToLogicalId": [ + {} + ] + } + }, + { + "type": "aws:cdk:analytics:method", + "data": { + "addToLogicalId": [ + {} + ] + } + }, + { + "type": "aws:cdk:analytics:method", + "data": { + "addToLogicalId": [ + {} + ] + } + }, + { + "type": "aws:cdk:analytics:method", + "data": { + "addToLogicalId": [ + {} + ] + } + }, + { + "type": "aws:cdk:analytics:method", + "data": { + "addToLogicalId": [ + {} + ] + } + } + ], "/test-apigateway-spec-restapi/my-api/Deployment/Resource": [ { "type": "aws:cdk:logicalId", - "data": "myapiDeployment92F2CB492c49d8fa05ada8b5cddee1ce76138bd0" + "data": "myapiDeployment92F2CB491b0e40e722acabc99cc39958c957686d" + } + ], + "/test-apigateway-spec-restapi/my-api/DeploymentStage.beta": [ + { + "type": "aws:cdk:analytics:construct", + "data": { + "deployment": "*", + "cacheClusterEnabled": true, + "stageName": "*", + "description": "*", + "loggingLevel": "INFO", + "dataTraceEnabled": true, + "methodOptions": "*" + } } ], "/test-apigateway-spec-restapi/my-api/DeploymentStage.beta/Resource": [ @@ -165,12 +430,57 @@ "data": "myapiEndpoint3628AFE3" } ], + "/test-apigateway-spec-restapi/my-api/ApiKey": [ + { + "type": "aws:cdk:analytics:construct", + "data": { + "stages": [ + "*" + ] + } + } + ], "/test-apigateway-spec-restapi/my-api/ApiKey/Resource": [ { "type": "aws:cdk:logicalId", "data": "myapiApiKey43446CCF" } ], + "/test-apigateway-spec-restapi/my-api/UsagePlan": [ + { + "type": "aws:cdk:analytics:construct", + "data": { + "name": "*", + "apiKey": "*", + "description": "*", + "throttle": { + "rateLimit": "*" + }, + "quota": { + "limit": "*", + "period": "MONTH" + } + } + }, + { + "type": "aws:cdk:analytics:method", + "data": { + "addApiStage": [ + { + "throttle": [ + { + "method": "*", + "throttle": { + "rateLimit": "*", + "burstLimit": "*" + } + } + ] + } + ] + } + } + ], "/test-apigateway-spec-restapi/my-api/UsagePlan/Resource": [ { "type": "aws:cdk:logicalId", @@ -183,6 +493,38 @@ "data": "myapiUsagePlanUsagePlanKeyResourcetestapigatewayspecrestapimyapiApiKey950FF760D8BD56CA" } ], + "/test-apigateway-spec-restapi/MyHandler": [ + { + "type": "aws:cdk:analytics:construct", + "data": { + "runtime": "*", + "code": "*", + "handler": "*" + } + } + ], + "/test-apigateway-spec-restapi/MyHandler/ServiceRole": [ + { + "type": "aws:cdk:analytics:construct", + "data": { + "assumedBy": { + "principalAccount": "*", + "assumeRoleAction": "*" + }, + "managedPolicies": [ + { + "managedPolicyArn": "*" + } + ] + } + } + ], + "/test-apigateway-spec-restapi/MyHandler/ServiceRole/ImportServiceRole": [ + { + "type": "aws:cdk:analytics:construct", + "data": "*" + } + ], "/test-apigateway-spec-restapi/MyHandler/ServiceRole/Resource": [ { "type": "aws:cdk:logicalId", @@ -206,6 +548,15 @@ "type": "aws:cdk:logicalId", "data": "CheckBootstrapVersion" } + ], + "myapiDeployment92F2CB492c49d8fa05ada8b5cddee1ce76138bd0": [ + { + "type": "aws:cdk:logicalId", + "data": "myapiDeployment92F2CB492c49d8fa05ada8b5cddee1ce76138bd0", + "trace": [ + "!!DESTRUCTIVE_CHANGES: WILL_DESTROY" + ] + } ] }, "displayName": "test-apigateway-spec-restapi" @@ -223,6 +574,7 @@ "environment": "aws://unknown-account/unknown-region", "properties": { "templateFile": "apigatewayspecrestapiDefaultTestDeployAssertD16AA485.template.json", + "terminationProtection": false, "validateOnSynth": false, "assumeRoleArn": "arn:${AWS::Partition}:iam::${AWS::AccountId}:role/cdk-hnb659fds-deploy-role-${AWS::AccountId}-${AWS::Region}", "cloudFormationExecutionRoleArn": "arn:${AWS::Partition}:iam::${AWS::AccountId}:role/cdk-hnb659fds-cfn-exec-role-${AWS::AccountId}-${AWS::Region}", @@ -263,5 +615,6 @@ "file": "tree.json" } } - } + }, + "minimumCliVersion": "2.1006.0" } \ No newline at end of file diff --git a/packages/@aws-cdk-testing/framework-integ/test/aws-apigateway/test/integ.spec-restapi.js.snapshot/test-apigateway-spec-restapi.assets.json b/packages/@aws-cdk-testing/framework-integ/test/aws-apigateway/test/integ.spec-restapi.js.snapshot/test-apigateway-spec-restapi.assets.json index 35308b8358329..44852e547d1d8 100644 --- a/packages/@aws-cdk-testing/framework-integ/test/aws-apigateway/test/integ.spec-restapi.js.snapshot/test-apigateway-spec-restapi.assets.json +++ b/packages/@aws-cdk-testing/framework-integ/test/aws-apigateway/test/integ.spec-restapi.js.snapshot/test-apigateway-spec-restapi.assets.json @@ -1,7 +1,8 @@ { - "version": "34.0.0", + "version": "41.0.0", "files": { "68497ac876de4e963fc8f7b5f1b28844c18ecc95e3f7c6e9e0bf250e03c037fb": { + "displayName": "my-api/APIDefinition", "source": { "path": "asset.68497ac876de4e963fc8f7b5f1b28844c18ecc95e3f7c6e9e0bf250e03c037fb.yaml", "packaging": "file" @@ -14,7 +15,8 @@ } } }, - "b37d9cf6d676a3d4144a75463a718fe69a9e07193a9c7cd15b0880949da273e0": { + "5ad2f9597f2cb5f0fea7242dcb36cf87a6314bc8c3d860324b4d428bf428f286": { + "displayName": "test-apigateway-spec-restapi Template", "source": { "path": "test-apigateway-spec-restapi.template.json", "packaging": "file" @@ -22,7 +24,7 @@ "destinations": { "current_account-current_region": { "bucketName": "cdk-hnb659fds-assets-${AWS::AccountId}-${AWS::Region}", - "objectKey": "b37d9cf6d676a3d4144a75463a718fe69a9e07193a9c7cd15b0880949da273e0.json", + "objectKey": "5ad2f9597f2cb5f0fea7242dcb36cf87a6314bc8c3d860324b4d428bf428f286.json", "assumeRoleArn": "arn:${AWS::Partition}:iam::${AWS::AccountId}:role/cdk-hnb659fds-file-publishing-role-${AWS::AccountId}-${AWS::Region}" } } diff --git a/packages/@aws-cdk-testing/framework-integ/test/aws-apigateway/test/integ.spec-restapi.js.snapshot/test-apigateway-spec-restapi.template.json b/packages/@aws-cdk-testing/framework-integ/test/aws-apigateway/test/integ.spec-restapi.js.snapshot/test-apigateway-spec-restapi.template.json index 946de77d61444..17980fde42d93 100644 --- a/packages/@aws-cdk-testing/framework-integ/test/aws-apigateway/test/integ.spec-restapi.js.snapshot/test-apigateway-spec-restapi.template.json +++ b/packages/@aws-cdk-testing/framework-integ/test/aws-apigateway/test/integ.spec-restapi.js.snapshot/test-apigateway-spec-restapi.template.json @@ -11,6 +11,7 @@ }, "DisableExecuteApiEndpoint": true, "MinimumCompressionSize": 1024, + "Mode": "merge", "Name": "my-api" } }, @@ -517,7 +518,7 @@ "UpdateReplacePolicy": "Retain", "DeletionPolicy": "Retain" }, - "myapiDeployment92F2CB492c49d8fa05ada8b5cddee1ce76138bd0": { + "myapiDeployment92F2CB491b0e40e722acabc99cc39958c957686d": { "Type": "AWS::ApiGateway::Deployment", "Properties": { "Description": "beta stage", @@ -546,7 +547,7 @@ "CacheClusterEnabled": true, "CacheClusterSize": "0.5", "DeploymentId": { - "Ref": "myapiDeployment92F2CB492c49d8fa05ada8b5cddee1ce76138bd0" + "Ref": "myapiDeployment92F2CB491b0e40e722acabc99cc39958c957686d" }, "Description": "beta stage", "MethodSettings": [ diff --git a/packages/@aws-cdk-testing/framework-integ/test/aws-apigateway/test/integ.spec-restapi.js.snapshot/tree.json b/packages/@aws-cdk-testing/framework-integ/test/aws-apigateway/test/integ.spec-restapi.js.snapshot/tree.json index a01fc1f9bf0d8..d67f0698d1b05 100644 --- a/packages/@aws-cdk-testing/framework-integ/test/aws-apigateway/test/integ.spec-restapi.js.snapshot/tree.json +++ b/packages/@aws-cdk-testing/framework-integ/test/aws-apigateway/test/integ.spec-restapi.js.snapshot/tree.json @@ -1,1202 +1 @@ -{ - "version": "tree-0.1", - "tree": { - "id": "App", - "path": "", - "children": { - "test-apigateway-spec-restapi": { - "id": "test-apigateway-spec-restapi", - "path": "test-apigateway-spec-restapi", - "children": { - "my-api": { - "id": "my-api", - "path": "test-apigateway-spec-restapi/my-api", - "children": { - "APIDefinition": { - "id": "APIDefinition", - "path": "test-apigateway-spec-restapi/my-api/APIDefinition", - "children": { - "Stage": { - "id": "Stage", - "path": "test-apigateway-spec-restapi/my-api/APIDefinition/Stage", - "constructInfo": { - "fqn": "aws-cdk-lib.AssetStaging", - "version": "0.0.0" - } - }, - "AssetBucket": { - "id": "AssetBucket", - "path": "test-apigateway-spec-restapi/my-api/APIDefinition/AssetBucket", - "constructInfo": { - "fqn": "aws-cdk-lib.aws_s3.BucketBase", - "version": "0.0.0" - } - } - }, - "constructInfo": { - "fqn": "aws-cdk-lib.aws_s3_assets.Asset", - "version": "0.0.0" - } - }, - "Resource": { - "id": "Resource", - "path": "test-apigateway-spec-restapi/my-api/Resource", - "attributes": { - "aws:cdk:cloudformation:type": "AWS::ApiGateway::RestApi", - "aws:cdk:cloudformation:props": { - "bodyS3Location": { - "bucket": { - "Fn::Sub": "cdk-hnb659fds-assets-${AWS::AccountId}-${AWS::Region}" - }, - "key": "68497ac876de4e963fc8f7b5f1b28844c18ecc95e3f7c6e9e0bf250e03c037fb.yaml" - }, - "disableExecuteApiEndpoint": true, - "minimumCompressionSize": 1024, - "name": "my-api" - } - }, - "constructInfo": { - "fqn": "aws-cdk-lib.aws_apigateway.CfnRestApi", - "version": "0.0.0" - } - }, - "Default": { - "id": "Default", - "path": "test-apigateway-spec-restapi/my-api/Default", - "children": { - "v1": { - "id": "v1", - "path": "test-apigateway-spec-restapi/my-api/Default/v1", - "children": { - "Resource": { - "id": "Resource", - "path": "test-apigateway-spec-restapi/my-api/Default/v1/Resource", - "attributes": { - "aws:cdk:cloudformation:type": "AWS::ApiGateway::Resource", - "aws:cdk:cloudformation:props": { - "parentId": { - "Fn::GetAtt": [ - "myapi4C7BF186", - "RootResourceId" - ] - }, - "pathPart": "v1", - "restApiId": { - "Ref": "myapi4C7BF186" - } - } - }, - "constructInfo": { - "fqn": "aws-cdk-lib.aws_apigateway.CfnResource", - "version": "0.0.0" - } - }, - "toys": { - "id": "toys", - "path": "test-apigateway-spec-restapi/my-api/Default/v1/toys", - "children": { - "Resource": { - "id": "Resource", - "path": "test-apigateway-spec-restapi/my-api/Default/v1/toys/Resource", - "attributes": { - "aws:cdk:cloudformation:type": "AWS::ApiGateway::Resource", - "aws:cdk:cloudformation:props": { - "parentId": { - "Ref": "myapiv113487378" - }, - "pathPart": "toys", - "restApiId": { - "Ref": "myapi4C7BF186" - } - } - }, - "constructInfo": { - "fqn": "aws-cdk-lib.aws_apigateway.CfnResource", - "version": "0.0.0" - } - }, - "GET": { - "id": "GET", - "path": "test-apigateway-spec-restapi/my-api/Default/v1/toys/GET", - "children": { - "ApiPermission.testapigatewayspecrestapimyapiA4A36FD7.GET..v1.toys": { - "id": "ApiPermission.testapigatewayspecrestapimyapiA4A36FD7.GET..v1.toys", - "path": "test-apigateway-spec-restapi/my-api/Default/v1/toys/GET/ApiPermission.testapigatewayspecrestapimyapiA4A36FD7.GET..v1.toys", - "attributes": { - "aws:cdk:cloudformation:type": "AWS::Lambda::Permission", - "aws:cdk:cloudformation:props": { - "action": "lambda:InvokeFunction", - "functionName": { - "Fn::GetAtt": [ - "MyHandler6B74D312", - "Arn" - ] - }, - "principal": "apigateway.amazonaws.com", - "sourceArn": { - "Fn::Join": [ - "", - [ - "arn:", - { - "Ref": "AWS::Partition" - }, - ":execute-api:", - { - "Ref": "AWS::Region" - }, - ":", - { - "Ref": "AWS::AccountId" - }, - ":", - { - "Ref": "myapi4C7BF186" - }, - "/", - { - "Ref": "myapiDeploymentStagebeta96434BEB" - }, - "/GET/v1/toys" - ] - ] - } - } - }, - "constructInfo": { - "fqn": "aws-cdk-lib.aws_lambda.CfnPermission", - "version": "0.0.0" - } - }, - "ApiPermission.Test.testapigatewayspecrestapimyapiA4A36FD7.GET..v1.toys": { - "id": "ApiPermission.Test.testapigatewayspecrestapimyapiA4A36FD7.GET..v1.toys", - "path": "test-apigateway-spec-restapi/my-api/Default/v1/toys/GET/ApiPermission.Test.testapigatewayspecrestapimyapiA4A36FD7.GET..v1.toys", - "attributes": { - "aws:cdk:cloudformation:type": "AWS::Lambda::Permission", - "aws:cdk:cloudformation:props": { - "action": "lambda:InvokeFunction", - "functionName": { - "Fn::GetAtt": [ - "MyHandler6B74D312", - "Arn" - ] - }, - "principal": "apigateway.amazonaws.com", - "sourceArn": { - "Fn::Join": [ - "", - [ - "arn:", - { - "Ref": "AWS::Partition" - }, - ":execute-api:", - { - "Ref": "AWS::Region" - }, - ":", - { - "Ref": "AWS::AccountId" - }, - ":", - { - "Ref": "myapi4C7BF186" - }, - "/test-invoke-stage/GET/v1/toys" - ] - ] - } - } - }, - "constructInfo": { - "fqn": "aws-cdk-lib.aws_lambda.CfnPermission", - "version": "0.0.0" - } - }, - "Resource": { - "id": "Resource", - "path": "test-apigateway-spec-restapi/my-api/Default/v1/toys/GET/Resource", - "attributes": { - "aws:cdk:cloudformation:type": "AWS::ApiGateway::Method", - "aws:cdk:cloudformation:props": { - "apiKeyRequired": true, - "authorizationType": "NONE", - "httpMethod": "GET", - "integration": { - "type": "AWS_PROXY", - "uri": { - "Fn::Join": [ - "", - [ - "arn:", - { - "Ref": "AWS::Partition" - }, - ":apigateway:", - { - "Ref": "AWS::Region" - }, - ":lambda:path/2015-03-31/functions/", - { - "Fn::GetAtt": [ - "MyHandler6B74D312", - "Arn" - ] - }, - "/invocations" - ] - ] - }, - "integrationHttpMethod": "POST" - }, - "resourceId": { - "Ref": "myapiv1toysA55FCBC4" - }, - "restApiId": { - "Ref": "myapi4C7BF186" - } - } - }, - "constructInfo": { - "fqn": "aws-cdk-lib.aws_apigateway.CfnMethod", - "version": "0.0.0" - } - } - }, - "constructInfo": { - "fqn": "aws-cdk-lib.aws_apigateway.Method", - "version": "0.0.0" - } - }, - "POST": { - "id": "POST", - "path": "test-apigateway-spec-restapi/my-api/Default/v1/toys/POST", - "children": { - "Resource": { - "id": "Resource", - "path": "test-apigateway-spec-restapi/my-api/Default/v1/toys/POST/Resource", - "attributes": { - "aws:cdk:cloudformation:type": "AWS::ApiGateway::Method", - "aws:cdk:cloudformation:props": { - "authorizationType": "NONE", - "httpMethod": "POST", - "integration": { - "type": "MOCK" - }, - "resourceId": { - "Ref": "myapiv1toysA55FCBC4" - }, - "restApiId": { - "Ref": "myapi4C7BF186" - } - } - }, - "constructInfo": { - "fqn": "aws-cdk-lib.aws_apigateway.CfnMethod", - "version": "0.0.0" - } - } - }, - "constructInfo": { - "fqn": "aws-cdk-lib.aws_apigateway.Method", - "version": "0.0.0" - } - }, - "PUT": { - "id": "PUT", - "path": "test-apigateway-spec-restapi/my-api/Default/v1/toys/PUT", - "children": { - "Resource": { - "id": "Resource", - "path": "test-apigateway-spec-restapi/my-api/Default/v1/toys/PUT/Resource", - "attributes": { - "aws:cdk:cloudformation:type": "AWS::ApiGateway::Method", - "aws:cdk:cloudformation:props": { - "authorizationType": "NONE", - "httpMethod": "PUT", - "integration": { - "type": "MOCK" - }, - "resourceId": { - "Ref": "myapiv1toysA55FCBC4" - }, - "restApiId": { - "Ref": "myapi4C7BF186" - } - } - }, - "constructInfo": { - "fqn": "aws-cdk-lib.aws_apigateway.CfnMethod", - "version": "0.0.0" - } - } - }, - "constructInfo": { - "fqn": "aws-cdk-lib.aws_apigateway.Method", - "version": "0.0.0" - } - } - }, - "constructInfo": { - "fqn": "aws-cdk-lib.aws_apigateway.Resource", - "version": "0.0.0" - } - }, - "appliances": { - "id": "appliances", - "path": "test-apigateway-spec-restapi/my-api/Default/v1/appliances", - "children": { - "Resource": { - "id": "Resource", - "path": "test-apigateway-spec-restapi/my-api/Default/v1/appliances/Resource", - "attributes": { - "aws:cdk:cloudformation:type": "AWS::ApiGateway::Resource", - "aws:cdk:cloudformation:props": { - "parentId": { - "Ref": "myapiv113487378" - }, - "pathPart": "appliances", - "restApiId": { - "Ref": "myapi4C7BF186" - } - } - }, - "constructInfo": { - "fqn": "aws-cdk-lib.aws_apigateway.CfnResource", - "version": "0.0.0" - } - }, - "GET": { - "id": "GET", - "path": "test-apigateway-spec-restapi/my-api/Default/v1/appliances/GET", - "children": { - "Resource": { - "id": "Resource", - "path": "test-apigateway-spec-restapi/my-api/Default/v1/appliances/GET/Resource", - "attributes": { - "aws:cdk:cloudformation:type": "AWS::ApiGateway::Method", - "aws:cdk:cloudformation:props": { - "authorizationType": "NONE", - "httpMethod": "GET", - "integration": { - "type": "MOCK" - }, - "resourceId": { - "Ref": "myapiv1appliances507FEFF4" - }, - "restApiId": { - "Ref": "myapi4C7BF186" - } - } - }, - "constructInfo": { - "fqn": "aws-cdk-lib.aws_apigateway.CfnMethod", - "version": "0.0.0" - } - } - }, - "constructInfo": { - "fqn": "aws-cdk-lib.aws_apigateway.Method", - "version": "0.0.0" - } - } - }, - "constructInfo": { - "fqn": "aws-cdk-lib.aws_apigateway.Resource", - "version": "0.0.0" - } - }, - "books": { - "id": "books", - "path": "test-apigateway-spec-restapi/my-api/Default/v1/books", - "children": { - "Resource": { - "id": "Resource", - "path": "test-apigateway-spec-restapi/my-api/Default/v1/books/Resource", - "attributes": { - "aws:cdk:cloudformation:type": "AWS::ApiGateway::Resource", - "aws:cdk:cloudformation:props": { - "parentId": { - "Ref": "myapiv113487378" - }, - "pathPart": "books", - "restApiId": { - "Ref": "myapi4C7BF186" - } - } - }, - "constructInfo": { - "fqn": "aws-cdk-lib.aws_apigateway.CfnResource", - "version": "0.0.0" - } - }, - "GET": { - "id": "GET", - "path": "test-apigateway-spec-restapi/my-api/Default/v1/books/GET", - "children": { - "ApiPermission.testapigatewayspecrestapimyapiA4A36FD7.GET..v1.books": { - "id": "ApiPermission.testapigatewayspecrestapimyapiA4A36FD7.GET..v1.books", - "path": "test-apigateway-spec-restapi/my-api/Default/v1/books/GET/ApiPermission.testapigatewayspecrestapimyapiA4A36FD7.GET..v1.books", - "attributes": { - "aws:cdk:cloudformation:type": "AWS::Lambda::Permission", - "aws:cdk:cloudformation:props": { - "action": "lambda:InvokeFunction", - "functionName": { - "Fn::GetAtt": [ - "MyHandler6B74D312", - "Arn" - ] - }, - "principal": "apigateway.amazonaws.com", - "sourceArn": { - "Fn::Join": [ - "", - [ - "arn:", - { - "Ref": "AWS::Partition" - }, - ":execute-api:", - { - "Ref": "AWS::Region" - }, - ":", - { - "Ref": "AWS::AccountId" - }, - ":", - { - "Ref": "myapi4C7BF186" - }, - "/", - { - "Ref": "myapiDeploymentStagebeta96434BEB" - }, - "/GET/v1/books" - ] - ] - } - } - }, - "constructInfo": { - "fqn": "aws-cdk-lib.aws_lambda.CfnPermission", - "version": "0.0.0" - } - }, - "ApiPermission.Test.testapigatewayspecrestapimyapiA4A36FD7.GET..v1.books": { - "id": "ApiPermission.Test.testapigatewayspecrestapimyapiA4A36FD7.GET..v1.books", - "path": "test-apigateway-spec-restapi/my-api/Default/v1/books/GET/ApiPermission.Test.testapigatewayspecrestapimyapiA4A36FD7.GET..v1.books", - "attributes": { - "aws:cdk:cloudformation:type": "AWS::Lambda::Permission", - "aws:cdk:cloudformation:props": { - "action": "lambda:InvokeFunction", - "functionName": { - "Fn::GetAtt": [ - "MyHandler6B74D312", - "Arn" - ] - }, - "principal": "apigateway.amazonaws.com", - "sourceArn": { - "Fn::Join": [ - "", - [ - "arn:", - { - "Ref": "AWS::Partition" - }, - ":execute-api:", - { - "Ref": "AWS::Region" - }, - ":", - { - "Ref": "AWS::AccountId" - }, - ":", - { - "Ref": "myapi4C7BF186" - }, - "/test-invoke-stage/GET/v1/books" - ] - ] - } - } - }, - "constructInfo": { - "fqn": "aws-cdk-lib.aws_lambda.CfnPermission", - "version": "0.0.0" - } - }, - "Resource": { - "id": "Resource", - "path": "test-apigateway-spec-restapi/my-api/Default/v1/books/GET/Resource", - "attributes": { - "aws:cdk:cloudformation:type": "AWS::ApiGateway::Method", - "aws:cdk:cloudformation:props": { - "authorizationType": "NONE", - "httpMethod": "GET", - "integration": { - "type": "AWS_PROXY", - "uri": { - "Fn::Join": [ - "", - [ - "arn:", - { - "Ref": "AWS::Partition" - }, - ":apigateway:", - { - "Ref": "AWS::Region" - }, - ":lambda:path/2015-03-31/functions/", - { - "Fn::GetAtt": [ - "MyHandler6B74D312", - "Arn" - ] - }, - "/invocations" - ] - ] - }, - "integrationHttpMethod": "POST" - }, - "resourceId": { - "Ref": "myapiv1books1D4BE6C1" - }, - "restApiId": { - "Ref": "myapi4C7BF186" - } - } - }, - "constructInfo": { - "fqn": "aws-cdk-lib.aws_apigateway.CfnMethod", - "version": "0.0.0" - } - } - }, - "constructInfo": { - "fqn": "aws-cdk-lib.aws_apigateway.Method", - "version": "0.0.0" - } - }, - "POST": { - "id": "POST", - "path": "test-apigateway-spec-restapi/my-api/Default/v1/books/POST", - "children": { - "ApiPermission.testapigatewayspecrestapimyapiA4A36FD7.POST..v1.books": { - "id": "ApiPermission.testapigatewayspecrestapimyapiA4A36FD7.POST..v1.books", - "path": "test-apigateway-spec-restapi/my-api/Default/v1/books/POST/ApiPermission.testapigatewayspecrestapimyapiA4A36FD7.POST..v1.books", - "attributes": { - "aws:cdk:cloudformation:type": "AWS::Lambda::Permission", - "aws:cdk:cloudformation:props": { - "action": "lambda:InvokeFunction", - "functionName": { - "Fn::GetAtt": [ - "MyHandler6B74D312", - "Arn" - ] - }, - "principal": "apigateway.amazonaws.com", - "sourceArn": { - "Fn::Join": [ - "", - [ - "arn:", - { - "Ref": "AWS::Partition" - }, - ":execute-api:", - { - "Ref": "AWS::Region" - }, - ":", - { - "Ref": "AWS::AccountId" - }, - ":", - { - "Ref": "myapi4C7BF186" - }, - "/", - { - "Ref": "myapiDeploymentStagebeta96434BEB" - }, - "/POST/v1/books" - ] - ] - } - } - }, - "constructInfo": { - "fqn": "aws-cdk-lib.aws_lambda.CfnPermission", - "version": "0.0.0" - } - }, - "ApiPermission.Test.testapigatewayspecrestapimyapiA4A36FD7.POST..v1.books": { - "id": "ApiPermission.Test.testapigatewayspecrestapimyapiA4A36FD7.POST..v1.books", - "path": "test-apigateway-spec-restapi/my-api/Default/v1/books/POST/ApiPermission.Test.testapigatewayspecrestapimyapiA4A36FD7.POST..v1.books", - "attributes": { - "aws:cdk:cloudformation:type": "AWS::Lambda::Permission", - "aws:cdk:cloudformation:props": { - "action": "lambda:InvokeFunction", - "functionName": { - "Fn::GetAtt": [ - "MyHandler6B74D312", - "Arn" - ] - }, - "principal": "apigateway.amazonaws.com", - "sourceArn": { - "Fn::Join": [ - "", - [ - "arn:", - { - "Ref": "AWS::Partition" - }, - ":execute-api:", - { - "Ref": "AWS::Region" - }, - ":", - { - "Ref": "AWS::AccountId" - }, - ":", - { - "Ref": "myapi4C7BF186" - }, - "/test-invoke-stage/POST/v1/books" - ] - ] - } - } - }, - "constructInfo": { - "fqn": "aws-cdk-lib.aws_lambda.CfnPermission", - "version": "0.0.0" - } - }, - "Resource": { - "id": "Resource", - "path": "test-apigateway-spec-restapi/my-api/Default/v1/books/POST/Resource", - "attributes": { - "aws:cdk:cloudformation:type": "AWS::ApiGateway::Method", - "aws:cdk:cloudformation:props": { - "authorizationType": "NONE", - "httpMethod": "POST", - "integration": { - "type": "AWS_PROXY", - "uri": { - "Fn::Join": [ - "", - [ - "arn:", - { - "Ref": "AWS::Partition" - }, - ":apigateway:", - { - "Ref": "AWS::Region" - }, - ":lambda:path/2015-03-31/functions/", - { - "Fn::GetAtt": [ - "MyHandler6B74D312", - "Arn" - ] - }, - "/invocations" - ] - ] - }, - "integrationHttpMethod": "POST" - }, - "resourceId": { - "Ref": "myapiv1books1D4BE6C1" - }, - "restApiId": { - "Ref": "myapi4C7BF186" - } - } - }, - "constructInfo": { - "fqn": "aws-cdk-lib.aws_apigateway.CfnMethod", - "version": "0.0.0" - } - } - }, - "constructInfo": { - "fqn": "aws-cdk-lib.aws_apigateway.Method", - "version": "0.0.0" - } - } - }, - "constructInfo": { - "fqn": "aws-cdk-lib.aws_apigateway.Resource", - "version": "0.0.0" - } - } - }, - "constructInfo": { - "fqn": "aws-cdk-lib.aws_apigateway.Resource", - "version": "0.0.0" - } - } - }, - "constructInfo": { - "fqn": "aws-cdk-lib.aws_apigateway.ResourceBase", - "version": "0.0.0" - } - }, - "CloudWatchRole": { - "id": "CloudWatchRole", - "path": "test-apigateway-spec-restapi/my-api/CloudWatchRole", - "children": { - "ImportCloudWatchRole": { - "id": "ImportCloudWatchRole", - "path": "test-apigateway-spec-restapi/my-api/CloudWatchRole/ImportCloudWatchRole", - "constructInfo": { - "fqn": "aws-cdk-lib.Resource", - "version": "0.0.0" - } - }, - "Resource": { - "id": "Resource", - "path": "test-apigateway-spec-restapi/my-api/CloudWatchRole/Resource", - "attributes": { - "aws:cdk:cloudformation:type": "AWS::IAM::Role", - "aws:cdk:cloudformation:props": { - "assumeRolePolicyDocument": { - "Statement": [ - { - "Action": "sts:AssumeRole", - "Effect": "Allow", - "Principal": { - "Service": "apigateway.amazonaws.com" - } - } - ], - "Version": "2012-10-17" - }, - "managedPolicyArns": [ - { - "Fn::Join": [ - "", - [ - "arn:", - { - "Ref": "AWS::Partition" - }, - ":iam::aws:policy/service-role/AmazonAPIGatewayPushToCloudWatchLogs" - ] - ] - } - ] - } - }, - "constructInfo": { - "fqn": "aws-cdk-lib.aws_iam.CfnRole", - "version": "0.0.0" - } - } - }, - "constructInfo": { - "fqn": "aws-cdk-lib.aws_iam.Role", - "version": "0.0.0" - } - }, - "Account": { - "id": "Account", - "path": "test-apigateway-spec-restapi/my-api/Account", - "attributes": { - "aws:cdk:cloudformation:type": "AWS::ApiGateway::Account", - "aws:cdk:cloudformation:props": { - "cloudWatchRoleArn": { - "Fn::GetAtt": [ - "myapiCloudWatchRole095452E5", - "Arn" - ] - } - } - }, - "constructInfo": { - "fqn": "aws-cdk-lib.aws_apigateway.CfnAccount", - "version": "0.0.0" - } - }, - "Deployment": { - "id": "Deployment", - "path": "test-apigateway-spec-restapi/my-api/Deployment", - "children": { - "Resource": { - "id": "Resource", - "path": "test-apigateway-spec-restapi/my-api/Deployment/Resource", - "attributes": { - "aws:cdk:cloudformation:type": "AWS::ApiGateway::Deployment", - "aws:cdk:cloudformation:props": { - "description": "beta stage", - "restApiId": { - "Ref": "myapi4C7BF186" - } - } - }, - "constructInfo": { - "fqn": "aws-cdk-lib.aws_apigateway.CfnDeployment", - "version": "0.0.0" - } - } - }, - "constructInfo": { - "fqn": "aws-cdk-lib.aws_apigateway.Deployment", - "version": "0.0.0" - } - }, - "DeploymentStage.beta": { - "id": "DeploymentStage.beta", - "path": "test-apigateway-spec-restapi/my-api/DeploymentStage.beta", - "children": { - "Resource": { - "id": "Resource", - "path": "test-apigateway-spec-restapi/my-api/DeploymentStage.beta/Resource", - "attributes": { - "aws:cdk:cloudformation:type": "AWS::ApiGateway::Stage", - "aws:cdk:cloudformation:props": { - "cacheClusterEnabled": true, - "cacheClusterSize": "0.5", - "deploymentId": { - "Ref": "myapiDeployment92F2CB492c49d8fa05ada8b5cddee1ce76138bd0" - }, - "description": "beta stage", - "methodSettings": [ - { - "httpMethod": "*", - "resourcePath": "/*", - "dataTraceEnabled": true, - "loggingLevel": "INFO" - }, - { - "httpMethod": "GET", - "resourcePath": "/~1api~1appliances", - "cachingEnabled": true, - "dataTraceEnabled": false - } - ], - "restApiId": { - "Ref": "myapi4C7BF186" - }, - "stageName": "beta" - } - }, - "constructInfo": { - "fqn": "aws-cdk-lib.aws_apigateway.CfnStage", - "version": "0.0.0" - } - } - }, - "constructInfo": { - "fqn": "aws-cdk-lib.aws_apigateway.Stage", - "version": "0.0.0" - } - }, - "Endpoint": { - "id": "Endpoint", - "path": "test-apigateway-spec-restapi/my-api/Endpoint", - "constructInfo": { - "fqn": "aws-cdk-lib.CfnOutput", - "version": "0.0.0" - } - }, - "ApiKey": { - "id": "ApiKey", - "path": "test-apigateway-spec-restapi/my-api/ApiKey", - "children": { - "Resource": { - "id": "Resource", - "path": "test-apigateway-spec-restapi/my-api/ApiKey/Resource", - "attributes": { - "aws:cdk:cloudformation:type": "AWS::ApiGateway::ApiKey", - "aws:cdk:cloudformation:props": { - "enabled": true, - "stageKeys": [ - { - "restApiId": { - "Ref": "myapi4C7BF186" - }, - "stageName": { - "Ref": "myapiDeploymentStagebeta96434BEB" - } - } - ] - } - }, - "constructInfo": { - "fqn": "aws-cdk-lib.aws_apigateway.CfnApiKey", - "version": "0.0.0" - } - } - }, - "constructInfo": { - "fqn": "aws-cdk-lib.aws_apigateway.ApiKey", - "version": "0.0.0" - } - }, - "UsagePlan": { - "id": "UsagePlan", - "path": "test-apigateway-spec-restapi/my-api/UsagePlan", - "children": { - "Resource": { - "id": "Resource", - "path": "test-apigateway-spec-restapi/my-api/UsagePlan/Resource", - "attributes": { - "aws:cdk:cloudformation:type": "AWS::ApiGateway::UsagePlan", - "aws:cdk:cloudformation:props": { - "apiStages": [ - { - "apiId": { - "Ref": "myapi4C7BF186" - }, - "stage": { - "Ref": "myapiDeploymentStagebeta96434BEB" - }, - "throttle": { - "/v1/toys/GET": { - "burstLimit": 2, - "rateLimit": 10 - } - } - } - ], - "description": "Free tier monthly usage plan", - "quota": { - "limit": 10000, - "period": "MONTH" - }, - "throttle": { - "rateLimit": 5 - }, - "usagePlanName": "Basic" - } - }, - "constructInfo": { - "fqn": "aws-cdk-lib.aws_apigateway.CfnUsagePlan", - "version": "0.0.0" - } - }, - "UsagePlanKeyResource:testapigatewayspecrestapimyapiApiKey950FF760": { - "id": "UsagePlanKeyResource:testapigatewayspecrestapimyapiApiKey950FF760", - "path": "test-apigateway-spec-restapi/my-api/UsagePlan/UsagePlanKeyResource:testapigatewayspecrestapimyapiApiKey950FF760", - "attributes": { - "aws:cdk:cloudformation:type": "AWS::ApiGateway::UsagePlanKey", - "aws:cdk:cloudformation:props": { - "keyId": { - "Ref": "myapiApiKey43446CCF" - }, - "keyType": "API_KEY", - "usagePlanId": { - "Ref": "myapiUsagePlan56F9C4F2" - } - } - }, - "constructInfo": { - "fqn": "aws-cdk-lib.aws_apigateway.CfnUsagePlanKey", - "version": "0.0.0" - } - } - }, - "constructInfo": { - "fqn": "aws-cdk-lib.aws_apigateway.UsagePlan", - "version": "0.0.0" - } - } - }, - "constructInfo": { - "fqn": "aws-cdk-lib.aws_apigateway.SpecRestApi", - "version": "0.0.0" - } - }, - "MyHandler": { - "id": "MyHandler", - "path": "test-apigateway-spec-restapi/MyHandler", - "children": { - "ServiceRole": { - "id": "ServiceRole", - "path": "test-apigateway-spec-restapi/MyHandler/ServiceRole", - "children": { - "ImportServiceRole": { - "id": "ImportServiceRole", - "path": "test-apigateway-spec-restapi/MyHandler/ServiceRole/ImportServiceRole", - "constructInfo": { - "fqn": "aws-cdk-lib.Resource", - "version": "0.0.0" - } - }, - "Resource": { - "id": "Resource", - "path": "test-apigateway-spec-restapi/MyHandler/ServiceRole/Resource", - "attributes": { - "aws:cdk:cloudformation:type": "AWS::IAM::Role", - "aws:cdk:cloudformation:props": { - "assumeRolePolicyDocument": { - "Statement": [ - { - "Action": "sts:AssumeRole", - "Effect": "Allow", - "Principal": { - "Service": "lambda.amazonaws.com" - } - } - ], - "Version": "2012-10-17" - }, - "managedPolicyArns": [ - { - "Fn::Join": [ - "", - [ - "arn:", - { - "Ref": "AWS::Partition" - }, - ":iam::aws:policy/service-role/AWSLambdaBasicExecutionRole" - ] - ] - } - ] - } - }, - "constructInfo": { - "fqn": "aws-cdk-lib.aws_iam.CfnRole", - "version": "0.0.0" - } - } - }, - "constructInfo": { - "fqn": "aws-cdk-lib.aws_iam.Role", - "version": "0.0.0" - } - }, - "Resource": { - "id": "Resource", - "path": "test-apigateway-spec-restapi/MyHandler/Resource", - "attributes": { - "aws:cdk:cloudformation:type": "AWS::Lambda::Function", - "aws:cdk:cloudformation:props": { - "code": { - "zipFile": "exports.handler = function handlerCode(event, _, callback) {\n return callback(undefined, {\n isBase64Encoded: false,\n statusCode: 200,\n headers: { 'content-type': 'application/json' },\n body: JSON.stringify(event),\n });\n }" - }, - "handler": "index.handler", - "role": { - "Fn::GetAtt": [ - "MyHandlerServiceRoleFFA06653", - "Arn" - ] - }, - "runtime": "nodejs18.x" - } - }, - "constructInfo": { - "fqn": "aws-cdk-lib.aws_lambda.CfnFunction", - "version": "0.0.0" - } - } - }, - "constructInfo": { - "fqn": "aws-cdk-lib.aws_lambda.Function", - "version": "0.0.0" - } - }, - "BootstrapVersion": { - "id": "BootstrapVersion", - "path": "test-apigateway-spec-restapi/BootstrapVersion", - "constructInfo": { - "fqn": "aws-cdk-lib.CfnParameter", - "version": "0.0.0" - } - }, - "CheckBootstrapVersion": { - "id": "CheckBootstrapVersion", - "path": "test-apigateway-spec-restapi/CheckBootstrapVersion", - "constructInfo": { - "fqn": "aws-cdk-lib.CfnRule", - "version": "0.0.0" - } - } - }, - "constructInfo": { - "fqn": "aws-cdk-lib.Stack", - "version": "0.0.0" - } - }, - "apigateway-spec-restapi": { - "id": "apigateway-spec-restapi", - "path": "apigateway-spec-restapi", - "children": { - "DefaultTest": { - "id": "DefaultTest", - "path": "apigateway-spec-restapi/DefaultTest", - "children": { - "Default": { - "id": "Default", - "path": "apigateway-spec-restapi/DefaultTest/Default", - "constructInfo": { - "fqn": "constructs.Construct", - "version": "10.2.70" - } - }, - "DeployAssert": { - "id": "DeployAssert", - "path": "apigateway-spec-restapi/DefaultTest/DeployAssert", - "children": { - "BootstrapVersion": { - "id": "BootstrapVersion", - "path": "apigateway-spec-restapi/DefaultTest/DeployAssert/BootstrapVersion", - "constructInfo": { - "fqn": "aws-cdk-lib.CfnParameter", - "version": "0.0.0" - } - }, - "CheckBootstrapVersion": { - "id": "CheckBootstrapVersion", - "path": "apigateway-spec-restapi/DefaultTest/DeployAssert/CheckBootstrapVersion", - "constructInfo": { - "fqn": "aws-cdk-lib.CfnRule", - "version": "0.0.0" - } - } - }, - "constructInfo": { - "fqn": "aws-cdk-lib.Stack", - "version": "0.0.0" - } - } - }, - "constructInfo": { - "fqn": "@aws-cdk/integ-tests-alpha.IntegTestCase", - "version": "0.0.0" - } - } - }, - "constructInfo": { - "fqn": "@aws-cdk/integ-tests-alpha.IntegTest", - "version": "0.0.0" - } - }, - "Tree": { - "id": "Tree", - "path": "Tree", - "constructInfo": { - "fqn": "constructs.Construct", - "version": "10.2.70" - } - } - }, - "constructInfo": { - "fqn": "aws-cdk-lib.App", - "version": "0.0.0" - } - } -} \ No newline at end of file +{"version":"tree-0.1","tree":{"id":"App","path":"","children":{"test-apigateway-spec-restapi":{"id":"test-apigateway-spec-restapi","path":"test-apigateway-spec-restapi","children":{"my-api":{"id":"my-api","path":"test-apigateway-spec-restapi/my-api","children":{"APIDefinition":{"id":"APIDefinition","path":"test-apigateway-spec-restapi/my-api/APIDefinition","children":{"Stage":{"id":"Stage","path":"test-apigateway-spec-restapi/my-api/APIDefinition/Stage","constructInfo":{"fqn":"aws-cdk-lib.AssetStaging","version":"0.0.0"}},"AssetBucket":{"id":"AssetBucket","path":"test-apigateway-spec-restapi/my-api/APIDefinition/AssetBucket","constructInfo":{"fqn":"aws-cdk-lib.aws_s3.BucketBase","version":"0.0.0","metadata":[]}}},"constructInfo":{"fqn":"aws-cdk-lib.aws_s3_assets.Asset","version":"0.0.0"}},"Resource":{"id":"Resource","path":"test-apigateway-spec-restapi/my-api/Resource","attributes":{"aws:cdk:cloudformation:type":"AWS::ApiGateway::RestApi","aws:cdk:cloudformation:props":{"bodyS3Location":{"bucket":{"Fn::Sub":"cdk-hnb659fds-assets-${AWS::AccountId}-${AWS::Region}"},"key":"68497ac876de4e963fc8f7b5f1b28844c18ecc95e3f7c6e9e0bf250e03c037fb.yaml"},"disableExecuteApiEndpoint":true,"minimumCompressionSize":1024,"mode":"merge","name":"my-api"}},"constructInfo":{"fqn":"aws-cdk-lib.aws_apigateway.CfnRestApi","version":"0.0.0"}},"Default":{"id":"Default","path":"test-apigateway-spec-restapi/my-api/Default","children":{"v1":{"id":"v1","path":"test-apigateway-spec-restapi/my-api/Default/v1","children":{"Resource":{"id":"Resource","path":"test-apigateway-spec-restapi/my-api/Default/v1/Resource","attributes":{"aws:cdk:cloudformation:type":"AWS::ApiGateway::Resource","aws:cdk:cloudformation:props":{"parentId":{"Fn::GetAtt":["myapi4C7BF186","RootResourceId"]},"pathPart":"v1","restApiId":{"Ref":"myapi4C7BF186"}}},"constructInfo":{"fqn":"aws-cdk-lib.aws_apigateway.CfnResource","version":"0.0.0"}},"toys":{"id":"toys","path":"test-apigateway-spec-restapi/my-api/Default/v1/toys","children":{"Resource":{"id":"Resource","path":"test-apigateway-spec-restapi/my-api/Default/v1/toys/Resource","attributes":{"aws:cdk:cloudformation:type":"AWS::ApiGateway::Resource","aws:cdk:cloudformation:props":{"parentId":{"Ref":"myapiv113487378"},"pathPart":"toys","restApiId":{"Ref":"myapi4C7BF186"}}},"constructInfo":{"fqn":"aws-cdk-lib.aws_apigateway.CfnResource","version":"0.0.0"}},"GET":{"id":"GET","path":"test-apigateway-spec-restapi/my-api/Default/v1/toys/GET","children":{"ApiPermission.testapigatewayspecrestapimyapiA4A36FD7.GET..v1.toys":{"id":"ApiPermission.testapigatewayspecrestapimyapiA4A36FD7.GET..v1.toys","path":"test-apigateway-spec-restapi/my-api/Default/v1/toys/GET/ApiPermission.testapigatewayspecrestapimyapiA4A36FD7.GET..v1.toys","attributes":{"aws:cdk:cloudformation:type":"AWS::Lambda::Permission","aws:cdk:cloudformation:props":{"action":"lambda:InvokeFunction","functionName":{"Fn::GetAtt":["MyHandler6B74D312","Arn"]},"principal":"apigateway.amazonaws.com","sourceArn":{"Fn::Join":["",["arn:",{"Ref":"AWS::Partition"},":execute-api:",{"Ref":"AWS::Region"},":",{"Ref":"AWS::AccountId"},":",{"Ref":"myapi4C7BF186"},"/",{"Ref":"myapiDeploymentStagebeta96434BEB"},"/GET/v1/toys"]]}}},"constructInfo":{"fqn":"aws-cdk-lib.aws_lambda.CfnPermission","version":"0.0.0"}},"ApiPermission.Test.testapigatewayspecrestapimyapiA4A36FD7.GET..v1.toys":{"id":"ApiPermission.Test.testapigatewayspecrestapimyapiA4A36FD7.GET..v1.toys","path":"test-apigateway-spec-restapi/my-api/Default/v1/toys/GET/ApiPermission.Test.testapigatewayspecrestapimyapiA4A36FD7.GET..v1.toys","attributes":{"aws:cdk:cloudformation:type":"AWS::Lambda::Permission","aws:cdk:cloudformation:props":{"action":"lambda:InvokeFunction","functionName":{"Fn::GetAtt":["MyHandler6B74D312","Arn"]},"principal":"apigateway.amazonaws.com","sourceArn":{"Fn::Join":["",["arn:",{"Ref":"AWS::Partition"},":execute-api:",{"Ref":"AWS::Region"},":",{"Ref":"AWS::AccountId"},":",{"Ref":"myapi4C7BF186"},"/test-invoke-stage/GET/v1/toys"]]}}},"constructInfo":{"fqn":"aws-cdk-lib.aws_lambda.CfnPermission","version":"0.0.0"}},"Resource":{"id":"Resource","path":"test-apigateway-spec-restapi/my-api/Default/v1/toys/GET/Resource","attributes":{"aws:cdk:cloudformation:type":"AWS::ApiGateway::Method","aws:cdk:cloudformation:props":{"apiKeyRequired":true,"authorizationType":"NONE","httpMethod":"GET","integration":{"type":"AWS_PROXY","uri":{"Fn::Join":["",["arn:",{"Ref":"AWS::Partition"},":apigateway:",{"Ref":"AWS::Region"},":lambda:path/2015-03-31/functions/",{"Fn::GetAtt":["MyHandler6B74D312","Arn"]},"/invocations"]]},"integrationHttpMethod":"POST"},"resourceId":{"Ref":"myapiv1toysA55FCBC4"},"restApiId":{"Ref":"myapi4C7BF186"}}},"constructInfo":{"fqn":"aws-cdk-lib.aws_apigateway.CfnMethod","version":"0.0.0"}}},"constructInfo":{"fqn":"aws-cdk-lib.aws_apigateway.Method","version":"0.0.0","metadata":[{"resource":"*","httpMethod":"*","integration":"*","options":{"apiKeyRequired":true}}]}},"POST":{"id":"POST","path":"test-apigateway-spec-restapi/my-api/Default/v1/toys/POST","children":{"Resource":{"id":"Resource","path":"test-apigateway-spec-restapi/my-api/Default/v1/toys/POST/Resource","attributes":{"aws:cdk:cloudformation:type":"AWS::ApiGateway::Method","aws:cdk:cloudformation:props":{"authorizationType":"NONE","httpMethod":"POST","integration":{"type":"MOCK"},"resourceId":{"Ref":"myapiv1toysA55FCBC4"},"restApiId":{"Ref":"myapi4C7BF186"}}},"constructInfo":{"fqn":"aws-cdk-lib.aws_apigateway.CfnMethod","version":"0.0.0"}}},"constructInfo":{"fqn":"aws-cdk-lib.aws_apigateway.Method","version":"0.0.0","metadata":[{"resource":"*","httpMethod":"*","integration":"*","options":"*"}]}},"PUT":{"id":"PUT","path":"test-apigateway-spec-restapi/my-api/Default/v1/toys/PUT","children":{"Resource":{"id":"Resource","path":"test-apigateway-spec-restapi/my-api/Default/v1/toys/PUT/Resource","attributes":{"aws:cdk:cloudformation:type":"AWS::ApiGateway::Method","aws:cdk:cloudformation:props":{"authorizationType":"NONE","httpMethod":"PUT","integration":{"type":"MOCK"},"resourceId":{"Ref":"myapiv1toysA55FCBC4"},"restApiId":{"Ref":"myapi4C7BF186"}}},"constructInfo":{"fqn":"aws-cdk-lib.aws_apigateway.CfnMethod","version":"0.0.0"}}},"constructInfo":{"fqn":"aws-cdk-lib.aws_apigateway.Method","version":"0.0.0","metadata":[{"resource":"*","httpMethod":"*","integration":"*","options":"*"}]}}},"constructInfo":{"fqn":"aws-cdk-lib.aws_apigateway.Resource","version":"0.0.0","metadata":[{"pathPart":"*"}]}},"appliances":{"id":"appliances","path":"test-apigateway-spec-restapi/my-api/Default/v1/appliances","children":{"Resource":{"id":"Resource","path":"test-apigateway-spec-restapi/my-api/Default/v1/appliances/Resource","attributes":{"aws:cdk:cloudformation:type":"AWS::ApiGateway::Resource","aws:cdk:cloudformation:props":{"parentId":{"Ref":"myapiv113487378"},"pathPart":"appliances","restApiId":{"Ref":"myapi4C7BF186"}}},"constructInfo":{"fqn":"aws-cdk-lib.aws_apigateway.CfnResource","version":"0.0.0"}},"GET":{"id":"GET","path":"test-apigateway-spec-restapi/my-api/Default/v1/appliances/GET","children":{"Resource":{"id":"Resource","path":"test-apigateway-spec-restapi/my-api/Default/v1/appliances/GET/Resource","attributes":{"aws:cdk:cloudformation:type":"AWS::ApiGateway::Method","aws:cdk:cloudformation:props":{"authorizationType":"NONE","httpMethod":"GET","integration":{"type":"MOCK"},"resourceId":{"Ref":"myapiv1appliances507FEFF4"},"restApiId":{"Ref":"myapi4C7BF186"}}},"constructInfo":{"fqn":"aws-cdk-lib.aws_apigateway.CfnMethod","version":"0.0.0"}}},"constructInfo":{"fqn":"aws-cdk-lib.aws_apigateway.Method","version":"0.0.0","metadata":[{"resource":"*","httpMethod":"*","integration":"*","options":"*"}]}}},"constructInfo":{"fqn":"aws-cdk-lib.aws_apigateway.Resource","version":"0.0.0","metadata":[{"pathPart":"*"}]}},"books":{"id":"books","path":"test-apigateway-spec-restapi/my-api/Default/v1/books","children":{"Resource":{"id":"Resource","path":"test-apigateway-spec-restapi/my-api/Default/v1/books/Resource","attributes":{"aws:cdk:cloudformation:type":"AWS::ApiGateway::Resource","aws:cdk:cloudformation:props":{"parentId":{"Ref":"myapiv113487378"},"pathPart":"books","restApiId":{"Ref":"myapi4C7BF186"}}},"constructInfo":{"fqn":"aws-cdk-lib.aws_apigateway.CfnResource","version":"0.0.0"}},"GET":{"id":"GET","path":"test-apigateway-spec-restapi/my-api/Default/v1/books/GET","children":{"ApiPermission.testapigatewayspecrestapimyapiA4A36FD7.GET..v1.books":{"id":"ApiPermission.testapigatewayspecrestapimyapiA4A36FD7.GET..v1.books","path":"test-apigateway-spec-restapi/my-api/Default/v1/books/GET/ApiPermission.testapigatewayspecrestapimyapiA4A36FD7.GET..v1.books","attributes":{"aws:cdk:cloudformation:type":"AWS::Lambda::Permission","aws:cdk:cloudformation:props":{"action":"lambda:InvokeFunction","functionName":{"Fn::GetAtt":["MyHandler6B74D312","Arn"]},"principal":"apigateway.amazonaws.com","sourceArn":{"Fn::Join":["",["arn:",{"Ref":"AWS::Partition"},":execute-api:",{"Ref":"AWS::Region"},":",{"Ref":"AWS::AccountId"},":",{"Ref":"myapi4C7BF186"},"/",{"Ref":"myapiDeploymentStagebeta96434BEB"},"/GET/v1/books"]]}}},"constructInfo":{"fqn":"aws-cdk-lib.aws_lambda.CfnPermission","version":"0.0.0"}},"ApiPermission.Test.testapigatewayspecrestapimyapiA4A36FD7.GET..v1.books":{"id":"ApiPermission.Test.testapigatewayspecrestapimyapiA4A36FD7.GET..v1.books","path":"test-apigateway-spec-restapi/my-api/Default/v1/books/GET/ApiPermission.Test.testapigatewayspecrestapimyapiA4A36FD7.GET..v1.books","attributes":{"aws:cdk:cloudformation:type":"AWS::Lambda::Permission","aws:cdk:cloudformation:props":{"action":"lambda:InvokeFunction","functionName":{"Fn::GetAtt":["MyHandler6B74D312","Arn"]},"principal":"apigateway.amazonaws.com","sourceArn":{"Fn::Join":["",["arn:",{"Ref":"AWS::Partition"},":execute-api:",{"Ref":"AWS::Region"},":",{"Ref":"AWS::AccountId"},":",{"Ref":"myapi4C7BF186"},"/test-invoke-stage/GET/v1/books"]]}}},"constructInfo":{"fqn":"aws-cdk-lib.aws_lambda.CfnPermission","version":"0.0.0"}},"Resource":{"id":"Resource","path":"test-apigateway-spec-restapi/my-api/Default/v1/books/GET/Resource","attributes":{"aws:cdk:cloudformation:type":"AWS::ApiGateway::Method","aws:cdk:cloudformation:props":{"authorizationType":"NONE","httpMethod":"GET","integration":{"type":"AWS_PROXY","uri":{"Fn::Join":["",["arn:",{"Ref":"AWS::Partition"},":apigateway:",{"Ref":"AWS::Region"},":lambda:path/2015-03-31/functions/",{"Fn::GetAtt":["MyHandler6B74D312","Arn"]},"/invocations"]]},"integrationHttpMethod":"POST"},"resourceId":{"Ref":"myapiv1books1D4BE6C1"},"restApiId":{"Ref":"myapi4C7BF186"}}},"constructInfo":{"fqn":"aws-cdk-lib.aws_apigateway.CfnMethod","version":"0.0.0"}}},"constructInfo":{"fqn":"aws-cdk-lib.aws_apigateway.Method","version":"0.0.0","metadata":[{"resource":"*","httpMethod":"*","integration":"*","options":"*"}]}},"POST":{"id":"POST","path":"test-apigateway-spec-restapi/my-api/Default/v1/books/POST","children":{"ApiPermission.testapigatewayspecrestapimyapiA4A36FD7.POST..v1.books":{"id":"ApiPermission.testapigatewayspecrestapimyapiA4A36FD7.POST..v1.books","path":"test-apigateway-spec-restapi/my-api/Default/v1/books/POST/ApiPermission.testapigatewayspecrestapimyapiA4A36FD7.POST..v1.books","attributes":{"aws:cdk:cloudformation:type":"AWS::Lambda::Permission","aws:cdk:cloudformation:props":{"action":"lambda:InvokeFunction","functionName":{"Fn::GetAtt":["MyHandler6B74D312","Arn"]},"principal":"apigateway.amazonaws.com","sourceArn":{"Fn::Join":["",["arn:",{"Ref":"AWS::Partition"},":execute-api:",{"Ref":"AWS::Region"},":",{"Ref":"AWS::AccountId"},":",{"Ref":"myapi4C7BF186"},"/",{"Ref":"myapiDeploymentStagebeta96434BEB"},"/POST/v1/books"]]}}},"constructInfo":{"fqn":"aws-cdk-lib.aws_lambda.CfnPermission","version":"0.0.0"}},"ApiPermission.Test.testapigatewayspecrestapimyapiA4A36FD7.POST..v1.books":{"id":"ApiPermission.Test.testapigatewayspecrestapimyapiA4A36FD7.POST..v1.books","path":"test-apigateway-spec-restapi/my-api/Default/v1/books/POST/ApiPermission.Test.testapigatewayspecrestapimyapiA4A36FD7.POST..v1.books","attributes":{"aws:cdk:cloudformation:type":"AWS::Lambda::Permission","aws:cdk:cloudformation:props":{"action":"lambda:InvokeFunction","functionName":{"Fn::GetAtt":["MyHandler6B74D312","Arn"]},"principal":"apigateway.amazonaws.com","sourceArn":{"Fn::Join":["",["arn:",{"Ref":"AWS::Partition"},":execute-api:",{"Ref":"AWS::Region"},":",{"Ref":"AWS::AccountId"},":",{"Ref":"myapi4C7BF186"},"/test-invoke-stage/POST/v1/books"]]}}},"constructInfo":{"fqn":"aws-cdk-lib.aws_lambda.CfnPermission","version":"0.0.0"}},"Resource":{"id":"Resource","path":"test-apigateway-spec-restapi/my-api/Default/v1/books/POST/Resource","attributes":{"aws:cdk:cloudformation:type":"AWS::ApiGateway::Method","aws:cdk:cloudformation:props":{"authorizationType":"NONE","httpMethod":"POST","integration":{"type":"AWS_PROXY","uri":{"Fn::Join":["",["arn:",{"Ref":"AWS::Partition"},":apigateway:",{"Ref":"AWS::Region"},":lambda:path/2015-03-31/functions/",{"Fn::GetAtt":["MyHandler6B74D312","Arn"]},"/invocations"]]},"integrationHttpMethod":"POST"},"resourceId":{"Ref":"myapiv1books1D4BE6C1"},"restApiId":{"Ref":"myapi4C7BF186"}}},"constructInfo":{"fqn":"aws-cdk-lib.aws_apigateway.CfnMethod","version":"0.0.0"}}},"constructInfo":{"fqn":"aws-cdk-lib.aws_apigateway.Method","version":"0.0.0","metadata":[{"resource":"*","httpMethod":"*","integration":"*","options":"*"}]}}},"constructInfo":{"fqn":"aws-cdk-lib.aws_apigateway.Resource","version":"0.0.0","metadata":[{"pathPart":"*"}]}}},"constructInfo":{"fqn":"aws-cdk-lib.aws_apigateway.Resource","version":"0.0.0","metadata":[{"pathPart":"*"}]}}},"constructInfo":{"fqn":"aws-cdk-lib.aws_apigateway.ResourceBase","version":"0.0.0","metadata":["*"]}},"CloudWatchRole":{"id":"CloudWatchRole","path":"test-apigateway-spec-restapi/my-api/CloudWatchRole","children":{"ImportCloudWatchRole":{"id":"ImportCloudWatchRole","path":"test-apigateway-spec-restapi/my-api/CloudWatchRole/ImportCloudWatchRole","constructInfo":{"fqn":"aws-cdk-lib.Resource","version":"0.0.0","metadata":["*"]}},"Resource":{"id":"Resource","path":"test-apigateway-spec-restapi/my-api/CloudWatchRole/Resource","attributes":{"aws:cdk:cloudformation:type":"AWS::IAM::Role","aws:cdk:cloudformation:props":{"assumeRolePolicyDocument":{"Statement":[{"Action":"sts:AssumeRole","Effect":"Allow","Principal":{"Service":"apigateway.amazonaws.com"}}],"Version":"2012-10-17"},"managedPolicyArns":[{"Fn::Join":["",["arn:",{"Ref":"AWS::Partition"},":iam::aws:policy/service-role/AmazonAPIGatewayPushToCloudWatchLogs"]]}]}},"constructInfo":{"fqn":"aws-cdk-lib.aws_iam.CfnRole","version":"0.0.0"}}},"constructInfo":{"fqn":"aws-cdk-lib.aws_iam.Role","version":"0.0.0","metadata":[{"assumedBy":{"principalAccount":"*","assumeRoleAction":"*"},"managedPolicies":[{"managedPolicyArn":"*"}]},{"applyRemovalPolicy":["retain"]}]}},"Account":{"id":"Account","path":"test-apigateway-spec-restapi/my-api/Account","attributes":{"aws:cdk:cloudformation:type":"AWS::ApiGateway::Account","aws:cdk:cloudformation:props":{"cloudWatchRoleArn":{"Fn::GetAtt":["myapiCloudWatchRole095452E5","Arn"]}}},"constructInfo":{"fqn":"aws-cdk-lib.aws_apigateway.CfnAccount","version":"0.0.0"}},"Deployment":{"id":"Deployment","path":"test-apigateway-spec-restapi/my-api/Deployment","children":{"Resource":{"id":"Resource","path":"test-apigateway-spec-restapi/my-api/Deployment/Resource","attributes":{"aws:cdk:cloudformation:type":"AWS::ApiGateway::Deployment","aws:cdk:cloudformation:props":{"description":"beta stage","restApiId":{"Ref":"myapi4C7BF186"}}},"constructInfo":{"fqn":"aws-cdk-lib.aws_apigateway.CfnDeployment","version":"0.0.0"}}},"constructInfo":{"fqn":"aws-cdk-lib.aws_apigateway.Deployment","version":"0.0.0","metadata":[{"description":"*","api":"*","retainDeployments":true},{"addToLogicalId":[{}]},{"addToLogicalId":[{}]},{"addToLogicalId":[{}]},{"addToLogicalId":[{}]},{"addToLogicalId":[{}]},{"addToLogicalId":[{}]},{"addToLogicalId":[{}]},{"addToLogicalId":[{}]},{"addToLogicalId":[{}]},{"addToLogicalId":[{}]}]}},"DeploymentStage.beta":{"id":"DeploymentStage.beta","path":"test-apigateway-spec-restapi/my-api/DeploymentStage.beta","children":{"Resource":{"id":"Resource","path":"test-apigateway-spec-restapi/my-api/DeploymentStage.beta/Resource","attributes":{"aws:cdk:cloudformation:type":"AWS::ApiGateway::Stage","aws:cdk:cloudformation:props":{"cacheClusterEnabled":true,"cacheClusterSize":"0.5","deploymentId":{"Ref":"myapiDeployment92F2CB491b0e40e722acabc99cc39958c957686d"},"description":"beta stage","methodSettings":[{"httpMethod":"*","resourcePath":"/*","dataTraceEnabled":true,"loggingLevel":"INFO"},{"httpMethod":"GET","resourcePath":"/~1api~1appliances","cachingEnabled":true,"dataTraceEnabled":false}],"restApiId":{"Ref":"myapi4C7BF186"},"stageName":"beta"}},"constructInfo":{"fqn":"aws-cdk-lib.aws_apigateway.CfnStage","version":"0.0.0"}}},"constructInfo":{"fqn":"aws-cdk-lib.aws_apigateway.Stage","version":"0.0.0","metadata":[{"deployment":"*","cacheClusterEnabled":true,"stageName":"*","description":"*","loggingLevel":"INFO","dataTraceEnabled":true,"methodOptions":"*"}]}},"Endpoint":{"id":"Endpoint","path":"test-apigateway-spec-restapi/my-api/Endpoint","constructInfo":{"fqn":"aws-cdk-lib.CfnOutput","version":"0.0.0"}},"ApiKey":{"id":"ApiKey","path":"test-apigateway-spec-restapi/my-api/ApiKey","children":{"Resource":{"id":"Resource","path":"test-apigateway-spec-restapi/my-api/ApiKey/Resource","attributes":{"aws:cdk:cloudformation:type":"AWS::ApiGateway::ApiKey","aws:cdk:cloudformation:props":{"enabled":true,"stageKeys":[{"restApiId":{"Ref":"myapi4C7BF186"},"stageName":{"Ref":"myapiDeploymentStagebeta96434BEB"}}]}},"constructInfo":{"fqn":"aws-cdk-lib.aws_apigateway.CfnApiKey","version":"0.0.0"}}},"constructInfo":{"fqn":"aws-cdk-lib.aws_apigateway.ApiKey","version":"0.0.0","metadata":[{"stages":["*"]}]}},"UsagePlan":{"id":"UsagePlan","path":"test-apigateway-spec-restapi/my-api/UsagePlan","children":{"Resource":{"id":"Resource","path":"test-apigateway-spec-restapi/my-api/UsagePlan/Resource","attributes":{"aws:cdk:cloudformation:type":"AWS::ApiGateway::UsagePlan","aws:cdk:cloudformation:props":{"apiStages":[{"apiId":{"Ref":"myapi4C7BF186"},"stage":{"Ref":"myapiDeploymentStagebeta96434BEB"},"throttle":{"/v1/toys/GET":{"burstLimit":2,"rateLimit":10}}}],"description":"Free tier monthly usage plan","quota":{"limit":10000,"period":"MONTH"},"throttle":{"rateLimit":5},"usagePlanName":"Basic"}},"constructInfo":{"fqn":"aws-cdk-lib.aws_apigateway.CfnUsagePlan","version":"0.0.0"}},"UsagePlanKeyResource:testapigatewayspecrestapimyapiApiKey950FF760":{"id":"UsagePlanKeyResource:testapigatewayspecrestapimyapiApiKey950FF760","path":"test-apigateway-spec-restapi/my-api/UsagePlan/UsagePlanKeyResource:testapigatewayspecrestapimyapiApiKey950FF760","attributes":{"aws:cdk:cloudformation:type":"AWS::ApiGateway::UsagePlanKey","aws:cdk:cloudformation:props":{"keyId":{"Ref":"myapiApiKey43446CCF"},"keyType":"API_KEY","usagePlanId":{"Ref":"myapiUsagePlan56F9C4F2"}}},"constructInfo":{"fqn":"aws-cdk-lib.aws_apigateway.CfnUsagePlanKey","version":"0.0.0"}}},"constructInfo":{"fqn":"aws-cdk-lib.aws_apigateway.UsagePlan","version":"0.0.0","metadata":[{"name":"*","apiKey":"*","description":"*","throttle":{"rateLimit":"*"},"quota":{"limit":"*","period":"MONTH"}},{"addApiStage":[{"throttle":[{"method":"*","throttle":{"rateLimit":"*","burstLimit":"*"}}]}]}]}}},"constructInfo":{"fqn":"aws-cdk-lib.aws_apigateway.SpecRestApi","version":"0.0.0","metadata":[{"apiDefinition":"*","disableExecuteApiEndpoint":true,"minCompressionSize":"*","retainDeployments":true,"cloudWatchRole":true,"deployOptions":{"cacheClusterEnabled":true,"stageName":"*","description":"*","loggingLevel":"INFO","dataTraceEnabled":true,"methodOptions":"*"}}]}},"MyHandler":{"id":"MyHandler","path":"test-apigateway-spec-restapi/MyHandler","children":{"ServiceRole":{"id":"ServiceRole","path":"test-apigateway-spec-restapi/MyHandler/ServiceRole","children":{"ImportServiceRole":{"id":"ImportServiceRole","path":"test-apigateway-spec-restapi/MyHandler/ServiceRole/ImportServiceRole","constructInfo":{"fqn":"aws-cdk-lib.Resource","version":"0.0.0","metadata":["*"]}},"Resource":{"id":"Resource","path":"test-apigateway-spec-restapi/MyHandler/ServiceRole/Resource","attributes":{"aws:cdk:cloudformation:type":"AWS::IAM::Role","aws:cdk:cloudformation:props":{"assumeRolePolicyDocument":{"Statement":[{"Action":"sts:AssumeRole","Effect":"Allow","Principal":{"Service":"lambda.amazonaws.com"}}],"Version":"2012-10-17"},"managedPolicyArns":[{"Fn::Join":["",["arn:",{"Ref":"AWS::Partition"},":iam::aws:policy/service-role/AWSLambdaBasicExecutionRole"]]}]}},"constructInfo":{"fqn":"aws-cdk-lib.aws_iam.CfnRole","version":"0.0.0"}}},"constructInfo":{"fqn":"aws-cdk-lib.aws_iam.Role","version":"0.0.0","metadata":[{"assumedBy":{"principalAccount":"*","assumeRoleAction":"*"},"managedPolicies":[{"managedPolicyArn":"*"}]}]}},"Resource":{"id":"Resource","path":"test-apigateway-spec-restapi/MyHandler/Resource","attributes":{"aws:cdk:cloudformation:type":"AWS::Lambda::Function","aws:cdk:cloudformation:props":{"code":{"zipFile":"exports.handler = function handlerCode(event, _, callback) {\n return callback(undefined, {\n isBase64Encoded: false,\n statusCode: 200,\n headers: { 'content-type': 'application/json' },\n body: JSON.stringify(event),\n });\n }"},"handler":"index.handler","role":{"Fn::GetAtt":["MyHandlerServiceRoleFFA06653","Arn"]},"runtime":"nodejs18.x"}},"constructInfo":{"fqn":"aws-cdk-lib.aws_lambda.CfnFunction","version":"0.0.0"}}},"constructInfo":{"fqn":"aws-cdk-lib.aws_lambda.Function","version":"0.0.0","metadata":[{"runtime":"*","code":"*","handler":"*"}]}},"BootstrapVersion":{"id":"BootstrapVersion","path":"test-apigateway-spec-restapi/BootstrapVersion","constructInfo":{"fqn":"aws-cdk-lib.CfnParameter","version":"0.0.0"}},"CheckBootstrapVersion":{"id":"CheckBootstrapVersion","path":"test-apigateway-spec-restapi/CheckBootstrapVersion","constructInfo":{"fqn":"aws-cdk-lib.CfnRule","version":"0.0.0"}}},"constructInfo":{"fqn":"aws-cdk-lib.Stack","version":"0.0.0"}},"apigateway-spec-restapi":{"id":"apigateway-spec-restapi","path":"apigateway-spec-restapi","children":{"DefaultTest":{"id":"DefaultTest","path":"apigateway-spec-restapi/DefaultTest","children":{"Default":{"id":"Default","path":"apigateway-spec-restapi/DefaultTest/Default","constructInfo":{"fqn":"constructs.Construct","version":"10.4.2"}},"DeployAssert":{"id":"DeployAssert","path":"apigateway-spec-restapi/DefaultTest/DeployAssert","children":{"BootstrapVersion":{"id":"BootstrapVersion","path":"apigateway-spec-restapi/DefaultTest/DeployAssert/BootstrapVersion","constructInfo":{"fqn":"aws-cdk-lib.CfnParameter","version":"0.0.0"}},"CheckBootstrapVersion":{"id":"CheckBootstrapVersion","path":"apigateway-spec-restapi/DefaultTest/DeployAssert/CheckBootstrapVersion","constructInfo":{"fqn":"aws-cdk-lib.CfnRule","version":"0.0.0"}}},"constructInfo":{"fqn":"aws-cdk-lib.Stack","version":"0.0.0"}}},"constructInfo":{"fqn":"@aws-cdk/integ-tests-alpha.IntegTestCase","version":"0.0.0"}}},"constructInfo":{"fqn":"@aws-cdk/integ-tests-alpha.IntegTest","version":"0.0.0"}},"Tree":{"id":"Tree","path":"Tree","constructInfo":{"fqn":"constructs.Construct","version":"10.4.2"}}},"constructInfo":{"fqn":"aws-cdk-lib.App","version":"0.0.0"}}} \ No newline at end of file diff --git a/packages/@aws-cdk-testing/framework-integ/test/aws-apigateway/test/integ.spec-restapi.ts b/packages/@aws-cdk-testing/framework-integ/test/aws-apigateway/test/integ.spec-restapi.ts index 1baa737b2139f..63fc66d77ab0e 100644 --- a/packages/@aws-cdk-testing/framework-integ/test/aws-apigateway/test/integ.spec-restapi.ts +++ b/packages/@aws-cdk-testing/framework-integ/test/aws-apigateway/test/integ.spec-restapi.ts @@ -28,6 +28,7 @@ class Test extends cdk.Stack { }, }, }, + mode: apigateway.RestApiMode.MERGE, }); const handler = new lambda.Function(this, 'MyHandler', { From 3c44a3091807b60dca978368d6067004980ccf58 Mon Sep 17 00:00:00 2001 From: tttol Date: Tue, 22 Apr 2025 06:38:43 +0900 Subject: [PATCH 10/16] chore --- packages/aws-cdk-lib/aws-apigateway/test/restapi.test.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/aws-cdk-lib/aws-apigateway/test/restapi.test.ts b/packages/aws-cdk-lib/aws-apigateway/test/restapi.test.ts index 920ef42a5a39b..648debb957b91 100644 --- a/packages/aws-cdk-lib/aws-apigateway/test/restapi.test.ts +++ b/packages/aws-cdk-lib/aws-apigateway/test/restapi.test.ts @@ -1420,7 +1420,7 @@ describe('SpecRestApi', () => { test.each([ [apigw.RestApiMode.OVERWRITE, 'overwrite'], [apigw.RestApiMode.MERGE, 'merge'], - [undefined, Match.absent()], + [undefined, undefined], ])('mode property is set (%s)', (mode, expectedMode) => { // WHEN const api = new apigw.SpecRestApi(stack, 'api', { From 086bd6ab87fa74512e5461271ec71f99f86bb8a9 Mon Sep 17 00:00:00 2001 From: tttol Date: Tue, 22 Apr 2025 07:24:43 +0900 Subject: [PATCH 11/16] rm empty line --- packages/aws-cdk-lib/aws-apigateway/test/restapi.test.ts | 1 - 1 file changed, 1 deletion(-) diff --git a/packages/aws-cdk-lib/aws-apigateway/test/restapi.test.ts b/packages/aws-cdk-lib/aws-apigateway/test/restapi.test.ts index 648debb957b91..cebd1e35e79c6 100644 --- a/packages/aws-cdk-lib/aws-apigateway/test/restapi.test.ts +++ b/packages/aws-cdk-lib/aws-apigateway/test/restapi.test.ts @@ -915,7 +915,6 @@ describe('restapi', () => { }); }).toThrow(/'cloudWatchRole' must be enabled for 'cloudWatchRoleRemovalPolicy' to be applied./); }); - }); describe('Import', () => { From b210b752a31110c9813d2d04be21940208d381ce Mon Sep 17 00:00:00 2001 From: Toru Takahashi Date: Tue, 22 Apr 2025 19:42:59 +0900 Subject: [PATCH 12/16] Update packages/aws-cdk-lib/aws-apigateway/lib/restapi.ts Co-authored-by: Kenta Goto (k.goto) <24818752+go-to-k@users.noreply.github.com> --- packages/aws-cdk-lib/aws-apigateway/lib/restapi.ts | 1 - 1 file changed, 1 deletion(-) diff --git a/packages/aws-cdk-lib/aws-apigateway/lib/restapi.ts b/packages/aws-cdk-lib/aws-apigateway/lib/restapi.ts index 1078862742827..700e6006d9646 100644 --- a/packages/aws-cdk-lib/aws-apigateway/lib/restapi.ts +++ b/packages/aws-cdk-lib/aws-apigateway/lib/restapi.ts @@ -275,7 +275,6 @@ export interface RestApiProps extends RestApiOptions { * @default - Metering is disabled. */ readonly apiKeySourceType?: ApiKeySourceType; - } /** From 087fe893fa3e124c419cc7f0f6b305d405546d5c Mon Sep 17 00:00:00 2001 From: Toru Takahashi Date: Tue, 22 Apr 2025 19:43:39 +0900 Subject: [PATCH 13/16] Update packages/aws-cdk-lib/aws-apigateway/lib/restapi.ts Co-authored-by: Kenta Goto (k.goto) <24818752+go-to-k@users.noreply.github.com> --- packages/aws-cdk-lib/aws-apigateway/lib/restapi.ts | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/packages/aws-cdk-lib/aws-apigateway/lib/restapi.ts b/packages/aws-cdk-lib/aws-apigateway/lib/restapi.ts index 700e6006d9646..0fb3dea692166 100644 --- a/packages/aws-cdk-lib/aws-apigateway/lib/restapi.ts +++ b/packages/aws-cdk-lib/aws-apigateway/lib/restapi.ts @@ -300,8 +300,7 @@ export interface SpecRestApiProps extends RestApiBaseProps { readonly minCompressionSize?: Size; /** - * This property applies only when you use OpenAPI to define your REST API. - * The Mode determines how API Gateway handles resource updates. + * The Mode that determines how API Gateway handles resource updates. * * Valid values are `overwrite` or `merge`. * From de68b4f8d792e97818e398a031680fe999d8a4f8 Mon Sep 17 00:00:00 2001 From: Toru Takahashi Date: Tue, 22 Apr 2025 19:43:46 +0900 Subject: [PATCH 14/16] Update packages/aws-cdk-lib/aws-apigateway/lib/restapi.ts Co-authored-by: Kenta Goto (k.goto) <24818752+go-to-k@users.noreply.github.com> --- packages/aws-cdk-lib/aws-apigateway/lib/restapi.ts | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/packages/aws-cdk-lib/aws-apigateway/lib/restapi.ts b/packages/aws-cdk-lib/aws-apigateway/lib/restapi.ts index 0fb3dea692166..2bfad98e21cfb 100644 --- a/packages/aws-cdk-lib/aws-apigateway/lib/restapi.ts +++ b/packages/aws-cdk-lib/aws-apigateway/lib/restapi.ts @@ -1081,8 +1081,7 @@ export enum EndpointType { } /** - * Specifies how API Gateway handles resource updates when importing an OpenAPI definition. - * This property applies only when you use OpenAPI to define your REST API. + * The Mode that determines how API Gateway handles resource updates when importing an OpenAPI definition. */ export enum RestApiMode { /** From 5ae6b9cd8c1131cd11ebc75b75bfebdded8ace09 Mon Sep 17 00:00:00 2001 From: tttol Date: Tue, 22 Apr 2025 20:29:51 +0900 Subject: [PATCH 15/16] fix README --- packages/aws-cdk-lib/aws-apigateway/README.md | 33 ++++++++++--------- 1 file changed, 17 insertions(+), 16 deletions(-) diff --git a/packages/aws-cdk-lib/aws-apigateway/README.md b/packages/aws-cdk-lib/aws-apigateway/README.md index 7b309c47af5d8..e5b76ff49f033 100644 --- a/packages/aws-cdk-lib/aws-apigateway/README.md +++ b/packages/aws-cdk-lib/aws-apigateway/README.md @@ -1604,7 +1604,23 @@ booksResource.addMethod('GET', integration); It is possible to use the `addResource()` API to define additional API Gateway Resources. -You can control how API Gateway handles resource updates using the `mode` property. Valid values are: + +**Note:** Deployment will fail if a Resource of the same name is already defined in the Open API specification. + +**Note:** Any default properties configured, such as `defaultIntegration`, `defaultMethodOptions`, etc. will only be +applied to Resources and Methods defined in the CDK, and not the ones defined in the spec. Use the [API Gateway +extensions to OpenAPI](https://docs.aws.amazon.com/apigateway/latest/developerguide/api-gateway-swagger-extensions.html) +to configure these. + +There are a number of limitations in using OpenAPI definitions in API Gateway. Read the [Amazon API Gateway important +notes for REST APIs](https://docs.aws.amazon.com/apigateway/latest/developerguide/api-gateway-known-issues.html#api-gateway-known-issues-rest-apis) +for more details. + +**Note:** When starting off with an OpenAPI definition using `SpecRestApi`, it is not possible to configure some +properties that can be configured directly in the OpenAPI specification file. This is to prevent people duplication +of these properties and potential confusion. + +However, you can control how API Gateway handles resource updates using the `mode` property. Valid values are: * `overwrite` - The new API definition replaces the existing one. The existing API identifier remains unchanged. * `merge` - The new API definition is merged with the existing API. @@ -1623,21 +1639,6 @@ const api = new apigateway.SpecRestApi(this, 'books-api', { }); ``` -**Note:** Deployment will fail if a Resource of the same name is already defined in the Open API specification. - -**Note:** Any default properties configured, such as `defaultIntegration`, `defaultMethodOptions`, etc. will only be -applied to Resources and Methods defined in the CDK, and not the ones defined in the spec. Use the [API Gateway -extensions to OpenAPI](https://docs.aws.amazon.com/apigateway/latest/developerguide/api-gateway-swagger-extensions.html) -to configure these. - -There are a number of limitations in using OpenAPI definitions in API Gateway. Read the [Amazon API Gateway important -notes for REST APIs](https://docs.aws.amazon.com/apigateway/latest/developerguide/api-gateway-known-issues.html#api-gateway-known-issues-rest-apis) -for more details. - -**Note:** When starting off with an OpenAPI definition using `SpecRestApi`, it is not possible to configure some -properties that can be configured directly in the OpenAPI specification file. This is to prevent people duplication -of these properties and potential confusion. - ### Endpoint configuration By default, `SpecRestApi` will create an edge optimized endpoint. From 693dc9682f9786bd1f8ab4acce7de78166ece4dd Mon Sep 17 00:00:00 2001 From: Toru Takahashi Date: Tue, 22 Apr 2025 20:36:35 +0900 Subject: [PATCH 16/16] Update packages/aws-cdk-lib/aws-apigateway/README.md Co-authored-by: Kenta Goto (k.goto) <24818752+go-to-k@users.noreply.github.com> --- packages/aws-cdk-lib/aws-apigateway/README.md | 1 - 1 file changed, 1 deletion(-) diff --git a/packages/aws-cdk-lib/aws-apigateway/README.md b/packages/aws-cdk-lib/aws-apigateway/README.md index e5b76ff49f033..62319d1b506e7 100644 --- a/packages/aws-cdk-lib/aws-apigateway/README.md +++ b/packages/aws-cdk-lib/aws-apigateway/README.md @@ -1604,7 +1604,6 @@ booksResource.addMethod('GET', integration); It is possible to use the `addResource()` API to define additional API Gateway Resources. - **Note:** Deployment will fail if a Resource of the same name is already defined in the Open API specification. **Note:** Any default properties configured, such as `defaultIntegration`, `defaultMethodOptions`, etc. will only be