diff --git a/CHANGELOG.v2.alpha.md b/CHANGELOG.v2.alpha.md index 33f5c92ed4e5b..06f4c22fb8660 100644 --- a/CHANGELOG.v2.alpha.md +++ b/CHANGELOG.v2.alpha.md @@ -2,6 +2,22 @@ All notable changes to this project will be documented in this file. See [standard-version](https://github.com/conventional-changelog/standard-version) for commit guidelines. +## [2.116.1-alpha.0](https://github.com/aws/aws-cdk/compare/v2.116.0-alpha.0...v2.116.1-alpha.0) (2023-12-22) + +## [2.116.0-alpha.0](https://github.com/aws/aws-cdk/compare/v2.115.0-alpha.0...v2.116.0-alpha.0) (2023-12-21) + + +### Features + +* **scheduler:** flexible time windows ([#28098](https://github.com/aws/aws-cdk/issues/28098)) ([6554e48](https://github.com/aws/aws-cdk/commit/6554e48908662de31aa5dba4578007c857c2403d)) +* **scheduler-targets:** add CodePipeline as target for scheduler ([#27799](https://github.com/aws/aws-cdk/issues/27799)) ([8c44f32](https://github.com/aws/aws-cdk/commit/8c44f3298f6bd6d5b2b081eeef50296d6f716a2d)), closes [#27449](https://github.com/aws/aws-cdk/issues/27449) + + +### Bug Fixes + +* **integ-tests:** apply correct IAM policy to waiterProvider ([#28424](https://github.com/aws/aws-cdk/issues/28424)) ([c488035](https://github.com/aws/aws-cdk/commit/c488035db893532c6aca97c59717a351539fa2ec)), closes [40aws-cdk/integ-tests-alpha/lib/assertions/sdk.ts#L136](https://github.com/40aws-cdk/integ-tests-alpha/lib/assertions/sdk.ts/issues/L136) [40aws-cdk/integ-tests-alpha/lib/assertions/sdk.ts#L247](https://github.com/40aws-cdk/integ-tests-alpha/lib/assertions/sdk.ts/issues/L247) [#27865](https://github.com/aws/aws-cdk/issues/27865) +* **lambda-python-alpha:** pipenv lock -r is no longer supported ([#28317](https://github.com/aws/aws-cdk/issues/28317)) ([f85f486](https://github.com/aws/aws-cdk/commit/f85f486d34e51c4e5d6a8b68b16a35a14f431329)), closes [#28015](https://github.com/aws/aws-cdk/issues/28015) [/github.com/pypa/pipenv/blob/main/CHANGELOG.md#2022813-2022-08-13](https://github.com/aws//github.com/pypa/pipenv/blob/main/CHANGELOG.md/issues/2022813-2022-08-13) [#28015](https://github.com/aws/aws-cdk/issues/28015) + ## [2.115.0-alpha.0](https://github.com/aws/aws-cdk/compare/v2.114.1-alpha.0...v2.115.0-alpha.0) (2023-12-14) diff --git a/CHANGELOG.v2.md b/CHANGELOG.v2.md index a2f554ce4e897..d73963e702114 100644 --- a/CHANGELOG.v2.md +++ b/CHANGELOG.v2.md @@ -2,6 +2,48 @@ All notable changes to this project will be documented in this file. See [standard-version](https://github.com/conventional-changelog/standard-version) for commit guidelines. +## [2.116.1](https://github.com/aws/aws-cdk/compare/v2.116.0...v2.116.1) (2023-12-22) + + +### Bug Fixes + +* **core:** core constructs fail with `Error: Cannot find module '../dist/core/.generated'` ([#28467](https://github.com/aws/aws-cdk/issues/28467)) ([e8be128](https://github.com/aws/aws-cdk/commit/e8be12836cdb73b74cd36e19e5cec52258304933)), closes [#28251](https://github.com/aws/aws-cdk/issues/28251) [#28465](https://github.com/aws/aws-cdk/issues/28465) + +## [2.116.0](https://github.com/aws/aws-cdk/compare/v2.115.0...v2.116.0) (2023-12-21) + + +### Features + +* **apigateway:** validate integrationHttpMethod with non-MOCK integration types ([#28316](https://github.com/aws/aws-cdk/issues/28316)) ([93cb6e4](https://github.com/aws/aws-cdk/commit/93cb6e4399fe0e2de67050f10920ec7a1eda34e1)) +* **ec2:** support creating key pairs ([#28138](https://github.com/aws/aws-cdk/issues/28138)) ([6b3caff](https://github.com/aws/aws-cdk/commit/6b3caff7ac4321ca79e70821991de041d33eaa7c)), closes [#5252](https://github.com/aws/aws-cdk/issues/5252) +* **ecr:** Add emptyOnDelete CloudFormation property to Repository L2 construct ([#28233](https://github.com/aws/aws-cdk/issues/28233)) ([a175da8](https://github.com/aws/aws-cdk/commit/a175da8ec1f4d6149efdfe05749d77ae104842d4)), closes [#24572](https://github.com/aws/aws-cdk/issues/24572) [#28196](https://github.com/aws/aws-cdk/issues/28196) +* **ecr:** tag pattern list for lifecycle policy ([#28432](https://github.com/aws/aws-cdk/issues/28432)) ([aa075cd](https://github.com/aws/aws-cdk/commit/aa075cd07a892e6c1d5243d5526e2c8658b98621)) +* **ecs:** log retention for FireLensLogDriver ([#28354](https://github.com/aws/aws-cdk/issues/28354)) ([52a5579](https://github.com/aws/aws-cdk/commit/52a5579aa52c88bb289a7a9677c35385763c8fff)), closes [/github.com/aws/aws-cdk/blob/db22b85c9b2a853aa2f830c182a340f0bcf95d1a/packages/aws-cdk-lib/aws-ecs/lib/base/task-definition.ts#L816](https://github.com/aws//github.com/aws/aws-cdk/blob/db22b85c9b2a853aa2f830c182a340f0bcf95d1a/packages/aws-cdk-lib/aws-ecs/lib/base/task-definition.ts/issues/L816) [/github.com/aws/aws-cdk/blob/db22b85c9b2a853aa2f830c182a340f0bcf95d1a/packages/aws-cdk-lib/aws-ecs/lib/firelens-log-router.ts#L170](https://github.com/aws//github.com/aws/aws-cdk/blob/db22b85c9b2a853aa2f830c182a340f0bcf95d1a/packages/aws-cdk-lib/aws-ecs/lib/firelens-log-router.ts/issues/L170) [#28258](https://github.com/aws/aws-cdk/issues/28258) +* **ecs:** Support specifying revision of task definition ([#27036](https://github.com/aws/aws-cdk/issues/27036)) ([de0d77b](https://github.com/aws/aws-cdk/commit/de0d77b2075506f3c28e657fa072a0bffc8c734a)), closes [#26983](https://github.com/aws/aws-cdk/issues/26983) +* **events:** add multiple event bus policies on a single event bus ([#27340](https://github.com/aws/aws-cdk/issues/27340)) ([4dde502](https://github.com/aws/aws-cdk/commit/4dde5021a4e69de0ca2e49226ef0d2cde76d4235)), closes [#24671](https://github.com/aws/aws-cdk/issues/24671) +* **rds:** support aurora mysql 3.05.1 ([#28370](https://github.com/aws/aws-cdk/issues/28370)) ([986db38](https://github.com/aws/aws-cdk/commit/986db38842c901bfe50098b36d78d6e3a6befdf1)) +* **ses:** add scalingMode property to dedicated ip pool ([#28392](https://github.com/aws/aws-cdk/issues/28392)) ([c687778](https://github.com/aws/aws-cdk/commit/c6877788f7abd19b4dcc792d5fa73fc118410efd)), closes [#27418](https://github.com/aws/aws-cdk/issues/27418) +* **sns:** delivery status logging configuration ([#28433](https://github.com/aws/aws-cdk/issues/28433)) ([36bb696](https://github.com/aws/aws-cdk/commit/36bb6967ad28a84b68e7b9ea5d5facadf0de4297)), closes [#21971](https://github.com/aws/aws-cdk/issues/21971) +* **stepfunctions:** CustomState addCatch ([#28422](https://github.com/aws/aws-cdk/issues/28422)) ([cf923bc](https://github.com/aws/aws-cdk/commit/cf923bc4eacd3bb0efdc469708dc389a67d38bcc)), closes [#25798](https://github.com/aws/aws-cdk/issues/25798) +* **stepfunctions:** support Map ItemProcessor ([#27913](https://github.com/aws/aws-cdk/issues/27913)) ([ac41730](https://github.com/aws/aws-cdk/commit/ac417301348f3bc2f0b7352c032802c2aff8d721)), closes [#27878](https://github.com/aws/aws-cdk/issues/27878) +* **stepfunctions-tasks:** EMR createCluster command support OnDemandSpecification ([#27791](https://github.com/aws/aws-cdk/issues/27791)) ([73a5e74](https://github.com/aws/aws-cdk/commit/73a5e740e7556c8b59111ab4602125ac78a5364f)), closes [#27761](https://github.com/aws/aws-cdk/issues/27761) +* implement code generated handler framework ([#28251](https://github.com/aws/aws-cdk/issues/28251)) ([1a9c30e](https://github.com/aws/aws-cdk/commit/1a9c30e55e58203bd0a61de82711cf10f1e04851)), closes [#27303](https://github.com/aws/aws-cdk/issues/27303) +* update AWS Service Spec ([#28407](https://github.com/aws/aws-cdk/issues/28407)) ([fcb701c](https://github.com/aws/aws-cdk/commit/fcb701ceb7288be5307a0f9c12826a13d97251b7)) + + +### Bug Fixes + +* **core:** messages from `annotations.ts` can show up as `[object Object]` ([#28414](https://github.com/aws/aws-cdk/issues/28414)) ([3e6f10d](https://github.com/aws/aws-cdk/commit/3e6f10ddfdf93147f3d488de2965f7e263bd1713)) +* **custom-resources:** cannot set logging for state machine generated in CompleteHandler ([#27310](https://github.com/aws/aws-cdk/issues/27310)) ([bfeef00](https://github.com/aws/aws-cdk/commit/bfeef00c5e1d99415ff2135054e35acc5e9f6b93)), closes [#27283](https://github.com/aws/aws-cdk/issues/27283) +* **ecs-patterns:** taskDefinition ignored by queueProcessingFargateService ([#28220](https://github.com/aws/aws-cdk/issues/28220)) ([5d6b8ee](https://github.com/aws/aws-cdk/commit/5d6b8eefc66d326325673bda2b86b72aa4579199)), closes [#27360](https://github.com/aws/aws-cdk/issues/27360) +* **eks:** neuron plugin not added with addNodegroupCapacity() ([#27909](https://github.com/aws/aws-cdk/issues/27909)) ([b87212b](https://github.com/aws/aws-cdk/commit/b87212b9fe2064b97d8935db49e6d78e183c2fd8)) +* **events-targets:** imported sqs queue cannot be used as a rule dlq ([#28165](https://github.com/aws/aws-cdk/issues/28165)) ([#28285](https://github.com/aws/aws-cdk/issues/28285)) ([588b106](https://github.com/aws/aws-cdk/commit/588b1064c289295c5acce1b991ef8dcd7c8bec3f)) +* **iam:** importedRoleStackSafeDefaultPolicyName feature flag results in excessively long IAM policy names ([#27548](https://github.com/aws/aws-cdk/issues/27548)) ([4f88db6](https://github.com/aws/aws-cdk/commit/4f88db691652274eb1b3119c8b1dccb196b29928)), closes [#27409](https://github.com/aws/aws-cdk/issues/27409) [#24441](https://github.com/aws/aws-cdk/issues/24441) +* **logs:** adding a resource policy statement with `AnyPrincipal` fails ([#27787](https://github.com/aws/aws-cdk/issues/27787)) ([0b2ba1c](https://github.com/aws/aws-cdk/commit/0b2ba1c5d807ce8dfc390ea3b0ca5a1e39636315)), closes [#27783](https://github.com/aws/aws-cdk/issues/27783) +* **s3-notifications:** multiple notifications doesn't work ([#28132](https://github.com/aws/aws-cdk/issues/28132)) ([37be7b9](https://github.com/aws/aws-cdk/commit/37be7b9b5d2abe04aa5f632a7b78aed3e9c233d8)) +* **secretsmanager:** cannot set hourly rotation ([#28303](https://github.com/aws/aws-cdk/issues/28303)) ([09cb003](https://github.com/aws/aws-cdk/commit/09cb003fb917714c0dc88b47cd05893c2a816d45)), closes [#28261](https://github.com/aws/aws-cdk/issues/28261) +* **secretsmanager:** hosted rotation with fromSecretNameV2() does not create correct iam policy ([#28379](https://github.com/aws/aws-cdk/issues/28379)) ([4ab5bb2](https://github.com/aws/aws-cdk/commit/4ab5bb2e9aab4cee4e8a2bcd81871254f2c3065f)), closes [#28308](https://github.com/aws/aws-cdk/issues/28308) + ## [2.115.0](https://github.com/aws/aws-cdk/compare/v2.114.1...v2.115.0) (2023-12-14) diff --git a/packages/@aws-cdk-testing/framework-integ/test/aws-apigatewayv2/test/http/integ.api.js.snapshot/aws-cdk-aws-apigatewayv2.assets.json b/packages/@aws-cdk-testing/framework-integ/test/aws-apigatewayv2/test/http/integ.api.js.snapshot/aws-cdk-aws-apigatewayv2.assets.json new file mode 100644 index 0000000000000..2a97a56ed3ab4 --- /dev/null +++ b/packages/@aws-cdk-testing/framework-integ/test/aws-apigatewayv2/test/http/integ.api.js.snapshot/aws-cdk-aws-apigatewayv2.assets.json @@ -0,0 +1,19 @@ +{ + "version": "35.0.0", + "files": { + "f753b6c52b805082d600dd33b6be3b816c0954f254acf84347e2447774db5100": { + "source": { + "path": "aws-cdk-aws-apigatewayv2.template.json", + "packaging": "file" + }, + "destinations": { + "current_account-current_region": { + "bucketName": "cdk-hnb659fds-assets-${AWS::AccountId}-${AWS::Region}", + "objectKey": "f753b6c52b805082d600dd33b6be3b816c0954f254acf84347e2447774db5100.json", + "assumeRoleArn": "arn:${AWS::Partition}:iam::${AWS::AccountId}:role/cdk-hnb659fds-file-publishing-role-${AWS::AccountId}-${AWS::Region}" + } + } + } + }, + "dockerImages": {} +} \ No newline at end of file diff --git a/packages/@aws-cdk-testing/framework-integ/test/aws-apigatewayv2/test/http/integ.api.js.snapshot/aws-cdk-aws-apigatewayv2.template.json b/packages/@aws-cdk-testing/framework-integ/test/aws-apigatewayv2/test/http/integ.api.js.snapshot/aws-cdk-aws-apigatewayv2.template.json new file mode 100644 index 0000000000000..36bd57da384f9 --- /dev/null +++ b/packages/@aws-cdk-testing/framework-integ/test/aws-apigatewayv2/test/http/integ.api.js.snapshot/aws-cdk-aws-apigatewayv2.template.json @@ -0,0 +1,55 @@ +{ + "Resources": { + "HttpApiF5A9A8A7": { + "Type": "AWS::ApiGatewayV2::Api", + "Properties": { + "Name": "HttpApi", + "ProtocolType": "HTTP" + } + }, + "HttpApiDefaultStage3EEB07D6": { + "Type": "AWS::ApiGatewayV2::Stage", + "Properties": { + "ApiId": { + "Ref": "HttpApiF5A9A8A7" + }, + "AutoDeploy": true, + "StageName": "$default" + } + } + }, + "Parameters": { + "BootstrapVersion": { + "Type": "AWS::SSM::Parameter::Value", + "Default": "/cdk-bootstrap/hnb659fds/version", + "Description": "Version of the CDK Bootstrap resources in this environment, automatically retrieved from SSM Parameter Store. [cdk:skip]" + } + }, + "Rules": { + "CheckBootstrapVersion": { + "Assertions": [ + { + "Assert": { + "Fn::Not": [ + { + "Fn::Contains": [ + [ + "1", + "2", + "3", + "4", + "5" + ], + { + "Ref": "BootstrapVersion" + } + ] + } + ] + }, + "AssertDescription": "CDK bootstrap stack version 6 required. Please run 'cdk bootstrap' with a recent version of the CDK CLI." + } + ] + } + } +} \ No newline at end of file diff --git a/packages/@aws-cdk-testing/framework-integ/test/aws-apigatewayv2/test/http/integ.api.js.snapshot/cdk.out b/packages/@aws-cdk-testing/framework-integ/test/aws-apigatewayv2/test/http/integ.api.js.snapshot/cdk.out new file mode 100644 index 0000000000000..c5cb2e5de6344 --- /dev/null +++ b/packages/@aws-cdk-testing/framework-integ/test/aws-apigatewayv2/test/http/integ.api.js.snapshot/cdk.out @@ -0,0 +1 @@ +{"version":"35.0.0"} \ No newline at end of file diff --git a/packages/@aws-cdk-testing/framework-integ/test/aws-apigatewayv2/test/http/integ.api.js.snapshot/httpapiDefaultTestDeployAssert77633A40.assets.json b/packages/@aws-cdk-testing/framework-integ/test/aws-apigatewayv2/test/http/integ.api.js.snapshot/httpapiDefaultTestDeployAssert77633A40.assets.json new file mode 100644 index 0000000000000..1b6f704767526 --- /dev/null +++ b/packages/@aws-cdk-testing/framework-integ/test/aws-apigatewayv2/test/http/integ.api.js.snapshot/httpapiDefaultTestDeployAssert77633A40.assets.json @@ -0,0 +1,19 @@ +{ + "version": "35.0.0", + "files": { + "21fbb51d7b23f6a6c262b46a9caee79d744a3ac019fd45422d988b96d44b2a22": { + "source": { + "path": "httpapiDefaultTestDeployAssert77633A40.template.json", + "packaging": "file" + }, + "destinations": { + "current_account-current_region": { + "bucketName": "cdk-hnb659fds-assets-${AWS::AccountId}-${AWS::Region}", + "objectKey": "21fbb51d7b23f6a6c262b46a9caee79d744a3ac019fd45422d988b96d44b2a22.json", + "assumeRoleArn": "arn:${AWS::Partition}:iam::${AWS::AccountId}:role/cdk-hnb659fds-file-publishing-role-${AWS::AccountId}-${AWS::Region}" + } + } + } + }, + "dockerImages": {} +} \ No newline at end of file diff --git a/packages/@aws-cdk-testing/framework-integ/test/aws-apigatewayv2/test/http/integ.api.js.snapshot/httpapiDefaultTestDeployAssert77633A40.template.json b/packages/@aws-cdk-testing/framework-integ/test/aws-apigatewayv2/test/http/integ.api.js.snapshot/httpapiDefaultTestDeployAssert77633A40.template.json new file mode 100644 index 0000000000000..ad9d0fb73d1dd --- /dev/null +++ b/packages/@aws-cdk-testing/framework-integ/test/aws-apigatewayv2/test/http/integ.api.js.snapshot/httpapiDefaultTestDeployAssert77633A40.template.json @@ -0,0 +1,36 @@ +{ + "Parameters": { + "BootstrapVersion": { + "Type": "AWS::SSM::Parameter::Value", + "Default": "/cdk-bootstrap/hnb659fds/version", + "Description": "Version of the CDK Bootstrap resources in this environment, automatically retrieved from SSM Parameter Store. [cdk:skip]" + } + }, + "Rules": { + "CheckBootstrapVersion": { + "Assertions": [ + { + "Assert": { + "Fn::Not": [ + { + "Fn::Contains": [ + [ + "1", + "2", + "3", + "4", + "5" + ], + { + "Ref": "BootstrapVersion" + } + ] + } + ] + }, + "AssertDescription": "CDK bootstrap stack version 6 required. Please run 'cdk bootstrap' with a recent version of the CDK CLI." + } + ] + } + } +} \ No newline at end of file diff --git a/packages/@aws-cdk-testing/framework-integ/test/aws-apigatewayv2/test/http/integ.api.js.snapshot/integ.json b/packages/@aws-cdk-testing/framework-integ/test/aws-apigatewayv2/test/http/integ.api.js.snapshot/integ.json new file mode 100644 index 0000000000000..1b3ad22cef14a --- /dev/null +++ b/packages/@aws-cdk-testing/framework-integ/test/aws-apigatewayv2/test/http/integ.api.js.snapshot/integ.json @@ -0,0 +1,12 @@ +{ + "version": "35.0.0", + "testCases": { + "http-api/DefaultTest": { + "stacks": [ + "aws-cdk-aws-apigatewayv2" + ], + "assertionStack": "http-api/DefaultTest/DeployAssert", + "assertionStackName": "httpapiDefaultTestDeployAssert77633A40" + } + } +} \ No newline at end of file diff --git a/packages/@aws-cdk-testing/framework-integ/test/aws-apigatewayv2/test/http/integ.api.js.snapshot/manifest.json b/packages/@aws-cdk-testing/framework-integ/test/aws-apigatewayv2/test/http/integ.api.js.snapshot/manifest.json new file mode 100644 index 0000000000000..91e40a0cbe7bb --- /dev/null +++ b/packages/@aws-cdk-testing/framework-integ/test/aws-apigatewayv2/test/http/integ.api.js.snapshot/manifest.json @@ -0,0 +1,119 @@ +{ + "version": "35.0.0", + "artifacts": { + "aws-cdk-aws-apigatewayv2.assets": { + "type": "cdk:asset-manifest", + "properties": { + "file": "aws-cdk-aws-apigatewayv2.assets.json", + "requiresBootstrapStackVersion": 6, + "bootstrapStackVersionSsmParameter": "/cdk-bootstrap/hnb659fds/version" + } + }, + "aws-cdk-aws-apigatewayv2": { + "type": "aws:cloudformation:stack", + "environment": "aws://unknown-account/unknown-region", + "properties": { + "templateFile": "aws-cdk-aws-apigatewayv2.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}/f753b6c52b805082d600dd33b6be3b816c0954f254acf84347e2447774db5100.json", + "requiresBootstrapStackVersion": 6, + "bootstrapStackVersionSsmParameter": "/cdk-bootstrap/hnb659fds/version", + "additionalDependencies": [ + "aws-cdk-aws-apigatewayv2.assets" + ], + "lookupRole": { + "arn": "arn:${AWS::Partition}:iam::${AWS::AccountId}:role/cdk-hnb659fds-lookup-role-${AWS::AccountId}-${AWS::Region}", + "requiresBootstrapStackVersion": 8, + "bootstrapStackVersionSsmParameter": "/cdk-bootstrap/hnb659fds/version" + } + }, + "dependencies": [ + "aws-cdk-aws-apigatewayv2.assets" + ], + "metadata": { + "/aws-cdk-aws-apigatewayv2/HttpApi/Resource": [ + { + "type": "aws:cdk:logicalId", + "data": "HttpApiF5A9A8A7" + } + ], + "/aws-cdk-aws-apigatewayv2/HttpApi/DefaultStage/Resource": [ + { + "type": "aws:cdk:logicalId", + "data": "HttpApiDefaultStage3EEB07D6" + } + ], + "/aws-cdk-aws-apigatewayv2/BootstrapVersion": [ + { + "type": "aws:cdk:logicalId", + "data": "BootstrapVersion" + } + ], + "/aws-cdk-aws-apigatewayv2/CheckBootstrapVersion": [ + { + "type": "aws:cdk:logicalId", + "data": "CheckBootstrapVersion" + } + ] + }, + "displayName": "aws-cdk-aws-apigatewayv2" + }, + "httpapiDefaultTestDeployAssert77633A40.assets": { + "type": "cdk:asset-manifest", + "properties": { + "file": "httpapiDefaultTestDeployAssert77633A40.assets.json", + "requiresBootstrapStackVersion": 6, + "bootstrapStackVersionSsmParameter": "/cdk-bootstrap/hnb659fds/version" + } + }, + "httpapiDefaultTestDeployAssert77633A40": { + "type": "aws:cloudformation:stack", + "environment": "aws://unknown-account/unknown-region", + "properties": { + "templateFile": "httpapiDefaultTestDeployAssert77633A40.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}/21fbb51d7b23f6a6c262b46a9caee79d744a3ac019fd45422d988b96d44b2a22.json", + "requiresBootstrapStackVersion": 6, + "bootstrapStackVersionSsmParameter": "/cdk-bootstrap/hnb659fds/version", + "additionalDependencies": [ + "httpapiDefaultTestDeployAssert77633A40.assets" + ], + "lookupRole": { + "arn": "arn:${AWS::Partition}:iam::${AWS::AccountId}:role/cdk-hnb659fds-lookup-role-${AWS::AccountId}-${AWS::Region}", + "requiresBootstrapStackVersion": 8, + "bootstrapStackVersionSsmParameter": "/cdk-bootstrap/hnb659fds/version" + } + }, + "dependencies": [ + "httpapiDefaultTestDeployAssert77633A40.assets" + ], + "metadata": { + "/http-api/DefaultTest/DeployAssert/BootstrapVersion": [ + { + "type": "aws:cdk:logicalId", + "data": "BootstrapVersion" + } + ], + "/http-api/DefaultTest/DeployAssert/CheckBootstrapVersion": [ + { + "type": "aws:cdk:logicalId", + "data": "CheckBootstrapVersion" + } + ] + }, + "displayName": "http-api/DefaultTest/DeployAssert" + }, + "Tree": { + "type": "cdk:tree", + "properties": { + "file": "tree.json" + } + } + } +} \ No newline at end of file diff --git a/packages/@aws-cdk-testing/framework-integ/test/aws-apigatewayv2/test/http/integ.api.js.snapshot/tree.json b/packages/@aws-cdk-testing/framework-integ/test/aws-apigatewayv2/test/http/integ.api.js.snapshot/tree.json new file mode 100644 index 0000000000000..d17481862eddf --- /dev/null +++ b/packages/@aws-cdk-testing/framework-integ/test/aws-apigatewayv2/test/http/integ.api.js.snapshot/tree.json @@ -0,0 +1,154 @@ +{ + "version": "tree-0.1", + "tree": { + "id": "App", + "path": "", + "children": { + "aws-cdk-aws-apigatewayv2": { + "id": "aws-cdk-aws-apigatewayv2", + "path": "aws-cdk-aws-apigatewayv2", + "children": { + "HttpApi": { + "id": "HttpApi", + "path": "aws-cdk-aws-apigatewayv2/HttpApi", + "children": { + "Resource": { + "id": "Resource", + "path": "aws-cdk-aws-apigatewayv2/HttpApi/Resource", + "attributes": { + "aws:cdk:cloudformation:type": "AWS::ApiGatewayV2::Api", + "aws:cdk:cloudformation:props": { + "name": "HttpApi", + "protocolType": "HTTP" + } + }, + "constructInfo": { + "fqn": "aws-cdk-lib.aws_apigatewayv2.CfnApi", + "version": "0.0.0" + } + }, + "DefaultStage": { + "id": "DefaultStage", + "path": "aws-cdk-aws-apigatewayv2/HttpApi/DefaultStage", + "children": { + "Resource": { + "id": "Resource", + "path": "aws-cdk-aws-apigatewayv2/HttpApi/DefaultStage/Resource", + "attributes": { + "aws:cdk:cloudformation:type": "AWS::ApiGatewayV2::Stage", + "aws:cdk:cloudformation:props": { + "apiId": { + "Ref": "HttpApiF5A9A8A7" + }, + "autoDeploy": true, + "stageName": "$default" + } + }, + "constructInfo": { + "fqn": "aws-cdk-lib.aws_apigatewayv2.CfnStage", + "version": "0.0.0" + } + } + }, + "constructInfo": { + "fqn": "aws-cdk-lib.aws_apigatewayv2.HttpStage", + "version": "0.0.0" + } + } + }, + "constructInfo": { + "fqn": "aws-cdk-lib.aws_apigatewayv2.HttpApi", + "version": "0.0.0" + } + }, + "BootstrapVersion": { + "id": "BootstrapVersion", + "path": "aws-cdk-aws-apigatewayv2/BootstrapVersion", + "constructInfo": { + "fqn": "aws-cdk-lib.CfnParameter", + "version": "0.0.0" + } + }, + "CheckBootstrapVersion": { + "id": "CheckBootstrapVersion", + "path": "aws-cdk-aws-apigatewayv2/CheckBootstrapVersion", + "constructInfo": { + "fqn": "aws-cdk-lib.CfnRule", + "version": "0.0.0" + } + } + }, + "constructInfo": { + "fqn": "aws-cdk-lib.Stack", + "version": "0.0.0" + } + }, + "http-api": { + "id": "http-api", + "path": "http-api", + "children": { + "DefaultTest": { + "id": "DefaultTest", + "path": "http-api/DefaultTest", + "children": { + "Default": { + "id": "Default", + "path": "http-api/DefaultTest/Default", + "constructInfo": { + "fqn": "constructs.Construct", + "version": "10.3.0" + } + }, + "DeployAssert": { + "id": "DeployAssert", + "path": "http-api/DefaultTest/DeployAssert", + "children": { + "BootstrapVersion": { + "id": "BootstrapVersion", + "path": "http-api/DefaultTest/DeployAssert/BootstrapVersion", + "constructInfo": { + "fqn": "aws-cdk-lib.CfnParameter", + "version": "0.0.0" + } + }, + "CheckBootstrapVersion": { + "id": "CheckBootstrapVersion", + "path": "http-api/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.3.0" + } + } + }, + "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-apigatewayv2/test/http/integ.api.ts b/packages/@aws-cdk-testing/framework-integ/test/aws-apigatewayv2/test/http/integ.api.ts new file mode 100644 index 0000000000000..dac08621b9906 --- /dev/null +++ b/packages/@aws-cdk-testing/framework-integ/test/aws-apigatewayv2/test/http/integ.api.ts @@ -0,0 +1,14 @@ +#!/usr/bin/env node +import { IntegTest } from '@aws-cdk/integ-tests-alpha'; +import * as cdk from 'aws-cdk-lib'; +import * as apigw from 'aws-cdk-lib/aws-apigatewayv2'; + +const app = new cdk.App(); +const stack = new cdk.Stack(app, 'aws-cdk-aws-apigatewayv2'); + +new apigw.HttpApi(stack, 'HttpApi'); + +new IntegTest(app, 'http-api', { + testCases: [stack], +}); + diff --git a/packages/@aws-cdk-testing/framework-integ/test/aws-apigatewayv2/test/websocket/integ.api.js.snapshot/aws-cdk-aws-apigatewayv2.assets.json b/packages/@aws-cdk-testing/framework-integ/test/aws-apigatewayv2/test/websocket/integ.api.js.snapshot/aws-cdk-aws-apigatewayv2.assets.json new file mode 100644 index 0000000000000..57cb00af71146 --- /dev/null +++ b/packages/@aws-cdk-testing/framework-integ/test/aws-apigatewayv2/test/websocket/integ.api.js.snapshot/aws-cdk-aws-apigatewayv2.assets.json @@ -0,0 +1,19 @@ +{ + "version": "35.0.0", + "files": { + "21500b34598d560b1f62ae0eb2fab8201e073b18c3d28b7d69eefbfdb686d481": { + "source": { + "path": "aws-cdk-aws-apigatewayv2.template.json", + "packaging": "file" + }, + "destinations": { + "current_account-current_region": { + "bucketName": "cdk-hnb659fds-assets-${AWS::AccountId}-${AWS::Region}", + "objectKey": "21500b34598d560b1f62ae0eb2fab8201e073b18c3d28b7d69eefbfdb686d481.json", + "assumeRoleArn": "arn:${AWS::Partition}:iam::${AWS::AccountId}:role/cdk-hnb659fds-file-publishing-role-${AWS::AccountId}-${AWS::Region}" + } + } + } + }, + "dockerImages": {} +} \ No newline at end of file diff --git a/packages/@aws-cdk-testing/framework-integ/test/aws-apigatewayv2/test/websocket/integ.api.js.snapshot/aws-cdk-aws-apigatewayv2.template.json b/packages/@aws-cdk-testing/framework-integ/test/aws-apigatewayv2/test/websocket/integ.api.js.snapshot/aws-cdk-aws-apigatewayv2.template.json new file mode 100644 index 0000000000000..f01269f88b4d5 --- /dev/null +++ b/packages/@aws-cdk-testing/framework-integ/test/aws-apigatewayv2/test/websocket/integ.api.js.snapshot/aws-cdk-aws-apigatewayv2.template.json @@ -0,0 +1,46 @@ +{ + "Resources": { + "WebSocketApi34BCF99B": { + "Type": "AWS::ApiGatewayV2::Api", + "Properties": { + "Name": "WebSocketApi", + "ProtocolType": "WEBSOCKET", + "RouteSelectionExpression": "$request.body.action" + } + } + }, + "Parameters": { + "BootstrapVersion": { + "Type": "AWS::SSM::Parameter::Value", + "Default": "/cdk-bootstrap/hnb659fds/version", + "Description": "Version of the CDK Bootstrap resources in this environment, automatically retrieved from SSM Parameter Store. [cdk:skip]" + } + }, + "Rules": { + "CheckBootstrapVersion": { + "Assertions": [ + { + "Assert": { + "Fn::Not": [ + { + "Fn::Contains": [ + [ + "1", + "2", + "3", + "4", + "5" + ], + { + "Ref": "BootstrapVersion" + } + ] + } + ] + }, + "AssertDescription": "CDK bootstrap stack version 6 required. Please run 'cdk bootstrap' with a recent version of the CDK CLI." + } + ] + } + } +} \ No newline at end of file diff --git a/packages/@aws-cdk-testing/framework-integ/test/aws-apigatewayv2/test/websocket/integ.api.js.snapshot/cdk.out b/packages/@aws-cdk-testing/framework-integ/test/aws-apigatewayv2/test/websocket/integ.api.js.snapshot/cdk.out new file mode 100644 index 0000000000000..c5cb2e5de6344 --- /dev/null +++ b/packages/@aws-cdk-testing/framework-integ/test/aws-apigatewayv2/test/websocket/integ.api.js.snapshot/cdk.out @@ -0,0 +1 @@ +{"version":"35.0.0"} \ No newline at end of file diff --git a/packages/@aws-cdk-testing/framework-integ/test/aws-apigatewayv2/test/websocket/integ.api.js.snapshot/integ.json b/packages/@aws-cdk-testing/framework-integ/test/aws-apigatewayv2/test/websocket/integ.api.js.snapshot/integ.json new file mode 100644 index 0000000000000..929aef5464bc2 --- /dev/null +++ b/packages/@aws-cdk-testing/framework-integ/test/aws-apigatewayv2/test/websocket/integ.api.js.snapshot/integ.json @@ -0,0 +1,12 @@ +{ + "version": "35.0.0", + "testCases": { + "web-socket-api/DefaultTest": { + "stacks": [ + "aws-cdk-aws-apigatewayv2" + ], + "assertionStack": "web-socket-api/DefaultTest/DeployAssert", + "assertionStackName": "websocketapiDefaultTestDeployAssert230DE1C6" + } + } +} \ No newline at end of file diff --git a/packages/@aws-cdk-testing/framework-integ/test/aws-apigatewayv2/test/websocket/integ.api.js.snapshot/manifest.json b/packages/@aws-cdk-testing/framework-integ/test/aws-apigatewayv2/test/websocket/integ.api.js.snapshot/manifest.json new file mode 100644 index 0000000000000..c3977ff8c048b --- /dev/null +++ b/packages/@aws-cdk-testing/framework-integ/test/aws-apigatewayv2/test/websocket/integ.api.js.snapshot/manifest.json @@ -0,0 +1,113 @@ +{ + "version": "35.0.0", + "artifacts": { + "aws-cdk-aws-apigatewayv2.assets": { + "type": "cdk:asset-manifest", + "properties": { + "file": "aws-cdk-aws-apigatewayv2.assets.json", + "requiresBootstrapStackVersion": 6, + "bootstrapStackVersionSsmParameter": "/cdk-bootstrap/hnb659fds/version" + } + }, + "aws-cdk-aws-apigatewayv2": { + "type": "aws:cloudformation:stack", + "environment": "aws://unknown-account/unknown-region", + "properties": { + "templateFile": "aws-cdk-aws-apigatewayv2.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}/21500b34598d560b1f62ae0eb2fab8201e073b18c3d28b7d69eefbfdb686d481.json", + "requiresBootstrapStackVersion": 6, + "bootstrapStackVersionSsmParameter": "/cdk-bootstrap/hnb659fds/version", + "additionalDependencies": [ + "aws-cdk-aws-apigatewayv2.assets" + ], + "lookupRole": { + "arn": "arn:${AWS::Partition}:iam::${AWS::AccountId}:role/cdk-hnb659fds-lookup-role-${AWS::AccountId}-${AWS::Region}", + "requiresBootstrapStackVersion": 8, + "bootstrapStackVersionSsmParameter": "/cdk-bootstrap/hnb659fds/version" + } + }, + "dependencies": [ + "aws-cdk-aws-apigatewayv2.assets" + ], + "metadata": { + "/aws-cdk-aws-apigatewayv2/WebSocketApi/Resource": [ + { + "type": "aws:cdk:logicalId", + "data": "WebSocketApi34BCF99B" + } + ], + "/aws-cdk-aws-apigatewayv2/BootstrapVersion": [ + { + "type": "aws:cdk:logicalId", + "data": "BootstrapVersion" + } + ], + "/aws-cdk-aws-apigatewayv2/CheckBootstrapVersion": [ + { + "type": "aws:cdk:logicalId", + "data": "CheckBootstrapVersion" + } + ] + }, + "displayName": "aws-cdk-aws-apigatewayv2" + }, + "websocketapiDefaultTestDeployAssert230DE1C6.assets": { + "type": "cdk:asset-manifest", + "properties": { + "file": "websocketapiDefaultTestDeployAssert230DE1C6.assets.json", + "requiresBootstrapStackVersion": 6, + "bootstrapStackVersionSsmParameter": "/cdk-bootstrap/hnb659fds/version" + } + }, + "websocketapiDefaultTestDeployAssert230DE1C6": { + "type": "aws:cloudformation:stack", + "environment": "aws://unknown-account/unknown-region", + "properties": { + "templateFile": "websocketapiDefaultTestDeployAssert230DE1C6.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}/21fbb51d7b23f6a6c262b46a9caee79d744a3ac019fd45422d988b96d44b2a22.json", + "requiresBootstrapStackVersion": 6, + "bootstrapStackVersionSsmParameter": "/cdk-bootstrap/hnb659fds/version", + "additionalDependencies": [ + "websocketapiDefaultTestDeployAssert230DE1C6.assets" + ], + "lookupRole": { + "arn": "arn:${AWS::Partition}:iam::${AWS::AccountId}:role/cdk-hnb659fds-lookup-role-${AWS::AccountId}-${AWS::Region}", + "requiresBootstrapStackVersion": 8, + "bootstrapStackVersionSsmParameter": "/cdk-bootstrap/hnb659fds/version" + } + }, + "dependencies": [ + "websocketapiDefaultTestDeployAssert230DE1C6.assets" + ], + "metadata": { + "/web-socket-api/DefaultTest/DeployAssert/BootstrapVersion": [ + { + "type": "aws:cdk:logicalId", + "data": "BootstrapVersion" + } + ], + "/web-socket-api/DefaultTest/DeployAssert/CheckBootstrapVersion": [ + { + "type": "aws:cdk:logicalId", + "data": "CheckBootstrapVersion" + } + ] + }, + "displayName": "web-socket-api/DefaultTest/DeployAssert" + }, + "Tree": { + "type": "cdk:tree", + "properties": { + "file": "tree.json" + } + } + } +} \ No newline at end of file diff --git a/packages/@aws-cdk-testing/framework-integ/test/aws-apigatewayv2/test/websocket/integ.api.js.snapshot/tree.json b/packages/@aws-cdk-testing/framework-integ/test/aws-apigatewayv2/test/websocket/integ.api.js.snapshot/tree.json new file mode 100644 index 0000000000000..96a63513767f1 --- /dev/null +++ b/packages/@aws-cdk-testing/framework-integ/test/aws-apigatewayv2/test/websocket/integ.api.js.snapshot/tree.json @@ -0,0 +1,127 @@ +{ + "version": "tree-0.1", + "tree": { + "id": "App", + "path": "", + "children": { + "aws-cdk-aws-apigatewayv2": { + "id": "aws-cdk-aws-apigatewayv2", + "path": "aws-cdk-aws-apigatewayv2", + "children": { + "WebSocketApi": { + "id": "WebSocketApi", + "path": "aws-cdk-aws-apigatewayv2/WebSocketApi", + "children": { + "Resource": { + "id": "Resource", + "path": "aws-cdk-aws-apigatewayv2/WebSocketApi/Resource", + "attributes": { + "aws:cdk:cloudformation:type": "AWS::ApiGatewayV2::Api", + "aws:cdk:cloudformation:props": { + "name": "WebSocketApi", + "protocolType": "WEBSOCKET", + "routeSelectionExpression": "$request.body.action" + } + }, + "constructInfo": { + "fqn": "aws-cdk-lib.aws_apigatewayv2.CfnApi", + "version": "0.0.0" + } + } + }, + "constructInfo": { + "fqn": "aws-cdk-lib.aws_apigatewayv2.WebSocketApi", + "version": "0.0.0" + } + }, + "BootstrapVersion": { + "id": "BootstrapVersion", + "path": "aws-cdk-aws-apigatewayv2/BootstrapVersion", + "constructInfo": { + "fqn": "aws-cdk-lib.CfnParameter", + "version": "0.0.0" + } + }, + "CheckBootstrapVersion": { + "id": "CheckBootstrapVersion", + "path": "aws-cdk-aws-apigatewayv2/CheckBootstrapVersion", + "constructInfo": { + "fqn": "aws-cdk-lib.CfnRule", + "version": "0.0.0" + } + } + }, + "constructInfo": { + "fqn": "aws-cdk-lib.Stack", + "version": "0.0.0" + } + }, + "web-socket-api": { + "id": "web-socket-api", + "path": "web-socket-api", + "children": { + "DefaultTest": { + "id": "DefaultTest", + "path": "web-socket-api/DefaultTest", + "children": { + "Default": { + "id": "Default", + "path": "web-socket-api/DefaultTest/Default", + "constructInfo": { + "fqn": "constructs.Construct", + "version": "10.3.0" + } + }, + "DeployAssert": { + "id": "DeployAssert", + "path": "web-socket-api/DefaultTest/DeployAssert", + "children": { + "BootstrapVersion": { + "id": "BootstrapVersion", + "path": "web-socket-api/DefaultTest/DeployAssert/BootstrapVersion", + "constructInfo": { + "fqn": "aws-cdk-lib.CfnParameter", + "version": "0.0.0" + } + }, + "CheckBootstrapVersion": { + "id": "CheckBootstrapVersion", + "path": "web-socket-api/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.3.0" + } + } + }, + "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-apigatewayv2/test/websocket/integ.api.js.snapshot/websocketapiDefaultTestDeployAssert230DE1C6.assets.json b/packages/@aws-cdk-testing/framework-integ/test/aws-apigatewayv2/test/websocket/integ.api.js.snapshot/websocketapiDefaultTestDeployAssert230DE1C6.assets.json new file mode 100644 index 0000000000000..a441519e712ae --- /dev/null +++ b/packages/@aws-cdk-testing/framework-integ/test/aws-apigatewayv2/test/websocket/integ.api.js.snapshot/websocketapiDefaultTestDeployAssert230DE1C6.assets.json @@ -0,0 +1,19 @@ +{ + "version": "35.0.0", + "files": { + "21fbb51d7b23f6a6c262b46a9caee79d744a3ac019fd45422d988b96d44b2a22": { + "source": { + "path": "websocketapiDefaultTestDeployAssert230DE1C6.template.json", + "packaging": "file" + }, + "destinations": { + "current_account-current_region": { + "bucketName": "cdk-hnb659fds-assets-${AWS::AccountId}-${AWS::Region}", + "objectKey": "21fbb51d7b23f6a6c262b46a9caee79d744a3ac019fd45422d988b96d44b2a22.json", + "assumeRoleArn": "arn:${AWS::Partition}:iam::${AWS::AccountId}:role/cdk-hnb659fds-file-publishing-role-${AWS::AccountId}-${AWS::Region}" + } + } + } + }, + "dockerImages": {} +} \ No newline at end of file diff --git a/packages/@aws-cdk-testing/framework-integ/test/aws-apigatewayv2/test/websocket/integ.api.js.snapshot/websocketapiDefaultTestDeployAssert230DE1C6.template.json b/packages/@aws-cdk-testing/framework-integ/test/aws-apigatewayv2/test/websocket/integ.api.js.snapshot/websocketapiDefaultTestDeployAssert230DE1C6.template.json new file mode 100644 index 0000000000000..ad9d0fb73d1dd --- /dev/null +++ b/packages/@aws-cdk-testing/framework-integ/test/aws-apigatewayv2/test/websocket/integ.api.js.snapshot/websocketapiDefaultTestDeployAssert230DE1C6.template.json @@ -0,0 +1,36 @@ +{ + "Parameters": { + "BootstrapVersion": { + "Type": "AWS::SSM::Parameter::Value", + "Default": "/cdk-bootstrap/hnb659fds/version", + "Description": "Version of the CDK Bootstrap resources in this environment, automatically retrieved from SSM Parameter Store. [cdk:skip]" + } + }, + "Rules": { + "CheckBootstrapVersion": { + "Assertions": [ + { + "Assert": { + "Fn::Not": [ + { + "Fn::Contains": [ + [ + "1", + "2", + "3", + "4", + "5" + ], + { + "Ref": "BootstrapVersion" + } + ] + } + ] + }, + "AssertDescription": "CDK bootstrap stack version 6 required. Please run 'cdk bootstrap' with a recent version of the CDK CLI." + } + ] + } + } +} \ No newline at end of file diff --git a/packages/@aws-cdk-testing/framework-integ/test/aws-apigatewayv2/test/websocket/integ.api.ts b/packages/@aws-cdk-testing/framework-integ/test/aws-apigatewayv2/test/websocket/integ.api.ts new file mode 100644 index 0000000000000..83fc1e845168d --- /dev/null +++ b/packages/@aws-cdk-testing/framework-integ/test/aws-apigatewayv2/test/websocket/integ.api.ts @@ -0,0 +1,14 @@ +#!/usr/bin/env node +import { IntegTest } from '@aws-cdk/integ-tests-alpha'; +import * as cdk from 'aws-cdk-lib'; +import * as apigw from 'aws-cdk-lib/aws-apigatewayv2'; + +const app = new cdk.App(); +const stack = new cdk.Stack(app, 'aws-cdk-aws-apigatewayv2'); + +new apigw.WebSocketApi(stack, 'WebSocketApi'); + +new IntegTest(app, 'web-socket-api', { + testCases: [stack], +}); + diff --git a/packages/@aws-cdk-testing/framework-integ/test/aws-globalaccelerator/test/integ.globalaccelerator-ip-address-type.js.snapshot/GlobalAcceleratorIpAddressTypeDefaultTestDeployAssertFE50B593.assets.json b/packages/@aws-cdk-testing/framework-integ/test/aws-globalaccelerator/test/integ.globalaccelerator-ip-address-type.js.snapshot/GlobalAcceleratorIpAddressTypeDefaultTestDeployAssertFE50B593.assets.json new file mode 100644 index 0000000000000..575c9f76edcb3 --- /dev/null +++ b/packages/@aws-cdk-testing/framework-integ/test/aws-globalaccelerator/test/integ.globalaccelerator-ip-address-type.js.snapshot/GlobalAcceleratorIpAddressTypeDefaultTestDeployAssertFE50B593.assets.json @@ -0,0 +1,19 @@ +{ + "version": "35.0.0", + "files": { + "21fbb51d7b23f6a6c262b46a9caee79d744a3ac019fd45422d988b96d44b2a22": { + "source": { + "path": "GlobalAcceleratorIpAddressTypeDefaultTestDeployAssertFE50B593.template.json", + "packaging": "file" + }, + "destinations": { + "current_account-current_region": { + "bucketName": "cdk-hnb659fds-assets-${AWS::AccountId}-${AWS::Region}", + "objectKey": "21fbb51d7b23f6a6c262b46a9caee79d744a3ac019fd45422d988b96d44b2a22.json", + "assumeRoleArn": "arn:${AWS::Partition}:iam::${AWS::AccountId}:role/cdk-hnb659fds-file-publishing-role-${AWS::AccountId}-${AWS::Region}" + } + } + } + }, + "dockerImages": {} +} \ No newline at end of file diff --git a/packages/@aws-cdk-testing/framework-integ/test/aws-globalaccelerator/test/integ.globalaccelerator-ip-address-type.js.snapshot/GlobalAcceleratorIpAddressTypeDefaultTestDeployAssertFE50B593.template.json b/packages/@aws-cdk-testing/framework-integ/test/aws-globalaccelerator/test/integ.globalaccelerator-ip-address-type.js.snapshot/GlobalAcceleratorIpAddressTypeDefaultTestDeployAssertFE50B593.template.json new file mode 100644 index 0000000000000..ad9d0fb73d1dd --- /dev/null +++ b/packages/@aws-cdk-testing/framework-integ/test/aws-globalaccelerator/test/integ.globalaccelerator-ip-address-type.js.snapshot/GlobalAcceleratorIpAddressTypeDefaultTestDeployAssertFE50B593.template.json @@ -0,0 +1,36 @@ +{ + "Parameters": { + "BootstrapVersion": { + "Type": "AWS::SSM::Parameter::Value", + "Default": "/cdk-bootstrap/hnb659fds/version", + "Description": "Version of the CDK Bootstrap resources in this environment, automatically retrieved from SSM Parameter Store. [cdk:skip]" + } + }, + "Rules": { + "CheckBootstrapVersion": { + "Assertions": [ + { + "Assert": { + "Fn::Not": [ + { + "Fn::Contains": [ + [ + "1", + "2", + "3", + "4", + "5" + ], + { + "Ref": "BootstrapVersion" + } + ] + } + ] + }, + "AssertDescription": "CDK bootstrap stack version 6 required. Please run 'cdk bootstrap' with a recent version of the CDK CLI." + } + ] + } + } +} \ No newline at end of file diff --git a/packages/@aws-cdk-testing/framework-integ/test/aws-globalaccelerator/test/integ.globalaccelerator-ip-address-type.js.snapshot/cdk.out b/packages/@aws-cdk-testing/framework-integ/test/aws-globalaccelerator/test/integ.globalaccelerator-ip-address-type.js.snapshot/cdk.out new file mode 100644 index 0000000000000..c5cb2e5de6344 --- /dev/null +++ b/packages/@aws-cdk-testing/framework-integ/test/aws-globalaccelerator/test/integ.globalaccelerator-ip-address-type.js.snapshot/cdk.out @@ -0,0 +1 @@ +{"version":"35.0.0"} \ No newline at end of file diff --git a/packages/@aws-cdk-testing/framework-integ/test/aws-globalaccelerator/test/integ.globalaccelerator-ip-address-type.js.snapshot/global-accelerator-ip-address-type.assets.json b/packages/@aws-cdk-testing/framework-integ/test/aws-globalaccelerator/test/integ.globalaccelerator-ip-address-type.js.snapshot/global-accelerator-ip-address-type.assets.json new file mode 100644 index 0000000000000..c7050f20c8248 --- /dev/null +++ b/packages/@aws-cdk-testing/framework-integ/test/aws-globalaccelerator/test/integ.globalaccelerator-ip-address-type.js.snapshot/global-accelerator-ip-address-type.assets.json @@ -0,0 +1,19 @@ +{ + "version": "35.0.0", + "files": { + "47744c3cc21fb0c0e29cdb8642c547ef19256315a25557df8546037677381323": { + "source": { + "path": "global-accelerator-ip-address-type.template.json", + "packaging": "file" + }, + "destinations": { + "current_account-current_region": { + "bucketName": "cdk-hnb659fds-assets-${AWS::AccountId}-${AWS::Region}", + "objectKey": "47744c3cc21fb0c0e29cdb8642c547ef19256315a25557df8546037677381323.json", + "assumeRoleArn": "arn:${AWS::Partition}:iam::${AWS::AccountId}:role/cdk-hnb659fds-file-publishing-role-${AWS::AccountId}-${AWS::Region}" + } + } + } + }, + "dockerImages": {} +} \ No newline at end of file diff --git a/packages/@aws-cdk-testing/framework-integ/test/aws-globalaccelerator/test/integ.globalaccelerator-ip-address-type.js.snapshot/global-accelerator-ip-address-type.template.json b/packages/@aws-cdk-testing/framework-integ/test/aws-globalaccelerator/test/integ.globalaccelerator-ip-address-type.js.snapshot/global-accelerator-ip-address-type.template.json new file mode 100644 index 0000000000000..de80846383032 --- /dev/null +++ b/packages/@aws-cdk-testing/framework-integ/test/aws-globalaccelerator/test/integ.globalaccelerator-ip-address-type.js.snapshot/global-accelerator-ip-address-type.template.json @@ -0,0 +1,46 @@ +{ + "Resources": { + "Accelerator8EB0B6B1": { + "Type": "AWS::GlobalAccelerator::Accelerator", + "Properties": { + "Enabled": true, + "IpAddressType": "DUAL_STACK", + "Name": "acceleratorWithIpAddressType" + } + } + }, + "Parameters": { + "BootstrapVersion": { + "Type": "AWS::SSM::Parameter::Value", + "Default": "/cdk-bootstrap/hnb659fds/version", + "Description": "Version of the CDK Bootstrap resources in this environment, automatically retrieved from SSM Parameter Store. [cdk:skip]" + } + }, + "Rules": { + "CheckBootstrapVersion": { + "Assertions": [ + { + "Assert": { + "Fn::Not": [ + { + "Fn::Contains": [ + [ + "1", + "2", + "3", + "4", + "5" + ], + { + "Ref": "BootstrapVersion" + } + ] + } + ] + }, + "AssertDescription": "CDK bootstrap stack version 6 required. Please run 'cdk bootstrap' with a recent version of the CDK CLI." + } + ] + } + } +} \ No newline at end of file diff --git a/packages/@aws-cdk-testing/framework-integ/test/aws-globalaccelerator/test/integ.globalaccelerator-ip-address-type.js.snapshot/integ.json b/packages/@aws-cdk-testing/framework-integ/test/aws-globalaccelerator/test/integ.globalaccelerator-ip-address-type.js.snapshot/integ.json new file mode 100644 index 0000000000000..3004bb9075474 --- /dev/null +++ b/packages/@aws-cdk-testing/framework-integ/test/aws-globalaccelerator/test/integ.globalaccelerator-ip-address-type.js.snapshot/integ.json @@ -0,0 +1,12 @@ +{ + "version": "35.0.0", + "testCases": { + "GlobalAcceleratorIpAddressType/DefaultTest": { + "stacks": [ + "global-accelerator-ip-address-type" + ], + "assertionStack": "GlobalAcceleratorIpAddressType/DefaultTest/DeployAssert", + "assertionStackName": "GlobalAcceleratorIpAddressTypeDefaultTestDeployAssertFE50B593" + } + } +} \ No newline at end of file diff --git a/packages/@aws-cdk-testing/framework-integ/test/aws-globalaccelerator/test/integ.globalaccelerator-ip-address-type.js.snapshot/manifest.json b/packages/@aws-cdk-testing/framework-integ/test/aws-globalaccelerator/test/integ.globalaccelerator-ip-address-type.js.snapshot/manifest.json new file mode 100644 index 0000000000000..c34258606a30a --- /dev/null +++ b/packages/@aws-cdk-testing/framework-integ/test/aws-globalaccelerator/test/integ.globalaccelerator-ip-address-type.js.snapshot/manifest.json @@ -0,0 +1,113 @@ +{ + "version": "35.0.0", + "artifacts": { + "global-accelerator-ip-address-type.assets": { + "type": "cdk:asset-manifest", + "properties": { + "file": "global-accelerator-ip-address-type.assets.json", + "requiresBootstrapStackVersion": 6, + "bootstrapStackVersionSsmParameter": "/cdk-bootstrap/hnb659fds/version" + } + }, + "global-accelerator-ip-address-type": { + "type": "aws:cloudformation:stack", + "environment": "aws://unknown-account/unknown-region", + "properties": { + "templateFile": "global-accelerator-ip-address-type.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}/47744c3cc21fb0c0e29cdb8642c547ef19256315a25557df8546037677381323.json", + "requiresBootstrapStackVersion": 6, + "bootstrapStackVersionSsmParameter": "/cdk-bootstrap/hnb659fds/version", + "additionalDependencies": [ + "global-accelerator-ip-address-type.assets" + ], + "lookupRole": { + "arn": "arn:${AWS::Partition}:iam::${AWS::AccountId}:role/cdk-hnb659fds-lookup-role-${AWS::AccountId}-${AWS::Region}", + "requiresBootstrapStackVersion": 8, + "bootstrapStackVersionSsmParameter": "/cdk-bootstrap/hnb659fds/version" + } + }, + "dependencies": [ + "global-accelerator-ip-address-type.assets" + ], + "metadata": { + "/global-accelerator-ip-address-type/Accelerator/Resource": [ + { + "type": "aws:cdk:logicalId", + "data": "Accelerator8EB0B6B1" + } + ], + "/global-accelerator-ip-address-type/BootstrapVersion": [ + { + "type": "aws:cdk:logicalId", + "data": "BootstrapVersion" + } + ], + "/global-accelerator-ip-address-type/CheckBootstrapVersion": [ + { + "type": "aws:cdk:logicalId", + "data": "CheckBootstrapVersion" + } + ] + }, + "displayName": "global-accelerator-ip-address-type" + }, + "GlobalAcceleratorIpAddressTypeDefaultTestDeployAssertFE50B593.assets": { + "type": "cdk:asset-manifest", + "properties": { + "file": "GlobalAcceleratorIpAddressTypeDefaultTestDeployAssertFE50B593.assets.json", + "requiresBootstrapStackVersion": 6, + "bootstrapStackVersionSsmParameter": "/cdk-bootstrap/hnb659fds/version" + } + }, + "GlobalAcceleratorIpAddressTypeDefaultTestDeployAssertFE50B593": { + "type": "aws:cloudformation:stack", + "environment": "aws://unknown-account/unknown-region", + "properties": { + "templateFile": "GlobalAcceleratorIpAddressTypeDefaultTestDeployAssertFE50B593.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}/21fbb51d7b23f6a6c262b46a9caee79d744a3ac019fd45422d988b96d44b2a22.json", + "requiresBootstrapStackVersion": 6, + "bootstrapStackVersionSsmParameter": "/cdk-bootstrap/hnb659fds/version", + "additionalDependencies": [ + "GlobalAcceleratorIpAddressTypeDefaultTestDeployAssertFE50B593.assets" + ], + "lookupRole": { + "arn": "arn:${AWS::Partition}:iam::${AWS::AccountId}:role/cdk-hnb659fds-lookup-role-${AWS::AccountId}-${AWS::Region}", + "requiresBootstrapStackVersion": 8, + "bootstrapStackVersionSsmParameter": "/cdk-bootstrap/hnb659fds/version" + } + }, + "dependencies": [ + "GlobalAcceleratorIpAddressTypeDefaultTestDeployAssertFE50B593.assets" + ], + "metadata": { + "/GlobalAcceleratorIpAddressType/DefaultTest/DeployAssert/BootstrapVersion": [ + { + "type": "aws:cdk:logicalId", + "data": "BootstrapVersion" + } + ], + "/GlobalAcceleratorIpAddressType/DefaultTest/DeployAssert/CheckBootstrapVersion": [ + { + "type": "aws:cdk:logicalId", + "data": "CheckBootstrapVersion" + } + ] + }, + "displayName": "GlobalAcceleratorIpAddressType/DefaultTest/DeployAssert" + }, + "Tree": { + "type": "cdk:tree", + "properties": { + "file": "tree.json" + } + } + } +} \ No newline at end of file diff --git a/packages/@aws-cdk-testing/framework-integ/test/aws-globalaccelerator/test/integ.globalaccelerator-ip-address-type.js.snapshot/tree.json b/packages/@aws-cdk-testing/framework-integ/test/aws-globalaccelerator/test/integ.globalaccelerator-ip-address-type.js.snapshot/tree.json new file mode 100644 index 0000000000000..ee2b632c13937 --- /dev/null +++ b/packages/@aws-cdk-testing/framework-integ/test/aws-globalaccelerator/test/integ.globalaccelerator-ip-address-type.js.snapshot/tree.json @@ -0,0 +1,127 @@ +{ + "version": "tree-0.1", + "tree": { + "id": "App", + "path": "", + "children": { + "global-accelerator-ip-address-type": { + "id": "global-accelerator-ip-address-type", + "path": "global-accelerator-ip-address-type", + "children": { + "Accelerator": { + "id": "Accelerator", + "path": "global-accelerator-ip-address-type/Accelerator", + "children": { + "Resource": { + "id": "Resource", + "path": "global-accelerator-ip-address-type/Accelerator/Resource", + "attributes": { + "aws:cdk:cloudformation:type": "AWS::GlobalAccelerator::Accelerator", + "aws:cdk:cloudformation:props": { + "enabled": true, + "ipAddressType": "DUAL_STACK", + "name": "acceleratorWithIpAddressType" + } + }, + "constructInfo": { + "fqn": "constructs.Construct", + "version": "10.3.0" + } + } + }, + "constructInfo": { + "fqn": "constructs.Construct", + "version": "10.3.0" + } + }, + "BootstrapVersion": { + "id": "BootstrapVersion", + "path": "global-accelerator-ip-address-type/BootstrapVersion", + "constructInfo": { + "fqn": "constructs.Construct", + "version": "10.3.0" + } + }, + "CheckBootstrapVersion": { + "id": "CheckBootstrapVersion", + "path": "global-accelerator-ip-address-type/CheckBootstrapVersion", + "constructInfo": { + "fqn": "constructs.Construct", + "version": "10.3.0" + } + } + }, + "constructInfo": { + "fqn": "constructs.Construct", + "version": "10.3.0" + } + }, + "GlobalAcceleratorIpAddressType": { + "id": "GlobalAcceleratorIpAddressType", + "path": "GlobalAcceleratorIpAddressType", + "children": { + "DefaultTest": { + "id": "DefaultTest", + "path": "GlobalAcceleratorIpAddressType/DefaultTest", + "children": { + "Default": { + "id": "Default", + "path": "GlobalAcceleratorIpAddressType/DefaultTest/Default", + "constructInfo": { + "fqn": "constructs.Construct", + "version": "10.3.0" + } + }, + "DeployAssert": { + "id": "DeployAssert", + "path": "GlobalAcceleratorIpAddressType/DefaultTest/DeployAssert", + "children": { + "BootstrapVersion": { + "id": "BootstrapVersion", + "path": "GlobalAcceleratorIpAddressType/DefaultTest/DeployAssert/BootstrapVersion", + "constructInfo": { + "fqn": "constructs.Construct", + "version": "10.3.0" + } + }, + "CheckBootstrapVersion": { + "id": "CheckBootstrapVersion", + "path": "GlobalAcceleratorIpAddressType/DefaultTest/DeployAssert/CheckBootstrapVersion", + "constructInfo": { + "fqn": "constructs.Construct", + "version": "10.3.0" + } + } + }, + "constructInfo": { + "fqn": "constructs.Construct", + "version": "10.3.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.3.0" + } + } + }, + "constructInfo": { + "fqn": "constructs.Construct", + "version": "10.3.0" + } + } +} \ No newline at end of file diff --git a/packages/@aws-cdk-testing/framework-integ/test/aws-globalaccelerator/test/integ.globalaccelerator-ip-address-type.ts b/packages/@aws-cdk-testing/framework-integ/test/aws-globalaccelerator/test/integ.globalaccelerator-ip-address-type.ts new file mode 100644 index 0000000000000..9047c1ec945af --- /dev/null +++ b/packages/@aws-cdk-testing/framework-integ/test/aws-globalaccelerator/test/integ.globalaccelerator-ip-address-type.ts @@ -0,0 +1,18 @@ +import { App, Stack } from 'aws-cdk-lib'; +import { IntegTest } from '@aws-cdk/integ-tests-alpha'; +import * as ga from 'aws-cdk-lib/aws-globalaccelerator'; + +const app = new App({}); + +const stack = new Stack(app, 'global-accelerator-ip-address-type'); + +new ga.Accelerator(stack, 'Accelerator', { + acceleratorName: 'acceleratorWithIpAddressType', + ipAddressType: ga.IpAddressType.DUAL_STACK, +}); + +new IntegTest(app, 'GlobalAcceleratorIpAddressType', { + testCases: [stack], +}); + +app.synth(); diff --git a/packages/@aws-cdk-testing/framework-integ/test/aws-globalaccelerator/test/integ.globalaccelerator-unique-name.js.snapshot/GlobalAcceleratorUniqueNameDefaultTestDeployAssertCA235111.assets.json b/packages/@aws-cdk-testing/framework-integ/test/aws-globalaccelerator/test/integ.globalaccelerator-unique-name.js.snapshot/GlobalAcceleratorUniqueNameDefaultTestDeployAssertCA235111.assets.json index 638d569ab5c46..ac4e559db804f 100644 --- a/packages/@aws-cdk-testing/framework-integ/test/aws-globalaccelerator/test/integ.globalaccelerator-unique-name.js.snapshot/GlobalAcceleratorUniqueNameDefaultTestDeployAssertCA235111.assets.json +++ b/packages/@aws-cdk-testing/framework-integ/test/aws-globalaccelerator/test/integ.globalaccelerator-unique-name.js.snapshot/GlobalAcceleratorUniqueNameDefaultTestDeployAssertCA235111.assets.json @@ -1,5 +1,5 @@ { - "version": "31.0.0", + "version": "35.0.0", "files": { "21fbb51d7b23f6a6c262b46a9caee79d744a3ac019fd45422d988b96d44b2a22": { "source": { diff --git a/packages/@aws-cdk-testing/framework-integ/test/aws-globalaccelerator/test/integ.globalaccelerator-unique-name.js.snapshot/cdk.out b/packages/@aws-cdk-testing/framework-integ/test/aws-globalaccelerator/test/integ.globalaccelerator-unique-name.js.snapshot/cdk.out index 7925065efbcc4..c5cb2e5de6344 100644 --- a/packages/@aws-cdk-testing/framework-integ/test/aws-globalaccelerator/test/integ.globalaccelerator-unique-name.js.snapshot/cdk.out +++ b/packages/@aws-cdk-testing/framework-integ/test/aws-globalaccelerator/test/integ.globalaccelerator-unique-name.js.snapshot/cdk.out @@ -1 +1 @@ -{"version":"31.0.0"} \ No newline at end of file +{"version":"35.0.0"} \ No newline at end of file diff --git a/packages/@aws-cdk-testing/framework-integ/test/aws-globalaccelerator/test/integ.globalaccelerator-unique-name.js.snapshot/global-accelerator-unique-name.assets.json b/packages/@aws-cdk-testing/framework-integ/test/aws-globalaccelerator/test/integ.globalaccelerator-unique-name.js.snapshot/global-accelerator-unique-name.assets.json index 632ad8edb4ed9..9a91c93ef020a 100644 --- a/packages/@aws-cdk-testing/framework-integ/test/aws-globalaccelerator/test/integ.globalaccelerator-unique-name.js.snapshot/global-accelerator-unique-name.assets.json +++ b/packages/@aws-cdk-testing/framework-integ/test/aws-globalaccelerator/test/integ.globalaccelerator-unique-name.js.snapshot/global-accelerator-unique-name.assets.json @@ -1,7 +1,7 @@ { - "version": "31.0.0", + "version": "35.0.0", "files": { - "0878b70e8e50789495d8912191b4f71d0564827682a0fffa7801d540fad94e83": { + "c23e37bb9e549e184722a2fabaa890032fa56a11b7bd9e2c63511e075175d12a": { "source": { "path": "global-accelerator-unique-name.template.json", "packaging": "file" @@ -9,7 +9,7 @@ "destinations": { "current_account-current_region": { "bucketName": "cdk-hnb659fds-assets-${AWS::AccountId}-${AWS::Region}", - "objectKey": "0878b70e8e50789495d8912191b4f71d0564827682a0fffa7801d540fad94e83.json", + "objectKey": "c23e37bb9e549e184722a2fabaa890032fa56a11b7bd9e2c63511e075175d12a.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-globalaccelerator/test/integ.globalaccelerator-unique-name.js.snapshot/global-accelerator-unique-name.template.json b/packages/@aws-cdk-testing/framework-integ/test/aws-globalaccelerator/test/integ.globalaccelerator-unique-name.js.snapshot/global-accelerator-unique-name.template.json index bcc6aeb9b211f..ea14599ce4361 100644 --- a/packages/@aws-cdk-testing/framework-integ/test/aws-globalaccelerator/test/integ.globalaccelerator-unique-name.js.snapshot/global-accelerator-unique-name.template.json +++ b/packages/@aws-cdk-testing/framework-integ/test/aws-globalaccelerator/test/integ.globalaccelerator-unique-name.js.snapshot/global-accelerator-unique-name.template.json @@ -3,8 +3,8 @@ "Accelerator8EB0B6B1": { "Type": "AWS::GlobalAccelerator::Accelerator", "Properties": { - "Name": "globalacceleratoruniquenameAccelerator519EC5EE", - "Enabled": true + "Enabled": true, + "Name": "globalacceleratoruniquenameAccelerator519EC5EE" } } }, diff --git a/packages/@aws-cdk-testing/framework-integ/test/aws-globalaccelerator/test/integ.globalaccelerator-unique-name.js.snapshot/integ.json b/packages/@aws-cdk-testing/framework-integ/test/aws-globalaccelerator/test/integ.globalaccelerator-unique-name.js.snapshot/integ.json index f5e0d5fd0e4d5..1cf7bae20641c 100644 --- a/packages/@aws-cdk-testing/framework-integ/test/aws-globalaccelerator/test/integ.globalaccelerator-unique-name.js.snapshot/integ.json +++ b/packages/@aws-cdk-testing/framework-integ/test/aws-globalaccelerator/test/integ.globalaccelerator-unique-name.js.snapshot/integ.json @@ -1,5 +1,5 @@ { - "version": "31.0.0", + "version": "35.0.0", "testCases": { "GlobalAcceleratorUniqueName/DefaultTest": { "stacks": [ diff --git a/packages/@aws-cdk-testing/framework-integ/test/aws-globalaccelerator/test/integ.globalaccelerator-unique-name.js.snapshot/manifest.json b/packages/@aws-cdk-testing/framework-integ/test/aws-globalaccelerator/test/integ.globalaccelerator-unique-name.js.snapshot/manifest.json index f0a419f321ffc..022b73705cfe8 100644 --- a/packages/@aws-cdk-testing/framework-integ/test/aws-globalaccelerator/test/integ.globalaccelerator-unique-name.js.snapshot/manifest.json +++ b/packages/@aws-cdk-testing/framework-integ/test/aws-globalaccelerator/test/integ.globalaccelerator-unique-name.js.snapshot/manifest.json @@ -1,5 +1,5 @@ { - "version": "31.0.0", + "version": "35.0.0", "artifacts": { "global-accelerator-unique-name.assets": { "type": "cdk:asset-manifest", @@ -14,10 +14,11 @@ "environment": "aws://unknown-account/unknown-region", "properties": { "templateFile": "global-accelerator-unique-name.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}/0878b70e8e50789495d8912191b4f71d0564827682a0fffa7801d540fad94e83.json", + "stackTemplateAssetObjectUrl": "s3://cdk-hnb659fds-assets-${AWS::AccountId}-${AWS::Region}/c23e37bb9e549e184722a2fabaa890032fa56a11b7bd9e2c63511e075175d12a.json", "requiresBootstrapStackVersion": 6, "bootstrapStackVersionSsmParameter": "/cdk-bootstrap/hnb659fds/version", "additionalDependencies": [ @@ -50,6 +51,15 @@ "type": "aws:cdk:logicalId", "data": "CheckBootstrapVersion" } + ], + "AccIpAddressTypeB72ABC9C": [ + { + "type": "aws:cdk:logicalId", + "data": "AccIpAddressTypeB72ABC9C", + "trace": [ + "!!DESTRUCTIVE_CHANGES: WILL_DESTROY" + ] + } ] }, "displayName": "global-accelerator-unique-name" @@ -67,6 +77,7 @@ "environment": "aws://unknown-account/unknown-region", "properties": { "templateFile": "GlobalAcceleratorUniqueNameDefaultTestDeployAssertCA235111.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}", diff --git a/packages/@aws-cdk-testing/framework-integ/test/aws-globalaccelerator/test/integ.globalaccelerator-unique-name.js.snapshot/tree.json b/packages/@aws-cdk-testing/framework-integ/test/aws-globalaccelerator/test/integ.globalaccelerator-unique-name.js.snapshot/tree.json index 11b05e24f4c9e..18d0cf0a03ee5 100644 --- a/packages/@aws-cdk-testing/framework-integ/test/aws-globalaccelerator/test/integ.globalaccelerator-unique-name.js.snapshot/tree.json +++ b/packages/@aws-cdk-testing/framework-integ/test/aws-globalaccelerator/test/integ.globalaccelerator-unique-name.js.snapshot/tree.json @@ -18,8 +18,8 @@ "attributes": { "aws:cdk:cloudformation:type": "AWS::GlobalAccelerator::Accelerator", "aws:cdk:cloudformation:props": { - "name": "globalacceleratoruniquenameAccelerator519EC5EE", - "enabled": true + "enabled": true, + "name": "globalacceleratoruniquenameAccelerator519EC5EE" } }, "constructInfo": { @@ -68,7 +68,7 @@ "path": "GlobalAcceleratorUniqueName/DefaultTest/Default", "constructInfo": { "fqn": "constructs.Construct", - "version": "10.1.270" + "version": "10.3.0" } }, "DeployAssert": { @@ -114,7 +114,7 @@ "path": "Tree", "constructInfo": { "fqn": "constructs.Construct", - "version": "10.1.270" + "version": "10.3.0" } } }, diff --git a/packages/@aws-cdk-testing/framework-integ/test/aws-sns/test/integ.sns.js.snapshot/SNSInteg.assets.json b/packages/@aws-cdk-testing/framework-integ/test/aws-sns/test/integ.sns.js.snapshot/SNSInteg.assets.json index bb7fb8ce9227a..815adb808f6c1 100644 --- a/packages/@aws-cdk-testing/framework-integ/test/aws-sns/test/integ.sns.js.snapshot/SNSInteg.assets.json +++ b/packages/@aws-cdk-testing/framework-integ/test/aws-sns/test/integ.sns.js.snapshot/SNSInteg.assets.json @@ -1,7 +1,7 @@ { - "version": "20.0.0", + "version": "35.0.0", "files": { - "abc29d4f06b918fce7d7beea18c92c833e7e6266f0863b256fd6927b69eb595f": { + "c917d5a2b2e16b9e3cd0679e1dee0539129223bcca595b66788045cc8fc23e20": { "source": { "path": "SNSInteg.template.json", "packaging": "file" @@ -9,7 +9,7 @@ "destinations": { "current_account-current_region": { "bucketName": "cdk-hnb659fds-assets-${AWS::AccountId}-${AWS::Region}", - "objectKey": "abc29d4f06b918fce7d7beea18c92c833e7e6266f0863b256fd6927b69eb595f.json", + "objectKey": "c917d5a2b2e16b9e3cd0679e1dee0539129223bcca595b66788045cc8fc23e20.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-sns/test/integ.sns.js.snapshot/SNSInteg.template.json b/packages/@aws-cdk-testing/framework-integ/test/aws-sns/test/integ.sns.js.snapshot/SNSInteg.template.json index 41dce82c5114a..69954cad9b6b7 100644 --- a/packages/@aws-cdk-testing/framework-integ/test/aws-sns/test/integ.sns.js.snapshot/SNSInteg.template.json +++ b/packages/@aws-cdk-testing/framework-integ/test/aws-sns/test/integ.sns.js.snapshot/SNSInteg.template.json @@ -38,6 +38,24 @@ "MyTopic86869434": { "Type": "AWS::SNS::Topic", "Properties": { + "DeliveryStatusLogging": [ + { + "FailureFeedbackRoleArn": { + "Fn::GetAtt": [ + "FeedbackRoleCAF84E5C", + "Arn" + ] + }, + "Protocol": "http/s", + "SuccessFeedbackRoleArn": { + "Fn::GetAtt": [ + "FeedbackRoleCAF84E5C", + "Arn" + ] + }, + "SuccessFeedbackSampleRate": "50" + } + ], "DisplayName": "fooDisplayName", "KmsMasterKeyId": { "Fn::GetAtt": [ @@ -47,6 +65,51 @@ }, "TopicName": "fooTopic" } + }, + "FeedbackRoleCAF84E5C": { + "Type": "AWS::IAM::Role", + "Properties": { + "AssumeRolePolicyDocument": { + "Statement": [ + { + "Action": "sts:AssumeRole", + "Effect": "Allow", + "Principal": { + "Service": "sns.amazonaws.com" + } + } + ], + "Version": "2012-10-17" + } + } + }, + "Policy23B91518": { + "Type": "AWS::IAM::ManagedPolicy", + "Properties": { + "Description": "", + "Path": "/", + "PolicyDocument": { + "Statement": [ + { + "Action": [ + "logs:CreateLogGroup", + "logs:CreateLogStream", + "logs:PutLogEvents", + "logs:PutMetricFilter", + "logs:PutRetentionPolicy" + ], + "Effect": "Allow", + "Resource": "*" + } + ], + "Version": "2012-10-17" + }, + "Roles": [ + { + "Ref": "FeedbackRoleCAF84E5C" + } + ] + } } }, "Parameters": { diff --git a/packages/@aws-cdk-testing/framework-integ/test/aws-sns/test/integ.sns.js.snapshot/cdk.out b/packages/@aws-cdk-testing/framework-integ/test/aws-sns/test/integ.sns.js.snapshot/cdk.out index 588d7b269d34f..c5cb2e5de6344 100644 --- a/packages/@aws-cdk-testing/framework-integ/test/aws-sns/test/integ.sns.js.snapshot/cdk.out +++ b/packages/@aws-cdk-testing/framework-integ/test/aws-sns/test/integ.sns.js.snapshot/cdk.out @@ -1 +1 @@ -{"version":"20.0.0"} \ No newline at end of file +{"version":"35.0.0"} \ No newline at end of file diff --git a/packages/@aws-cdk-testing/framework-integ/test/aws-sns/test/integ.sns.js.snapshot/integ.json b/packages/@aws-cdk-testing/framework-integ/test/aws-sns/test/integ.sns.js.snapshot/integ.json index 4a167e58f13f1..d9fab2006a00e 100644 --- a/packages/@aws-cdk-testing/framework-integ/test/aws-sns/test/integ.sns.js.snapshot/integ.json +++ b/packages/@aws-cdk-testing/framework-integ/test/aws-sns/test/integ.sns.js.snapshot/integ.json @@ -1,5 +1,5 @@ { - "version": "20.0.0", + "version": "35.0.0", "testCases": { "integ.sns": { "stacks": [ diff --git a/packages/@aws-cdk-testing/framework-integ/test/aws-sns/test/integ.sns.js.snapshot/manifest.json b/packages/@aws-cdk-testing/framework-integ/test/aws-sns/test/integ.sns.js.snapshot/manifest.json index ab09a23e85494..08016c12ab007 100644 --- a/packages/@aws-cdk-testing/framework-integ/test/aws-sns/test/integ.sns.js.snapshot/manifest.json +++ b/packages/@aws-cdk-testing/framework-integ/test/aws-sns/test/integ.sns.js.snapshot/manifest.json @@ -1,12 +1,6 @@ { - "version": "20.0.0", + "version": "35.0.0", "artifacts": { - "Tree": { - "type": "cdk:tree", - "properties": { - "file": "tree.json" - } - }, "SNSInteg.assets": { "type": "cdk:asset-manifest", "properties": { @@ -20,10 +14,11 @@ "environment": "aws://unknown-account/unknown-region", "properties": { "templateFile": "SNSInteg.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}/abc29d4f06b918fce7d7beea18c92c833e7e6266f0863b256fd6927b69eb595f.json", + "stackTemplateAssetObjectUrl": "s3://cdk-hnb659fds-assets-${AWS::AccountId}-${AWS::Region}/c917d5a2b2e16b9e3cd0679e1dee0539129223bcca595b66788045cc8fc23e20.json", "requiresBootstrapStackVersion": 6, "bootstrapStackVersionSsmParameter": "/cdk-bootstrap/hnb659fds/version", "additionalDependencies": [ @@ -51,6 +46,18 @@ "data": "MyTopic86869434" } ], + "/SNSInteg/FeedbackRole/Resource": [ + { + "type": "aws:cdk:logicalId", + "data": "FeedbackRoleCAF84E5C" + } + ], + "/SNSInteg/Policy/Resource": [ + { + "type": "aws:cdk:logicalId", + "data": "Policy23B91518" + } + ], "/SNSInteg/BootstrapVersion": [ { "type": "aws:cdk:logicalId", @@ -65,6 +72,12 @@ ] }, "displayName": "SNSInteg" + }, + "Tree": { + "type": "cdk:tree", + "properties": { + "file": "tree.json" + } } } } \ No newline at end of file diff --git a/packages/@aws-cdk-testing/framework-integ/test/aws-sns/test/integ.sns.js.snapshot/tree.json b/packages/@aws-cdk-testing/framework-integ/test/aws-sns/test/integ.sns.js.snapshot/tree.json index 9b87706b97868..c7a2a6387aacc 100644 --- a/packages/@aws-cdk-testing/framework-integ/test/aws-sns/test/integ.sns.js.snapshot/tree.json +++ b/packages/@aws-cdk-testing/framework-integ/test/aws-sns/test/integ.sns.js.snapshot/tree.json @@ -4,14 +4,6 @@ "id": "App", "path": "", "children": { - "Tree": { - "id": "Tree", - "path": "Tree", - "constructInfo": { - "fqn": "constructs.Construct", - "version": "10.1.85" - } - }, "SNSInteg": { "id": "SNSInteg", "path": "SNSInteg", @@ -57,14 +49,14 @@ } }, "constructInfo": { - "fqn": "@aws-cdk/aws-kms.CfnKey", - "version": "0.0.0" + "fqn": "constructs.Construct", + "version": "10.3.0" } } }, "constructInfo": { - "fqn": "@aws-cdk/aws-kms.Key", - "version": "0.0.0" + "fqn": "constructs.Construct", + "version": "10.3.0" } }, "MyTopic": { @@ -77,6 +69,24 @@ "attributes": { "aws:cdk:cloudformation:type": "AWS::SNS::Topic", "aws:cdk:cloudformation:props": { + "deliveryStatusLogging": [ + { + "protocol": "http/s", + "failureFeedbackRoleArn": { + "Fn::GetAtt": [ + "FeedbackRoleCAF84E5C", + "Arn" + ] + }, + "successFeedbackRoleArn": { + "Fn::GetAtt": [ + "FeedbackRoleCAF84E5C", + "Arn" + ] + }, + "successFeedbackSampleRate": "50" + } + ], "displayName": "fooDisplayName", "kmsMasterKeyId": { "Fn::GetAtt": [ @@ -88,26 +98,147 @@ } }, "constructInfo": { - "fqn": "@aws-cdk/aws-sns.CfnTopic", - "version": "0.0.0" + "fqn": "constructs.Construct", + "version": "10.3.0" + } + } + }, + "constructInfo": { + "fqn": "constructs.Construct", + "version": "10.3.0" + } + }, + "FeedbackRole": { + "id": "FeedbackRole", + "path": "SNSInteg/FeedbackRole", + "children": { + "ImportFeedbackRole": { + "id": "ImportFeedbackRole", + "path": "SNSInteg/FeedbackRole/ImportFeedbackRole", + "constructInfo": { + "fqn": "constructs.Construct", + "version": "10.3.0" + } + }, + "Resource": { + "id": "Resource", + "path": "SNSInteg/FeedbackRole/Resource", + "attributes": { + "aws:cdk:cloudformation:type": "AWS::IAM::Role", + "aws:cdk:cloudformation:props": { + "assumeRolePolicyDocument": { + "Statement": [ + { + "Action": "sts:AssumeRole", + "Effect": "Allow", + "Principal": { + "Service": "sns.amazonaws.com" + } + } + ], + "Version": "2012-10-17" + } + } + }, + "constructInfo": { + "fqn": "constructs.Construct", + "version": "10.3.0" + } + } + }, + "constructInfo": { + "fqn": "constructs.Construct", + "version": "10.3.0" + } + }, + "Policy": { + "id": "Policy", + "path": "SNSInteg/Policy", + "children": { + "ImportedPolicy": { + "id": "ImportedPolicy", + "path": "SNSInteg/Policy/ImportedPolicy", + "constructInfo": { + "fqn": "constructs.Construct", + "version": "10.3.0" + } + }, + "Resource": { + "id": "Resource", + "path": "SNSInteg/Policy/Resource", + "attributes": { + "aws:cdk:cloudformation:type": "AWS::IAM::ManagedPolicy", + "aws:cdk:cloudformation:props": { + "description": "", + "path": "/", + "policyDocument": { + "Statement": [ + { + "Action": [ + "logs:CreateLogGroup", + "logs:CreateLogStream", + "logs:PutLogEvents", + "logs:PutMetricFilter", + "logs:PutRetentionPolicy" + ], + "Effect": "Allow", + "Resource": "*" + } + ], + "Version": "2012-10-17" + }, + "roles": [ + { + "Ref": "FeedbackRoleCAF84E5C" + } + ] + } + }, + "constructInfo": { + "fqn": "constructs.Construct", + "version": "10.3.0" } } }, "constructInfo": { - "fqn": "@aws-cdk/aws-sns.Topic", - "version": "0.0.0" + "fqn": "constructs.Construct", + "version": "10.3.0" + } + }, + "BootstrapVersion": { + "id": "BootstrapVersion", + "path": "SNSInteg/BootstrapVersion", + "constructInfo": { + "fqn": "constructs.Construct", + "version": "10.3.0" + } + }, + "CheckBootstrapVersion": { + "id": "CheckBootstrapVersion", + "path": "SNSInteg/CheckBootstrapVersion", + "constructInfo": { + "fqn": "constructs.Construct", + "version": "10.3.0" } } }, "constructInfo": { "fqn": "constructs.Construct", - "version": "10.1.85" + "version": "10.3.0" + } + }, + "Tree": { + "id": "Tree", + "path": "Tree", + "constructInfo": { + "fqn": "constructs.Construct", + "version": "10.3.0" } } }, "constructInfo": { "fqn": "constructs.Construct", - "version": "10.1.85" + "version": "10.3.0" } } } \ No newline at end of file diff --git a/packages/@aws-cdk-testing/framework-integ/test/aws-sns/test/integ.sns.ts b/packages/@aws-cdk-testing/framework-integ/test/aws-sns/test/integ.sns.ts index ad9e6048dce91..5e1adcf34bc2e 100644 --- a/packages/@aws-cdk-testing/framework-integ/test/aws-sns/test/integ.sns.ts +++ b/packages/@aws-cdk-testing/framework-integ/test/aws-sns/test/integ.sns.ts @@ -1,6 +1,7 @@ import { Key } from 'aws-cdk-lib/aws-kms'; import { App, Stack, StackProps } from 'aws-cdk-lib'; -import { Topic } from 'aws-cdk-lib/aws-sns'; +import { LoggingProtocol, Topic } from 'aws-cdk-lib/aws-sns'; +import { ManagedPolicy, PolicyDocument, PolicyStatement, Role, ServicePrincipal } from 'aws-cdk-lib/aws-iam'; class SNSInteg extends Stack { constructor(scope: App, id: string, props?: StackProps) { @@ -8,11 +9,37 @@ class SNSInteg extends Stack { const key = new Key(this, 'CustomKey'); - new Topic(this, 'MyTopic', { + const topic = new Topic(this, 'MyTopic', { topicName: 'fooTopic', displayName: 'fooDisplayName', masterKey: key, }); + + const feedbackRole = new Role(this, 'FeedbackRole', { + assumedBy: new ServicePrincipal('sns.amazonaws.com'), + }); + const deliveryLoggingPolicy = new ManagedPolicy(this, 'Policy', { + document: new PolicyDocument({ + statements: [new PolicyStatement({ + actions: [ + 'logs:CreateLogGroup', + 'logs:CreateLogStream', + 'logs:PutLogEvents', + 'logs:PutMetricFilter', + 'logs:PutRetentionPolicy', + ], + resources: ['*'], + })], + }), + }); + deliveryLoggingPolicy.attachToRole(feedbackRole); + + topic.addLoggingConfig({ + protocol: LoggingProtocol.HTTP, + failureFeedbackRole: feedbackRole, + successFeedbackRole: feedbackRole, + successFeedbackSampleRate: 50, + }); } } diff --git a/packages/@aws-cdk/aws-lambda-python-alpha/lib/function.ts b/packages/@aws-cdk/aws-lambda-python-alpha/lib/function.ts index 4dd3a23e06dc7..510725c028af2 100644 --- a/packages/@aws-cdk/aws-lambda-python-alpha/lib/function.ts +++ b/packages/@aws-cdk/aws-lambda-python-alpha/lib/function.ts @@ -74,6 +74,8 @@ export class PythonFunction extends Function { entry, runtime, skip: !Stack.of(scope).bundlingRequired, + // define architecture based on the target architecture of the function, possibly overriden in bundling options + architecture: props.architecture, ...props.bundling, }), handler: resolvedHandler, diff --git a/packages/@aws-cdk/aws-lambda-python-alpha/test/function.test.ts b/packages/@aws-cdk/aws-lambda-python-alpha/test/function.test.ts index a8bf7ffaceafb..a101ed521e0b6 100644 --- a/packages/@aws-cdk/aws-lambda-python-alpha/test/function.test.ts +++ b/packages/@aws-cdk/aws-lambda-python-alpha/test/function.test.ts @@ -1,6 +1,6 @@ import * as path from 'path'; import { Template } from 'aws-cdk-lib/assertions'; -import { Code, Runtime } from 'aws-cdk-lib/aws-lambda'; +import { Code, Runtime, Architecture } from 'aws-cdk-lib/aws-lambda'; import * as lambda from 'aws-cdk-lib/aws-lambda'; import { AssetHashType, DockerImage, Stack } from 'aws-cdk-lib'; import { PythonFunction } from '../lib'; @@ -217,3 +217,17 @@ test('Do not skip bundling when stack requires it', () => { spy.mockRestore(); }); + +test('PythonFunction specifying architecture', () => { + new PythonFunction(stack, 'handler', { + entry: path.join(__dirname, 'lambda-handler'), + runtime: Runtime.PYTHON_3_11, + architecture: Architecture.ARM_64, + }); + + expect(Bundling.bundle).toHaveBeenCalledWith( + expect.objectContaining({ + architecture: Architecture.ARM_64, + }), + ); +}); \ No newline at end of file diff --git a/packages/aws-cdk-lib/.npmignore b/packages/aws-cdk-lib/.npmignore index 60e48f52cdd0f..04bd4687b89d0 100644 --- a/packages/aws-cdk-lib/.npmignore +++ b/packages/aws-cdk-lib/.npmignore @@ -16,6 +16,7 @@ coverage build-tools dist !custom-resource-handlers/dist/ +!core/lib/dist/ scripts .LAST_BUILD .LAST_PACKAGE @@ -30,9 +31,11 @@ tsconfig.json # exclude cdk artifacts **/cdk.out junit.xml - !*.lit.ts +# exclude additional documention +core/adr/ + # keep class map for cloudformation-include !cloudformation-include/cfn-types-2-classes.json diff --git a/packages/aws-cdk-lib/aws-apigatewayv2/README.md b/packages/aws-cdk-lib/aws-apigatewayv2/README.md index dcf5e9c0b40fc..e5604dafebf1a 100644 --- a/packages/aws-cdk-lib/aws-apigatewayv2/README.md +++ b/packages/aws-cdk-lib/aws-apigatewayv2/README.md @@ -13,6 +13,7 @@ - [Metrics](#metrics) - [VPC Link](#vpc-link) - [Private Integration](#private-integration) + - [Generating ARN for Execute API](#generating-arn-for-execute-api) - [WebSocket API](#websocket-api) - [Manage Connections Permission](#manage-connections-permission) - [Managing access to WebSocket APIs](#managing-access-to-websocket-apis) @@ -325,6 +326,19 @@ clients outside of the VPC. These integrations can be found in the [aws-apigatewayv2-integrations](https://docs.aws.amazon.com/cdk/api/v2/docs/aws-cdk-lib.aws_apigatewayv2_integrations-readme.html) constructs library. +### Generating ARN for Execute API + +The arnForExecuteApi function in AWS CDK is designed to generate Amazon Resource Names (ARNs) for Execute API operations. This is particularly useful when you need to create ARNs dynamically based on different parameters like HTTP method, API path, and stage. + +```ts +const api = new apigwv2.HttpApi(this, 'my-api'); +const arn = api.arnForExecuteApi('GET', '/myApiPath', 'dev'); +``` + +- Ensure that the path parameter, if provided, starts with '/'. +- The 'ANY' method can be used for matching any HTTP methods not explicitly defined. +- The function gracefully handles undefined parameters by using wildcards, making it flexible for various API configurations. + ## WebSocket API A WebSocket API in API Gateway is a collection of WebSocket routes that are integrated with backend HTTP endpoints, @@ -405,6 +419,16 @@ To import an existing WebSocketApi: const webSocketApi = apigwv2.WebSocketApi.fromWebSocketApiAttributes(this, 'mywsapi', { webSocketId: 'api-1234' }); ``` +To generate an ARN for Execute API: + +```ts +const api = new apigwv2.WebSocketApi(this, 'mywsapi'); +const arn = api.arnForExecuteApi('GET', '/myApiPath', 'dev'); +``` + +For a detailed explanation of this function, including usage and examples, please refer to the [Generating ARN for Execute API](#generating-arn-for-execute-api) section under HTTP API. + + ### Manage Connections Permission Grant permission to use API Gateway Management API of a WebSocket API by calling the `grantManageConnections` API. diff --git a/packages/aws-cdk-lib/aws-apigatewayv2/lib/http/api.ts b/packages/aws-cdk-lib/aws-apigatewayv2/lib/http/api.ts index a9a605ec917b6..877c853be7dbf 100644 --- a/packages/aws-cdk-lib/aws-apigatewayv2/lib/http/api.ts +++ b/packages/aws-cdk-lib/aws-apigatewayv2/lib/http/api.ts @@ -6,7 +6,7 @@ import { IHttpStage, HttpStage, HttpStageOptions } from './stage'; import { VpcLink, VpcLinkProps } from './vpc-link'; import { CfnApi, CfnApiProps } from '.././index'; import { Metric, MetricOptions } from '../../../aws-cloudwatch'; -import { Duration } from '../../../core'; +import { ArnFormat, Duration, Stack, Token } from '../../../core'; import { IApi } from '../common/api'; import { ApiBase } from '../common/base'; import { DomainMappingOptions } from '../common/stage'; @@ -81,6 +81,18 @@ export interface IHttpApi extends IApi { * Add a new VpcLink */ addVpcLink(options: VpcLinkProps): VpcLink + + /** + * Get the "execute-api" ARN. + * When 'ANY' is passed to the method, an ARN with the method set to '*' is obtained. + * + * @default - The default behavior applies when no specific method, path, or stage is provided. + * In this case, the ARN will cover all methods, all resources, and all stages of this API. + * Specifically, if 'method' is not specified, it defaults to '*', representing all methods. + * If 'path' is not specified, it defaults to '/*', representing all paths. + * If 'stage' is not specified, it also defaults to '*', representing all stages. + */ + arnForExecuteApi(method?: string, path?: string, stage?: string): string; } /** @@ -291,6 +303,23 @@ abstract class HttpApiBase extends ApiBase implements IHttpApi { // note that th return vpcLink; } + + public arnForExecuteApi(method?: string, path?: string, stage?: string): string { + if (path && !Token.isUnresolved(path) && !path.startsWith('/')) { + throw new Error(`Path must start with '/': ${path}`); + } + + if (method && method.toUpperCase() === 'ANY') { + method = '*'; + } + + return Stack.of(this).formatArn({ + service: 'execute-api', + resource: this.httpApiId, + arnFormat: ArnFormat.SLASH_RESOURCE_NAME, + resourceName: `${stage ?? '*'}/${method ?? '*'}${path ?? '/*'}`, + }); + } } /** diff --git a/packages/aws-cdk-lib/aws-apigatewayv2/lib/websocket/api.ts b/packages/aws-cdk-lib/aws-apigatewayv2/lib/websocket/api.ts index c8e27c97e3fdf..9c1ed6d821c1a 100644 --- a/packages/aws-cdk-lib/aws-apigatewayv2/lib/websocket/api.ts +++ b/packages/aws-cdk-lib/aws-apigatewayv2/lib/websocket/api.ts @@ -2,7 +2,7 @@ import { Construct } from 'constructs'; import { WebSocketRoute, WebSocketRouteOptions } from './route'; import { CfnApi } from '.././index'; import { Grant, IGrantable } from '../../../aws-iam'; -import { Stack } from '../../../core'; +import { ArnFormat, Stack, Token } from '../../../core'; import { IApi } from '../common/api'; import { ApiBase } from '../common/base'; @@ -188,4 +188,31 @@ export class WebSocketApi extends ApiBase implements IWebSocketApi { resourceArns: [`${arn}/*/*/@connections/*`], }); } + + /** + * Get the "execute-api" ARN. + * When 'ANY' is passed to the method, an ARN with the method set to '*' is obtained. + * + * @default - The default behavior applies when no specific method, path, or stage is provided. + * In this case, the ARN will cover all methods, all resources, and all stages of this API. + * Specifically, if 'method' is not specified, it defaults to '*', representing all methods. + * If 'path' is not specified, it defaults to '/*', representing all paths. + * If 'stage' is not specified, it also defaults to '*', representing all stages. + */ + public arnForExecuteApi(method?: string, path?: string, stage?: string): string { + if (path && !Token.isUnresolved(path) && !path.startsWith('/')) { + throw new Error(`Path must start with '/': ${path}`); + } + + if (method && method.toUpperCase() === 'ANY') { + method = '*'; + } + + return Stack.of(this).formatArn({ + service: 'execute-api', + resource: this.apiId, + arnFormat: ArnFormat.SLASH_RESOURCE_NAME, + resourceName: `${stage ?? '*'}/${method ?? '*'}${path ?? '/*'}`, + }); + } } diff --git a/packages/aws-cdk-lib/aws-apigatewayv2/test/http/api.test.ts b/packages/aws-cdk-lib/aws-apigatewayv2/test/http/api.test.ts index 1affa4b47566b..e703dbd9d7d56 100644 --- a/packages/aws-cdk-lib/aws-apigatewayv2/test/http/api.test.ts +++ b/packages/aws-cdk-lib/aws-apigatewayv2/test/http/api.test.ts @@ -528,6 +528,71 @@ describe('HttpApi', () => { }); }); }); + + test('get arnForExecuteApi', () => { + const stack = new Stack(); + const api = new HttpApi(stack, 'api'); + + expect(stack.resolve(api.arnForExecuteApi('method', '/path', 'stage'))).toEqual({ + 'Fn::Join': ['', [ + 'arn:', + { Ref: 'AWS::Partition' }, + ':execute-api:', + { Ref: 'AWS::Region' }, + ':', + { Ref: 'AWS::AccountId' }, + ':', + stack.resolve(api.apiId), + '/stage/method/path', + ]], + }); + }); + + test('get arnForExecuteApi with default values', () => { + const stack = new Stack(); + const api = new HttpApi(stack, 'api'); + + expect(stack.resolve(api.arnForExecuteApi())).toEqual({ + 'Fn::Join': ['', [ + 'arn:', + { Ref: 'AWS::Partition' }, + ':execute-api:', + { Ref: 'AWS::Region' }, + ':', + { Ref: 'AWS::AccountId' }, + ':', + stack.resolve(api.apiId), + '/*/*/*', + ]], + }); + }); + + test('get arnForExecuteApi with ANY method', () => { + const stack = new Stack(); + const api = new HttpApi(stack, 'api'); + + expect(stack.resolve(api.arnForExecuteApi('ANY', '/path', 'stage'))).toEqual({ + 'Fn::Join': ['', [ + 'arn:', + { Ref: 'AWS::Partition' }, + ':execute-api:', + { Ref: 'AWS::Region' }, + ':', + { Ref: 'AWS::AccountId' }, + ':', + stack.resolve(api.apiId), + '/stage/*/path', + ]], + }); + }); + + test('throws when call arnForExecuteApi method with specifing a string that does not start with / for the path argument.', () => { + const stack = new Stack(); + const api = new HttpApi(stack, 'api'); + + expect(() => api.arnForExecuteApi('method', 'path', 'stage')) + .toThrow("Path must start with '/': path"); + }); }); class DummyRouteIntegration extends HttpRouteIntegration { diff --git a/packages/aws-cdk-lib/aws-apigatewayv2/test/websocket/api.test.ts b/packages/aws-cdk-lib/aws-apigatewayv2/test/websocket/api.test.ts index 91b4ad90e6a3b..8abe6d44c1340 100644 --- a/packages/aws-cdk-lib/aws-apigatewayv2/test/websocket/api.test.ts +++ b/packages/aws-cdk-lib/aws-apigatewayv2/test/websocket/api.test.ts @@ -148,6 +148,71 @@ describe('WebSocketApi', () => { expect(() => api.apiEndpoint).toThrow(/apiEndpoint is not configured/); }); + test('get arnForExecuteApi', () => { + const stack = new Stack(); + const api = new WebSocketApi(stack, 'api'); + + expect(stack.resolve(api.arnForExecuteApi('method', '/path', 'stage'))).toEqual({ + 'Fn::Join': ['', [ + 'arn:', + { Ref: 'AWS::Partition' }, + ':execute-api:', + { Ref: 'AWS::Region' }, + ':', + { Ref: 'AWS::AccountId' }, + ':', + stack.resolve(api.apiId), + '/stage/method/path', + ]], + }); + }); + + test('get arnForExecuteApi with default values', () => { + const stack = new Stack(); + const api = new WebSocketApi(stack, 'api'); + + expect(stack.resolve(api.arnForExecuteApi())).toEqual({ + 'Fn::Join': ['', [ + 'arn:', + { Ref: 'AWS::Partition' }, + ':execute-api:', + { Ref: 'AWS::Region' }, + ':', + { Ref: 'AWS::AccountId' }, + ':', + stack.resolve(api.apiId), + '/*/*/*', + ]], + }); + }); + + test('get arnForExecuteApi with ANY method', () => { + const stack = new Stack(); + const api = new WebSocketApi(stack, 'api'); + + expect(stack.resolve(api.arnForExecuteApi('ANY', '/path', 'stage'))).toEqual({ + 'Fn::Join': ['', [ + 'arn:', + { Ref: 'AWS::Partition' }, + ':execute-api:', + { Ref: 'AWS::Region' }, + ':', + { Ref: 'AWS::AccountId' }, + ':', + stack.resolve(api.apiId), + '/stage/*/path', + ]], + }); + }); + + test('throws when call arnForExecuteApi method with specifing a string that does not start with / for the path argument.', () => { + const stack = new Stack(); + const api = new WebSocketApi(stack, 'api'); + + expect(() => api.arnForExecuteApi('method', 'path', 'stage')) + .toThrow("Path must start with '/': path"); + }); + describe('grantManageConnections', () => { test('adds an IAM policy to the principal', () => { // GIVEN diff --git a/packages/aws-cdk-lib/aws-events-targets/lib/util.ts b/packages/aws-cdk-lib/aws-events-targets/lib/util.ts index ab279d03f4b60..7d8162df20d60 100644 --- a/packages/aws-cdk-lib/aws-events-targets/lib/util.ts +++ b/packages/aws-cdk-lib/aws-events-targets/lib/util.ts @@ -140,10 +140,18 @@ export function addToDeadLetterQueueResourcePolicy(rule: events.IRule, queue: sq /** * Whether two string probably contain the same environment dimension (region or account) * - * Used to compare either accounts or regions, and also returns true if both - * are unresolved (in which case both are expted to be "current region" or "current account"). + * Used to compare either accounts or regions on a best effort basis. If we cannot tell definitively + * that the dimensions are in different environments, we will pass. + * + * For example, returns true if both are unresolved (in which case both are expected to be + * "current region" or "current account"). + * + * Also returns true if one is unresolved (in which case we expect the unresolved dimension to match + * the resolved dimension, but it is up to the user to ensure this). Returning true here makes sure + * that we are not overly aggressive in producing a synth-time error. + * * @internal */ function sameEnvDimension(dim1: string, dim2: string) { - return [TokenComparison.SAME, TokenComparison.BOTH_UNRESOLVED].includes(Token.compareStrings(dim1, dim2)); + return [TokenComparison.SAME, TokenComparison.ONE_UNRESOLVED, TokenComparison.BOTH_UNRESOLVED].includes(Token.compareStrings(dim1, dim2)); } diff --git a/packages/aws-cdk-lib/aws-events-targets/test/sqs/sqs.test.ts b/packages/aws-cdk-lib/aws-events-targets/test/sqs/sqs.test.ts index 3c979d1b0fe49..4bdd8f633e6a5 100644 --- a/packages/aws-cdk-lib/aws-events-targets/test/sqs/sqs.test.ts +++ b/packages/aws-cdk-lib/aws-events-targets/test/sqs/sqs.test.ts @@ -2,7 +2,8 @@ import { Match, Template } from '../../../assertions'; import * as events from '../../../aws-events'; import * as kms from '../../../aws-kms'; import * as sqs from '../../../aws-sqs'; -import { App, Duration, Stack } from '../../../core'; +import * as ssm from '../../../aws-ssm'; +import { App, CustomResource, Duration, Stack } from '../../../core'; import * as cxapi from '../../../cx-api'; import * as targets from '../../lib'; @@ -401,3 +402,38 @@ test('specifying retry policy with 0 retryAttempts', () => { ], }); }); + +test('dead letter queue is imported', () => { + const stack = new Stack(); + const queue = new sqs.Queue(stack, 'MyQueue', { fifo: true }); + const rule = new events.Rule(stack, 'MyRule', { + schedule: events.Schedule.rate(Duration.hours(1)), + }); + + const dlqArn = 'arn:aws:sqs:eu-west-1:444455556666:queue1'; + const deadLetterQueue = sqs.Queue.fromQueueArn(stack, 'MyDeadLetterQueue', dlqArn); + + // WHEN + rule.addTarget(new targets.SqsQueue(queue, { + deadLetterQueue, + })); + + Template.fromStack(stack).hasResourceProperties('AWS::Events::Rule', { + ScheduleExpression: 'rate(1 hour)', + State: 'ENABLED', + Targets: [ + { + Arn: { + 'Fn::GetAtt': [ + 'MyQueueE6CA6235', + 'Arn', + ], + }, + Id: 'Target0', + DeadLetterConfig: { + Arn: dlqArn, + }, + }, + ], + }); +}); diff --git a/packages/aws-cdk-lib/aws-globalaccelerator/README.md b/packages/aws-cdk-lib/aws-globalaccelerator/README.md index 8f0955e899ac7..8630620939dea 100644 --- a/packages/aws-cdk-lib/aws-globalaccelerator/README.md +++ b/packages/aws-cdk-lib/aws-globalaccelerator/README.md @@ -53,6 +53,18 @@ listener.addEndpointGroup('Group2', { }); ``` +### Create an Accelerator with IP addresses and IP address type + +```ts +const accelerator = new globalaccelerator.Accelerator(this, 'Accelerator', { + ipAddresses: [ + '1.1.1.1', + '2.2.2.2', + ], + ipAddressType: globalaccelerator.IpAddressType.IPV4, +}); +``` + ## Concepts The **Accelerator** construct defines a Global Accelerator resource. diff --git a/packages/aws-cdk-lib/aws-globalaccelerator/lib/accelerator.ts b/packages/aws-cdk-lib/aws-globalaccelerator/lib/accelerator.ts index 5058f170e0007..ecf2c587bfed1 100644 --- a/packages/aws-cdk-lib/aws-globalaccelerator/lib/accelerator.ts +++ b/packages/aws-cdk-lib/aws-globalaccelerator/lib/accelerator.ts @@ -8,7 +8,7 @@ import * as cdk from '../../core'; */ export interface IAccelerator extends cdk.IResource { /** - * The ARN of the accelerator + * The ARN of the accelerator. * * @attribute */ @@ -21,6 +21,28 @@ export interface IAccelerator extends cdk.IResource { * @attribute */ readonly dnsName: string; + + /** + * The DNS name that Global Accelerator creates that points to a dual-stack accelerator's four static IP addresses: + * two IPv4 addresses and two IPv6 addresses. + * + * @attribute + */ + readonly dualStackDnsName?: string; + + /** + * The array of IPv4 addresses in the IP address set. An IP address set can have a maximum of two IP addresses. + * + * @attribute + */ + readonly ipv4Addresses?: string[]; + + /** + * The array of IPv6 addresses in the IP address set. An IP address set can have a maximum of two IP addresses. + * + * @attribute + */ + readonly ipv6Addresses?: string[]; } /** @@ -40,6 +62,33 @@ export interface AcceleratorProps { * @default true */ readonly enabled?: boolean; + + /** + * IP addresses associated with the accelerator. + * + * Optionally, if you've added your own IP address pool to Global Accelerator (BYOIP), you can choose IP + * addresses from your own pool to use for the accelerator's static IP addresses when you create an accelerator. + * You can specify one or two addresses, separated by a comma. Do not include the /32 suffix. + * + * Only one IP address from each of your IP address ranges can be used for each accelerator. If you specify + * only one IP address from your IP address range, Global Accelerator assigns a second static IP address for + * the accelerator from the AWS IP address pool. + * + * Note that you can't update IP addresses for an existing accelerator. To change them, you must create a + * new accelerator with the new addresses. + * + * @default - undefined. IP addresses will be from Amazon's pool of IP addresses. + */ + readonly ipAddresses?: string[]; + + /** + * The IP address type that an accelerator supports. + * + * For a standard accelerator, the value can be IPV4 or DUAL_STACK. + * + * @default - "IPV4" + */ + readonly ipAddressType?: IpAddressType; } /** @@ -55,6 +104,42 @@ export interface AcceleratorAttributes { * The DNS name of the accelerator */ readonly dnsName: string; + + /** + * The DNS name that points to the dual-stack accelerator's four static IP addresses: two IPv4 addresses and two IPv6 addresses. + * + * @default - undefined + */ + readonly dualStackDnsName?: string; + + /** + * The array of IPv4 addresses in the IP address set + * + * @default - undefined + */ + readonly ipv4Addresses?: string[]; + + /** + * The array of IPv6 addresses in the IP address set + * + * @default - undefined + */ + readonly ipv6Addresses?: string[]; +} + +/** + * The IP address type that an accelerator supports. + */ +export enum IpAddressType { + /** + * IPV4 + */ + IPV4 = 'IPV4', + + /** + * DUAL_STACK + */ + DUAL_STACK = 'DUAL_STACK', } /** @@ -68,6 +153,9 @@ export class Accelerator extends cdk.Resource implements IAccelerator { class Import extends cdk.Resource implements IAccelerator { public readonly acceleratorArn = attrs.acceleratorArn; public readonly dnsName = attrs.dnsName; + public readonly dualStackDnsName = attrs.dualStackDnsName; + public readonly ipv4Addresses = attrs.ipv4Addresses; + public readonly ipv6Addresses = attrs.ipv6Addresses; } return new Import(scope, id); } @@ -82,20 +170,43 @@ export class Accelerator extends cdk.Resource implements IAccelerator { */ public readonly dnsName: string; + /** + * The DNS name that points to the dual-stack accelerator's four static IP addresses: + * two IPv4 addresses and two IPv6 addresses. + */ + public readonly dualStackDnsName?: string; + + /** + * The array of IPv4 addresses in the IP address set + */ + public readonly ipv4Addresses?: string[]; + + /** + * The array of IPv6 addresses in the IP address set + */ + public readonly ipv6Addresses?: string[]; + constructor(scope: Construct, id: string, props: AcceleratorProps = {}) { super(scope, id); this.validateAcceleratorName(props.acceleratorName); + this.validateIpAddresses(props.ipAddresses); + const name = props.acceleratorName ?? cdk.Names.uniqueResourceName(this, { maxLength: 64, }); const resource = new ga.CfnAccelerator(this, 'Resource', { enabled: props.enabled ?? true, name, + ipAddresses: props.ipAddresses, + ipAddressType: props.ipAddressType, }); this.acceleratorArn = resource.attrAcceleratorArn; this.dnsName = resource.attrDnsName; + this.dualStackDnsName = resource.attrDualStackDnsName; + this.ipv4Addresses = resource.attrIpv4Addresses; + this.ipv6Addresses = resource.attrIpv6Addresses; } /** @@ -113,4 +224,10 @@ export class Accelerator extends cdk.Resource implements IAccelerator { throw new Error(`Invalid acceleratorName value ${name}, must have length between 1 and 64, got: ${name.length}`); } } + + private validateIpAddresses(ipAddresses?: string[]) { + if (ipAddresses !== undefined && (ipAddresses.length < 1 || ipAddresses.length > 2)) { + throw new Error(`Invalid ipAddresses value [${ipAddresses}], you can specify one or two addresses, got: ${ipAddresses.length}`); + } + } } diff --git a/packages/aws-cdk-lib/aws-globalaccelerator/test/globalaccelerator.test.ts b/packages/aws-cdk-lib/aws-globalaccelerator/test/globalaccelerator.test.ts index 8ab34df895e7e..b1ea83937a71c 100644 --- a/packages/aws-cdk-lib/aws-globalaccelerator/test/globalaccelerator.test.ts +++ b/packages/aws-cdk-lib/aws-globalaccelerator/test/globalaccelerator.test.ts @@ -1,5 +1,5 @@ import { testFixture } from './util'; -import { Template } from '../../assertions'; +import { Match, Template } from '../../assertions'; import { Duration } from '../../core'; import * as ga from '../lib'; @@ -225,6 +225,47 @@ test('create accelerator with uniqueResourceName if acceleratorName is not speci }); }); +test('create accelerator with IpAddresses and IpAddressType', () => { + // GIVEN + const { stack } = testFixture(); + + // WHEN + const acc = new ga.Accelerator(stack, 'Accelerator', { + ipAddresses: [ + '1.1.1.1', + '2.2.2.2', + ], + ipAddressType: ga.IpAddressType.DUAL_STACK, + }); + + // THEN + Template.fromStack(stack).hasResourceProperties('AWS::GlobalAccelerator::Accelerator', { + Enabled: true, + Name: 'StackAccelerator472129D8', + IpAddresses: [ + '1.1.1.1', + '2.2.2.2', + ], + IpAddressType: 'DUAL_STACK', + }); +}); + +test('create accelerator with no IpAddresses and IpAddressType', () => { + // GIVEN + const { stack } = testFixture(); + + // WHEN + new ga.Accelerator(stack, 'Accelerator'); + + // THEN + Template.fromStack(stack).hasResourceProperties('AWS::GlobalAccelerator::Accelerator', { + Enabled: true, + Name: 'StackAccelerator472129D8', + IpAddresses: Match.absent(), + IpAddressType: Match.absent(), + }); +}); + test('should validate acceleratorName minimum and maximum length', () => { const { stack } = testFixture(); @@ -239,3 +280,31 @@ test('should validate acceleratorName minimum and maximum length', () => { }); }).toThrowError(/must have length between 1 and 64/); }); + +test('should validate ipAddresses minimum and maximum length', () => { + const { stack } = testFixture(); + + expect(() => { + new ga.Accelerator(stack, 'Acc1', {}); + }).not.toThrow(); + expect(() => { + new ga.Accelerator(stack, 'Acc2', { + ipAddresses: ['1.1.1.1'], + }); + }).not.toThrow(); + expect(() => { + new ga.Accelerator(stack, 'Acc3', { + ipAddresses: ['1.1.1.1', '2.2.2.2'], + }); + }).not.toThrow(); + expect(() => { + new ga.Accelerator(stack, 'Acc4', { + ipAddresses: [], + }); + }).toThrow('Invalid ipAddresses value [], you can specify one or two addresses, got: 0'); + expect(() => { + new ga.Accelerator(stack, 'Acc5', { + ipAddresses: ['1.1.1.1', '2.2.2.2', '3.3.3.3'], + }); + }).toThrow('Invalid ipAddresses value [1.1.1.1,2.2.2.2,3.3.3.3], you can specify one or two addresses, got: 3'); +}); diff --git a/packages/aws-cdk-lib/aws-sns/README.md b/packages/aws-cdk-lib/aws-sns/README.md index 542482e50c3d8..dfde7e3312cba 100644 --- a/packages/aws-cdk-lib/aws-sns/README.md +++ b/packages/aws-cdk-lib/aws-sns/README.md @@ -206,3 +206,45 @@ const topicPolicy = new sns.TopicPolicy(this, 'Policy', { policyDocument, }); ``` + +## Delivery status logging + +Amazon SNS provides support to log the delivery status of notification messages sent to topics with the following Amazon SNS endpoints: + +- HTTP +- Amazon Kinesis Data Firehose +- AWS Lambda +- Platform application endpoint +- Amazon Simple Queue Service + +Example with a delivery status logging configuration for SQS: + +```ts +declare const role: iam.Role; +const topic = new sns.Topic(this, 'MyTopic', { + loggingConfigs: [ + { + protocol: sns.LoggingProtocol.SQS, + failureFeedbackRole: role, + successFeedbackRole: role, + successFeedbackSampleRate: 50, + }, + ], +}); +``` + +A delivery status logging configuration can also be added to your topic by `addLoggingConfig` method: + +```ts +declare const role: iam.Role; +const topic = new sns.Topic(this, 'MyTopic'); + +topic.addLoggingConfig({ + protocol: sns.LoggingProtocol.SQS, + failureFeedbackRole: role, + successFeedbackRole: role, + successFeedbackSampleRate: 50, +}); +``` + +Note that valid values for `successFeedbackSampleRate` are integer between 0-100. \ No newline at end of file diff --git a/packages/aws-cdk-lib/aws-sns/lib/topic.ts b/packages/aws-cdk-lib/aws-sns/lib/topic.ts index 7478c6ea0a415..15604b1cf2f40 100644 --- a/packages/aws-cdk-lib/aws-sns/lib/topic.ts +++ b/packages/aws-cdk-lib/aws-sns/lib/topic.ts @@ -1,8 +1,9 @@ import { Construct } from 'constructs'; import { CfnTopic } from './sns.generated'; import { ITopic, TopicBase } from './topic-base'; +import { IRole } from '../../aws-iam'; import { IKey } from '../../aws-kms'; -import { ArnFormat, Names, Stack } from '../../core'; +import { ArnFormat, Lazy, Names, Stack } from '../../core'; /** * Properties for a new SNS topic @@ -46,6 +47,80 @@ export interface TopicProps { * @default None */ readonly fifo?: boolean; + + /** + * The list of delivery status logging configurations for the topic. + * + * For more information, see https://docs.aws.amazon.com/sns/latest/dg/sns-topic-attributes.html. + * + * @default None + */ + readonly loggingConfigs?: LoggingConfig[]; +} + +/** + * A logging configuration for delivery status of messages sent from SNS topic to subscribed endpoints. + * + * For more information, see https://docs.aws.amazon.com/sns/latest/dg/sns-topic-attributes.html. + */ +export interface LoggingConfig { + /** + * Indicates one of the supported protocols for the SNS topic. + */ + readonly protocol: LoggingProtocol; + + /** + * The IAM role to be used when logging failed message deliveries in Amazon CloudWatch. + * + * @default None + */ + readonly failureFeedbackRole?: IRole; + + /** + * The IAM role to be used when logging successful message deliveries in Amazon CloudWatch. + * + * @default None + */ + readonly successFeedbackRole?: IRole; + + /** + * The percentage of successful message deliveries to be logged in Amazon CloudWatch. + * + * Valid values are integer between 0-100 + * + * @default None + */ + readonly successFeedbackSampleRate?: number; +} + +/** + * The type of supported protocol for delivery status logging. + */ +export enum LoggingProtocol { + /** + * HTTP + */ + HTTP = 'http/s', + + /** + * Amazon Simple Queue Service + */ + SQS = 'sqs', + + /** + * AWS Lambda + */ + LAMBDA = 'lambda', + + /** + * Amazon Kinesis Data Firehose + */ + FIREHOSE = 'firehose', + + /** + * Platform application endpoint + */ + APPLICATION = 'application', } /** @@ -81,6 +156,8 @@ export class Topic extends TopicBase { protected readonly autoCreatePolicy: boolean = true; + private readonly loggingConfigs: LoggingConfig[] = []; + constructor(scope: Construct, id: string, props: TopicProps = {}) { super(scope, id, { physicalName: props.topicName, @@ -90,6 +167,10 @@ export class Topic extends TopicBase { throw new Error('Content based deduplication can only be enabled for FIFO SNS topics.'); } + if (props.loggingConfigs) { + props.loggingConfigs.forEach(c => this.addLoggingConfig(c)); + } + let cfnTopicName: string; if (props.fifo && props.topicName && !props.topicName.endsWith('.fifo')) { cfnTopicName = this.physicalName + '.fifo'; @@ -110,6 +191,7 @@ export class Topic extends TopicBase { kmsMasterKeyId: props.masterKey && props.masterKey.keyArn, contentBasedDeduplication: props.contentBasedDeduplication, fifoTopic: props.fifo, + deliveryStatusLogging: Lazy.any({ produce: () => this.renderLoggingConfigs() }, { omitEmptyArray: true }), }); this.topicArn = this.getResourceArnAttribute(resource.ref, { @@ -120,4 +202,30 @@ export class Topic extends TopicBase { this.fifo = props.fifo || false; this.contentBasedDeduplication = props.contentBasedDeduplication || false; } + + private renderLoggingConfigs(): CfnTopic.LoggingConfigProperty[] { + return this.loggingConfigs.map(renderLoggingConfig); + + function renderLoggingConfig(spec: LoggingConfig): CfnTopic.LoggingConfigProperty { + if (spec.successFeedbackSampleRate !== undefined) { + const rate = spec.successFeedbackSampleRate; + if (!Number.isInteger(rate) || rate < 0 || rate > 100) { + throw new Error('Success feedback sample rate must be an integer between 0 and 100'); + } + } + return { + protocol: spec.protocol, + failureFeedbackRoleArn: spec.failureFeedbackRole?.roleArn, + successFeedbackRoleArn: spec.successFeedbackRole?.roleArn, + successFeedbackSampleRate: spec.successFeedbackSampleRate?.toString(), + }; + } + } + + /** + * Adds a delivery status logging configuration to the topic. + */ + public addLoggingConfig(config: LoggingConfig) { + this.loggingConfigs.push(config); + } } diff --git a/packages/aws-cdk-lib/aws-sns/test/sns.test.ts b/packages/aws-cdk-lib/aws-sns/test/sns.test.ts index 461575fb10038..45bb004e0deae 100644 --- a/packages/aws-cdk-lib/aws-sns/test/sns.test.ts +++ b/packages/aws-cdk-lib/aws-sns/test/sns.test.ts @@ -503,4 +503,109 @@ describe('Topic', () => { }); }); + + test('specify delivery status logging configuration through construct props', () => { + // GIVEN + const stack = new cdk.Stack(); + const feedbackRole = new iam.Role(stack, 'feedbackRole', { + assumedBy: new iam.ServicePrincipal('sns.amazonaws.com'), + }); + + // WHEN + new sns.Topic(stack, 'MyTopic', { + loggingConfigs: [ + { + protocol: sns.LoggingProtocol.SQS, + failureFeedbackRole: feedbackRole, + successFeedbackRole: feedbackRole, + successFeedbackSampleRate: 50, + }, + ], + }); + + // THEN + Template.fromStack(stack).hasResourceProperties('AWS::SNS::Topic', { + 'DeliveryStatusLogging': [{ + 'Protocol': 'sqs', + 'SuccessFeedbackRoleArn': { 'Fn::GetAtt': ['feedbackRole2010903F', 'Arn'] }, + 'FailureFeedbackRoleArn': { 'Fn::GetAtt': ['feedbackRole2010903F', 'Arn'] }, + 'SuccessFeedbackSampleRate': '50', + }], + }); + }); + + test('add delivery status logging configuration to a topic', () => { + // GIVEN + const stack = new cdk.Stack(); + const feedbackRole = new iam.Role(stack, 'feedbackRole', { + assumedBy: new iam.ServicePrincipal('sns.amazonaws.com'), + }); + const topic = new sns.Topic(stack, 'MyTopic'); + + // WHEN + topic.addLoggingConfig({ + protocol: sns.LoggingProtocol.HTTP, + failureFeedbackRole: feedbackRole, + successFeedbackRole: feedbackRole, + successFeedbackSampleRate: 50, + }); + + // THEN + Template.fromStack(stack).hasResourceProperties('AWS::SNS::Topic', { + 'DeliveryStatusLogging': [{ + 'Protocol': 'http/s', + 'SuccessFeedbackRoleArn': { 'Fn::GetAtt': ['feedbackRole2010903F', 'Arn'] }, + 'FailureFeedbackRoleArn': { 'Fn::GetAtt': ['feedbackRole2010903F', 'Arn'] }, + 'SuccessFeedbackSampleRate': '50', + }], + }); + }); + + test('fails if success feedback sample rate is outside the appropriate range', () => { + // GIVEN + const app = new cdk.App(); + const stack = new cdk.Stack(app, 'my-stack'); + const feedbackRole = new iam.Role(stack, 'feedbackRole', { + assumedBy: new iam.ServicePrincipal('sns.amazonaws.com'), + }); + + // WHEN + new sns.Topic(stack, 'MyTopic', { + loggingConfigs: [ + { + protocol: sns.LoggingProtocol.SQS, + failureFeedbackRole: feedbackRole, + successFeedbackRole: feedbackRole, + successFeedbackSampleRate: 110, + }, + ], + }); + + // THEN + expect(() => app.synth()).toThrow(/Success feedback sample rate must be an integer between 0 and 100/); + }); + + test('fails if success feedback sample rate is decimal', () => { + // GIVEN + const app = new cdk.App(); + const stack = new cdk.Stack(app, 'my-stack'); + const feedbackRole = new iam.Role(stack, 'feedbackRole', { + assumedBy: new iam.ServicePrincipal('sns.amazonaws.com'), + }); + + // WHEN + new sns.Topic(stack, 'MyTopic', { + loggingConfigs: [ + { + protocol: sns.LoggingProtocol.SQS, + failureFeedbackRole: feedbackRole, + successFeedbackRole: feedbackRole, + successFeedbackSampleRate: 50.4, + }, + ], + }); + + // THEN + expect(() => app.synth()).toThrow(/Success feedback sample rate must be an integer between 0 and 100/); + }); }); diff --git a/packages/aws-cdk-lib/core/lib/adr/acknowledge-warnings.md b/packages/aws-cdk-lib/core/adr/acknowledge-warnings.md similarity index 100% rename from packages/aws-cdk-lib/core/lib/adr/acknowledge-warnings.md rename to packages/aws-cdk-lib/core/adr/acknowledge-warnings.md diff --git a/version.v2.json b/version.v2.json index 5af5c565af2c6..036be73a62de9 100644 --- a/version.v2.json +++ b/version.v2.json @@ -1,4 +1,4 @@ { - "version": "2.115.0", - "alphaVersion": "2.115.0-alpha.0" + "version": "2.116.1", + "alphaVersion": "2.116.1-alpha.0" } \ No newline at end of file