From 6f9fcd624b777d9be21796da181aff9470570057 Mon Sep 17 00:00:00 2001 From: Olli Date: Tue, 22 Aug 2023 16:09:05 +0300 Subject: [PATCH] fix(apigateway): deployOptions.description is not used for deployment's description (#26149) When creating an instance of a `RestApi` construct, by default it has a `Deployment` attached to it. The description of the `Deployment` can be configured with an option given to the `RestApi`, like so: ```tsx const api = new RestApi(this, 'Api', { restApiName: 'MyApi', deployOptions: { description: 'Deployment description' } }); ``` However, looking at the [source code](https://github.com/aws/aws-cdk/blob/72eb1e957afb9d1573445999eddd38b5c345fa7a/packages/aws-cdk-lib/aws-apigateway/lib/restapi.ts#L592C25-L592C25), we see that instead of using the `props.deployOptions.description`, it uses `props.description`. Fixes https://github.com/aws/aws-cdk/issues/26148 ---- *By submitting this pull request, I confirm that my contribution is made under the terms of the Apache-2.0 license* --- ...efaultTestDeployAssert6A9696A7.assets.json | 2 +- .../test/integ.restapi.js.snapshot/cdk.out | 2 +- .../test/integ.restapi.js.snapshot/integ.json | 2 +- .../integ.restapi.js.snapshot/manifest.json | 16 +- .../test-apigateway-restapi.assets.json | 6 +- .../test-apigateway-restapi.template.json | 11 +- .../test/integ.restapi.js.snapshot/tree.json | 137 +++++++++--------- .../test/aws-apigateway/test/integ.restapi.ts | 1 + ...efaultTestDeployAssertD16AA485.assets.json | 2 +- .../integ.spec-restapi.js.snapshot/cdk.out | 2 +- .../integ.spec-restapi.js.snapshot/integ.json | 2 +- .../manifest.json | 13 +- .../test-apigateway-spec-restapi.assets.json | 6 +- ...test-apigateway-spec-restapi.template.json | 2 +- .../integ.spec-restapi.js.snapshot/tree.json | 126 ++++++++-------- .../aws-cdk-lib/aws-apigateway/lib/restapi.ts | 2 +- .../aws-apigateway/test/restapi.test.ts | 19 +++ 17 files changed, 182 insertions(+), 169 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 0a13f744eed97..3c94ee08488f4 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,5 +1,5 @@ { - "version": "30.0.0", + "version": "32.0.0", "files": { "21fbb51d7b23f6a6c262b46a9caee79d744a3ac019fd45422d988b96d44b2a22": { "source": { 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 ae4b03c54e770..f0b901e7c06e5 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":"30.0.0"} \ No newline at end of file +{"version":"32.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 67626e9b771eb..5f294b42e8654 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": "30.0.0", + "version": "32.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 382751142abcf..0dbf087a3e973 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": "30.0.0", + "version": "32.0.0", "artifacts": { "test-apigateway-restapi.assets": { "type": "cdk:asset-manifest", @@ -17,7 +17,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}/94f416193221135915e06201345d08e3db001c8bbf22b073f16ec02d3b8fba4b.json", + "stackTemplateAssetObjectUrl": "s3://cdk-hnb659fds-assets-${AWS::AccountId}-${AWS::Region}/c00b67076079aca10705c26d8b2f87803ff864e13c715f333bcec05a6e7021af.json", "requiresBootstrapStackVersion": 6, "bootstrapStackVersionSsmParameter": "/cdk-bootstrap/hnb659fds/version", "additionalDependencies": [ @@ -54,7 +54,7 @@ "/test-apigateway-restapi/my-api/Deployment/Resource": [ { "type": "aws:cdk:logicalId", - "data": "myapiDeployment92F2CB496a6dee9579dae89ab3a0b094b4d193eb" + "data": "myapiDeployment92F2CB4993c0f175ba8d5964f5e1cc7bc64fe6e6" } ], "/test-apigateway-restapi/my-api/DeploymentStage.beta/Resource": [ @@ -198,7 +198,7 @@ "/test-apigateway-restapi/TestDeployment/Resource": [ { "type": "aws:cdk:logicalId", - "data": "TestDeploymentD77B56860a9c34c1bc306bfbc7d318827eacd1e1" + "data": "TestDeploymentD77B56865531eba1e8fde4b8e6988d5af7b2efd6" } ], "/test-apigateway-restapi/TestStage/Resource": [ @@ -225,19 +225,19 @@ "data": "CheckBootstrapVersion" } ], - "myapiDeployment92F2CB4996088bac04ec19d9db88f146f3d88bca": [ + "myapiDeployment92F2CB496a6dee9579dae89ab3a0b094b4d193eb": [ { "type": "aws:cdk:logicalId", - "data": "myapiDeployment92F2CB4996088bac04ec19d9db88f146f3d88bca", + "data": "myapiDeployment92F2CB496a6dee9579dae89ab3a0b094b4d193eb", "trace": [ "!!DESTRUCTIVE_CHANGES: WILL_DESTROY" ] } ], - "TestDeploymentD77B56866f3141cef1e8fea8ab3b3b8bc90df36d": [ + "TestDeploymentD77B56860a9c34c1bc306bfbc7d318827eacd1e1": [ { "type": "aws:cdk:logicalId", - "data": "TestDeploymentD77B56866f3141cef1e8fea8ab3b3b8bc90df36d", + "data": "TestDeploymentD77B56860a9c34c1bc306bfbc7d318827eacd1e1", "trace": [ "!!DESTRUCTIVE_CHANGES: WILL_DESTROY" ] 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 09a88ca2b52e8..f255885b7e4dd 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,7 @@ { - "version": "30.0.0", + "version": "32.0.0", "files": { - "94f416193221135915e06201345d08e3db001c8bbf22b073f16ec02d3b8fba4b": { + "c00b67076079aca10705c26d8b2f87803ff864e13c715f333bcec05a6e7021af": { "source": { "path": "test-apigateway-restapi.template.json", "packaging": "file" @@ -9,7 +9,7 @@ "destinations": { "current_account-current_region": { "bucketName": "cdk-hnb659fds-assets-${AWS::AccountId}-${AWS::Region}", - "objectKey": "94f416193221135915e06201345d08e3db001c8bbf22b073f16ec02d3b8fba4b.json", + "objectKey": "c00b67076079aca10705c26d8b2f87803ff864e13c715f333bcec05a6e7021af.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 43a8699e33d49..41e77ae6ee4c1 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 @@ -3,6 +3,7 @@ "myapi4C7BF186": { "Type": "AWS::ApiGateway::RestApi", "Properties": { + "Description": "api description", "MinimumCompressionSize": 1024, "Name": "my-api" } @@ -56,13 +57,13 @@ "UpdateReplacePolicy": "Retain", "DeletionPolicy": "Retain" }, - "myapiDeployment92F2CB496a6dee9579dae89ab3a0b094b4d193eb": { + "myapiDeployment92F2CB4993c0f175ba8d5964f5e1cc7bc64fe6e6": { "Type": "AWS::ApiGateway::Deployment", "Properties": { "RestApiId": { "Ref": "myapi4C7BF186" }, - "Description": "Automatically created by the RestApi construct" + "Description": "beta stage" }, "DependsOn": [ "myapiv1appliancesallGETC4DF552D", @@ -88,7 +89,7 @@ "CacheClusterEnabled": true, "CacheClusterSize": "0.5", "DeploymentId": { - "Ref": "myapiDeployment92F2CB496a6dee9579dae89ab3a0b094b4d193eb" + "Ref": "myapiDeployment92F2CB4993c0f175ba8d5964f5e1cc7bc64fe6e6" }, "Description": "beta stage", "MethodSettings": [ @@ -673,7 +674,7 @@ "MyHandlerServiceRoleFFA06653" ] }, - "TestDeploymentD77B56860a9c34c1bc306bfbc7d318827eacd1e1": { + "TestDeploymentD77B56865531eba1e8fde4b8e6988d5af7b2efd6": { "Type": "AWS::ApiGateway::Deployment", "Properties": { "RestApiId": { @@ -696,7 +697,7 @@ "Ref": "myapi4C7BF186" }, "DeploymentId": { - "Ref": "TestDeploymentD77B56860a9c34c1bc306bfbc7d318827eacd1e1" + "Ref": "TestDeploymentD77B56865531eba1e8fde4b8e6988d5af7b2efd6" }, "StageName": "prod" }, 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 3bf0e3cc25e09..54671c9cccf53 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 @@ -18,12 +18,13 @@ "attributes": { "aws:cdk:cloudformation:type": "AWS::ApiGateway::RestApi", "aws:cdk:cloudformation:props": { + "description": "api description", "minimumCompressionSize": 1024, "name": "my-api" } }, "constructInfo": { - "fqn": "@aws-cdk/aws-apigateway.CfnRestApi", + "fqn": "aws-cdk-lib.aws_apigateway.CfnRestApi", "version": "0.0.0" } }, @@ -35,7 +36,7 @@ "id": "ImportCloudWatchRole", "path": "test-apigateway-restapi/my-api/CloudWatchRole/ImportCloudWatchRole", "constructInfo": { - "fqn": "@aws-cdk/core.Resource", + "fqn": "aws-cdk-lib.Resource", "version": "0.0.0" } }, @@ -74,13 +75,13 @@ } }, "constructInfo": { - "fqn": "@aws-cdk/aws-iam.CfnRole", + "fqn": "aws-cdk-lib.aws_iam.CfnRole", "version": "0.0.0" } } }, "constructInfo": { - "fqn": "@aws-cdk/aws-iam.Role", + "fqn": "aws-cdk-lib.aws_iam.Role", "version": "0.0.0" } }, @@ -99,7 +100,7 @@ } }, "constructInfo": { - "fqn": "@aws-cdk/aws-apigateway.CfnAccount", + "fqn": "aws-cdk-lib.aws_apigateway.CfnAccount", "version": "0.0.0" } }, @@ -116,17 +117,17 @@ "restApiId": { "Ref": "myapi4C7BF186" }, - "description": "Automatically created by the RestApi construct" + "description": "beta stage" } }, "constructInfo": { - "fqn": "@aws-cdk/aws-apigateway.CfnDeployment", + "fqn": "aws-cdk-lib.aws_apigateway.CfnDeployment", "version": "0.0.0" } } }, "constructInfo": { - "fqn": "@aws-cdk/aws-apigateway.Deployment", + "fqn": "aws-cdk-lib.aws_apigateway.Deployment", "version": "0.0.0" } }, @@ -146,7 +147,7 @@ "cacheClusterEnabled": true, "cacheClusterSize": "0.5", "deploymentId": { - "Ref": "myapiDeployment92F2CB496a6dee9579dae89ab3a0b094b4d193eb" + "Ref": "myapiDeployment92F2CB4993c0f175ba8d5964f5e1cc7bc64fe6e6" }, "description": "beta stage", "methodSettings": [ @@ -167,13 +168,13 @@ } }, "constructInfo": { - "fqn": "@aws-cdk/aws-apigateway.CfnStage", + "fqn": "aws-cdk-lib.aws_apigateway.CfnStage", "version": "0.0.0" } } }, "constructInfo": { - "fqn": "@aws-cdk/aws-apigateway.Stage", + "fqn": "aws-cdk-lib.aws_apigateway.Stage", "version": "0.0.0" } }, @@ -181,7 +182,7 @@ "id": "Endpoint", "path": "test-apigateway-restapi/my-api/Endpoint", "constructInfo": { - "fqn": "@aws-cdk/core.CfnOutput", + "fqn": "aws-cdk-lib.CfnOutput", "version": "0.0.0" } }, @@ -212,7 +213,7 @@ } }, "constructInfo": { - "fqn": "@aws-cdk/aws-apigateway.CfnResource", + "fqn": "aws-cdk-lib.aws_apigateway.CfnResource", "version": "0.0.0" } }, @@ -236,7 +237,7 @@ } }, "constructInfo": { - "fqn": "@aws-cdk/aws-apigateway.CfnResource", + "fqn": "aws-cdk-lib.aws_apigateway.CfnResource", "version": "0.0.0" } }, @@ -289,7 +290,7 @@ } }, "constructInfo": { - "fqn": "@aws-cdk/aws-lambda.CfnPermission", + "fqn": "aws-cdk-lib.aws_lambda.CfnPermission", "version": "0.0.0" } }, @@ -334,7 +335,7 @@ } }, "constructInfo": { - "fqn": "@aws-cdk/aws-lambda.CfnPermission", + "fqn": "aws-cdk-lib.aws_lambda.CfnPermission", "version": "0.0.0" } }, @@ -383,13 +384,13 @@ } }, "constructInfo": { - "fqn": "@aws-cdk/aws-apigateway.CfnMethod", + "fqn": "aws-cdk-lib.aws_apigateway.CfnMethod", "version": "0.0.0" } } }, "constructInfo": { - "fqn": "@aws-cdk/aws-apigateway.Method", + "fqn": "aws-cdk-lib.aws_apigateway.Method", "version": "0.0.0" } }, @@ -417,13 +418,13 @@ } }, "constructInfo": { - "fqn": "@aws-cdk/aws-apigateway.CfnMethod", + "fqn": "aws-cdk-lib.aws_apigateway.CfnMethod", "version": "0.0.0" } } }, "constructInfo": { - "fqn": "@aws-cdk/aws-apigateway.Method", + "fqn": "aws-cdk-lib.aws_apigateway.Method", "version": "0.0.0" } }, @@ -451,19 +452,19 @@ } }, "constructInfo": { - "fqn": "@aws-cdk/aws-apigateway.CfnMethod", + "fqn": "aws-cdk-lib.aws_apigateway.CfnMethod", "version": "0.0.0" } } }, "constructInfo": { - "fqn": "@aws-cdk/aws-apigateway.Method", + "fqn": "aws-cdk-lib.aws_apigateway.Method", "version": "0.0.0" } } }, "constructInfo": { - "fqn": "@aws-cdk/aws-apigateway.Resource", + "fqn": "aws-cdk-lib.aws_apigateway.Resource", "version": "0.0.0" } }, @@ -487,7 +488,7 @@ } }, "constructInfo": { - "fqn": "@aws-cdk/aws-apigateway.CfnResource", + "fqn": "aws-cdk-lib.aws_apigateway.CfnResource", "version": "0.0.0" } }, @@ -515,19 +516,19 @@ } }, "constructInfo": { - "fqn": "@aws-cdk/aws-apigateway.CfnMethod", + "fqn": "aws-cdk-lib.aws_apigateway.CfnMethod", "version": "0.0.0" } } }, "constructInfo": { - "fqn": "@aws-cdk/aws-apigateway.Method", + "fqn": "aws-cdk-lib.aws_apigateway.Method", "version": "0.0.0" } } }, "constructInfo": { - "fqn": "@aws-cdk/aws-apigateway.Resource", + "fqn": "aws-cdk-lib.aws_apigateway.Resource", "version": "0.0.0" } }, @@ -551,7 +552,7 @@ } }, "constructInfo": { - "fqn": "@aws-cdk/aws-apigateway.CfnResource", + "fqn": "aws-cdk-lib.aws_apigateway.CfnResource", "version": "0.0.0" } }, @@ -604,7 +605,7 @@ } }, "constructInfo": { - "fqn": "@aws-cdk/aws-lambda.CfnPermission", + "fqn": "aws-cdk-lib.aws_lambda.CfnPermission", "version": "0.0.0" } }, @@ -649,7 +650,7 @@ } }, "constructInfo": { - "fqn": "@aws-cdk/aws-lambda.CfnPermission", + "fqn": "aws-cdk-lib.aws_lambda.CfnPermission", "version": "0.0.0" } }, @@ -697,13 +698,13 @@ } }, "constructInfo": { - "fqn": "@aws-cdk/aws-apigateway.CfnMethod", + "fqn": "aws-cdk-lib.aws_apigateway.CfnMethod", "version": "0.0.0" } } }, "constructInfo": { - "fqn": "@aws-cdk/aws-apigateway.Method", + "fqn": "aws-cdk-lib.aws_apigateway.Method", "version": "0.0.0" } }, @@ -756,7 +757,7 @@ } }, "constructInfo": { - "fqn": "@aws-cdk/aws-lambda.CfnPermission", + "fqn": "aws-cdk-lib.aws_lambda.CfnPermission", "version": "0.0.0" } }, @@ -801,7 +802,7 @@ } }, "constructInfo": { - "fqn": "@aws-cdk/aws-lambda.CfnPermission", + "fqn": "aws-cdk-lib.aws_lambda.CfnPermission", "version": "0.0.0" } }, @@ -849,31 +850,31 @@ } }, "constructInfo": { - "fqn": "@aws-cdk/aws-apigateway.CfnMethod", + "fqn": "aws-cdk-lib.aws_apigateway.CfnMethod", "version": "0.0.0" } } }, "constructInfo": { - "fqn": "@aws-cdk/aws-apigateway.Method", + "fqn": "aws-cdk-lib.aws_apigateway.Method", "version": "0.0.0" } } }, "constructInfo": { - "fqn": "@aws-cdk/aws-apigateway.Resource", + "fqn": "aws-cdk-lib.aws_apigateway.Resource", "version": "0.0.0" } } }, "constructInfo": { - "fqn": "@aws-cdk/aws-apigateway.Resource", + "fqn": "aws-cdk-lib.aws_apigateway.Resource", "version": "0.0.0" } } }, "constructInfo": { - "fqn": "@aws-cdk/aws-apigateway.ResourceBase", + "fqn": "aws-cdk-lib.aws_apigateway.ResourceBase", "version": "0.0.0" } }, @@ -901,13 +902,13 @@ } }, "constructInfo": { - "fqn": "@aws-cdk/aws-apigateway.CfnApiKey", + "fqn": "aws-cdk-lib.aws_apigateway.CfnApiKey", "version": "0.0.0" } } }, "constructInfo": { - "fqn": "@aws-cdk/aws-apigateway.ApiKey", + "fqn": "aws-cdk-lib.aws_apigateway.ApiKey", "version": "0.0.0" } }, @@ -949,7 +950,7 @@ } }, "constructInfo": { - "fqn": "@aws-cdk/aws-apigateway.CfnUsagePlan", + "fqn": "aws-cdk-lib.aws_apigateway.CfnUsagePlan", "version": "0.0.0" } }, @@ -969,19 +970,19 @@ } }, "constructInfo": { - "fqn": "@aws-cdk/aws-apigateway.CfnUsagePlanKey", + "fqn": "aws-cdk-lib.aws_apigateway.CfnUsagePlanKey", "version": "0.0.0" } } }, "constructInfo": { - "fqn": "@aws-cdk/aws-apigateway.UsagePlan", + "fqn": "aws-cdk-lib.aws_apigateway.UsagePlan", "version": "0.0.0" } } }, "constructInfo": { - "fqn": "@aws-cdk/aws-apigateway.RestApi", + "fqn": "aws-cdk-lib.aws_apigateway.RestApi", "version": "0.0.0" } }, @@ -997,7 +998,7 @@ "id": "ImportServiceRole", "path": "test-apigateway-restapi/MyHandler/ServiceRole/ImportServiceRole", "constructInfo": { - "fqn": "@aws-cdk/core.Resource", + "fqn": "aws-cdk-lib.Resource", "version": "0.0.0" } }, @@ -1036,13 +1037,13 @@ } }, "constructInfo": { - "fqn": "@aws-cdk/aws-iam.CfnRole", + "fqn": "aws-cdk-lib.aws_iam.CfnRole", "version": "0.0.0" } } }, "constructInfo": { - "fqn": "@aws-cdk/aws-iam.Role", + "fqn": "aws-cdk-lib.aws_iam.Role", "version": "0.0.0" } }, @@ -1066,13 +1067,13 @@ } }, "constructInfo": { - "fqn": "@aws-cdk/aws-lambda.CfnFunction", + "fqn": "aws-cdk-lib.aws_lambda.CfnFunction", "version": "0.0.0" } } }, "constructInfo": { - "fqn": "@aws-cdk/aws-lambda.Function", + "fqn": "aws-cdk-lib.aws_lambda.Function", "version": "0.0.0" } }, @@ -1092,13 +1093,13 @@ } }, "constructInfo": { - "fqn": "@aws-cdk/aws-apigateway.CfnDeployment", + "fqn": "aws-cdk-lib.aws_apigateway.CfnDeployment", "version": "0.0.0" } } }, "constructInfo": { - "fqn": "@aws-cdk/aws-apigateway.Deployment", + "fqn": "aws-cdk-lib.aws_apigateway.Deployment", "version": "0.0.0" } }, @@ -1116,13 +1117,13 @@ "Ref": "myapi4C7BF186" }, "deploymentId": { - "Ref": "TestDeploymentD77B56860a9c34c1bc306bfbc7d318827eacd1e1" + "Ref": "TestDeploymentD77B56865531eba1e8fde4b8e6988d5af7b2efd6" }, "stageName": "prod" } }, "constructInfo": { - "fqn": "@aws-cdk/aws-apigateway.CfnStage", + "fqn": "aws-cdk-lib.aws_apigateway.CfnStage", "version": "0.0.0" } }, @@ -1150,19 +1151,19 @@ } }, "constructInfo": { - "fqn": "@aws-cdk/aws-apigateway.CfnApiKey", + "fqn": "aws-cdk-lib.aws_apigateway.CfnApiKey", "version": "0.0.0" } } }, "constructInfo": { - "fqn": "@aws-cdk/aws-apigateway.ApiKey", + "fqn": "aws-cdk-lib.aws_apigateway.ApiKey", "version": "0.0.0" } } }, "constructInfo": { - "fqn": "@aws-cdk/aws-apigateway.Stage", + "fqn": "aws-cdk-lib.aws_apigateway.Stage", "version": "0.0.0" } }, @@ -1170,7 +1171,7 @@ "id": "BootstrapVersion", "path": "test-apigateway-restapi/BootstrapVersion", "constructInfo": { - "fqn": "@aws-cdk/core.CfnParameter", + "fqn": "aws-cdk-lib.CfnParameter", "version": "0.0.0" } }, @@ -1178,13 +1179,13 @@ "id": "CheckBootstrapVersion", "path": "test-apigateway-restapi/CheckBootstrapVersion", "constructInfo": { - "fqn": "@aws-cdk/core.CfnRule", + "fqn": "aws-cdk-lib.CfnRule", "version": "0.0.0" } } }, "constructInfo": { - "fqn": "@aws-cdk/core.Stack", + "fqn": "aws-cdk-lib.Stack", "version": "0.0.0" } }, @@ -1201,7 +1202,7 @@ "path": "apigateway-restapi/DefaultTest/Default", "constructInfo": { "fqn": "constructs.Construct", - "version": "10.1.249" + "version": "10.2.55" } }, "DeployAssert": { @@ -1212,7 +1213,7 @@ "id": "BootstrapVersion", "path": "apigateway-restapi/DefaultTest/DeployAssert/BootstrapVersion", "constructInfo": { - "fqn": "@aws-cdk/core.CfnParameter", + "fqn": "aws-cdk-lib.CfnParameter", "version": "0.0.0" } }, @@ -1220,25 +1221,25 @@ "id": "CheckBootstrapVersion", "path": "apigateway-restapi/DefaultTest/DeployAssert/CheckBootstrapVersion", "constructInfo": { - "fqn": "@aws-cdk/core.CfnRule", + "fqn": "aws-cdk-lib.CfnRule", "version": "0.0.0" } } }, "constructInfo": { - "fqn": "@aws-cdk/core.Stack", + "fqn": "aws-cdk-lib.Stack", "version": "0.0.0" } } }, "constructInfo": { - "fqn": "@aws-cdk/integ-tests.IntegTestCase", + "fqn": "@aws-cdk/integ-tests-alpha.IntegTestCase", "version": "0.0.0" } } }, "constructInfo": { - "fqn": "@aws-cdk/integ-tests.IntegTest", + "fqn": "@aws-cdk/integ-tests-alpha.IntegTest", "version": "0.0.0" } }, @@ -1247,12 +1248,12 @@ "path": "Tree", "constructInfo": { "fqn": "constructs.Construct", - "version": "10.1.249" + "version": "10.2.55" } } }, "constructInfo": { - "fqn": "@aws-cdk/core.App", + "fqn": "aws-cdk-lib.App", "version": "0.0.0" } } 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 befc3df8a0e45..b816bb9bc1854 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 @@ -12,6 +12,7 @@ class Test extends cdk.Stack { retainDeployments: true, cloudWatchRole: true, minCompressionSize: Size.bytes(1024), + description: 'api description', deployOptions: { cacheClusterEnabled: true, stageName: 'beta', 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 eae4994100f87..e229c22cd2458 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,5 +1,5 @@ { - "version": "30.0.0", + "version": "32.0.0", "files": { "21fbb51d7b23f6a6c262b46a9caee79d744a3ac019fd45422d988b96d44b2a22": { "source": { 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 ae4b03c54e770..f0b901e7c06e5 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":"30.0.0"} \ No newline at end of file +{"version":"32.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 27ab5a7e80179..4f7c6cc983cbc 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": "30.0.0", + "version": "32.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 1112099915ed4..65e20beb57540 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": "30.0.0", + "version": "32.0.0", "artifacts": { "test-apigateway-spec-restapi.assets": { "type": "cdk:asset-manifest", @@ -17,7 +17,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}/a361f357c68964992ee5038aa363d75be98e145d828b8955269361c54d7722ae.json", + "stackTemplateAssetObjectUrl": "s3://cdk-hnb659fds-assets-${AWS::AccountId}-${AWS::Region}/ff9ec72cb862844262ef8431b42a511389dbca1fa3d87be6e52b32dab9f66445.json", "requiresBootstrapStackVersion": 6, "bootstrapStackVersionSsmParameter": "/cdk-bootstrap/hnb659fds/version", "additionalDependencies": [ @@ -206,15 +206,6 @@ "type": "aws:cdk:logicalId", "data": "CheckBootstrapVersion" } - ], - "myapiDeployment92F2CB49e2ce3595b92ff44fad021c2e55149db1": [ - { - "type": "aws:cdk:logicalId", - "data": "myapiDeployment92F2CB49e2ce3595b92ff44fad021c2e55149db1", - "trace": [ - "!!DESTRUCTIVE_CHANGES: WILL_DESTROY" - ] - } ] }, "displayName": "test-apigateway-spec-restapi" 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 54d375c1f6975..37a69560c0f28 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,5 +1,5 @@ { - "version": "30.0.0", + "version": "32.0.0", "files": { "68497ac876de4e963fc8f7b5f1b28844c18ecc95e3f7c6e9e0bf250e03c037fb": { "source": { @@ -14,7 +14,7 @@ } } }, - "a361f357c68964992ee5038aa363d75be98e145d828b8955269361c54d7722ae": { + "ff9ec72cb862844262ef8431b42a511389dbca1fa3d87be6e52b32dab9f66445": { "source": { "path": "test-apigateway-spec-restapi.template.json", "packaging": "file" @@ -22,7 +22,7 @@ "destinations": { "current_account-current_region": { "bucketName": "cdk-hnb659fds-assets-${AWS::AccountId}-${AWS::Region}", - "objectKey": "a361f357c68964992ee5038aa363d75be98e145d828b8955269361c54d7722ae.json", + "objectKey": "ff9ec72cb862844262ef8431b42a511389dbca1fa3d87be6e52b32dab9f66445.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 219437fc11d7c..6b66ef1d64e92 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 @@ -523,7 +523,7 @@ "RestApiId": { "Ref": "myapi4C7BF186" }, - "Description": "Automatically created by the RestApi construct" + "Description": "beta stage" }, "DependsOn": [ "myapiv1appliancesGET8FE872EC", 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 2dd509aaa2020..538969f7e9242 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 @@ -20,7 +20,7 @@ "id": "Stage", "path": "test-apigateway-spec-restapi/my-api/APIDefinition/Stage", "constructInfo": { - "fqn": "@aws-cdk/core.AssetStaging", + "fqn": "aws-cdk-lib.AssetStaging", "version": "0.0.0" } }, @@ -28,13 +28,13 @@ "id": "AssetBucket", "path": "test-apigateway-spec-restapi/my-api/APIDefinition/AssetBucket", "constructInfo": { - "fqn": "@aws-cdk/aws-s3.BucketBase", + "fqn": "aws-cdk-lib.aws_s3.BucketBase", "version": "0.0.0" } } }, "constructInfo": { - "fqn": "@aws-cdk/aws-s3-assets.Asset", + "fqn": "aws-cdk-lib.aws_s3_assets.Asset", "version": "0.0.0" } }, @@ -56,7 +56,7 @@ } }, "constructInfo": { - "fqn": "@aws-cdk/aws-apigateway.CfnRestApi", + "fqn": "aws-cdk-lib.aws_apigateway.CfnRestApi", "version": "0.0.0" } }, @@ -87,7 +87,7 @@ } }, "constructInfo": { - "fqn": "@aws-cdk/aws-apigateway.CfnResource", + "fqn": "aws-cdk-lib.aws_apigateway.CfnResource", "version": "0.0.0" } }, @@ -111,7 +111,7 @@ } }, "constructInfo": { - "fqn": "@aws-cdk/aws-apigateway.CfnResource", + "fqn": "aws-cdk-lib.aws_apigateway.CfnResource", "version": "0.0.0" } }, @@ -164,7 +164,7 @@ } }, "constructInfo": { - "fqn": "@aws-cdk/aws-lambda.CfnPermission", + "fqn": "aws-cdk-lib.aws_lambda.CfnPermission", "version": "0.0.0" } }, @@ -209,7 +209,7 @@ } }, "constructInfo": { - "fqn": "@aws-cdk/aws-lambda.CfnPermission", + "fqn": "aws-cdk-lib.aws_lambda.CfnPermission", "version": "0.0.0" } }, @@ -258,13 +258,13 @@ } }, "constructInfo": { - "fqn": "@aws-cdk/aws-apigateway.CfnMethod", + "fqn": "aws-cdk-lib.aws_apigateway.CfnMethod", "version": "0.0.0" } } }, "constructInfo": { - "fqn": "@aws-cdk/aws-apigateway.Method", + "fqn": "aws-cdk-lib.aws_apigateway.Method", "version": "0.0.0" } }, @@ -292,13 +292,13 @@ } }, "constructInfo": { - "fqn": "@aws-cdk/aws-apigateway.CfnMethod", + "fqn": "aws-cdk-lib.aws_apigateway.CfnMethod", "version": "0.0.0" } } }, "constructInfo": { - "fqn": "@aws-cdk/aws-apigateway.Method", + "fqn": "aws-cdk-lib.aws_apigateway.Method", "version": "0.0.0" } }, @@ -326,19 +326,19 @@ } }, "constructInfo": { - "fqn": "@aws-cdk/aws-apigateway.CfnMethod", + "fqn": "aws-cdk-lib.aws_apigateway.CfnMethod", "version": "0.0.0" } } }, "constructInfo": { - "fqn": "@aws-cdk/aws-apigateway.Method", + "fqn": "aws-cdk-lib.aws_apigateway.Method", "version": "0.0.0" } } }, "constructInfo": { - "fqn": "@aws-cdk/aws-apigateway.Resource", + "fqn": "aws-cdk-lib.aws_apigateway.Resource", "version": "0.0.0" } }, @@ -362,7 +362,7 @@ } }, "constructInfo": { - "fqn": "@aws-cdk/aws-apigateway.CfnResource", + "fqn": "aws-cdk-lib.aws_apigateway.CfnResource", "version": "0.0.0" } }, @@ -390,19 +390,19 @@ } }, "constructInfo": { - "fqn": "@aws-cdk/aws-apigateway.CfnMethod", + "fqn": "aws-cdk-lib.aws_apigateway.CfnMethod", "version": "0.0.0" } } }, "constructInfo": { - "fqn": "@aws-cdk/aws-apigateway.Method", + "fqn": "aws-cdk-lib.aws_apigateway.Method", "version": "0.0.0" } } }, "constructInfo": { - "fqn": "@aws-cdk/aws-apigateway.Resource", + "fqn": "aws-cdk-lib.aws_apigateway.Resource", "version": "0.0.0" } }, @@ -426,7 +426,7 @@ } }, "constructInfo": { - "fqn": "@aws-cdk/aws-apigateway.CfnResource", + "fqn": "aws-cdk-lib.aws_apigateway.CfnResource", "version": "0.0.0" } }, @@ -479,7 +479,7 @@ } }, "constructInfo": { - "fqn": "@aws-cdk/aws-lambda.CfnPermission", + "fqn": "aws-cdk-lib.aws_lambda.CfnPermission", "version": "0.0.0" } }, @@ -524,7 +524,7 @@ } }, "constructInfo": { - "fqn": "@aws-cdk/aws-lambda.CfnPermission", + "fqn": "aws-cdk-lib.aws_lambda.CfnPermission", "version": "0.0.0" } }, @@ -572,13 +572,13 @@ } }, "constructInfo": { - "fqn": "@aws-cdk/aws-apigateway.CfnMethod", + "fqn": "aws-cdk-lib.aws_apigateway.CfnMethod", "version": "0.0.0" } } }, "constructInfo": { - "fqn": "@aws-cdk/aws-apigateway.Method", + "fqn": "aws-cdk-lib.aws_apigateway.Method", "version": "0.0.0" } }, @@ -631,7 +631,7 @@ } }, "constructInfo": { - "fqn": "@aws-cdk/aws-lambda.CfnPermission", + "fqn": "aws-cdk-lib.aws_lambda.CfnPermission", "version": "0.0.0" } }, @@ -676,7 +676,7 @@ } }, "constructInfo": { - "fqn": "@aws-cdk/aws-lambda.CfnPermission", + "fqn": "aws-cdk-lib.aws_lambda.CfnPermission", "version": "0.0.0" } }, @@ -724,31 +724,31 @@ } }, "constructInfo": { - "fqn": "@aws-cdk/aws-apigateway.CfnMethod", + "fqn": "aws-cdk-lib.aws_apigateway.CfnMethod", "version": "0.0.0" } } }, "constructInfo": { - "fqn": "@aws-cdk/aws-apigateway.Method", + "fqn": "aws-cdk-lib.aws_apigateway.Method", "version": "0.0.0" } } }, "constructInfo": { - "fqn": "@aws-cdk/aws-apigateway.Resource", + "fqn": "aws-cdk-lib.aws_apigateway.Resource", "version": "0.0.0" } } }, "constructInfo": { - "fqn": "@aws-cdk/aws-apigateway.Resource", + "fqn": "aws-cdk-lib.aws_apigateway.Resource", "version": "0.0.0" } } }, "constructInfo": { - "fqn": "@aws-cdk/aws-apigateway.ResourceBase", + "fqn": "aws-cdk-lib.aws_apigateway.ResourceBase", "version": "0.0.0" } }, @@ -760,7 +760,7 @@ "id": "ImportCloudWatchRole", "path": "test-apigateway-spec-restapi/my-api/CloudWatchRole/ImportCloudWatchRole", "constructInfo": { - "fqn": "@aws-cdk/core.Resource", + "fqn": "aws-cdk-lib.Resource", "version": "0.0.0" } }, @@ -799,13 +799,13 @@ } }, "constructInfo": { - "fqn": "@aws-cdk/aws-iam.CfnRole", + "fqn": "aws-cdk-lib.aws_iam.CfnRole", "version": "0.0.0" } } }, "constructInfo": { - "fqn": "@aws-cdk/aws-iam.Role", + "fqn": "aws-cdk-lib.aws_iam.Role", "version": "0.0.0" } }, @@ -824,7 +824,7 @@ } }, "constructInfo": { - "fqn": "@aws-cdk/aws-apigateway.CfnAccount", + "fqn": "aws-cdk-lib.aws_apigateway.CfnAccount", "version": "0.0.0" } }, @@ -841,17 +841,17 @@ "restApiId": { "Ref": "myapi4C7BF186" }, - "description": "Automatically created by the RestApi construct" + "description": "beta stage" } }, "constructInfo": { - "fqn": "@aws-cdk/aws-apigateway.CfnDeployment", + "fqn": "aws-cdk-lib.aws_apigateway.CfnDeployment", "version": "0.0.0" } } }, "constructInfo": { - "fqn": "@aws-cdk/aws-apigateway.Deployment", + "fqn": "aws-cdk-lib.aws_apigateway.Deployment", "version": "0.0.0" } }, @@ -892,13 +892,13 @@ } }, "constructInfo": { - "fqn": "@aws-cdk/aws-apigateway.CfnStage", + "fqn": "aws-cdk-lib.aws_apigateway.CfnStage", "version": "0.0.0" } } }, "constructInfo": { - "fqn": "@aws-cdk/aws-apigateway.Stage", + "fqn": "aws-cdk-lib.aws_apigateway.Stage", "version": "0.0.0" } }, @@ -906,7 +906,7 @@ "id": "Endpoint", "path": "test-apigateway-spec-restapi/my-api/Endpoint", "constructInfo": { - "fqn": "@aws-cdk/core.CfnOutput", + "fqn": "aws-cdk-lib.CfnOutput", "version": "0.0.0" } }, @@ -934,13 +934,13 @@ } }, "constructInfo": { - "fqn": "@aws-cdk/aws-apigateway.CfnApiKey", + "fqn": "aws-cdk-lib.aws_apigateway.CfnApiKey", "version": "0.0.0" } } }, "constructInfo": { - "fqn": "@aws-cdk/aws-apigateway.ApiKey", + "fqn": "aws-cdk-lib.aws_apigateway.ApiKey", "version": "0.0.0" } }, @@ -982,7 +982,7 @@ } }, "constructInfo": { - "fqn": "@aws-cdk/aws-apigateway.CfnUsagePlan", + "fqn": "aws-cdk-lib.aws_apigateway.CfnUsagePlan", "version": "0.0.0" } }, @@ -1002,19 +1002,19 @@ } }, "constructInfo": { - "fqn": "@aws-cdk/aws-apigateway.CfnUsagePlanKey", + "fqn": "aws-cdk-lib.aws_apigateway.CfnUsagePlanKey", "version": "0.0.0" } } }, "constructInfo": { - "fqn": "@aws-cdk/aws-apigateway.UsagePlan", + "fqn": "aws-cdk-lib.aws_apigateway.UsagePlan", "version": "0.0.0" } } }, "constructInfo": { - "fqn": "@aws-cdk/aws-apigateway.SpecRestApi", + "fqn": "aws-cdk-lib.aws_apigateway.SpecRestApi", "version": "0.0.0" } }, @@ -1030,7 +1030,7 @@ "id": "ImportServiceRole", "path": "test-apigateway-spec-restapi/MyHandler/ServiceRole/ImportServiceRole", "constructInfo": { - "fqn": "@aws-cdk/core.Resource", + "fqn": "aws-cdk-lib.Resource", "version": "0.0.0" } }, @@ -1069,13 +1069,13 @@ } }, "constructInfo": { - "fqn": "@aws-cdk/aws-iam.CfnRole", + "fqn": "aws-cdk-lib.aws_iam.CfnRole", "version": "0.0.0" } } }, "constructInfo": { - "fqn": "@aws-cdk/aws-iam.Role", + "fqn": "aws-cdk-lib.aws_iam.Role", "version": "0.0.0" } }, @@ -1099,13 +1099,13 @@ } }, "constructInfo": { - "fqn": "@aws-cdk/aws-lambda.CfnFunction", + "fqn": "aws-cdk-lib.aws_lambda.CfnFunction", "version": "0.0.0" } } }, "constructInfo": { - "fqn": "@aws-cdk/aws-lambda.Function", + "fqn": "aws-cdk-lib.aws_lambda.Function", "version": "0.0.0" } }, @@ -1113,7 +1113,7 @@ "id": "BootstrapVersion", "path": "test-apigateway-spec-restapi/BootstrapVersion", "constructInfo": { - "fqn": "@aws-cdk/core.CfnParameter", + "fqn": "aws-cdk-lib.CfnParameter", "version": "0.0.0" } }, @@ -1121,13 +1121,13 @@ "id": "CheckBootstrapVersion", "path": "test-apigateway-spec-restapi/CheckBootstrapVersion", "constructInfo": { - "fqn": "@aws-cdk/core.CfnRule", + "fqn": "aws-cdk-lib.CfnRule", "version": "0.0.0" } } }, "constructInfo": { - "fqn": "@aws-cdk/core.Stack", + "fqn": "aws-cdk-lib.Stack", "version": "0.0.0" } }, @@ -1144,7 +1144,7 @@ "path": "apigateway-spec-restapi/DefaultTest/Default", "constructInfo": { "fqn": "constructs.Construct", - "version": "10.1.249" + "version": "10.2.55" } }, "DeployAssert": { @@ -1155,7 +1155,7 @@ "id": "BootstrapVersion", "path": "apigateway-spec-restapi/DefaultTest/DeployAssert/BootstrapVersion", "constructInfo": { - "fqn": "@aws-cdk/core.CfnParameter", + "fqn": "aws-cdk-lib.CfnParameter", "version": "0.0.0" } }, @@ -1163,25 +1163,25 @@ "id": "CheckBootstrapVersion", "path": "apigateway-spec-restapi/DefaultTest/DeployAssert/CheckBootstrapVersion", "constructInfo": { - "fqn": "@aws-cdk/core.CfnRule", + "fqn": "aws-cdk-lib.CfnRule", "version": "0.0.0" } } }, "constructInfo": { - "fqn": "@aws-cdk/core.Stack", + "fqn": "aws-cdk-lib.Stack", "version": "0.0.0" } } }, "constructInfo": { - "fqn": "@aws-cdk/integ-tests.IntegTestCase", + "fqn": "@aws-cdk/integ-tests-alpha.IntegTestCase", "version": "0.0.0" } } }, "constructInfo": { - "fqn": "@aws-cdk/integ-tests.IntegTest", + "fqn": "@aws-cdk/integ-tests-alpha.IntegTest", "version": "0.0.0" } }, @@ -1190,12 +1190,12 @@ "path": "Tree", "constructInfo": { "fqn": "constructs.Construct", - "version": "10.1.249" + "version": "10.2.55" } } }, "constructInfo": { - "fqn": "@aws-cdk/core.App", + "fqn": "aws-cdk-lib.App", "version": "0.0.0" } } diff --git a/packages/aws-cdk-lib/aws-apigateway/lib/restapi.ts b/packages/aws-cdk-lib/aws-apigateway/lib/restapi.ts index 203dd85ce5cd5..34100e0c6154e 100644 --- a/packages/aws-cdk-lib/aws-apigateway/lib/restapi.ts +++ b/packages/aws-cdk-lib/aws-apigateway/lib/restapi.ts @@ -589,7 +589,7 @@ export abstract class RestApiBase extends Resource implements IRestApi { if (deploy) { this._latestDeployment = new Deployment(this, 'Deployment', { - description: props.description? props.description :'Automatically created by the RestApi construct', + description: props.deployOptions?.description ?? props.description ?? 'Automatically created by the RestApi construct', api: this, retainDeployments: props.retainDeployments, }); 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 dcbfc056ee609..3172fabb442e0 100644 --- a/packages/aws-cdk-lib/aws-apigateway/test/restapi.test.ts +++ b/packages/aws-cdk-lib/aws-apigateway/test/restapi.test.ts @@ -324,6 +324,25 @@ describe('restapi', () => { })).toThrow(/Cannot set 'deployOptions' if 'deploy' is disabled/); }); + test('uses correct description for Deployment from "deployOptions"', () => { + // GIVEN + const stack = new Stack(); + const api = new apigw.RestApi(stack, 'restapi', { + description: 'Api description', + deployOptions: { description: 'Deployment description' }, + }); + api.root.addMethod('GET'); + + // THEN + Template.fromStack(stack).hasResourceProperties('AWS::ApiGateway::Deployment', { + Description: 'Deployment description', + }); + + Template.fromStack(stack).hasResourceProperties('AWS::ApiGateway::RestApi', { + Description: 'Api description', + }); + }); + test('CloudWatch role is created for API Gateway', () => { // GIVEN const stack = new Stack();