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', { diff --git a/packages/aws-cdk-lib/aws-apigateway/README.md b/packages/aws-cdk-lib/aws-apigateway/README.md index 76dc92b71aa8b..62319d1b506e7 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) @@ -1615,6 +1619,25 @@ for more details. 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. + +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 +}); +``` + ### Endpoint configuration By default, `SpecRestApi` will create an edge optimized endpoint. @@ -1667,4 +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. \ 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 12541570c6f15..2bfad98e21cfb 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 */ @@ -298,6 +298,27 @@ export interface SpecRestApiProps extends RestApiBaseProps { * @default - Compression is disabled. */ readonly minCompressionSize?: Size; + + /** + * The Mode that 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; } /** @@ -754,6 +775,7 @@ export class SpecRestApi extends RestApiBase { endpointConfiguration: this._configureEndpoints(props), parameters: props.parameters, disableExecuteApiEndpoint: props.disableExecuteApiEndpoint, + mode: props.mode, }); props.apiDefinition.bindAfterCreate(this, this); @@ -1058,6 +1080,21 @@ export enum EndpointType { PRIVATE = 'PRIVATE', } +/** + * The Mode that determines how API Gateway handles resource updates when importing an OpenAPI definition. + */ +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; 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..cebd1e35e79c6 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'; @@ -1416,6 +1416,26 @@ describe('SpecRestApi', () => { }); }); + test.each([ + [apigw.RestApiMode.OVERWRITE, 'overwrite'], + [apigw.RestApiMode.MERGE, 'merge'], + [undefined, undefined], + ])('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