From c7aa9ae0afbd816f8f05dde16e58d04e8d11f77b Mon Sep 17 00:00:00 2001 From: Hitendra Nishar Date: Wed, 9 Sep 2020 22:31:18 -0400 Subject: [PATCH] Update to version v1.62.0 --- CHANGELOG.md | 12 +- source/lerna.json | 2 +- source/package.json | 2 +- .../aws-apigateway-dynamodb/package.json | 28 +- .../aws-apigateway-kinesisstreams/README.md | 4 +- .../lib/index.ts | 19 +- .../package.json | 28 +- ...apigateway-kinesis-overwrite.expected.json | 30 +- .../integ.apigateway-kinesis-overwrite.ts | 4 +- .../aws-apigateway-lambda/package.json | 28 +- .../aws-apigateway-sqs/package.json | 32 +- .../package.json | 40 +- .../aws-cloudfront-apigateway/package.json | 32 +- .../aws-cloudfront-s3/package.json | 24 +- .../package.json | 32 +- .../package.json | 48 +- .../aws-dynamodb-stream-lambda/package.json | 28 +- .../aws-events-rule-lambda/package.json | 24 +- .../aws-events-rule-sns/README.md | 38 +- .../aws-events-rule-sns/lib/index.ts | 71 ++- .../aws-events-rule-sns/package.json | 27 +- .../events-rule-sns-topic.test.js.snap | 97 +++- .../test/events-rule-sns-topic.test.ts | 322 ++++++++----- ...teg.events-rule-no-arguments.expected.json | 131 ++++-- .../test/integ.events-rule-no-arguments.ts | 17 +- .../aws-events-rule-sqs/README.md | 42 +- .../aws-events-rule-sqs/lib/index.ts | 48 +- .../aws-events-rule-sqs/package.json | 27 +- .../events-rule-sqs-queue.test.js.snap | 79 +++- .../test/events-rule-sqs-queue.test.ts | 437 ++++++++++------- ...g.events-rule-existing-queue.expected.json | 239 +++++----- .../test/integ.events-rule-existing-queue.ts | 26 +- ...teg.events-rule-no-arguments.expected.json | 445 ++++++++++-------- .../test/integ.events-rule-no-arguments.ts | 14 +- .../package.json | 40 +- .../aws-iot-kinesisfirehose-s3/package.json | 36 +- .../aws-iot-lambda-dynamodb/package.json | 32 +- .../aws-iot-lambda/package.json | 24 +- .../package.json | 40 +- .../aws-kinesisfirehose-s3/package.json | 28 +- .../aws-kinesisstreams-lambda/package.json | 28 +- .../aws-lambda-dynamodb/package.json | 20 +- .../package.json | 32 +- .../aws-lambda-s3/package.json | 20 +- .../aws-lambda-sns/package.json | 24 +- .../__snapshots__/lambda-sns.test.js.snap | 21 +- .../test/integ.deployFunction.expected.json | 21 +- .../test/integ.existingFunction.expected.json | 21 +- .../aws-lambda-sns/test/lambda-sns.test.ts | 21 +- .../aws-lambda-sqs-lambda/package.json | 28 +- .../aws-lambda-sqs/package.json | 20 +- .../aws-lambda-step-function/package.json | 28 +- .../aws-s3-lambda/package.json | 32 +- .../aws-s3-step-function/package.json | 52 +- .../aws-sns-lambda/package.json | 32 +- .../__snapshots__/sns-lambda.test.js.snap | 21 +- .../test/integ.no-arguments.expected.json | 21 +- .../aws-sns-sqs/package.json | 32 +- .../test/__snapshots__/sns-sqs.test.js.snap | 31 +- .../test/integ.existing-kms-key.expected.json | 5 +- .../test/integ.no-arguments.expected.json | 5 +- .../integ.sns-managed-kms-key.expected.json | 21 +- .../aws-sns-sqs/test/sns-sqs.test.ts | 36 +- .../aws-sqs-lambda/package.json | 28 +- .../core/package.json | 92 ++-- .../__snapshots__/sns-helper.test.js.snap | 31 +- .../core/test/sns-helper.test.ts | 26 +- source/tools/cdk-integ-tools/package.json | 6 +- .../aws-s3-static-website/package.json | 22 +- .../aws-serverless-image-handler/package.json | 40 +- .../aws-serverless-web-app/package.json | 32 +- 71 files changed, 2181 insertions(+), 1345 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 4d2b904d5..870ae3d78 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -4,6 +4,16 @@ All notable changes to this project will be documented in this file. The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/), and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). +## [1.62.0] - 2020-09-09 + +### Added +- aws-events-rule-sqs pattern added ([#25](https://github.com/awslabs/aws-solutions-constructs/issues/25)) +- aws-events-rule-sns pattern added ([#42](https://github.com/awslabs/aws-solutions-constructs/issues/42)) +- aws-apigateway-kinesisstreams pattern added ([#51](https://github.com/awslabs/aws-solutions-constructs/issues/51)) + +### Changed +- Upgraded all patterns to CDK v1.62.0 + ## [1.61.1] - 2020-09-01 ### Added @@ -161,4 +171,4 @@ General Availability of the AWS Solutions Constructs!! πŸŽ‰πŸŽ‰πŸ₯‚πŸ₯‚πŸΎπŸΎ - aws-s3-lambda pattern added - aws-sns-lambda pattern added - aws-sqs-lambda pattern added -- core pattern added +- core pattern added \ No newline at end of file diff --git a/source/lerna.json b/source/lerna.json index d914128bb..6f4f6b00c 100644 --- a/source/lerna.json +++ b/source/lerna.json @@ -6,5 +6,5 @@ "./patterns/@aws-solutions-constructs/*" ], "rejectCycles": "true", - "version": "1.61.1" + "version": "1.62.0" } diff --git a/source/package.json b/source/package.json index af42d6359..5f2833a4c 100644 --- a/source/package.json +++ b/source/package.json @@ -1,6 +1,6 @@ { "name": "aws-solutions-constructs", - "version": "1.61.1", + "version": "1.62.0", "description": "AWS Solutions Constructs Library", "repository": { "type": "git", diff --git a/source/patterns/@aws-solutions-constructs/aws-apigateway-dynamodb/package.json b/source/patterns/@aws-solutions-constructs/aws-apigateway-dynamodb/package.json index 81bc9f2fa..5dc03f235 100644 --- a/source/patterns/@aws-solutions-constructs/aws-apigateway-dynamodb/package.json +++ b/source/patterns/@aws-solutions-constructs/aws-apigateway-dynamodb/package.json @@ -1,6 +1,6 @@ { "name": "@aws-solutions-constructs/aws-apigateway-dynamodb", - "version": "1.61.1", + "version": "1.62.0", "description": "CDK Constructs for AWS API Gateway and Amazon DynamoDB integration.", "main": "lib/index.js", "types": "lib/index.d.ts", @@ -53,16 +53,16 @@ } }, "dependencies": { - "@aws-cdk/core": "~1.61.1", - "@aws-cdk/aws-apigateway": "~1.61.1", - "@aws-cdk/aws-iam": "~1.61.1", - "@aws-cdk/aws-dynamodb": "~1.61.1", - "@aws-cdk/aws-logs": "~1.61.1", - "@aws-solutions-constructs/core": "~1.61.1", + "@aws-cdk/core": "~1.62.0", + "@aws-cdk/aws-apigateway": "~1.62.0", + "@aws-cdk/aws-iam": "~1.62.0", + "@aws-cdk/aws-dynamodb": "~1.62.0", + "@aws-cdk/aws-logs": "~1.62.0", + "@aws-solutions-constructs/core": "~1.62.0", "constructs": "^3.0.4" }, "devDependencies": { - "@aws-cdk/assert": "~1.61.1", + "@aws-cdk/assert": "~1.62.0", "@types/jest": "^24.0.23", "@types/node": "^10.3.0" }, @@ -72,12 +72,12 @@ ] }, "peerDependencies": { - "@aws-cdk/core": "~1.61.1", - "@aws-cdk/aws-apigateway": "~1.61.1", - "@aws-cdk/aws-iam": "~1.61.1", - "@aws-cdk/aws-dynamodb": "~1.61.1", - "@aws-solutions-constructs/core": "~1.61.1", + "@aws-cdk/core": "~1.62.0", + "@aws-cdk/aws-apigateway": "~1.62.0", + "@aws-cdk/aws-iam": "~1.62.0", + "@aws-cdk/aws-dynamodb": "~1.62.0", + "@aws-solutions-constructs/core": "~1.62.0", "constructs": "^3.0.4", - "@aws-cdk/aws-logs": "~1.61.1" + "@aws-cdk/aws-logs": "~1.62.0" } } diff --git a/source/patterns/@aws-solutions-constructs/aws-apigateway-kinesisstreams/README.md b/source/patterns/@aws-solutions-constructs/aws-apigateway-kinesisstreams/README.md index 701203bf5..2f8b207b3 100644 --- a/source/patterns/@aws-solutions-constructs/aws-apigateway-kinesisstreams/README.md +++ b/source/patterns/@aws-solutions-constructs/aws-apigateway-kinesisstreams/README.md @@ -75,8 +75,8 @@ _Parameters_ | **Method** | **Request Path** | **Request Body** | **Stream Action** | **Description** | |:-------------|:----------------|-----------------|-----------------|-----------------| -|POST|`/record`| `{ "data": "Hello World!", "partitionKey": "pk001 }` |`kinesis:PutRecord`|Writes a single data record into the stream.| -|POST|`/records`| `{ "records": [{ "data": "abc", "partitionKey": "pk001" }, { "data": "xyz", "partitionKeyID": "pk001" }] }` |`kinesis:PutRecords`|Writes multiple data records into the stream in a single call.| +|POST|`/record`| `{ "data": "Hello World!", "partitionKey": "pk001" }` |`kinesis:PutRecord`|Writes a single data record into the stream.| +|POST|`/records`| `{ "records": [{ "data": "abc", "partitionKey": "pk001" }, { "data": "xyz", "partitionKey": "pk001" }] }` |`kinesis:PutRecords`|Writes multiple data records into the stream in a single call.| ## Default settings Out of the box implementation of the Construct without any override will set the following defaults: diff --git a/source/patterns/@aws-solutions-constructs/aws-apigateway-kinesisstreams/lib/index.ts b/source/patterns/@aws-solutions-constructs/aws-apigateway-kinesisstreams/lib/index.ts index 0ac80f838..3978cad29 100644 --- a/source/patterns/@aws-solutions-constructs/aws-apigateway-kinesisstreams/lib/index.ts +++ b/source/patterns/@aws-solutions-constructs/aws-apigateway-kinesisstreams/lib/index.ts @@ -34,7 +34,8 @@ export interface ApiGatewayToKinesisStreamsProps { * API Gateway request template for the PutRecord action. * If not provided, a default one will be used. * - * @default - None + * @default - { "StreamName": "${this.kinesisStream.streamName}", "Data": "$util.base64Encode($input.json('$.data'))", + * "PartitionKey": "$input.path('$.partitionKey')" } */ readonly putRecordRequestTemplate?: string; @@ -42,7 +43,8 @@ export interface ApiGatewayToKinesisStreamsProps { * API Gateway request model for the PutRecord action. * If not provided, a default one will be created. * - * @default - None + * @default - {"$schema":"http://json-schema.org/draft-04/schema#","title":"PutRecord proxy single-record payload","type":"object", + * "required":["data","partitionKey"],"properties":{"data":{"type":"string"},"partitionKey":{"type":"string"}}} */ readonly putRecordRequestModel?: api.ModelOptions; @@ -50,7 +52,8 @@ export interface ApiGatewayToKinesisStreamsProps { * API Gateway request template for the PutRecords action. * If not provided, a default one will be used. * - * @default - None + * @default - { "StreamName": "${this.kinesisStream.streamName}", "Records": [ #foreach($elem in $input.path('$.records')) + * { "Data": "$util.base64Encode($elem.data)", "PartitionKey": "$elem.partitionKey"}#if($foreach.hasNext),#end #end ] } */ readonly putRecordsRequestTemplate?: string; @@ -58,7 +61,9 @@ export interface ApiGatewayToKinesisStreamsProps { * API Gateway request model for the PutRecords action. * If not provided, a default one will be created. * - * @default - None + * @default - {"$schema":"http://json-schema.org/draft-04/schema#","title":"PutRecords proxy payload data","type":"object","required":["records"], + * "properties":{"records":{"type":"array","items":{"type":"object", + * "required":["data","partitionKey"],"properties":{"data":{"type":"string"},"partitionKey":{"type":"string"}}}}}} */ readonly putRecordsRequestModel?: api.ModelOptions; @@ -92,7 +97,7 @@ export class ApiGatewayToKinesisStreams extends Construct { * @param {cdk.App} scope - represents the scope for all the resources. * @param {string} id - this is a a scope-unique id. * @param {ApiGatewayToKinesisStreamsProps} props - user provided props for the construct. - * @since 1.61.1 + * @since 1.62.0 * @access public */ constructor(scope: Construct, id: string, props: ApiGatewayToKinesisStreamsProps) { @@ -150,7 +155,7 @@ export class ApiGatewayToKinesisStreams extends Construct { private getPutRecordTemplate(putRecordTemplate?: string): string { if (putRecordTemplate !== undefined) { - return putRecordTemplate; + return putRecordTemplate.replace("${StreamName}", this.kinesisStream.streamName); } return `{ "StreamName": "${this.kinesisStream.streamName}", "Data": "$util.base64Encode($input.json('$.data'))", "PartitionKey": "$input.path('$.partitionKey')" }`; @@ -184,7 +189,7 @@ export class ApiGatewayToKinesisStreams extends Construct { private getPutRecordsTemplate(putRecordsTemplate?: string): string { if (putRecordsTemplate !== undefined) { - return putRecordsTemplate; + return putRecordsTemplate.replace("${StreamName}", this.kinesisStream.streamName); } return `{ "StreamName": "${this.kinesisStream.streamName}", "Records": [ #foreach($elem in $input.path('$.records')) { "Data": "$util.base64Encode($elem.data)", "PartitionKey": "$elem.partitionKey"}#if($foreach.hasNext),#end #end ] }`; diff --git a/source/patterns/@aws-solutions-constructs/aws-apigateway-kinesisstreams/package.json b/source/patterns/@aws-solutions-constructs/aws-apigateway-kinesisstreams/package.json index 2e8c032eb..902b033fe 100644 --- a/source/patterns/@aws-solutions-constructs/aws-apigateway-kinesisstreams/package.json +++ b/source/patterns/@aws-solutions-constructs/aws-apigateway-kinesisstreams/package.json @@ -1,6 +1,6 @@ { "name": "@aws-solutions-constructs/aws-apigateway-kinesisstreams", - "version": "1.61.1", + "version": "1.62.0", "description": "CDK Constructs for AWS API Gateway and Amazon Kinesis Data Streams integration.", "main": "lib/index.js", "types": "lib/index.d.ts", @@ -53,16 +53,16 @@ } }, "dependencies": { - "@aws-cdk/core": "~1.61.1", - "@aws-cdk/aws-apigateway": "~1.61.1", - "@aws-cdk/aws-iam": "~1.61.1", - "@aws-cdk/aws-kinesis": "~1.61.1", - "@aws-cdk/aws-logs": "~1.61.1", - "@aws-solutions-constructs/core": "~1.61.1", + "@aws-cdk/core": "~1.62.0", + "@aws-cdk/aws-apigateway": "~1.62.0", + "@aws-cdk/aws-iam": "~1.62.0", + "@aws-cdk/aws-kinesis": "~1.62.0", + "@aws-cdk/aws-logs": "~1.62.0", + "@aws-solutions-constructs/core": "~1.62.0", "constructs": "^3.0.4" }, "devDependencies": { - "@aws-cdk/assert": "~1.61.1", + "@aws-cdk/assert": "~1.62.0", "@types/jest": "^24.0.23", "@types/node": "^10.3.0" }, @@ -72,12 +72,12 @@ ] }, "peerDependencies": { - "@aws-cdk/core": "~1.61.1", - "@aws-cdk/aws-apigateway": "~1.61.1", - "@aws-cdk/aws-iam": "~1.61.1", - "@aws-cdk/aws-kinesis": "~1.61.1", - "@aws-solutions-constructs/core": "~1.61.1", + "@aws-cdk/core": "~1.62.0", + "@aws-cdk/aws-apigateway": "~1.62.0", + "@aws-cdk/aws-iam": "~1.62.0", + "@aws-cdk/aws-kinesis": "~1.62.0", + "@aws-solutions-constructs/core": "~1.62.0", "constructs": "^3.0.4", - "@aws-cdk/aws-logs": "~1.61.1" + "@aws-cdk/aws-logs": "~1.62.0" } } diff --git a/source/patterns/@aws-solutions-constructs/aws-apigateway-kinesisstreams/test/integ.apigateway-kinesis-overwrite.expected.json b/source/patterns/@aws-solutions-constructs/aws-apigateway-kinesisstreams/test/integ.apigateway-kinesis-overwrite.expected.json index c5d88fccf..b342b6789 100644 --- a/source/patterns/@aws-solutions-constructs/aws-apigateway-kinesisstreams/test/integ.apigateway-kinesis-overwrite.expected.json +++ b/source/patterns/@aws-solutions-constructs/aws-apigateway-kinesisstreams/test/integ.apigateway-kinesis-overwrite.expected.json @@ -17,7 +17,7 @@ "Name": "my-api" } }, - "testapigatewaykinesisoverwriteRestApiDeployment1EE3B0963b59c487316048a0c96d810cbd1cf3bb": { + "testapigatewaykinesisoverwriteRestApiDeployment1EE3B096ca960d6e964dacd9ef8ada66856cca97": { "Type": "AWS::ApiGateway::Deployment", "Properties": { "RestApiId": { @@ -61,7 +61,7 @@ "Format": "{\"requestId\":\"$context.requestId\",\"ip\":\"$context.identity.sourceIp\",\"user\":\"$context.identity.user\",\"caller\":\"$context.identity.caller\",\"requestTime\":\"$context.requestTime\",\"httpMethod\":\"$context.httpMethod\",\"resourcePath\":\"$context.resourcePath\",\"status\":\"$context.status\",\"protocol\":\"$context.protocol\",\"responseLength\":\"$context.responseLength\"}" }, "DeploymentId": { - "Ref": "testapigatewaykinesisoverwriteRestApiDeployment1EE3B0963b59c487316048a0c96d810cbd1cf3bb" + "Ref": "testapigatewaykinesisoverwriteRestApiDeployment1EE3B096ca960d6e964dacd9ef8ada66856cca97" }, "MethodSettings": [ { @@ -132,7 +132,18 @@ "integration.request.header.Content-Type": "'x-amz-json-1.1'" }, "RequestTemplates": { - "application/json": "{ \"Data\": \"$util.base64Encode($input.json('$.foo'))\", \"PartitionKey\": \"$input.path('$.bar')\" }" + "application/json": { + "Fn::Join": [ + "", + [ + "{ \"StreamName\": \"", + { + "Ref": "KinesisStream46752A3E" + }, + "\", \"Data\": \"$util.base64Encode($input.json('$.foo'))\", \"PartitionKey\": \"$input.path('$.bar')\" }" + ] + ] + } }, "Type": "AWS", "Uri": { @@ -227,7 +238,18 @@ "integration.request.header.Content-Type": "'x-amz-json-1.1'" }, "RequestTemplates": { - "application/json": "{ \"Records\": [ #foreach($elem in $input.path('$.records')) { \"Data\": \"$util.base64Encode($elem.foo)\", \"PartitionKey\": \"$elem.bar\"}#if($foreach.hasNext),#end #end ] }" + "application/json": { + "Fn::Join": [ + "", + [ + "{ \"StreamName\": \"", + { + "Ref": "KinesisStream46752A3E" + }, + "\", \"Records\": [ #foreach($elem in $input.path('$.records')) { \"Data\": \"$util.base64Encode($elem.foo)\", \"PartitionKey\": \"$elem.bar\"}#if($foreach.hasNext),#end #end ] }" + ] + ] + } }, "Type": "AWS", "Uri": { diff --git a/source/patterns/@aws-solutions-constructs/aws-apigateway-kinesisstreams/test/integ.apigateway-kinesis-overwrite.ts b/source/patterns/@aws-solutions-constructs/aws-apigateway-kinesisstreams/test/integ.apigateway-kinesis-overwrite.ts index 5c5dcb2b2..3921dc824 100644 --- a/source/patterns/@aws-solutions-constructs/aws-apigateway-kinesisstreams/test/integ.apigateway-kinesis-overwrite.ts +++ b/source/patterns/@aws-solutions-constructs/aws-apigateway-kinesisstreams/test/integ.apigateway-kinesis-overwrite.ts @@ -37,10 +37,10 @@ const props: ApiGatewayToKinesisStreamsProps = { shardCount: 1, retentionPeriod: Duration.days(4) }, - putRecordRequestTemplate: `{ "Data": "$util.base64Encode($input.json('$.foo'))", "PartitionKey": "$input.path('$.bar')" }`, + putRecordRequestTemplate: `{ "StreamName": "\${StreamName}", "Data": "$util.base64Encode($input.json('$.foo'))", "PartitionKey": "$input.path('$.bar')" }`, putRecordRequestModel: { schema: {} }, - putRecordsRequestTemplate: `{ "Records": [ #foreach($elem in $input.path('$.records')) { "Data": "$util.base64Encode($elem.foo)", "PartitionKey": "$elem.bar"}#if($foreach.hasNext),#end #end ] }`, + putRecordsRequestTemplate: `{ "StreamName": "\${StreamName}", "Records": [ #foreach($elem in $input.path('$.records')) { "Data": "$util.base64Encode($elem.foo)", "PartitionKey": "$elem.bar"}#if($foreach.hasNext),#end #end ] }`, putRecordsRequestModel: { schema: {} } }; diff --git a/source/patterns/@aws-solutions-constructs/aws-apigateway-lambda/package.json b/source/patterns/@aws-solutions-constructs/aws-apigateway-lambda/package.json index 2fd719969..729561059 100644 --- a/source/patterns/@aws-solutions-constructs/aws-apigateway-lambda/package.json +++ b/source/patterns/@aws-solutions-constructs/aws-apigateway-lambda/package.json @@ -1,6 +1,6 @@ { "name": "@aws-solutions-constructs/aws-apigateway-lambda", - "version": "1.61.1", + "version": "1.62.0", "description": "CDK constructs for defining an interaction between an API Gateway and a Lambda function.", "main": "lib/index.js", "types": "lib/index.d.ts", @@ -53,16 +53,16 @@ } }, "dependencies": { - "@aws-cdk/aws-apigateway": "~1.61.1", - "@aws-cdk/aws-lambda": "~1.61.1", - "@aws-cdk/aws-logs": "~1.61.1", - "@aws-cdk/core": "~1.61.1", - "@aws-cdk/aws-iam": "~1.61.1", - "@aws-solutions-constructs/core": "~1.61.1", + "@aws-cdk/aws-apigateway": "~1.62.0", + "@aws-cdk/aws-lambda": "~1.62.0", + "@aws-cdk/aws-logs": "~1.62.0", + "@aws-cdk/core": "~1.62.0", + "@aws-cdk/aws-iam": "~1.62.0", + "@aws-solutions-constructs/core": "~1.62.0", "constructs": "^3.0.4" }, "devDependencies": { - "@aws-cdk/assert": "~1.61.1", + "@aws-cdk/assert": "~1.62.0", "@types/jest": "^24.0.23", "@types/node": "^10.3.0" }, @@ -72,12 +72,12 @@ ] }, "peerDependencies": { - "@aws-cdk/aws-apigateway": "~1.61.1", - "@aws-cdk/aws-lambda": "~1.61.1", - "@aws-cdk/aws-logs": "~1.61.1", - "@aws-cdk/core": "~1.61.1", - "@aws-solutions-constructs/core": "~1.61.1", + "@aws-cdk/aws-apigateway": "~1.62.0", + "@aws-cdk/aws-lambda": "~1.62.0", + "@aws-cdk/aws-logs": "~1.62.0", + "@aws-cdk/core": "~1.62.0", + "@aws-solutions-constructs/core": "~1.62.0", "constructs": "^3.0.4", - "@aws-cdk/aws-iam": "~1.61.1" + "@aws-cdk/aws-iam": "~1.62.0" } } diff --git a/source/patterns/@aws-solutions-constructs/aws-apigateway-sqs/package.json b/source/patterns/@aws-solutions-constructs/aws-apigateway-sqs/package.json index 374b7eed0..450d8b9f4 100644 --- a/source/patterns/@aws-solutions-constructs/aws-apigateway-sqs/package.json +++ b/source/patterns/@aws-solutions-constructs/aws-apigateway-sqs/package.json @@ -1,6 +1,6 @@ { "name": "@aws-solutions-constructs/aws-apigateway-sqs", - "version": "1.61.1", + "version": "1.62.0", "description": "CDK constructs for defining an interaction between an AWS Lambda function and an Amazon S3 bucket.", "main": "lib/index.js", "types": "lib/index.d.ts", @@ -53,17 +53,17 @@ } }, "dependencies": { - "@aws-cdk/aws-apigateway": "~1.61.1", - "@aws-cdk/aws-sqs": "~1.61.1", - "@aws-cdk/aws-kms": "~1.61.1", - "@aws-cdk/aws-iam": "~1.61.1", - "@aws-cdk/aws-logs": "~1.61.1", - "@aws-cdk/core": "~1.61.1", - "@aws-solutions-constructs/core": "~1.61.1", + "@aws-cdk/aws-apigateway": "~1.62.0", + "@aws-cdk/aws-sqs": "~1.62.0", + "@aws-cdk/aws-kms": "~1.62.0", + "@aws-cdk/aws-iam": "~1.62.0", + "@aws-cdk/aws-logs": "~1.62.0", + "@aws-cdk/core": "~1.62.0", + "@aws-solutions-constructs/core": "~1.62.0", "constructs": "^3.0.4" }, "devDependencies": { - "@aws-cdk/assert": "~1.61.1", + "@aws-cdk/assert": "~1.62.0", "@types/jest": "^24.0.23", "@types/node": "^10.3.0" }, @@ -73,13 +73,13 @@ ] }, "peerDependencies": { - "@aws-cdk/aws-apigateway": "~1.61.1", - "@aws-cdk/aws-sqs": "~1.61.1", - "@aws-cdk/aws-kms": "~1.61.1", - "@aws-cdk/aws-iam": "~1.61.1", - "@aws-cdk/core": "~1.61.1", - "@aws-solutions-constructs/core": "~1.61.1", + "@aws-cdk/aws-apigateway": "~1.62.0", + "@aws-cdk/aws-sqs": "~1.62.0", + "@aws-cdk/aws-kms": "~1.62.0", + "@aws-cdk/aws-iam": "~1.62.0", + "@aws-cdk/core": "~1.62.0", + "@aws-solutions-constructs/core": "~1.62.0", "constructs": "^3.0.4", - "@aws-cdk/aws-logs": "~1.61.1" + "@aws-cdk/aws-logs": "~1.62.0" } } diff --git a/source/patterns/@aws-solutions-constructs/aws-cloudfront-apigateway-lambda/package.json b/source/patterns/@aws-solutions-constructs/aws-cloudfront-apigateway-lambda/package.json index e2bda454e..b753d950f 100644 --- a/source/patterns/@aws-solutions-constructs/aws-cloudfront-apigateway-lambda/package.json +++ b/source/patterns/@aws-solutions-constructs/aws-cloudfront-apigateway-lambda/package.json @@ -1,6 +1,6 @@ { "name": "@aws-solutions-constructs/aws-cloudfront-apigateway-lambda", - "version": "1.61.1", + "version": "1.62.0", "description": "CDK Constructs for AWS Cloudfront to AWS API Gateway to AWS Lambda integration.", "main": "lib/index.js", "types": "lib/index.d.ts", @@ -53,19 +53,19 @@ } }, "dependencies": { - "@aws-cdk/core": "~1.61.1", - "@aws-cdk/aws-cloudfront": "~1.61.1", - "@aws-cdk/aws-apigateway": "~1.61.1", - "@aws-cdk/aws-lambda": "~1.61.1", - "@aws-cdk/aws-logs": "~1.61.1", - "@aws-cdk/aws-s3": "~1.61.1", - "@aws-cdk/aws-iam": "~1.61.1", - "@aws-solutions-constructs/aws-cloudfront-apigateway": "~1.61.1", - "@aws-solutions-constructs/core": "~1.61.1", + "@aws-cdk/core": "~1.62.0", + "@aws-cdk/aws-cloudfront": "~1.62.0", + "@aws-cdk/aws-apigateway": "~1.62.0", + "@aws-cdk/aws-lambda": "~1.62.0", + "@aws-cdk/aws-logs": "~1.62.0", + "@aws-cdk/aws-s3": "~1.62.0", + "@aws-cdk/aws-iam": "~1.62.0", + "@aws-solutions-constructs/aws-cloudfront-apigateway": "~1.62.0", + "@aws-solutions-constructs/core": "~1.62.0", "constructs": "^3.0.4" }, "devDependencies": { - "@aws-cdk/assert": "~1.61.1", + "@aws-cdk/assert": "~1.62.0", "@types/jest": "^24.0.23", "@types/node": "^10.3.0" }, @@ -75,15 +75,15 @@ ] }, "peerDependencies": { - "@aws-cdk/core": "~1.61.1", - "@aws-cdk/aws-cloudfront": "~1.61.1", - "@aws-cdk/aws-apigateway": "~1.61.1", - "@aws-solutions-constructs/core": "~1.61.1", - "@aws-cdk/aws-lambda": "~1.61.1", - "@aws-cdk/aws-logs": "~1.61.1", - "@aws-solutions-constructs/aws-cloudfront-apigateway": "~1.61.1", + "@aws-cdk/core": "~1.62.0", + "@aws-cdk/aws-cloudfront": "~1.62.0", + "@aws-cdk/aws-apigateway": "~1.62.0", + "@aws-solutions-constructs/core": "~1.62.0", + "@aws-cdk/aws-lambda": "~1.62.0", + "@aws-cdk/aws-logs": "~1.62.0", + "@aws-solutions-constructs/aws-cloudfront-apigateway": "~1.62.0", "constructs": "^3.0.4", - "@aws-cdk/aws-s3": "~1.61.1", - "@aws-cdk/aws-iam": "~1.61.1" + "@aws-cdk/aws-s3": "~1.62.0", + "@aws-cdk/aws-iam": "~1.62.0" } } diff --git a/source/patterns/@aws-solutions-constructs/aws-cloudfront-apigateway/package.json b/source/patterns/@aws-solutions-constructs/aws-cloudfront-apigateway/package.json index 99c3137ee..ba1dc2862 100644 --- a/source/patterns/@aws-solutions-constructs/aws-cloudfront-apigateway/package.json +++ b/source/patterns/@aws-solutions-constructs/aws-cloudfront-apigateway/package.json @@ -1,6 +1,6 @@ { "name": "@aws-solutions-constructs/aws-cloudfront-apigateway", - "version": "1.61.1", + "version": "1.62.0", "description": "CDK Constructs for AWS Cloudfront to AWS API Gateway integration.", "main": "lib/index.js", "types": "lib/index.d.ts", @@ -53,17 +53,17 @@ } }, "dependencies": { - "@aws-cdk/core": "~1.61.1", - "@aws-cdk/aws-cloudfront": "~1.61.1", - "@aws-cdk/aws-apigateway": "~1.61.1", - "@aws-cdk/aws-lambda": "~1.61.1", - "@aws-cdk/aws-logs": "~1.61.1", - "@aws-cdk/aws-s3": "~1.61.1", - "@aws-solutions-constructs/core": "~1.61.1", + "@aws-cdk/core": "~1.62.0", + "@aws-cdk/aws-cloudfront": "~1.62.0", + "@aws-cdk/aws-apigateway": "~1.62.0", + "@aws-cdk/aws-lambda": "~1.62.0", + "@aws-cdk/aws-logs": "~1.62.0", + "@aws-cdk/aws-s3": "~1.62.0", + "@aws-solutions-constructs/core": "~1.62.0", "constructs": "^3.0.4" }, "devDependencies": { - "@aws-cdk/assert": "~1.61.1", + "@aws-cdk/assert": "~1.62.0", "@types/jest": "^24.0.23", "@types/node": "^10.3.0" }, @@ -73,13 +73,13 @@ ] }, "peerDependencies": { - "@aws-cdk/core": "~1.61.1", - "@aws-cdk/aws-cloudfront": "~1.61.1", - "@aws-cdk/aws-apigateway": "~1.61.1", - "@aws-solutions-constructs/core": "~1.61.1", - "@aws-cdk/aws-lambda": "~1.61.1", - "@aws-cdk/aws-logs": "~1.61.1", + "@aws-cdk/core": "~1.62.0", + "@aws-cdk/aws-cloudfront": "~1.62.0", + "@aws-cdk/aws-apigateway": "~1.62.0", + "@aws-solutions-constructs/core": "~1.62.0", + "@aws-cdk/aws-lambda": "~1.62.0", + "@aws-cdk/aws-logs": "~1.62.0", "constructs": "^3.0.4", - "@aws-cdk/aws-s3": "~1.61.1" + "@aws-cdk/aws-s3": "~1.62.0" } } diff --git a/source/patterns/@aws-solutions-constructs/aws-cloudfront-s3/package.json b/source/patterns/@aws-solutions-constructs/aws-cloudfront-s3/package.json index d1683773a..b4575c22b 100644 --- a/source/patterns/@aws-solutions-constructs/aws-cloudfront-s3/package.json +++ b/source/patterns/@aws-solutions-constructs/aws-cloudfront-s3/package.json @@ -1,6 +1,6 @@ { "name": "@aws-solutions-constructs/aws-cloudfront-s3", - "version": "1.61.1", + "version": "1.62.0", "description": "CDK Constructs for AWS Cloudfront to AWS S3 integration.", "main": "lib/index.js", "types": "lib/index.d.ts", @@ -53,15 +53,15 @@ } }, "dependencies": { - "@aws-cdk/core": "~1.61.1", - "@aws-cdk/aws-cloudfront": "~1.61.1", - "@aws-cdk/aws-s3": "~1.61.1", - "@aws-cdk/aws-lambda": "~1.61.1", - "@aws-solutions-constructs/core": "~1.61.1", + "@aws-cdk/core": "~1.62.0", + "@aws-cdk/aws-cloudfront": "~1.62.0", + "@aws-cdk/aws-s3": "~1.62.0", + "@aws-cdk/aws-lambda": "~1.62.0", + "@aws-solutions-constructs/core": "~1.62.0", "constructs": "^3.0.4" }, "devDependencies": { - "@aws-cdk/assert": "~1.61.1", + "@aws-cdk/assert": "~1.62.0", "@types/jest": "^24.0.23", "@types/node": "^10.3.0" }, @@ -71,11 +71,11 @@ ] }, "peerDependencies": { - "@aws-cdk/core": "~1.61.1", - "@aws-cdk/aws-cloudfront": "~1.61.1", - "@aws-cdk/aws-s3": "~1.61.1", - "@aws-solutions-constructs/core": "~1.61.1", + "@aws-cdk/core": "~1.62.0", + "@aws-cdk/aws-cloudfront": "~1.62.0", + "@aws-cdk/aws-s3": "~1.62.0", + "@aws-solutions-constructs/core": "~1.62.0", "constructs": "^3.0.4", - "@aws-cdk/aws-lambda": "~1.61.1" + "@aws-cdk/aws-lambda": "~1.62.0" } } diff --git a/source/patterns/@aws-solutions-constructs/aws-cognito-apigateway-lambda/package.json b/source/patterns/@aws-solutions-constructs/aws-cognito-apigateway-lambda/package.json index 5d183fe79..acefda6fc 100644 --- a/source/patterns/@aws-solutions-constructs/aws-cognito-apigateway-lambda/package.json +++ b/source/patterns/@aws-solutions-constructs/aws-cognito-apigateway-lambda/package.json @@ -1,6 +1,6 @@ { "name": "@aws-solutions-constructs/aws-cognito-apigateway-lambda", - "version": "1.61.1", + "version": "1.62.0", "description": "CDK Constructs for AWS Cognito to AWS API Gateway to AWS Lambda integration", "main": "lib/index.js", "types": "lib/index.d.ts", @@ -53,17 +53,17 @@ } }, "dependencies": { - "@aws-cdk/aws-lambda": "~1.61.1", - "@aws-cdk/core": "~1.61.1", - "@aws-cdk/aws-cognito": "~1.61.1", - "@aws-cdk/aws-apigateway": "~1.61.1", - "@aws-cdk/aws-logs": "~1.61.1", - "@aws-cdk/aws-iam": "~1.61.1", - "@aws-solutions-constructs/core": "~1.61.1", + "@aws-cdk/aws-lambda": "~1.62.0", + "@aws-cdk/core": "~1.62.0", + "@aws-cdk/aws-cognito": "~1.62.0", + "@aws-cdk/aws-apigateway": "~1.62.0", + "@aws-cdk/aws-logs": "~1.62.0", + "@aws-cdk/aws-iam": "~1.62.0", + "@aws-solutions-constructs/core": "~1.62.0", "constructs": "^3.0.4" }, "devDependencies": { - "@aws-cdk/assert": "~1.61.1", + "@aws-cdk/assert": "~1.62.0", "@types/jest": "^24.0.23", "@types/node": "^10.3.0" }, @@ -73,13 +73,13 @@ ] }, "peerDependencies": { - "@aws-cdk/aws-lambda": "~1.61.1", - "@aws-cdk/core": "~1.61.1", - "@aws-cdk/aws-cognito": "~1.61.1", - "@aws-cdk/aws-apigateway": "~1.61.1", - "@aws-solutions-constructs/core": "~1.61.1", + "@aws-cdk/aws-lambda": "~1.62.0", + "@aws-cdk/core": "~1.62.0", + "@aws-cdk/aws-cognito": "~1.62.0", + "@aws-cdk/aws-apigateway": "~1.62.0", + "@aws-solutions-constructs/core": "~1.62.0", "constructs": "^3.0.4", - "@aws-cdk/aws-logs": "~1.61.1", - "@aws-cdk/aws-iam": "~1.61.1" + "@aws-cdk/aws-logs": "~1.62.0", + "@aws-cdk/aws-iam": "~1.62.0" } } diff --git a/source/patterns/@aws-solutions-constructs/aws-dynamodb-stream-lambda-elasticsearch-kibana/package.json b/source/patterns/@aws-solutions-constructs/aws-dynamodb-stream-lambda-elasticsearch-kibana/package.json index ca99ee291..345feb040 100644 --- a/source/patterns/@aws-solutions-constructs/aws-dynamodb-stream-lambda-elasticsearch-kibana/package.json +++ b/source/patterns/@aws-solutions-constructs/aws-dynamodb-stream-lambda-elasticsearch-kibana/package.json @@ -1,6 +1,6 @@ { "name": "@aws-solutions-constructs/aws-dynamodb-stream-lambda-elasticsearch-kibana", - "version": "1.61.1", + "version": "1.62.0", "description": "CDK Constructs for Amazon Dynamodb stream to AWS Lambda to AWS Elasticsearch with Kibana integration", "main": "lib/index.js", "types": "lib/index.d.ts", @@ -53,21 +53,21 @@ } }, "dependencies": { - "@aws-cdk/aws-lambda": "~1.61.1", - "@aws-cdk/aws-lambda-event-sources": "~1.61.1", - "@aws-cdk/core": "~1.61.1", - "@aws-cdk/aws-cognito": "~1.61.1", - "@aws-cdk/aws-elasticsearch": "~1.61.1", - "@aws-cdk/aws-dynamodb": "~1.61.1", - "@aws-cdk/aws-cloudwatch": "~1.61.1", - "@aws-cdk/aws-iam": "~1.61.1", - "@aws-solutions-constructs/core": "~1.61.1", - "@aws-solutions-constructs/aws-dynamodb-stream-lambda": "~1.61.1", - "@aws-solutions-constructs/aws-lambda-elasticsearch-kibana": "~1.61.1", + "@aws-cdk/aws-lambda": "~1.62.0", + "@aws-cdk/aws-lambda-event-sources": "~1.62.0", + "@aws-cdk/core": "~1.62.0", + "@aws-cdk/aws-cognito": "~1.62.0", + "@aws-cdk/aws-elasticsearch": "~1.62.0", + "@aws-cdk/aws-dynamodb": "~1.62.0", + "@aws-cdk/aws-cloudwatch": "~1.62.0", + "@aws-cdk/aws-iam": "~1.62.0", + "@aws-solutions-constructs/core": "~1.62.0", + "@aws-solutions-constructs/aws-dynamodb-stream-lambda": "~1.62.0", + "@aws-solutions-constructs/aws-lambda-elasticsearch-kibana": "~1.62.0", "constructs": "^3.0.4" }, "devDependencies": { - "@aws-cdk/assert": "~1.61.1", + "@aws-cdk/assert": "~1.62.0", "@types/jest": "^24.0.23", "@types/node": "^10.3.0" }, @@ -77,17 +77,17 @@ ] }, "peerDependencies": { - "@aws-cdk/aws-lambda": "~1.61.1", - "@aws-cdk/core": "~1.61.1", - "@aws-cdk/aws-cognito": "~1.61.1", - "@aws-cdk/aws-elasticsearch": "~1.61.1", - "@aws-cdk/aws-dynamodb": "~1.61.1", - "@aws-cdk/aws-cloudwatch": "~1.61.1", - "@aws-solutions-constructs/core": "~1.61.1", - "@aws-solutions-constructs/aws-dynamodb-stream-lambda": "~1.61.1", - "@aws-solutions-constructs/aws-lambda-elasticsearch-kibana": "~1.61.1", - "@aws-cdk/aws-lambda-event-sources": "~1.61.1", + "@aws-cdk/aws-lambda": "~1.62.0", + "@aws-cdk/core": "~1.62.0", + "@aws-cdk/aws-cognito": "~1.62.0", + "@aws-cdk/aws-elasticsearch": "~1.62.0", + "@aws-cdk/aws-dynamodb": "~1.62.0", + "@aws-cdk/aws-cloudwatch": "~1.62.0", + "@aws-solutions-constructs/core": "~1.62.0", + "@aws-solutions-constructs/aws-dynamodb-stream-lambda": "~1.62.0", + "@aws-solutions-constructs/aws-lambda-elasticsearch-kibana": "~1.62.0", + "@aws-cdk/aws-lambda-event-sources": "~1.62.0", "constructs": "^3.0.4", - "@aws-cdk/aws-iam": "~1.61.1" + "@aws-cdk/aws-iam": "~1.62.0" } } diff --git a/source/patterns/@aws-solutions-constructs/aws-dynamodb-stream-lambda/package.json b/source/patterns/@aws-solutions-constructs/aws-dynamodb-stream-lambda/package.json index f07c855e1..e29623c60 100644 --- a/source/patterns/@aws-solutions-constructs/aws-dynamodb-stream-lambda/package.json +++ b/source/patterns/@aws-solutions-constructs/aws-dynamodb-stream-lambda/package.json @@ -1,6 +1,6 @@ { "name": "@aws-solutions-constructs/aws-dynamodb-stream-lambda", - "version": "1.61.1", + "version": "1.62.0", "description": "CDK Constructs for AWS DynamoDB Stream to AWS Lambda integration.", "main": "lib/index.js", "types": "lib/index.d.ts", @@ -53,16 +53,16 @@ } }, "dependencies": { - "@aws-cdk/aws-lambda": "~1.61.1", - "@aws-cdk/aws-lambda-event-sources": "~1.61.1", - "@aws-cdk/aws-dynamodb": "~1.61.1", - "@aws-cdk/aws-iam": "~1.61.1", - "@aws-cdk/core": "~1.61.1", - "@aws-solutions-constructs/core": "~1.61.1", + "@aws-cdk/aws-lambda": "~1.62.0", + "@aws-cdk/aws-lambda-event-sources": "~1.62.0", + "@aws-cdk/aws-dynamodb": "~1.62.0", + "@aws-cdk/aws-iam": "~1.62.0", + "@aws-cdk/core": "~1.62.0", + "@aws-solutions-constructs/core": "~1.62.0", "constructs": "^3.0.4" }, "devDependencies": { - "@aws-cdk/assert": "~1.61.1", + "@aws-cdk/assert": "~1.62.0", "@types/jest": "^24.0.23", "@types/node": "^10.3.0" }, @@ -72,12 +72,12 @@ ] }, "peerDependencies": { - "@aws-cdk/aws-lambda": "~1.61.1", - "@aws-cdk/aws-dynamodb": "~1.61.1", - "@aws-cdk/core": "~1.61.1", - "@aws-solutions-constructs/core": "~1.61.1", - "@aws-cdk/aws-lambda-event-sources": "~1.61.1", + "@aws-cdk/aws-lambda": "~1.62.0", + "@aws-cdk/aws-dynamodb": "~1.62.0", + "@aws-cdk/core": "~1.62.0", + "@aws-solutions-constructs/core": "~1.62.0", + "@aws-cdk/aws-lambda-event-sources": "~1.62.0", "constructs": "^3.0.4", - "@aws-cdk/aws-iam": "~1.61.1" + "@aws-cdk/aws-iam": "~1.62.0" } } diff --git a/source/patterns/@aws-solutions-constructs/aws-events-rule-lambda/package.json b/source/patterns/@aws-solutions-constructs/aws-events-rule-lambda/package.json index a1afe8e0f..2ea0e5a3f 100644 --- a/source/patterns/@aws-solutions-constructs/aws-events-rule-lambda/package.json +++ b/source/patterns/@aws-solutions-constructs/aws-events-rule-lambda/package.json @@ -1,6 +1,6 @@ { "name": "@aws-solutions-constructs/aws-events-rule-lambda", - "version": "1.61.1", + "version": "1.62.0", "description": "CDK Constructs for deploying AWS Events Rule that inveokes AWS Lambda", "main": "lib/index.js", "types": "lib/index.d.ts", @@ -53,15 +53,15 @@ } }, "dependencies": { - "@aws-cdk/aws-lambda": "~1.61.1", - "@aws-cdk/core": "~1.61.1", - "@aws-cdk/aws-events": "~1.61.1", - "@aws-cdk/aws-iam": "~1.61.1", - "@aws-solutions-constructs/core": "~1.61.1", + "@aws-cdk/aws-lambda": "~1.62.0", + "@aws-cdk/core": "~1.62.0", + "@aws-cdk/aws-events": "~1.62.0", + "@aws-cdk/aws-iam": "~1.62.0", + "@aws-solutions-constructs/core": "~1.62.0", "constructs": "^3.0.4" }, "devDependencies": { - "@aws-cdk/assert": "~1.61.1", + "@aws-cdk/assert": "~1.62.0", "@types/jest": "^24.0.23", "@types/node": "^10.3.0" }, @@ -71,11 +71,11 @@ ] }, "peerDependencies": { - "@aws-cdk/aws-lambda": "~1.61.1", - "@aws-cdk/core": "~1.61.1", - "@aws-cdk/aws-events": "~1.61.1", - "@aws-cdk/aws-iam": "~1.61.1", - "@aws-solutions-constructs/core": "~1.61.1", + "@aws-cdk/aws-lambda": "~1.62.0", + "@aws-cdk/core": "~1.62.0", + "@aws-cdk/aws-events": "~1.62.0", + "@aws-cdk/aws-iam": "~1.62.0", + "@aws-solutions-constructs/core": "~1.62.0", "constructs": "^3.0.4" } } diff --git a/source/patterns/@aws-solutions-constructs/aws-events-rule-sns/README.md b/source/patterns/@aws-solutions-constructs/aws-events-rule-sns/README.md index e47c799ba..48a13eca3 100644 --- a/source/patterns/@aws-solutions-constructs/aws-events-rule-sns/README.md +++ b/source/patterns/@aws-solutions-constructs/aws-events-rule-sns/README.md @@ -24,34 +24,41 @@ This AWS Solutions Construct implements an AWS Events rule and an AWS SNS Topic. -Here is a minimal deployable pattern definition: +Here is a minimal deployable pattern definition in Typescript: ``` typescript -import { EventsRuleToSNSTopicProps, EventsRuleToSNSTopic } from "@aws-solutions-constructs/aws-events-rule-sns"; +import { EventsRuleToSNSProps, EventsRuleToSNS } from "@aws-solutions-constructs/aws-events-rule-sns"; -const props: EventsRuleToSNSTopicProps = { +const props: EventsRuleToSNSProps = { eventRuleProps: { schedule: events.Schedule.rate(Duration.minutes(5)), - }, - topicsProps: { - displayName: 'event-rule-sns' } }; -new EventsRuleToSNSTopic(this, 'test-events-rule-sns', props); +const constructStack = new EventsRuleToSNS(this, 'test-events-rule-sns', props); + +// Grant yourself permissions to use the Customer Managed KMS Key +const policyStatement = new iam.PolicyStatement({ + actions: ["kms:Encrypt", "kms:Decrypt"], + effect: iam.Effect.ALLOW, + principals: [ new iam.AccountRootPrincipal() ], + resources: [ "*" ] +}); + +constructStack.encryptionKey?.addToResourcePolicy(policyStatement); ``` ## Initializer ``` text -new EventsRuleToSNSTopic(scope: Construct, id: string, props: EventsRuleToSNSTopicProps); +new EventsRuleToSNS(scope: Construct, id: string, props: EventsRuleToSNSProps); ``` _Parameters_ * scope [`Construct`](https://docs.aws.amazon.com/cdk/api/latest/docs/@aws-cdk_core.Construct.html) * id `string` -* props [`EventsRuleToSNSTopicProps`](#pattern-construct-props) +* props [`EventsRuleToSNSProps`](#pattern-construct-props) ## Pattern Construct Props @@ -60,7 +67,9 @@ _Parameters_ |eventRuleProps|[`events.RuleProps`](https://docs.aws.amazon.com/cdk/api/latest/docs/@aws-cdk_aws-events.RuleProps.html)|User provided eventRuleProps to override the defaults. | |existingTopicObj?|[`sns.Topic`](https://docs.aws.amazon.com/cdk/api/latest/docs/@aws-cdk_aws-lambda.Function.html)|Existing instance of SNS Topic object, if this is set then the topicProps is ignored.| |topicProps?|[`sns.TopicProps`](https://docs.aws.amazon.com/cdk/api/latest/docs/@aws-cdk_aws-sns.TopicProps.html)|User provided props to override the default props for the SNS Topic. | - +|enableEncryptionWithCustomerManagedKey?|`boolean`|Use a KMS Key, either managed by this CDK app, or imported. If importing an encryption key, it must be specified in the encryptionKey property for this construct.| +|encryptionKey?|[`kms.Key`](https://docs.aws.amazon.com/cdk/api/latest/docs/@aws-cdk_aws-kms.Key.html)|An optional, imported encryption key to encrypt the SNS Topic.| +|encryptionKeyProps?|[`kms.KeyProps`](https://docs.aws.amazon.com/cdk/api/latest/docs/@aws-cdk_aws-kms.KeyProps.html)|An optional, user provided properties to override the default properties for the KMS encryption key.| ## Pattern Properties @@ -68,18 +77,19 @@ _Parameters_ |:-------------|:----------------|-----------------| |eventsRule|[`events.Rule`](https://docs.aws.amazon.com/cdk/api/latest/docs/@aws-cdk_aws-events.Rule.html)|Returns an instance of events.Rule created by the construct| |snsTopic|[`sns.Topic`](https://docs.aws.amazon.com/cdk/api/latest/docs/@aws-cdk_aws-sns.Topic.html)|Returns an instance of sns.Topic created by the construct| +|encryptionKey?|[`kms.Key`](https://docs.aws.amazon.com/cdk/api/latest/docs/@aws-cdk_aws-kms.Key.html)|Returns an instance of kms Key used for the SNS Topic.| ## Default settings Out of the box implementation of the Construct without any override will set the following defaults: ### Amazon CloudWatch Events Rule -* Grant least privilege permissions to CloudWatch Events to publish to the SNS Topic +* Grant least privilege permissions to CloudWatch Events to publish to the SNS Topic. ### Amazon SNS Topic -* Configure least privilege access permissions for SNS Topic -* Enable server-side encryption forSNS Topic using AWS managed KMS Key -* Enforce encryption of data in transit +* Configure least privilege access permissions for SNS Topic. +* Enable server-side encryption forSNS Topic using Customer managed KMS Key. +* Enforce encryption of data in transit. ## Architecture ![Architecture Diagram](architecture.png) diff --git a/source/patterns/@aws-solutions-constructs/aws-events-rule-sns/lib/index.ts b/source/patterns/@aws-solutions-constructs/aws-events-rule-sns/lib/index.ts index 430a5cbf0..15f64edb4 100644 --- a/source/patterns/@aws-solutions-constructs/aws-events-rule-sns/lib/index.ts +++ b/source/patterns/@aws-solutions-constructs/aws-events-rule-sns/lib/index.ts @@ -13,12 +13,13 @@ import * as sns from '@aws-cdk/aws-sns'; import * as events from '@aws-cdk/aws-events'; +import * as kms from '@aws-cdk/aws-kms'; import * as defaults from '@aws-solutions-constructs/core'; import { Construct } from '@aws-cdk/core'; import { overrideProps } from '@aws-solutions-constructs/core'; -import { ArnPrincipal } from '@aws-cdk/aws-iam'; +import { ServicePrincipal } from '@aws-cdk/aws-iam'; -export interface EventsRuleToSNSTopicProps { +export interface EventsRuleToSNSProps { /** * User provided props to override the default props for the SNS Topic. * @@ -37,47 +38,83 @@ export interface EventsRuleToSNSTopicProps { * @default - Default props are used */ readonly existingTopicObj?: sns.Topic, + /** + * Use a KMS Key, either managed by this CDK app, or imported. If importing an encryption key, it must be specified in + * the encryptionKey property for this construct. + * + * @default - true (encryption enabled, managed by this CDK app). + */ + readonly enableEncryptionWithCustomerManagedKey?: boolean + /** + * An optional, imported encryption key to encrypt the SQS queue, and SNS Topic. + * + * @default - not specified. + */ + readonly encryptionKey?: kms.Key + /** + * Optional user-provided props to override the default props for the encryption key. + * + * @default - Default props are used. + */ + readonly encryptionKeyProps?: kms.KeyProps } -export class EventsRuleToSNSTopic extends Construct { +export class EventsRuleToSNS extends Construct { public readonly snsTopic: sns.Topic; public readonly eventsRule: events.Rule; - + public readonly encryptionKey?: kms.Key; /** * @summary Constructs a new instance of the EventRuleToSns class. * @param {cdk.App} scope - represents the scope for all the resources. * @param {string} id - this is a a scope-unique id. - * @param {EventsRuleToSNSTopicProps} props - user provided props for the construct. - * @since 1.61.1 + * @param {EventsRuleToSNSProps} props - user provided props for the construct. + * @since 1.62.0 * @access public */ - constructor(scope: Construct, id: string, props: EventsRuleToSNSTopicProps) { + constructor(scope: Construct, id: string, props: EventsRuleToSNSProps) { super(scope, id); - //Setup the sns topic. - [this.snsTopic] = defaults.buildTopic(this, { + let enableEncryptionParam = props.enableEncryptionWithCustomerManagedKey; + if (props.enableEncryptionWithCustomerManagedKey === undefined || + props.enableEncryptionWithCustomerManagedKey === true) { + enableEncryptionParam = true; + } + + // Setup the sns topic. + [this.snsTopic, this.encryptionKey] = defaults.buildTopic(this, { existingTopicObj: props.existingTopicObj, - topicProps: props.topicsProps + topicProps: props.topicsProps, + enableEncryptionWithCustomerManagedKey: enableEncryptionParam, + encryptionKey: props.encryptionKey, + encryptionKeyProps: props.encryptionKeyProps }); - //Setup the event rule target as sns topic. + // Setup the event rule target as sns topic. const topicEventTarget: events.IRuleTarget = { bind: () => ({ id: this.snsTopic.topicName, arn: this.snsTopic.topicArn }) - } + }; - //Setup up the event rule property. - const defaultEventsRuleProps = defaults.DefaultEventsRuleProps([topicEventTarget]); + // Setup up the event rule property. + const defaultEventsRuleProps = defaults.DefaultEventsRuleProps([topicEventTarget]); const eventsRuleProps = overrideProps(defaultEventsRuleProps, props.eventRuleProps, true); - //Setup up the event rule. + // Setup up the event rule. this.eventsRule = new events.Rule(this, 'EventsRule', eventsRuleProps); - //Setup up the grant policy for event to be able to publish to the sns topic. - this.snsTopic.grantPublish(new ArnPrincipal(this.eventsRule.ruleArn)) + // Setup up the grant policy for event to be able to publish to the sns topic. + this.snsTopic.grantPublish(new ServicePrincipal('events.amazonaws.com')); + + // Grant EventBridge service access to the SNS Topic encryption key + this.encryptionKey?.grant(new ServicePrincipal('events.amazonaws.com'), + "kms:Decrypt", + "kms:Encrypt", + "kms:ReEncrypt*", + "kms:GenerateDataKey*" + ); } } \ No newline at end of file diff --git a/source/patterns/@aws-solutions-constructs/aws-events-rule-sns/package.json b/source/patterns/@aws-solutions-constructs/aws-events-rule-sns/package.json index 613043b96..8a70cc956 100644 --- a/source/patterns/@aws-solutions-constructs/aws-events-rule-sns/package.json +++ b/source/patterns/@aws-solutions-constructs/aws-events-rule-sns/package.json @@ -1,6 +1,6 @@ { "name": "@aws-solutions-constructs/aws-events-rule-sns", - "version": "1.61.1", + "version": "1.62.0", "description": "CDK Constructs for deploying AWS Events Rule that invokes AWS SNS", "main": "lib/index.js", "types": "lib/index.d.ts", @@ -53,15 +53,16 @@ } }, "dependencies": { - "@aws-cdk/aws-events": "~1.61.1", - "@aws-cdk/aws-iam": "~1.61.1", - "@aws-cdk/aws-sns": "~1.61.1", - "@aws-cdk/core": "~1.61.1", - "@aws-solutions-constructs/core": "~1.61.1", + "@aws-cdk/aws-events": "~1.62.0", + "@aws-cdk/aws-iam": "~1.62.0", + "@aws-cdk/aws-sns": "~1.62.0", + "@aws-cdk/aws-kms": "~1.62.0", + "@aws-cdk/core": "~1.62.0", + "@aws-solutions-constructs/core": "~1.62.0", "constructs": "^3.0.4" }, "devDependencies": { - "@aws-cdk/assert": "~1.61.1", + "@aws-cdk/assert": "~1.62.0", "@types/jest": "^24.0.23", "@types/node": "^10.3.0" }, @@ -71,12 +72,12 @@ ] }, "peerDependencies": { - "@aws-cdk/aws-sns": "~1.61.1", - "@aws-cdk/core": "~1.61.1", - "@aws-cdk/aws-events": "~1.61.1", - "@aws-cdk/aws-iam": "~1.61.1", - "@aws-cdk/aws-kms": "~1.61.1", - "@aws-solutions-constructs/core": "~1.61.1", + "@aws-cdk/aws-sns": "~1.62.0", + "@aws-cdk/core": "~1.62.0", + "@aws-cdk/aws-events": "~1.62.0", + "@aws-cdk/aws-iam": "~1.62.0", + "@aws-cdk/aws-kms": "~1.62.0", + "@aws-solutions-constructs/core": "~1.62.0", "constructs": "^3.0.4" } } diff --git a/source/patterns/@aws-solutions-constructs/aws-events-rule-sns/test/__snapshots__/events-rule-sns-topic.test.js.snap b/source/patterns/@aws-solutions-constructs/aws-events-rule-sns/test/__snapshots__/events-rule-sns-topic.test.js.snap index 31147fb2b..5984badfe 100644 --- a/source/patterns/@aws-solutions-constructs/aws-events-rule-sns/test/__snapshots__/events-rule-sns-topic.test.js.snap +++ b/source/patterns/@aws-solutions-constructs/aws-events-rule-sns/test/__snapshots__/events-rule-sns-topic.test.js.snap @@ -3,18 +3,83 @@ exports[`snapshot test EventsRuleToSNS default params 1`] = ` Object { "Resources": Object { - "testeventsrulesnsEventsRule5F1C01CC": Object { + "testEncryptionKeyB55BFDBC": Object { + "DeletionPolicy": "Retain", + "Properties": Object { + "EnableKeyRotation": true, + "KeyPolicy": Object { + "Statement": Array [ + Object { + "Action": Array [ + "kms:Create*", + "kms:Describe*", + "kms:Enable*", + "kms:List*", + "kms:Put*", + "kms:Update*", + "kms:Revoke*", + "kms:Disable*", + "kms:Get*", + "kms:Delete*", + "kms:ScheduleKeyDeletion", + "kms:CancelKeyDeletion", + "kms:GenerateDataKey", + "kms:TagResource", + "kms:UntagResource", + ], + "Effect": "Allow", + "Principal": Object { + "AWS": Object { + "Fn::Join": Array [ + "", + Array [ + "arn:", + Object { + "Ref": "AWS::Partition", + }, + ":iam::", + Object { + "Ref": "AWS::AccountId", + }, + ":root", + ], + ], + }, + }, + "Resource": "*", + }, + Object { + "Action": Array [ + "kms:Decrypt", + "kms:Encrypt", + "kms:ReEncrypt*", + "kms:GenerateDataKey*", + ], + "Effect": "Allow", + "Principal": Object { + "Service": "events.amazonaws.com", + }, + "Resource": "*", + }, + ], + "Version": "2012-10-17", + }, + }, + "Type": "AWS::KMS::Key", + "UpdateReplacePolicy": "Retain", + }, + "testEventsRuleE75BC9BA": Object { "Properties": Object { "ScheduleExpression": "rate(5 minutes)", "State": "ENABLED", "Targets": Array [ Object { "Arn": Object { - "Ref": "testeventsrulesnsSnsTopicCEB51DAD", + "Ref": "testSnsTopic42942701", }, "Id": Object { "Fn::GetAtt": Array [ - "testeventsrulesnsSnsTopicCEB51DAD", + "testSnsTopic42942701", "TopicName", ], }, @@ -23,13 +88,18 @@ Object { }, "Type": "AWS::Events::Rule", }, - "testeventsrulesnsSnsTopicCEB51DAD": Object { + "testSnsTopic42942701": Object { "Properties": Object { - "KmsMasterKeyId": "alias/aws/sns", + "KmsMasterKeyId": Object { + "Fn::GetAtt": Array [ + "testEncryptionKeyB55BFDBC", + "Arn", + ], + }, }, "Type": "AWS::SNS::Topic", }, - "testeventsrulesnsSnsTopicPolicyF1A0FC73": Object { + "testSnsTopicPolicyCF3F7399": Object { "Properties": Object { "PolicyDocument": Object { "Statement": Array [ @@ -72,7 +142,7 @@ Object { }, }, "Resource": Object { - "Ref": "testeventsrulesnsSnsTopicCEB51DAD", + "Ref": "testSnsTopic42942701", }, "Sid": "TopicOwnerOnlyAccess", }, @@ -96,7 +166,7 @@ Object { "Effect": "Deny", "Principal": "*", "Resource": Object { - "Ref": "testeventsrulesnsSnsTopicCEB51DAD", + "Ref": "testSnsTopic42942701", }, "Sid": "HttpsOnly", }, @@ -104,15 +174,10 @@ Object { "Action": "sns:Publish", "Effect": "Allow", "Principal": Object { - "AWS": Object { - "Fn::GetAtt": Array [ - "testeventsrulesnsEventsRule5F1C01CC", - "Arn", - ], - }, + "Service": "events.amazonaws.com", }, "Resource": Object { - "Ref": "testeventsrulesnsSnsTopicCEB51DAD", + "Ref": "testSnsTopic42942701", }, "Sid": "2", }, @@ -121,7 +186,7 @@ Object { }, "Topics": Array [ Object { - "Ref": "testeventsrulesnsSnsTopicCEB51DAD", + "Ref": "testSnsTopic42942701", }, ], }, diff --git a/source/patterns/@aws-solutions-constructs/aws-events-rule-sns/test/events-rule-sns-topic.test.ts b/source/patterns/@aws-solutions-constructs/aws-events-rule-sns/test/events-rule-sns-topic.test.ts index fbfad49ed..a5300b6c2 100644 --- a/source/patterns/@aws-solutions-constructs/aws-events-rule-sns/test/events-rule-sns-topic.test.ts +++ b/source/patterns/@aws-solutions-constructs/aws-events-rule-sns/test/events-rule-sns-topic.test.ts @@ -14,140 +14,124 @@ import { SynthUtils } from '@aws-cdk/assert'; import * as cdk from "@aws-cdk/core"; import * as events from "@aws-cdk/aws-events"; +import * as defaults from '@aws-solutions-constructs/core'; import '@aws-cdk/assert/jest'; -import { EventsRuleToSNSTopic, EventsRuleToSNSTopicProps } from "../lib" +import { EventsRuleToSNS, EventsRuleToSNSProps } from "../lib"; - -function deployNewFunc(stack: cdk.Stack) { - const props: EventsRuleToSNSTopicProps = { +function deployNewStack(stack: cdk.Stack) { + const props: EventsRuleToSNSProps = { eventRuleProps: { schedule: events.Schedule.rate(cdk.Duration.minutes(5)) } - } - return new EventsRuleToSNSTopic(stack, 'test-events-rule-sns', props); -} - -function getStack() { - const app = new cdk.App() - return new cdk.Stack(app, 'stack') + }; + return new EventsRuleToSNS(stack, 'test', props); } test('snapshot test EventsRuleToSNS default params', () => { - const stack = getStack() - deployNewFunc(stack) + const stack = new cdk.Stack(); + deployNewStack(stack); expect(SynthUtils.toCloudFormation(stack)).toMatchSnapshot(); }); -test('check the sns topic resource is created', () => { - const stack = getStack() - deployNewFunc(stack) - expect(stack).toHaveResource('AWS::SNS::Topic', {}) -}) - test('check if the event rule has permission/policy in place in sns for it to be able to publish to the topic', () => { - const stack = getStack() - deployNewFunc(stack) + const stack = new cdk.Stack(); + deployNewStack(stack); expect(stack).toHaveResource('AWS::SNS::TopicPolicy', { - PolicyDocument: { - Statement: [ - { - Action: [ - "SNS:Publish", - "SNS:RemovePermission", - "SNS:SetTopicAttributes", - "SNS:DeleteTopic", - "SNS:ListSubscriptionsByTopic", - "SNS:GetTopicAttributes", - "SNS:Receive", - "SNS:AddPermission", - "SNS:Subscribe", - ], - Condition: { - "StringEquals": { - "AWS:SourceOwner": { - "Ref": "AWS::AccountId" - }, + PolicyDocument: { + Statement: [ + { + Action: [ + "SNS:Publish", + "SNS:RemovePermission", + "SNS:SetTopicAttributes", + "SNS:DeleteTopic", + "SNS:ListSubscriptionsByTopic", + "SNS:GetTopicAttributes", + "SNS:Receive", + "SNS:AddPermission", + "SNS:Subscribe" + ], + Condition: { + StringEquals: { + "AWS:SourceOwner": { + Ref: "AWS::AccountId" + } + } }, - }, - Effect: "Allow", - Principal: { - "AWS": { - "Fn::Join": [ - "", - [ - "arn:", - { - "Ref": "AWS::Partition", - }, - ":iam::", - { - "Ref": "AWS::AccountId", - }, - ":root", - ], - ], + Effect: "Allow", + Principal: { + AWS: { + "Fn::Join": [ + "", + [ + "arn:", + { + Ref: "AWS::Partition" + }, + ":iam::", + { + Ref: "AWS::AccountId" + }, + ":root" + ] + ] + } }, - }, - Resource: { - "Ref": "testeventsrulesnsSnsTopicCEB51DAD", - }, - Sid: "TopicOwnerOnlyAccess", - }, - { - Action: [ - "SNS:Publish", - "SNS:RemovePermission", - "SNS:SetTopicAttributes", - "SNS:DeleteTopic", - "SNS:ListSubscriptionsByTopic", - "SNS:GetTopicAttributes", - "SNS:Receive", - "SNS:AddPermission", - "SNS:Subscribe", - ], - Condition: { - "Bool": { - "aws:SecureTransport": "false", + Resource: { + Ref: "testSnsTopic42942701" }, + Sid: "TopicOwnerOnlyAccess" }, - Effect: "Deny", - Principal: "*", - Resource: { - "Ref": "testeventsrulesnsSnsTopicCEB51DAD", - }, - Sid: "HttpsOnly", - }, - { - Action: "sns:Publish", - Effect: "Allow", - Principal: { - "AWS": { - "Fn::GetAtt": [ - "testeventsrulesnsEventsRule5F1C01CC", - "Arn", - ], + { + Action: [ + "SNS:Publish", + "SNS:RemovePermission", + "SNS:SetTopicAttributes", + "SNS:DeleteTopic", + "SNS:ListSubscriptionsByTopic", + "SNS:GetTopicAttributes", + "SNS:Receive", + "SNS:AddPermission", + "SNS:Subscribe" + ], + Condition: { + Bool: { + "aws:SecureTransport": "false" + } }, + Effect: "Deny", + Principal: "*", + Resource: { + Ref: "testSnsTopic42942701" + }, + Sid: "HttpsOnly" }, - Resource: { - "Ref": "testeventsrulesnsSnsTopicCEB51DAD", - }, - Sid: "2", - }, - ], - Version: "2012-10-17", - }, - Topics: [ - { - "Ref": "testeventsrulesnsSnsTopicCEB51DAD", + { + Action: "sns:Publish", + Effect: "Allow", + Principal: { + Service: "events.amazonaws.com" + }, + Resource: { + Ref: "testSnsTopic42942701" + }, + Sid: "2" + } + ], + Version: "2012-10-17" }, - ], - }, - ) -}) + Topics: [ + { + Ref: "testSnsTopic42942701" + } + ] + } + ); +}); -test('check events rule properties for deploy: true', () => { - const stack = getStack() - deployNewFunc(stack) +test('check events rule properties', () => { + const stack = new cdk.Stack(); + deployNewStack(stack); expect(stack).toHaveResource('AWS::Events::Rule', { ScheduleExpression: "rate(5 minutes)", @@ -155,24 +139,124 @@ test('check events rule properties for deploy: true', () => { Targets: [ { Arn: { - "Ref": "testeventsrulesnsSnsTopicCEB51DAD" + Ref: "testSnsTopic42942701" }, Id: { "Fn::GetAtt": [ - "testeventsrulesnsSnsTopicCEB51DAD", + "testSnsTopic42942701", "TopicName" ] } } ] - }) -}) + }); +}); test('check properties', () => { const stack = new cdk.Stack(); - - const construct: EventsRuleToSNSTopic = deployNewFunc(stack); + const construct: EventsRuleToSNS = deployNewStack(stack); expect(construct.eventsRule !== null); expect(construct.snsTopic !== null); + expect(construct.encryptionKey !== null); }); + +test('check the sns topic properties', () => { + const stack = new cdk.Stack(); + deployNewStack(stack); + expect(stack).toHaveResource('AWS::SNS::Topic', { + KmsMasterKeyId: { + "Fn::GetAtt": [ + "testEncryptionKeyB55BFDBC", + "Arn" + ] + } + }); +}); + +test('check the sns topic properties with existing KMS key', () => { + const stack = new cdk.Stack(); + const key = defaults.buildEncryptionKey(stack, { + description: 'my-key' + }); + + const props: EventsRuleToSNSProps = { + eventRuleProps: { + schedule: events.Schedule.rate(cdk.Duration.minutes(5)) + }, + encryptionKey: key + }; + + new EventsRuleToSNS(stack, 'test-events-rule-sqs', props); + + expect(stack).toHaveResource('AWS::SNS::Topic', { + KmsMasterKeyId: { + "Fn::GetAtt": [ + "EncryptionKey1B843E66", + "Arn" + ] + } + }); + + expect(stack).toHaveResource('AWS::KMS::Key', { + KeyPolicy: { + Statement: [ + { + Action: [ + "kms:Create*", + "kms:Describe*", + "kms:Enable*", + "kms:List*", + "kms:Put*", + "kms:Update*", + "kms:Revoke*", + "kms:Disable*", + "kms:Get*", + "kms:Delete*", + "kms:ScheduleKeyDeletion", + "kms:CancelKeyDeletion", + "kms:GenerateDataKey", + "kms:TagResource", + "kms:UntagResource" + ], + Effect: "Allow", + Principal: { + AWS: { + "Fn::Join": [ + "", + [ + "arn:", + { + Ref: "AWS::Partition" + }, + ":iam::", + { + Ref: "AWS::AccountId" + }, + ":root" + ] + ] + } + }, + Resource: "*" + }, + { + Action: [ + "kms:Decrypt", + "kms:Encrypt", + "kms:ReEncrypt*", + "kms:GenerateDataKey*" + ], + Effect: "Allow", + Principal: { + Service: "events.amazonaws.com" + }, + Resource: "*" + } + ], + Version: "2012-10-17" + }, + Description: "my-key", + EnableKeyRotation: true + }); +}); \ No newline at end of file diff --git a/source/patterns/@aws-solutions-constructs/aws-events-rule-sns/test/integ.events-rule-no-arguments.expected.json b/source/patterns/@aws-solutions-constructs/aws-events-rule-sns/test/integ.events-rule-no-arguments.expected.json index 0b0358fe6..ba39eebaa 100644 --- a/source/patterns/@aws-solutions-constructs/aws-events-rule-sns/test/integ.events-rule-no-arguments.expected.json +++ b/source/patterns/@aws-solutions-constructs/aws-events-rule-sns/test/integ.events-rule-no-arguments.expected.json @@ -1,32 +1,83 @@ { "Resources": { - "testeventsrulesnsEventsRule5F1C01CC": { + "testconstructEncryptionKey6153B053": { + "Type": "AWS::KMS::Key", "Properties": { - "ScheduleExpression": "rate(5 minutes)", - "State": "ENABLED", - "Targets": [ - { - "Arn": { - "Ref": "testeventsrulesnsSnsTopicCEB51DAD" + "KeyPolicy": { + "Statement": [ + { + "Action": [ + "kms:Create*", + "kms:Describe*", + "kms:Enable*", + "kms:List*", + "kms:Put*", + "kms:Update*", + "kms:Revoke*", + "kms:Disable*", + "kms:Get*", + "kms:Delete*", + "kms:ScheduleKeyDeletion", + "kms:CancelKeyDeletion", + "kms:GenerateDataKey", + "kms:TagResource", + "kms:UntagResource" + ], + "Effect": "Allow", + "Principal": { + "AWS": { + "Fn::Join": [ + "", + [ + "arn:", + { + "Ref": "AWS::Partition" + }, + ":iam::", + { + "Ref": "AWS::AccountId" + }, + ":root" + ] + ] + } + }, + "Resource": "*" }, - "Id": { - "Fn::GetAtt": [ - "testeventsrulesnsSnsTopicCEB51DAD", - "TopicName" - ] + { + "Action": [ + "kms:Decrypt", + "kms:Encrypt", + "kms:ReEncrypt*", + "kms:GenerateDataKey*" + ], + "Effect": "Allow", + "Principal": { + "Service": "events.amazonaws.com" + }, + "Resource": "*" } - } - ] + ], + "Version": "2012-10-17" + }, + "EnableKeyRotation": true }, - "Type": "AWS::Events::Rule" + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Retain" }, - "testeventsrulesnsSnsTopicCEB51DAD": { + "testconstructSnsTopic44188529": { + "Type": "AWS::SNS::Topic", "Properties": { - "KmsMasterKeyId": "alias/aws/sns" - }, - "Type": "AWS::SNS::Topic" + "KmsMasterKeyId": { + "Fn::GetAtt": [ + "testconstructEncryptionKey6153B053", + "Arn" + ] + } + } }, - "testeventsrulesnsSnsTopicPolicyF1A0FC73": { + "testconstructSnsTopicPolicy72FFD530": { + "Type": "AWS::SNS::TopicPolicy", "Properties": { "PolicyDocument": { "Statement": [ @@ -60,7 +111,7 @@ "Ref": "AWS::Partition" }, ":iam::", - { + { "Ref": "AWS::AccountId" }, ":root" @@ -69,7 +120,7 @@ } }, "Resource": { - "Ref": "testeventsrulesnsSnsTopicCEB51DAD" + "Ref": "testconstructSnsTopic44188529" }, "Sid": "TopicOwnerOnlyAccess" }, @@ -93,7 +144,7 @@ "Effect": "Deny", "Principal": "*", "Resource": { - "Ref": "testeventsrulesnsSnsTopicCEB51DAD" + "Ref": "testconstructSnsTopic44188529" }, "Sid": "HttpsOnly" }, @@ -101,15 +152,10 @@ "Action": "sns:Publish", "Effect": "Allow", "Principal": { - "AWS": { - "Fn::GetAtt": [ - "testeventsrulesnsEventsRule5F1C01CC", - "Arn" - ] - } + "Service": "events.amazonaws.com" }, "Resource": { - "Ref": "testeventsrulesnsSnsTopicCEB51DAD" + "Ref": "testconstructSnsTopic44188529" }, "Sid": "2" } @@ -118,11 +164,30 @@ }, "Topics": [ { - "Ref": "testeventsrulesnsSnsTopicCEB51DAD" + "Ref": "testconstructSnsTopic44188529" } ] - }, - "Type": "AWS::SNS::TopicPolicy" + } + }, + "testconstructEventsRule145DBA20": { + "Type": "AWS::Events::Rule", + "Properties": { + "ScheduleExpression": "rate(5 minutes)", + "State": "ENABLED", + "Targets": [ + { + "Arn": { + "Ref": "testconstructSnsTopic44188529" + }, + "Id": { + "Fn::GetAtt": [ + "testconstructSnsTopic44188529", + "TopicName" + ] + } + } + ] + } } } } \ No newline at end of file diff --git a/source/patterns/@aws-solutions-constructs/aws-events-rule-sns/test/integ.events-rule-no-arguments.ts b/source/patterns/@aws-solutions-constructs/aws-events-rule-sns/test/integ.events-rule-no-arguments.ts index aa53f6dad..39ae92dde 100644 --- a/source/patterns/@aws-solutions-constructs/aws-events-rule-sns/test/integ.events-rule-no-arguments.ts +++ b/source/patterns/@aws-solutions-constructs/aws-events-rule-sns/test/integ.events-rule-no-arguments.ts @@ -11,19 +11,20 @@ * and limitations under the License. */ -import { Duration } from '@aws-cdk/core' -import { EventsRuleToSNSTopic, EventsRuleToSNSTopicProps } from '../lib' -import * as events from '@aws-cdk/aws-events' -import { App, Stack } from '@aws-cdk/core' +import { Duration } from '@aws-cdk/core'; +import { EventsRuleToSNS, EventsRuleToSNSProps } from '../lib'; +import * as events from '@aws-cdk/aws-events'; +import { App, Stack } from '@aws-cdk/core'; const app = new App(); -const stack = new Stack(app, 'test-events-rule-sns-stack'); +const stack = new Stack(app, 'test-rule-sns'); -const props: EventsRuleToSNSTopicProps = { +const props: EventsRuleToSNSProps = { eventRuleProps: { schedule: events.Schedule.rate(Duration.minutes(5)) } -} +}; + +new EventsRuleToSNS(stack, 'test-construct', props); -new EventsRuleToSNSTopic(stack, 'test-events-rule-sns', props); app.synth(); \ No newline at end of file diff --git a/source/patterns/@aws-solutions-constructs/aws-events-rule-sqs/README.md b/source/patterns/@aws-solutions-constructs/aws-events-rule-sqs/README.md index 2d067c2f3..80014b038 100644 --- a/source/patterns/@aws-solutions-constructs/aws-events-rule-sqs/README.md +++ b/source/patterns/@aws-solutions-constructs/aws-events-rule-sqs/README.md @@ -24,37 +24,42 @@ This AWS Solutions Construct implements an AWS Events rule and an AWS SQS Queue. -Here is a minimal deployable pattern definition: +Here is a minimal deployable pattern definition in Typescript: ``` typescript -import { EventsRuleToSQSQueueProps, EventsRuleToSQSQueue } from ('@aws-solutions-constructs/aws-events-rule-sqs'); +import { EventsRuleToSQSProps, EventsRuleToSQS } from "@aws-solutions-constructs/aws-events-rule-sqs"; +import * as iam from '@aws-cdk/aws-iam'; -const props: EventsRuleToSQSQueueProps = { +const props: EventsRuleToSQSProps = { eventRuleProps: { schedule: events.Schedule.rate(Duration.minutes(5)) - }, - queueProps: { - queueName: 'event-rule-sqs', - fifo: true - }, - enableQueuePurging: false, - deployDeadLetterQueue: false + } }; -new EventsRuleToSQSQueue(stack, 'test-events-rule-sqs', props); +const constructStack = new EventsRuleToSQS(this, 'test-events-rule-sqs', props); + +// Grant yourself permissions to use the Customer Managed KMS Key +const policyStatement = new iam.PolicyStatement({ + actions: ["kms:Encrypt", "kms:Decrypt"], + effect: iam.Effect.ALLOW, + principals: [ new iam.AccountRootPrincipal() ], + resources: [ "*" ] +}); + +constructStack.encryptionKey?.addToResourcePolicy(policyStatement); ``` ## Initializer ``` text -new EventsRuleToSQSQueue(scope: Construct, id: string, props: EventsRuleToSQSQueueProps); +new EventsRuleToSQS(scope: Construct, id: string, props: EventsRuleToSQSProps); ``` _Parameters_ * scope [`Construct`](https://docs.aws.amazon.com/cdk/api/latest/docs/@aws-cdk_core.Construct.html) * id `string` -* props [`EventsRuleToSQSQueueProps`](#pattern-construct-props) +* props [`EventsRuleToSQSProps`](#pattern-construct-props) ## Pattern Construct Props @@ -67,6 +72,9 @@ _Parameters_ |deployDeadLetterQueue?|`boolean`|Whether to create a secondary queue to be used as a dead letter queue. Defaults to `true`.| |deadLetterQueueProps?|[`sqs.QueueProps`](https://docs.aws.amazon.com/cdk/api/latest/docs/@aws-cdk_aws-sqs.QueueProps.html)|Optional user-provided props to override the default props for the dead letter queue. Only used if the `deployDeadLetterQueue` property is set to true.| |maxReceiveCount?|`number`|The number of times a message can be unsuccessfully dequeued before being moved to the dead letter queue. Defaults to `15`.| +|enableEncryptionWithCustomerManagedKey?|`boolean`|Use a KMS Key, either managed by this CDK app, or imported. If importing an encryption key, it must be specified in the encryptionKey property for this construct.| +|encryptionKey?|[`kms.Key`](https://docs.aws.amazon.com/cdk/api/latest/docs/@aws-cdk_aws-kms.Key.html)|An optional, imported encryption key to encrypt the SQS queue.| +|encryptionKeyProps?|[`kms.KeyProps`](https://docs.aws.amazon.com/cdk/api/latest/docs/@aws-cdk_aws-kms.KeyProps.html)|An optional, user provided properties to override the default properties for the KMS encryption key.| ## Pattern Properties @@ -74,18 +82,20 @@ _Parameters_ |:-------------|:----------------|-----------------| |eventsRule|[`events.Rule`](https://docs.aws.amazon.com/cdk/api/latest/docs/@aws-cdk_aws-events.Rule.html)|Returns an instance of events.Rule created by the construct| |sqsQueue|[`sqs.Queue`](https://docs.aws.amazon.com/cdk/api/latest/docs/@aws-cdk_aws-sqs.Queue.html)|Returns an instance of sqs.Queue created by the construct| +|encryptionKey?|[`kms.Key`](https://docs.aws.amazon.com/cdk/api/latest/docs/@aws-cdk_aws-kms.Key.html)|Returns an instance of kms Key used for the SQS queue.| +|deadLetterQueue?|[`sqs.Queue`](https://docs.aws.amazon.com/cdk/api/latest/docs/@aws-cdk_aws-sqs.Queue.html)|Returns an instance of the dead-letter SQS queue created by the pattern.| ## Default settings Out of the box implementation of the Construct without any override will set the following defaults: ### Amazon CloudWatch Events Rule -* Grant least privilege permissions to CloudWatch Events to publish to the SQS Queue +* Grant least privilege permissions to CloudWatch Events to publish to the SQS Queue. ### Amazon SQS Queue * Deploy SQS dead-letter queue for the source SQS Queue. -* Enable server-side encryption for source SQS Queue using AWS Managed KMS Key. -* Enforce encryption of data in transit +* Enable server-side encryption for source SQS Queue using Customer managed KMS Key. +* Enforce encryption of data in transit. ## Architecture ![Architecture Diagram](architecture.png) diff --git a/source/patterns/@aws-solutions-constructs/aws-events-rule-sqs/lib/index.ts b/source/patterns/@aws-solutions-constructs/aws-events-rule-sqs/lib/index.ts index 41bc3f637..be1cff7dd 100644 --- a/source/patterns/@aws-solutions-constructs/aws-events-rule-sqs/lib/index.ts +++ b/source/patterns/@aws-solutions-constructs/aws-events-rule-sqs/lib/index.ts @@ -13,8 +13,9 @@ import * as sqs from '@aws-cdk/aws-sqs'; import * as events from '@aws-cdk/aws-events'; +import * as kms from '@aws-cdk/aws-kms'; import * as defaults from '@aws-solutions-constructs/core'; -import { ArnPrincipal } from '@aws-cdk/aws-iam'; +import { ServicePrincipal } from '@aws-cdk/aws-iam'; import { Construct } from '@aws-cdk/core'; import { overrideProps } from '@aws-solutions-constructs/core'; @@ -63,20 +64,40 @@ export interface EventsRuleToSQSProps { * * @default - required field if deployDeadLetterQueue=true. */ - readonly maxReceiveCount?: number + readonly maxReceiveCount?: number, + /** + * Use a KMS Key, either managed by this CDK app, or imported. If importing an encryption key, it must be specified in + * the encryptionKey property for this construct. + * + * @default - true (encryption enabled, managed by this CDK app). + */ + readonly enableEncryptionWithCustomerManagedKey?: boolean + /** + * An optional, imported encryption key to encrypt the SQS queue, and SNS Topic. + * + * @default - not specified. + */ + readonly encryptionKey?: kms.Key + /** + * Optional user-provided props to override the default props for the encryption key. + * + * @default - Default props are used. + */ + readonly encryptionKeyProps?: kms.KeyProps } export class EventsRuleToSQS extends Construct { public readonly sqsQueue: sqs.Queue; - public readonly deadLetterQueue: sqs.DeadLetterQueue | undefined; + public readonly deadLetterQueue?: sqs.DeadLetterQueue; public readonly eventsRule: events.Rule; + public readonly encryptionKey?: kms.IKey; /** * @summary Constructs a new instance of the EventsRuleToSQS class. * @param {cdk.App} scope - represents the scope for all the resources. * @param {string} id - this is a a scope-unique id. * @param {EventsRuleToSQSProps} props - user provided props for the construct - * @since 1.61.1 + * @since 1.62.0 * @access public */ constructor(scope: Construct, id: string, props: EventsRuleToSQSProps) { @@ -93,11 +114,20 @@ export class EventsRuleToSQS extends Construct { }); } + let enableEncryptionParam = props.enableEncryptionWithCustomerManagedKey; + if (props.enableEncryptionWithCustomerManagedKey === undefined || + props.enableEncryptionWithCustomerManagedKey === true) { + enableEncryptionParam = true; + } + // Setup the queue - [this.sqsQueue] = defaults.buildQueue(this, 'queue', { + [this.sqsQueue, this.encryptionKey] = defaults.buildQueue(this, 'queue', { existingQueueObj: props.existingQueueObj, queueProps: props.queueProps, - deadLetterQueue: this.deadLetterQueue + deadLetterQueue: this.deadLetterQueue, + enableEncryptionWithCustomerManagedKey: enableEncryptionParam, + encryptionKey: props.encryptionKey, + encryptionKeyProps: props.encryptionKeyProps }); const sqsEventTarget: events.IRuleTarget = { @@ -114,10 +144,10 @@ export class EventsRuleToSQS extends Construct { // Enable queue purging permissions for the event rule, if enabled if (props.enableQueuePurging) { - this.sqsQueue.grantPurge(new ArnPrincipal(this.eventsRule.ruleArn)); + this.sqsQueue.grantPurge(new ServicePrincipal('events.amazonaws.com')); } - //Policy for event to be able to send messages to the queue - this.sqsQueue.grantSendMessages(new ArnPrincipal(this.eventsRule.ruleArn)) + // Policy for event to be able to send messages to the queue and Grant Event Bridge service access to the SQS queue encryption key + this.sqsQueue.grantSendMessages(new ServicePrincipal('events.amazonaws.com')); } } \ No newline at end of file diff --git a/source/patterns/@aws-solutions-constructs/aws-events-rule-sqs/package.json b/source/patterns/@aws-solutions-constructs/aws-events-rule-sqs/package.json index dace224b7..715c6ce9d 100644 --- a/source/patterns/@aws-solutions-constructs/aws-events-rule-sqs/package.json +++ b/source/patterns/@aws-solutions-constructs/aws-events-rule-sqs/package.json @@ -1,6 +1,6 @@ { "name": "@aws-solutions-constructs/aws-events-rule-sqs", - "version": "1.61.1", + "version": "1.62.0", "description": "CDK Constructs for deploying AWS Events Rule that invokes AWS SQS", "main": "lib/index.js", "types": "lib/index.d.ts", @@ -53,15 +53,16 @@ } }, "dependencies": { - "@aws-cdk/aws-events": "~1.61.1", - "@aws-cdk/aws-iam": "~1.61.1", - "@aws-cdk/aws-sqs": "~1.61.1", - "@aws-cdk/core": "~1.61.1", - "@aws-solutions-constructs/core": "~1.61.1", + "@aws-cdk/aws-events": "~1.62.0", + "@aws-cdk/aws-iam": "~1.62.0", + "@aws-cdk/aws-sqs": "~1.62.0", + "@aws-cdk/aws-kms": "~1.62.0", + "@aws-cdk/core": "~1.62.0", + "@aws-solutions-constructs/core": "~1.62.0", "constructs": "^3.0.4" }, "devDependencies": { - "@aws-cdk/assert": "~1.61.1", + "@aws-cdk/assert": "~1.62.0", "@types/jest": "^24.0.23", "@types/node": "^10.3.0" }, @@ -71,12 +72,12 @@ ] }, "peerDependencies": { - "@aws-cdk/aws-sqs": "~1.61.1", - "@aws-cdk/core": "~1.61.1", - "@aws-cdk/aws-events": "~1.61.1", - "@aws-cdk/aws-iam": "~1.61.1", - "@aws-cdk/aws-kms": "~1.61.1", - "@aws-solutions-constructs/core": "~1.61.1", + "@aws-cdk/aws-sqs": "~1.62.0", + "@aws-cdk/core": "~1.62.0", + "@aws-cdk/aws-events": "~1.62.0", + "@aws-cdk/aws-iam": "~1.62.0", + "@aws-cdk/aws-kms": "~1.62.0", + "@aws-solutions-constructs/core": "~1.62.0", "constructs": "^3.0.4" } } diff --git a/source/patterns/@aws-solutions-constructs/aws-events-rule-sqs/test/__snapshots__/events-rule-sqs-queue.test.js.snap b/source/patterns/@aws-solutions-constructs/aws-events-rule-sqs/test/__snapshots__/events-rule-sqs-queue.test.js.snap index aad5e56dc..af71151b8 100644 --- a/source/patterns/@aws-solutions-constructs/aws-events-rule-sqs/test/__snapshots__/events-rule-sqs-queue.test.js.snap +++ b/source/patterns/@aws-solutions-constructs/aws-events-rule-sqs/test/__snapshots__/events-rule-sqs-queue.test.js.snap @@ -3,6 +3,71 @@ exports[`snapshot test EventsRuleToSQS default params 1`] = ` Object { "Resources": Object { + "testeventsrulesqsEncryptionKey19AB0C02": Object { + "DeletionPolicy": "Retain", + "Properties": Object { + "EnableKeyRotation": true, + "KeyPolicy": Object { + "Statement": Array [ + Object { + "Action": Array [ + "kms:Create*", + "kms:Describe*", + "kms:Enable*", + "kms:List*", + "kms:Put*", + "kms:Update*", + "kms:Revoke*", + "kms:Disable*", + "kms:Get*", + "kms:Delete*", + "kms:ScheduleKeyDeletion", + "kms:CancelKeyDeletion", + "kms:GenerateDataKey", + "kms:TagResource", + "kms:UntagResource", + ], + "Effect": "Allow", + "Principal": Object { + "AWS": Object { + "Fn::Join": Array [ + "", + Array [ + "arn:", + Object { + "Ref": "AWS::Partition", + }, + ":iam::", + Object { + "Ref": "AWS::AccountId", + }, + ":root", + ], + ], + }, + }, + "Resource": "*", + }, + Object { + "Action": Array [ + "kms:Decrypt", + "kms:Encrypt", + "kms:ReEncrypt*", + "kms:GenerateDataKey*", + ], + "Effect": "Allow", + "Principal": Object { + "Service": "events.amazonaws.com", + }, + "Resource": "*", + }, + ], + "Version": "2012-10-17", + }, + }, + "Type": "AWS::KMS::Key", + "UpdateReplacePolicy": "Retain", + }, "testeventsrulesqsEventsRule06054F3F": Object { "Properties": Object { "ScheduleExpression": "rate(5 minutes)", @@ -103,7 +168,12 @@ Object { }, "testeventsrulesqsqueueAACD0364": Object { "Properties": Object { - "KmsMasterKeyId": "alias/aws/sqs", + "KmsMasterKeyId": Object { + "Fn::GetAtt": Array [ + "testeventsrulesqsEncryptionKey19AB0C02", + "Arn", + ], + }, "RedrivePolicy": Object { "deadLetterTargetArn": Object { "Fn::GetAtt": Array [ @@ -182,12 +252,7 @@ Object { ], "Effect": "Allow", "Principal": Object { - "AWS": Object { - "Fn::GetAtt": Array [ - "testeventsrulesqsEventsRule06054F3F", - "Arn", - ], - }, + "Service": "events.amazonaws.com", }, "Resource": Object { "Fn::GetAtt": Array [ diff --git a/source/patterns/@aws-solutions-constructs/aws-events-rule-sqs/test/events-rule-sqs-queue.test.ts b/source/patterns/@aws-solutions-constructs/aws-events-rule-sqs/test/events-rule-sqs-queue.test.ts index f4b91b08c..af7a2084b 100644 --- a/source/patterns/@aws-solutions-constructs/aws-events-rule-sqs/test/events-rule-sqs-queue.test.ts +++ b/source/patterns/@aws-solutions-constructs/aws-events-rule-sqs/test/events-rule-sqs-queue.test.ts @@ -12,201 +12,310 @@ */ import * as cdk from '@aws-cdk/core'; -import { EventsRuleToSQS, EventsRuleToSQSProps } from '../lib' +import { EventsRuleToSQS, EventsRuleToSQSProps } from '../lib'; import * as events from "@aws-cdk/aws-events"; import { SynthUtils } from '@aws-cdk/assert'; import '@aws-cdk/assert/jest'; +import * as defaults from '@aws-solutions-constructs/core'; - -function deployNewFunc(stack: cdk.Stack) { - const props: EventsRuleToSQSProps = { - eventRuleProps: { - schedule: events.Schedule.rate(cdk.Duration.minutes(5)) - } - } - return new EventsRuleToSQS(stack, 'test-events-rule-sqs', props); -} - -function getStack() { - const app = new cdk.App() - return new cdk.Stack(app, 'stack') +function deployNewStack(stack: cdk.Stack) { + const props: EventsRuleToSQSProps = { + eventRuleProps: { + schedule: events.Schedule.rate(cdk.Duration.minutes(5)) + } + }; + return new EventsRuleToSQS(stack, 'test-events-rule-sqs', props); } test('snapshot test EventsRuleToSQS default params', () => { - const stack = getStack() - deployNewFunc(stack) - expect(SynthUtils.toCloudFormation(stack)).toMatchSnapshot(); + const stack = new cdk.Stack(); + deployNewStack(stack); + expect(SynthUtils.toCloudFormation(stack)).toMatchSnapshot(); }); test('check the sqs queue properties', () => { - const stack = getStack() - deployNewFunc(stack) - expect(stack).toHaveResource('AWS::SQS::Queue', {}) -}) + const stack = new cdk.Stack(); + deployNewStack(stack); + expect(stack).toHaveResource('AWS::SQS::Queue', { + KmsMasterKeyId: { + "Fn::GetAtt": [ + "testeventsrulesqsEncryptionKey19AB0C02", + "Arn" + ] + }, + RedrivePolicy: { + deadLetterTargetArn: { + "Fn::GetAtt": [ + "testeventsrulesqsdeadLetterQueueA4A15A1C", + "Arn" + ] + }, + maxReceiveCount: 15 + } + }); +}); + +test('check the sqs queue properties with existing KMS key', () => { + const stack = new cdk.Stack(); + const key = defaults.buildEncryptionKey(stack, { + description: 'my-key' + }); + + const props: EventsRuleToSQSProps = { + eventRuleProps: { + schedule: events.Schedule.rate(cdk.Duration.minutes(5)) + }, + encryptionKey: key + }; + + new EventsRuleToSQS(stack, 'test-events-rule-sqs', props); + + expect(stack).toHaveResource('AWS::SQS::Queue', { + KmsMasterKeyId: { + "Fn::GetAtt": [ + "EncryptionKey1B843E66", + "Arn" + ] + }, + RedrivePolicy: { + deadLetterTargetArn: { + "Fn::GetAtt": [ + "testeventsrulesqsdeadLetterQueueA4A15A1C", + "Arn" + ] + }, + maxReceiveCount: 15 + } + }); + + expect(stack).toHaveResource('AWS::KMS::Key', { + KeyPolicy: { + Statement: [ + { + Action: [ + "kms:Create*", + "kms:Describe*", + "kms:Enable*", + "kms:List*", + "kms:Put*", + "kms:Update*", + "kms:Revoke*", + "kms:Disable*", + "kms:Get*", + "kms:Delete*", + "kms:ScheduleKeyDeletion", + "kms:CancelKeyDeletion", + "kms:GenerateDataKey", + "kms:TagResource", + "kms:UntagResource" + ], + Effect: "Allow", + Principal: { + AWS: { + "Fn::Join": [ + "", + [ + "arn:", + { + Ref: "AWS::Partition" + }, + ":iam::", + { + Ref: "AWS::AccountId" + }, + ":root" + ] + ] + } + }, + Resource: "*" + }, + { + Action: [ + "kms:Decrypt", + "kms:Encrypt", + "kms:ReEncrypt*", + "kms:GenerateDataKey*" + ], + Effect: "Allow", + Principal: { + Service: "events.amazonaws.com" + }, + Resource: "*" + } + ], + Version: "2012-10-17" + }, + Description: "my-key", + EnableKeyRotation: true + }); +}); test('check if the event rule has permission/policy in place in sqs queue for it to be able to send messages to the queue.', () => { - const stack = getStack() - deployNewFunc(stack) - expect(stack).toHaveResource('AWS::SQS::QueuePolicy', { - PolicyDocument: { - Statement: [ - { - Action: [ - "sqs:DeleteMessage", - "sqs:ReceiveMessage", - "sqs:SendMessage", - "sqs:GetQueueAttributes", - "sqs:RemovePermission", - "sqs:AddPermission", - "sqs:SetQueueAttributes", - ], - Effect: "Allow", - Principal: { - "AWS": { - "Fn::Join": [ - "", - [ - "arn:", - { - "Ref": "AWS::Partition", - }, - ":iam::", + const stack = new cdk.Stack(); + deployNewStack(stack); + expect(stack).toHaveResource('AWS::SQS::QueuePolicy', { + PolicyDocument: { + Statement: [ + { + Action: [ + "sqs:DeleteMessage", + "sqs:ReceiveMessage", + "sqs:SendMessage", + "sqs:GetQueueAttributes", + "sqs:RemovePermission", + "sqs:AddPermission", + "sqs:SetQueueAttributes", + ], + Effect: "Allow", + Principal: { + AWS: { + "Fn::Join": [ + "", + [ + "arn:", { - "Ref": "AWS::AccountId", + Ref: "AWS::Partition", }, - ":root" - ], + ":iam::", + { + Ref: "AWS::AccountId", + }, + ":root" ], - }, - }, - Resource: { - "Fn::GetAtt": [ - "testeventsrulesqsqueueAACD0364", - "Arn", ], }, - Sid: "QueueOwnerOnlyAccess", }, - { - Action: "SQS:*", - Condition: { - "Bool": { - "aws:SecureTransport": "false", - }, - }, - Effect: "Deny", - Principal: "*", - Resource: { - "Fn::GetAtt": [ - "testeventsrulesqsqueueAACD0364", - "Arn", - ], + Resource: { + "Fn::GetAtt": [ + "testeventsrulesqsqueueAACD0364", + "Arn", + ], + }, + Sid: "QueueOwnerOnlyAccess", + }, + { + Action: "SQS:*", + Condition: { + Bool: { + "aws:SecureTransport": "false", }, - Sid: "HttpsOnly", }, - { - Action: [ - "sqs:SendMessage", - "sqs:GetQueueAttributes", - "sqs:GetQueueUrl", + Effect: "Deny", + Principal: "*", + Resource: { + "Fn::GetAtt": [ + "testeventsrulesqsqueueAACD0364", + "Arn", ], - Effect: "Allow", - Principal: { - "AWS": { - "Fn::GetAtt": [ - "testeventsrulesqsEventsRule06054F3F", - "Arn", - ], - }, - }, - Resource: { - "Fn::GetAtt": [ - "testeventsrulesqsqueueAACD0364", - "Arn", - ], - }, }, - ], - Version: "2012-10-17" - }, - Queues: [ - { - "Ref": "testeventsrulesqsqueueAACD0364", - } - ] - }) -}) + Sid: "HttpsOnly", + }, + { + Action: [ + "sqs:SendMessage", + "sqs:GetQueueAttributes", + "sqs:GetQueueUrl" + ], + Effect: "Allow", + Principal: { + Service: "events.amazonaws.com" + }, + Resource: { + "Fn::GetAtt": [ + "testeventsrulesqsqueueAACD0364", + "Arn" + ] + } + } + ], + Version: "2012-10-17" + }, + Queues: [ + { + Ref: "testeventsrulesqsqueueAACD0364", + } + ] + }); +}); test('check if the dead letter queue policy is setup', () => { - const stack = getStack() - deployNewFunc(stack) - expect(stack).toHaveResource('AWS::SQS::QueuePolicy', { - PolicyDocument: { - Statement: [ - { - Action: [ - "sqs:DeleteMessage", - "sqs:ReceiveMessage", - "sqs:SendMessage", - "sqs:GetQueueAttributes", - "sqs:RemovePermission", - "sqs:AddPermission", - "sqs:SetQueueAttributes", - ], - Effect: "Allow", - Principal: { - AWS: { - "Fn::Join": [ - "", - [ - "arn:", - { - "Ref": "AWS::Partition", - }, - ":iam::", - { - "Ref": "AWS::AccountId" + const stack = new cdk.Stack(); + deployNewStack(stack); + expect(stack).toHaveResource('AWS::SQS::QueuePolicy', { + PolicyDocument: { + Statement: [ + { + Action: [ + "sqs:DeleteMessage", + "sqs:ReceiveMessage", + "sqs:SendMessage", + "sqs:GetQueueAttributes", + "sqs:RemovePermission", + "sqs:AddPermission", + "sqs:SetQueueAttributes", + ], + Effect: "Allow", + Principal: { + AWS: { + "Fn::Join": [ + "", + [ + "arn:", + { + Ref: "AWS::Partition", }, - ":root" - ], + ":iam::", + { + Ref: "AWS::AccountId" + }, + ":root" ], - }, - }, - Resource: { - "Fn::GetAtt": [ - "testeventsrulesqsdeadLetterQueueA4A15A1C", - "Arn", ], }, - Sid: "QueueOwnerOnlyAccess", }, - { - Action: "SQS:*", - Condition: { - "Bool": { - "aws:SecureTransport": "false", - }, - }, - Effect: "Deny", - Principal: "*", - Resource: { - "Fn::GetAtt": [ - "testeventsrulesqsdeadLetterQueueA4A15A1C", - "Arn", - ], + Resource: { + "Fn::GetAtt": [ + "testeventsrulesqsdeadLetterQueueA4A15A1C", + "Arn", + ], + }, + Sid: "QueueOwnerOnlyAccess", + }, + { + Action: "SQS:*", + Condition: { + Bool: { + "aws:SecureTransport": "false", }, - Sid: "HttpsOnly", }, - ], - Version: "2012-10-17", - }, - Queues: [ - { - "Ref": "testeventsrulesqsdeadLetterQueueA4A15A1C", + Effect: "Deny", + Principal: "*", + Resource: { + "Fn::GetAtt": [ + "testeventsrulesqsdeadLetterQueueA4A15A1C", + "Arn", + ], + }, + Sid: "HttpsOnly", }, - ] - }) + ], + Version: "2012-10-17", + }, + Queues: [ + { + Ref: "testeventsrulesqsdeadLetterQueueA4A15A1C", + }, + ] + }); +}); -}) +test('check properties', () => { + const stack = new cdk.Stack(); + const construct: EventsRuleToSQS = deployNewStack(stack); - \ No newline at end of file + expect(construct.eventsRule !== null); + expect(construct.sqsQueue !== null); + expect(construct.encryptionKey !== null); + expect(construct.deadLetterQueue !== null); +}); \ No newline at end of file diff --git a/source/patterns/@aws-solutions-constructs/aws-events-rule-sqs/test/integ.events-rule-existing-queue.expected.json b/source/patterns/@aws-solutions-constructs/aws-events-rule-sqs/test/integ.events-rule-existing-queue.expected.json index ef8f80b68..95bad249f 100644 --- a/source/patterns/@aws-solutions-constructs/aws-events-rule-sqs/test/integ.events-rule-existing-queue.expected.json +++ b/source/patterns/@aws-solutions-constructs/aws-events-rule-sqs/test/integ.events-rule-existing-queue.expected.json @@ -1,124 +1,135 @@ { - "Resources": { - "testeventsrulesqsEventsRule06054F3F": { - "Properties": { - "ScheduleExpression": "rate(5 minutes)", - "State": "ENABLED", - "Targets": [ - { - "Arn": { - "Fn::GetAtt": [ - "existingqueue03D57A53", - "Arn" + "Resources": { + "MyKey6AB29FA6": { + "Type": "AWS::KMS::Key", + "Properties": { + "KeyPolicy": { + "Statement": [ + { + "Action": [ + "kms:Create*", + "kms:Describe*", + "kms:Enable*", + "kms:List*", + "kms:Put*", + "kms:Update*", + "kms:Revoke*", + "kms:Disable*", + "kms:Get*", + "kms:Delete*", + "kms:ScheduleKeyDeletion", + "kms:CancelKeyDeletion", + "kms:GenerateDataKey", + "kms:TagResource", + "kms:UntagResource" + ], + "Effect": "Allow", + "Principal": { + "AWS": { + "Fn::Join": [ + "", + [ + "arn:", + { + "Ref": "AWS::Partition" + }, + ":iam::", + { + "Ref": "AWS::AccountId" + }, + ":root" ] - }, - "Id": { - "Fn::GetAtt": [ - "existingqueue03D57A53", - "QueueName" - ] - } + ] } - ] - }, - "Type": "AWS::Events::Rule" - }, - "existingqueue03D57A53": { - "Properties": { - "KmsMasterKeyId": "alias/aws/sqs" + }, + "Resource": "*" }, - "Type": "AWS::SQS::Queue" - }, - "existingqueuePolicy8BCB024D": { - "Properties": { - "PolicyDocument": { - "Statement": [ - { - "Action": [ - "sqs:DeleteMessage", - "sqs:ReceiveMessage", - "sqs:SendMessage", - "sqs:GetQueueAttributes", - "sqs:RemovePermission", - "sqs:AddPermission", - "sqs:SetQueueAttributes" - ], - "Effect": "Allow", - "Principal": { - "AWS": { - "Fn::Join": [ - "", - [ - "arn:", - { - "Ref": "AWS::Partition" - }, - ":iam::", - { - "Ref": "AWS::AccountId" - }, - ":root" - ] - ] - } - }, - "Resource": { - "Fn::GetAtt": [ - "existingqueue03D57A53", - "Arn" - ] - }, - "Sid": "QueueOwnerOnlyAccess" - }, - { - "Action": "SQS:*", - "Condition": { - "Bool": { - "aws:SecureTransport": "false" - } - }, - "Effect": "Deny", - "Principal": "*", - "Resource": { - "Fn::GetAtt": [ - "existingqueue03D57A53", - "Arn" - ] - }, - "Sid": "HttpsOnly" - }, - { - "Action": [ - "sqs:SendMessage", - "sqs:GetQueueAttributes", - "sqs:GetQueueUrl" - ], - "Effect": "Allow", - "Principal": { - "AWS": { - "Fn::GetAtt": [ - "testeventsrulesqsEventsRule06054F3F", - "Arn" - ] - } - }, - "Resource": { - "Fn::GetAtt": [ - "existingqueue03D57A53", - "Arn" - ] - } - } - ], - "Version": "2012-10-17" + { + "Action": [ + "kms:Decrypt", + "kms:Encrypt", + "kms:ReEncrypt*", + "kms:GenerateDataKey*" + ], + "Effect": "Allow", + "Principal": { + "Service": "events.amazonaws.com" }, - "Queues": [ - { - "Ref": "existingqueue03D57A53" - } + "Resource": "*" + } + ], + "Version": "2012-10-17" + }, + "EnableKeyRotation": true + }, + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Retain" + }, + "MyQueueE6CA6235": { + "Type": "AWS::SQS::Queue", + "Properties": { + "KmsMasterKeyId": { + "Fn::GetAtt": [ + "MyKey6AB29FA6", + "Arn" + ] + } + } + }, + "MyQueuePolicy6BBEDDAC": { + "Type": "AWS::SQS::QueuePolicy", + "Properties": { + "PolicyDocument": { + "Statement": [ + { + "Action": [ + "sqs:SendMessage", + "sqs:GetQueueAttributes", + "sqs:GetQueueUrl" + ], + "Effect": "Allow", + "Principal": { + "Service": "events.amazonaws.com" + }, + "Resource": { + "Fn::GetAtt": [ + "MyQueueE6CA6235", + "Arn" + ] + } + } + ], + "Version": "2012-10-17" + }, + "Queues": [ + { + "Ref": "MyQueueE6CA6235" + } + ] + } + }, + "constructEventsRule43880ADB": { + "Type": "AWS::Events::Rule", + "Properties": { + "ScheduleExpression": "rate(5 minutes)", + "State": "ENABLED", + "Targets": [ + { + "Arn": { + "Fn::GetAtt": [ + "MyQueueE6CA6235", + "Arn" ] }, - "Type": "AWS::SQS::QueuePolicy" + "Id": { + "Fn::GetAtt": [ + "MyQueueE6CA6235", + "QueueName" + ] + } } + ] + } } + } } \ No newline at end of file diff --git a/source/patterns/@aws-solutions-constructs/aws-events-rule-sqs/test/integ.events-rule-existing-queue.ts b/source/patterns/@aws-solutions-constructs/aws-events-rule-sqs/test/integ.events-rule-existing-queue.ts index 5e65fae4c..e18a83199 100644 --- a/source/patterns/@aws-solutions-constructs/aws-events-rule-sqs/test/integ.events-rule-existing-queue.ts +++ b/source/patterns/@aws-solutions-constructs/aws-events-rule-sqs/test/integ.events-rule-existing-queue.ts @@ -11,23 +11,29 @@ * and limitations under the License. */ -import { Duration } from '@aws-cdk/core' -import { EventsRuleToSQSProps, EventsRuleToSQS } from '../lib' -import * as events from '@aws-cdk/aws-events' -import { App, Stack } from '@aws-cdk/core' -import * as Defaults from '@aws-solutions-constructs/core'; +import { Duration } from '@aws-cdk/core'; +import { EventsRuleToSQSProps, EventsRuleToSQS } from '../lib'; +import * as events from '@aws-cdk/aws-events'; +import { App, Stack } from '@aws-cdk/core'; +import * as sqs from '@aws-cdk/aws-sqs'; +import * as kms from '@aws-cdk/aws-kms'; const app = new App(); -const stack = new Stack(app, 'test-events-rule-sqs-stack'); +const stack = new Stack(app, 'test-rule-exist-sqs'); -const [existingQueueObj] = Defaults.buildQueue(stack, 'existing-queue', {}) +const existingQueueObj = new sqs.Queue(stack, 'MyQueue', { + encryption: sqs.QueueEncryption.KMS, + encryptionMasterKey: new kms.Key(stack, 'MyKey', { + enableKeyRotation: true + }), +}); const props: EventsRuleToSQSProps = { eventRuleProps: { schedule: events.Schedule.rate(Duration.minutes(5)) }, - existingQueueObj: existingQueueObj -} + existingQueueObj +}; -new EventsRuleToSQS(stack, 'test-events-rule-sqs', props); +new EventsRuleToSQS(stack, 'construct', props); app.synth(); \ No newline at end of file diff --git a/source/patterns/@aws-solutions-constructs/aws-events-rule-sqs/test/integ.events-rule-no-arguments.expected.json b/source/patterns/@aws-solutions-constructs/aws-events-rule-sqs/test/integ.events-rule-no-arguments.expected.json index c5af258a5..147934e4d 100644 --- a/source/patterns/@aws-solutions-constructs/aws-events-rule-sqs/test/integ.events-rule-no-arguments.expected.json +++ b/source/patterns/@aws-solutions-constructs/aws-events-rule-sqs/test/integ.events-rule-no-arguments.expected.json @@ -1,208 +1,273 @@ { - "Resources": { - "testeventsrulesqsEventsRule06054F3F": { - "Properties": { - "ScheduleExpression": "rate(5 minutes)", - "State": "ENABLED", - "Targets": [ - { - "Arn": { - "Fn::GetAtt": [ - "testeventsrulesqsqueueAACD0364", - "Arn" - ] - }, - "Id": { - "Fn::GetAtt": [ - "testeventsrulesqsqueueAACD0364", - "QueueName" + "Resources": { + "constructdeadLetterQueueD87A77D4": { + "Type": "AWS::SQS::Queue", + "Properties": { + "KmsMasterKeyId": "alias/aws/sqs" + } + }, + "constructdeadLetterQueuePolicyBA602BC6": { + "Type": "AWS::SQS::QueuePolicy", + "Properties": { + "PolicyDocument": { + "Statement": [ + { + "Action": [ + "sqs:DeleteMessage", + "sqs:ReceiveMessage", + "sqs:SendMessage", + "sqs:GetQueueAttributes", + "sqs:RemovePermission", + "sqs:AddPermission", + "sqs:SetQueueAttributes" + ], + "Effect": "Allow", + "Principal": { + "AWS": { + "Fn::Join": [ + "", + [ + "arn:", + { + "Ref": "AWS::Partition" + }, + ":iam::", + { + "Ref": "AWS::AccountId" + }, + ":root" ] - } + ] } - ] - }, - "Type": "AWS::Events::Rule" - }, - "testeventsrulesqsdeadLetterQueueA4A15A1C": { - "Properties": { - "KmsMasterKeyId": "alias/aws/sqs" + }, + "Resource": { + "Fn::GetAtt": [ + "constructdeadLetterQueueD87A77D4", + "Arn" + ] + }, + "Sid": "QueueOwnerOnlyAccess" }, - "Type": "AWS::SQS::Queue" - }, - "testeventsrulesqsdeadLetterQueuePolicyB769DC48": { - "Properties": { - "PolicyDocument": { - "Statement": [ - { - "Action": [ - "sqs:DeleteMessage", - "sqs:ReceiveMessage", - "sqs:SendMessage", - "sqs:GetQueueAttributes", - "sqs:RemovePermission", - "sqs:AddPermission", - "sqs:SetQueueAttributes" - ], - "Effect": "Allow", - "Principal": { - "AWS": { - "Fn::Join": [ - "", - [ - "arn:", - { - "Ref": "AWS::Partition" - }, - ":iam::", - { + { + "Action": "SQS:*", + "Condition": { + "Bool": { + "aws:SecureTransport": "false" + } + }, + "Effect": "Deny", + "Principal": "*", + "Resource": { + "Fn::GetAtt": [ + "constructdeadLetterQueueD87A77D4", + "Arn" + ] + }, + "Sid": "HttpsOnly" + } + ], + "Version": "2012-10-17" + }, + "Queues": [ + { + "Ref": "constructdeadLetterQueueD87A77D4" + } + ] + } + }, + "constructEncryptionKey9426451E": { + "Type": "AWS::KMS::Key", + "Properties": { + "KeyPolicy": { + "Statement": [ + { + "Action": [ + "kms:Create*", + "kms:Describe*", + "kms:Enable*", + "kms:List*", + "kms:Put*", + "kms:Update*", + "kms:Revoke*", + "kms:Disable*", + "kms:Get*", + "kms:Delete*", + "kms:ScheduleKeyDeletion", + "kms:CancelKeyDeletion", + "kms:GenerateDataKey", + "kms:TagResource", + "kms:UntagResource" + ], + "Effect": "Allow", + "Principal": { + "AWS": { + "Fn::Join": [ + "", + [ + "arn:", + { + "Ref": "AWS::Partition" + }, + ":iam::", + { "Ref": "AWS::AccountId" }, ":root" - ] - ] - } - }, - "Resource": { - "Fn::GetAtt": [ - "testeventsrulesqsdeadLetterQueueA4A15A1C", - "Arn" - ] - }, - "Sid": "QueueOwnerOnlyAccess" - }, - { - "Action": "SQS:*", - "Condition": { - "Bool": { - "aws:SecureTransport": "false" - } - }, - "Effect": "Deny", - "Principal": "*", - "Resource": { - "Fn::GetAtt": [ - "testeventsrulesqsdeadLetterQueueA4A15A1C", - "Arn" - ] - }, - "Sid": "HttpsOnly" - } - ], - "Version": "2012-10-17" - }, - "Queues": [ - { - "Ref": "testeventsrulesqsdeadLetterQueueA4A15A1C" + ] + ] } - ] + }, + "Resource": "*" }, - "Type": "AWS::SQS::QueuePolicy" + { + "Action": [ + "kms:Decrypt", + "kms:Encrypt", + "kms:ReEncrypt*", + "kms:GenerateDataKey*" + ], + "Effect": "Allow", + "Principal": { + "Service": "events.amazonaws.com" + }, + "Resource": "*" + } + ], + "Version": "2012-10-17" + }, + "EnableKeyRotation": true + }, + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Retain" + }, + "constructqueue481DC1EC": { + "Type": "AWS::SQS::Queue", + "Properties": { + "KmsMasterKeyId": { + "Fn::GetAtt": [ + "constructEncryptionKey9426451E", + "Arn" + ] + }, + "RedrivePolicy": { + "deadLetterTargetArn": { + "Fn::GetAtt": [ + "constructdeadLetterQueueD87A77D4", + "Arn" + ] }, - "testeventsrulesqsqueueAACD0364": { - "Properties": { - "KmsMasterKeyId": "alias/aws/sqs", - "RedrivePolicy": { - "deadLetterTargetArn": { - "Fn::GetAtt": [ - "testeventsrulesqsdeadLetterQueueA4A15A1C", - "Arn" + "maxReceiveCount": 15 + } + } + }, + "constructqueuePolicy5B0256B1": { + "Type": "AWS::SQS::QueuePolicy", + "Properties": { + "PolicyDocument": { + "Statement": [ + { + "Action": [ + "sqs:DeleteMessage", + "sqs:ReceiveMessage", + "sqs:SendMessage", + "sqs:GetQueueAttributes", + "sqs:RemovePermission", + "sqs:AddPermission", + "sqs:SetQueueAttributes" + ], + "Effect": "Allow", + "Principal": { + "AWS": { + "Fn::Join": [ + "", + [ + "arn:", + { + "Ref": "AWS::Partition" + }, + ":iam::", + { + "Ref": "AWS::AccountId" + }, + ":root" + ] ] - }, - "maxReceiveCount": 15 - } - }, - "Type": "AWS::SQS::Queue" - }, - "testeventsrulesqsqueuePolicy6D46CF4A": { - "Properties": { - "PolicyDocument": { - "Statement": [ - { - "Action": [ - "sqs:DeleteMessage", - "sqs:ReceiveMessage", - "sqs:SendMessage", - "sqs:GetQueueAttributes", - "sqs:RemovePermission", - "sqs:AddPermission", - "sqs:SetQueueAttributes" - ], - "Effect": "Allow", - "Principal": { - "AWS": { - "Fn::Join": [ - "", - [ - "arn:", - { - "Ref": "AWS::Partition" - }, - ":iam::", - { - "Ref": "AWS::AccountId" - }, - ":root" - ] - ] - } - }, - "Resource": { - "Fn::GetAtt": [ - "testeventsrulesqsqueueAACD0364", - "Arn" - ] - }, - "Sid": "QueueOwnerOnlyAccess" - }, - { - "Action": "SQS:*", - "Condition": { - "Bool": { - "aws:SecureTransport": "false" - } - }, - "Effect": "Deny", - "Principal": "*", - "Resource": { - "Fn::GetAtt": [ - "testeventsrulesqsqueueAACD0364", - "Arn" - ] - }, - "Sid": "HttpsOnly" - }, - { - "Action": [ - "sqs:SendMessage", - "sqs:GetQueueAttributes", - "sqs:GetQueueUrl" - ], - "Effect": "Allow", - "Principal": { - "AWS": { - "Fn::GetAtt": [ - "testeventsrulesqsEventsRule06054F3F", - "Arn" - ] - } - }, - "Resource": { - "Fn::GetAtt": [ - "testeventsrulesqsqueueAACD0364", - "Arn" - ] - } - } - ], - "Version": "2012-10-17" + } + }, + "Resource": { + "Fn::GetAtt": [ + "constructqueue481DC1EC", + "Arn" + ] }, - "Queues": [ - { - "Ref": "testeventsrulesqsqueueAACD0364" + "Sid": "QueueOwnerOnlyAccess" + }, + { + "Action": "SQS:*", + "Condition": { + "Bool": { + "aws:SecureTransport": "false" } + }, + "Effect": "Deny", + "Principal": "*", + "Resource": { + "Fn::GetAtt": [ + "constructqueue481DC1EC", + "Arn" + ] + }, + "Sid": "HttpsOnly" + }, + { + "Action": [ + "sqs:SendMessage", + "sqs:GetQueueAttributes", + "sqs:GetQueueUrl" + ], + "Effect": "Allow", + "Principal": { + "Service": "events.amazonaws.com" + }, + "Resource": { + "Fn::GetAtt": [ + "constructqueue481DC1EC", + "Arn" + ] + } + } + ], + "Version": "2012-10-17" + }, + "Queues": [ + { + "Ref": "constructqueue481DC1EC" + } + ] + } + }, + "constructEventsRule43880ADB": { + "Type": "AWS::Events::Rule", + "Properties": { + "ScheduleExpression": "rate(5 minutes)", + "State": "ENABLED", + "Targets": [ + { + "Arn": { + "Fn::GetAtt": [ + "constructqueue481DC1EC", + "Arn" ] }, - "Type": "AWS::SQS::QueuePolicy" + "Id": { + "Fn::GetAtt": [ + "constructqueue481DC1EC", + "QueueName" + ] + } } + ] + } } + } } \ No newline at end of file diff --git a/source/patterns/@aws-solutions-constructs/aws-events-rule-sqs/test/integ.events-rule-no-arguments.ts b/source/patterns/@aws-solutions-constructs/aws-events-rule-sqs/test/integ.events-rule-no-arguments.ts index 16d0009e4..0c43785d5 100644 --- a/source/patterns/@aws-solutions-constructs/aws-events-rule-sqs/test/integ.events-rule-no-arguments.ts +++ b/source/patterns/@aws-solutions-constructs/aws-events-rule-sqs/test/integ.events-rule-no-arguments.ts @@ -11,19 +11,19 @@ * and limitations under the License. */ -import { Duration } from '@aws-cdk/core' -import { EventsRuleToSQSProps, EventsRuleToSQS } from '../lib' -import * as events from '@aws-cdk/aws-events' -import { App, Stack } from '@aws-cdk/core' +import { Duration } from '@aws-cdk/core'; +import { EventsRuleToSQSProps, EventsRuleToSQS } from '../lib'; +import * as events from '@aws-cdk/aws-events'; +import { App, Stack } from '@aws-cdk/core'; const app = new App(); -const stack = new Stack(app, 'test-events-rule-sqs-stack'); +const stack = new Stack(app, 'test-rule-sqs'); const props: EventsRuleToSQSProps = { eventRuleProps: { schedule: events.Schedule.rate(Duration.minutes(5)) } -} +}; -new EventsRuleToSQS(stack, 'test-events-rule-sqs', props); +new EventsRuleToSQS(stack, 'construct', props); app.synth(); \ No newline at end of file diff --git a/source/patterns/@aws-solutions-constructs/aws-events-rule-step-function/package.json b/source/patterns/@aws-solutions-constructs/aws-events-rule-step-function/package.json index 740cb424a..d005af8b3 100644 --- a/source/patterns/@aws-solutions-constructs/aws-events-rule-step-function/package.json +++ b/source/patterns/@aws-solutions-constructs/aws-events-rule-step-function/package.json @@ -1,6 +1,6 @@ { "name": "@aws-solutions-constructs/aws-events-rule-step-function", - "version": "1.61.1", + "version": "1.62.0", "description": "CDK Constructs for deploying AWS Events Rule that invokes AWS Step Function", "main": "lib/index.js", "types": "lib/index.d.ts", @@ -53,19 +53,19 @@ } }, "dependencies": { - "@aws-cdk/aws-stepfunctions": "~1.61.1", - "@aws-cdk/aws-stepfunctions-tasks": "~1.61.1", - "@aws-cdk/core": "~1.61.1", - "@aws-cdk/aws-events": "~1.61.1", - "@aws-cdk/aws-iam": "~1.61.1", - "@aws-cdk/aws-lambda": "~1.61.1", - "@aws-cdk/aws-logs": "~1.61.1", - "@aws-cdk/aws-cloudwatch": "~1.61.1", - "@aws-solutions-constructs/core": "~1.61.1", + "@aws-cdk/aws-stepfunctions": "~1.62.0", + "@aws-cdk/aws-stepfunctions-tasks": "~1.62.0", + "@aws-cdk/core": "~1.62.0", + "@aws-cdk/aws-events": "~1.62.0", + "@aws-cdk/aws-iam": "~1.62.0", + "@aws-cdk/aws-lambda": "~1.62.0", + "@aws-cdk/aws-logs": "~1.62.0", + "@aws-cdk/aws-cloudwatch": "~1.62.0", + "@aws-solutions-constructs/core": "~1.62.0", "constructs": "^3.0.4" }, "devDependencies": { - "@aws-cdk/assert": "~1.61.1", + "@aws-cdk/assert": "~1.62.0", "@types/jest": "^24.0.23", "@types/node": "^10.3.0" }, @@ -75,15 +75,15 @@ ] }, "peerDependencies": { - "@aws-cdk/aws-stepfunctions": "~1.61.1", - "@aws-cdk/core": "~1.61.1", - "@aws-cdk/aws-events": "~1.61.1", - "@aws-cdk/aws-iam": "~1.61.1", - "@aws-solutions-constructs/core": "~1.61.1", + "@aws-cdk/aws-stepfunctions": "~1.62.0", + "@aws-cdk/core": "~1.62.0", + "@aws-cdk/aws-events": "~1.62.0", + "@aws-cdk/aws-iam": "~1.62.0", + "@aws-solutions-constructs/core": "~1.62.0", "constructs": "^3.0.4", - "@aws-cdk/aws-lambda": "~1.61.1", - "@aws-cdk/aws-cloudwatch": "~1.61.1", - "@aws-cdk/aws-stepfunctions-tasks": "~1.61.1", - "@aws-cdk/aws-logs": "~1.61.1" + "@aws-cdk/aws-lambda": "~1.62.0", + "@aws-cdk/aws-cloudwatch": "~1.62.0", + "@aws-cdk/aws-stepfunctions-tasks": "~1.62.0", + "@aws-cdk/aws-logs": "~1.62.0" } } diff --git a/source/patterns/@aws-solutions-constructs/aws-iot-kinesisfirehose-s3/package.json b/source/patterns/@aws-solutions-constructs/aws-iot-kinesisfirehose-s3/package.json index 0df878dea..5aec0f0f0 100644 --- a/source/patterns/@aws-solutions-constructs/aws-iot-kinesisfirehose-s3/package.json +++ b/source/patterns/@aws-solutions-constructs/aws-iot-kinesisfirehose-s3/package.json @@ -1,6 +1,6 @@ { "name": "@aws-solutions-constructs/aws-iot-kinesisfirehose-s3", - "version": "1.61.1", + "version": "1.62.0", "description": "CDK Constructs for AWS IoT to AWS Kinesis Firehose to AWS S3 integration.", "main": "lib/index.js", "types": "lib/index.d.ts", @@ -53,18 +53,18 @@ } }, "dependencies": { - "@aws-cdk/aws-iam": "~1.61.1", - "@aws-cdk/aws-kinesisfirehose": "~1.61.1", - "@aws-cdk/core": "~1.61.1", - "@aws-cdk/aws-iot": "~1.61.1", - "@aws-cdk/aws-s3": "~1.61.1", - "@aws-cdk/aws-logs": "~1.61.1", - "@aws-solutions-constructs/core": "~1.61.1", - "@aws-solutions-constructs/aws-kinesisfirehose-s3": "~1.61.1", + "@aws-cdk/aws-iam": "~1.62.0", + "@aws-cdk/aws-kinesisfirehose": "~1.62.0", + "@aws-cdk/core": "~1.62.0", + "@aws-cdk/aws-iot": "~1.62.0", + "@aws-cdk/aws-s3": "~1.62.0", + "@aws-cdk/aws-logs": "~1.62.0", + "@aws-solutions-constructs/core": "~1.62.0", + "@aws-solutions-constructs/aws-kinesisfirehose-s3": "~1.62.0", "constructs": "^3.0.4" }, "devDependencies": { - "@aws-cdk/assert": "~1.61.1", + "@aws-cdk/assert": "~1.62.0", "@types/jest": "^24.0.23", "@types/node": "^10.3.0" }, @@ -74,14 +74,14 @@ ] }, "peerDependencies": { - "@aws-cdk/aws-iam": "~1.61.1", - "@aws-cdk/aws-kinesisfirehose": "~1.61.1", - "@aws-cdk/core": "~1.61.1", - "@aws-cdk/aws-iot": "~1.61.1", - "@aws-cdk/aws-s3": "~1.61.1", - "@aws-solutions-constructs/core": "~1.61.1", - "@aws-solutions-constructs/aws-kinesisfirehose-s3": "~1.61.1", + "@aws-cdk/aws-iam": "~1.62.0", + "@aws-cdk/aws-kinesisfirehose": "~1.62.0", + "@aws-cdk/core": "~1.62.0", + "@aws-cdk/aws-iot": "~1.62.0", + "@aws-cdk/aws-s3": "~1.62.0", + "@aws-solutions-constructs/core": "~1.62.0", + "@aws-solutions-constructs/aws-kinesisfirehose-s3": "~1.62.0", "constructs": "^3.0.4", - "@aws-cdk/aws-logs": "~1.61.1" + "@aws-cdk/aws-logs": "~1.62.0" } } diff --git a/source/patterns/@aws-solutions-constructs/aws-iot-lambda-dynamodb/package.json b/source/patterns/@aws-solutions-constructs/aws-iot-lambda-dynamodb/package.json index 6ef8020e1..594fc6e52 100644 --- a/source/patterns/@aws-solutions-constructs/aws-iot-lambda-dynamodb/package.json +++ b/source/patterns/@aws-solutions-constructs/aws-iot-lambda-dynamodb/package.json @@ -1,6 +1,6 @@ { "name": "@aws-solutions-constructs/aws-iot-lambda-dynamodb", - "version": "1.61.1", + "version": "1.62.0", "description": "CDK Constructs for AWS IoT to AWS Lambda to AWS DyanmoDB integration.", "main": "lib/index.js", "types": "lib/index.d.ts", @@ -53,17 +53,17 @@ } }, "dependencies": { - "@aws-cdk/aws-dynamodb": "~1.61.1", - "@aws-cdk/aws-lambda": "~1.61.1", - "@aws-cdk/aws-iot": "~1.61.1", - "@aws-cdk/core": "~1.61.1", - "@aws-solutions-constructs/core": "~1.61.1", - "@aws-solutions-constructs/aws-iot-lambda": "~1.61.1", - "@aws-solutions-constructs/aws-lambda-dynamodb": "~1.61.1", + "@aws-cdk/aws-dynamodb": "~1.62.0", + "@aws-cdk/aws-lambda": "~1.62.0", + "@aws-cdk/aws-iot": "~1.62.0", + "@aws-cdk/core": "~1.62.0", + "@aws-solutions-constructs/core": "~1.62.0", + "@aws-solutions-constructs/aws-iot-lambda": "~1.62.0", + "@aws-solutions-constructs/aws-lambda-dynamodb": "~1.62.0", "constructs": "^3.0.4" }, "devDependencies": { - "@aws-cdk/assert": "~1.61.1", + "@aws-cdk/assert": "~1.62.0", "@types/jest": "^24.0.23", "@types/node": "^10.3.0" }, @@ -73,13 +73,13 @@ ] }, "peerDependencies": { - "@aws-cdk/aws-dynamodb": "~1.61.1", - "@aws-cdk/aws-lambda": "~1.61.1", - "@aws-cdk/aws-iot": "~1.61.1", - "@aws-cdk/core": "~1.61.1", - "@aws-solutions-constructs/core": "~1.61.1", - "@aws-solutions-constructs/aws-iot-lambda": "~1.61.1", - "@aws-solutions-constructs/aws-lambda-dynamodb": "~1.61.1", + "@aws-cdk/aws-dynamodb": "~1.62.0", + "@aws-cdk/aws-lambda": "~1.62.0", + "@aws-cdk/aws-iot": "~1.62.0", + "@aws-cdk/core": "~1.62.0", + "@aws-solutions-constructs/core": "~1.62.0", + "@aws-solutions-constructs/aws-iot-lambda": "~1.62.0", + "@aws-solutions-constructs/aws-lambda-dynamodb": "~1.62.0", "constructs": "^3.0.4" } } diff --git a/source/patterns/@aws-solutions-constructs/aws-iot-lambda/package.json b/source/patterns/@aws-solutions-constructs/aws-iot-lambda/package.json index 8da7ee32e..ccbd558a9 100644 --- a/source/patterns/@aws-solutions-constructs/aws-iot-lambda/package.json +++ b/source/patterns/@aws-solutions-constructs/aws-iot-lambda/package.json @@ -1,6 +1,6 @@ { "name": "@aws-solutions-constructs/aws-iot-lambda", - "version": "1.61.1", + "version": "1.62.0", "description": "CDK Constructs for AWS IoT to AWS Lambda integration", "main": "lib/index.js", "types": "lib/index.d.ts", @@ -53,15 +53,15 @@ } }, "dependencies": { - "@aws-cdk/aws-iot": "~1.61.1", - "@aws-cdk/aws-lambda": "~1.61.1", - "@aws-cdk/aws-iam": "~1.61.1", - "@aws-cdk/core": "~1.61.1", - "@aws-solutions-constructs/core": "~1.61.1", + "@aws-cdk/aws-iot": "~1.62.0", + "@aws-cdk/aws-lambda": "~1.62.0", + "@aws-cdk/aws-iam": "~1.62.0", + "@aws-cdk/core": "~1.62.0", + "@aws-solutions-constructs/core": "~1.62.0", "constructs": "^3.0.4" }, "devDependencies": { - "@aws-cdk/assert": "~1.61.1", + "@aws-cdk/assert": "~1.62.0", "@types/jest": "^24.0.23", "@types/node": "^10.3.0" }, @@ -71,11 +71,11 @@ ] }, "peerDependencies": { - "@aws-cdk/aws-iot": "~1.61.1", - "@aws-cdk/aws-lambda": "~1.61.1", - "@aws-cdk/core": "~1.61.1", - "@aws-solutions-constructs/core": "~1.61.1", - "@aws-cdk/aws-iam": "~1.61.1", + "@aws-cdk/aws-iot": "~1.62.0", + "@aws-cdk/aws-lambda": "~1.62.0", + "@aws-cdk/core": "~1.62.0", + "@aws-solutions-constructs/core": "~1.62.0", + "@aws-cdk/aws-iam": "~1.62.0", "constructs": "^3.0.4" } } diff --git a/source/patterns/@aws-solutions-constructs/aws-kinesisfirehose-s3-and-kinesisanalytics/package.json b/source/patterns/@aws-solutions-constructs/aws-kinesisfirehose-s3-and-kinesisanalytics/package.json index 936afc51e..8d032a55b 100644 --- a/source/patterns/@aws-solutions-constructs/aws-kinesisfirehose-s3-and-kinesisanalytics/package.json +++ b/source/patterns/@aws-solutions-constructs/aws-kinesisfirehose-s3-and-kinesisanalytics/package.json @@ -1,6 +1,6 @@ { "name": "@aws-solutions-constructs/aws-kinesisfirehose-s3-and-kinesisanalytics", - "version": "1.61.1", + "version": "1.62.0", "description": "CDK constructs for defining an interaction between an Amazon Kinesis Data Firehose delivery stream and (1) an Amazon S3 bucket, and (2) an Amazon Kinesis Data Analytics application.", "main": "lib/index.js", "types": "lib/index.d.ts", @@ -53,19 +53,19 @@ } }, "dependencies": { - "@aws-cdk/aws-iam": "~1.61.1", - "@aws-cdk/aws-kinesis": "~1.61.1", - "@aws-cdk/aws-kinesisanalytics": "~1.61.1", - "@aws-cdk/aws-kinesisfirehose": "~1.61.1", - "@aws-cdk/aws-s3": "~1.61.1", - "@aws-cdk/aws-logs": "~1.61.1", - "@aws-cdk/core": "~1.61.1", - "@aws-solutions-constructs/core": "~1.61.1", - "@aws-solutions-constructs/aws-kinesisfirehose-s3": "~1.61.1", + "@aws-cdk/aws-iam": "~1.62.0", + "@aws-cdk/aws-kinesis": "~1.62.0", + "@aws-cdk/aws-kinesisanalytics": "~1.62.0", + "@aws-cdk/aws-kinesisfirehose": "~1.62.0", + "@aws-cdk/aws-s3": "~1.62.0", + "@aws-cdk/aws-logs": "~1.62.0", + "@aws-cdk/core": "~1.62.0", + "@aws-solutions-constructs/core": "~1.62.0", + "@aws-solutions-constructs/aws-kinesisfirehose-s3": "~1.62.0", "constructs": "^3.0.4" }, "devDependencies": { - "@aws-cdk/assert": "~1.61.1", + "@aws-cdk/assert": "~1.62.0", "@types/jest": "^24.0.23", "@types/node": "^10.3.0" }, @@ -75,15 +75,15 @@ ] }, "peerDependencies": { - "@aws-cdk/aws-iam": "~1.61.1", - "@aws-cdk/aws-kinesis": "~1.61.1", - "@aws-cdk/aws-kinesisanalytics": "~1.61.1", - "@aws-cdk/aws-kinesisfirehose": "~1.61.1", - "@aws-cdk/aws-s3": "~1.61.1", - "@aws-cdk/core": "~1.61.1", - "@aws-solutions-constructs/core": "~1.61.1", - "@aws-solutions-constructs/aws-kinesisfirehose-s3": "~1.61.1", + "@aws-cdk/aws-iam": "~1.62.0", + "@aws-cdk/aws-kinesis": "~1.62.0", + "@aws-cdk/aws-kinesisanalytics": "~1.62.0", + "@aws-cdk/aws-kinesisfirehose": "~1.62.0", + "@aws-cdk/aws-s3": "~1.62.0", + "@aws-cdk/core": "~1.62.0", + "@aws-solutions-constructs/core": "~1.62.0", + "@aws-solutions-constructs/aws-kinesisfirehose-s3": "~1.62.0", "constructs": "^3.0.4", - "@aws-cdk/aws-logs": "~1.61.1" + "@aws-cdk/aws-logs": "~1.62.0" } } diff --git a/source/patterns/@aws-solutions-constructs/aws-kinesisfirehose-s3/package.json b/source/patterns/@aws-solutions-constructs/aws-kinesisfirehose-s3/package.json index 7898a6ed3..0d9ae62df 100644 --- a/source/patterns/@aws-solutions-constructs/aws-kinesisfirehose-s3/package.json +++ b/source/patterns/@aws-solutions-constructs/aws-kinesisfirehose-s3/package.json @@ -1,6 +1,6 @@ { "name": "@aws-solutions-constructs/aws-kinesisfirehose-s3", - "version": "1.61.1", + "version": "1.62.0", "description": "CDK constructs for defining an interaction between an Amazon Kinesis Data Firehose delivery stream and an Amazon S3 bucket.", "main": "lib/index.js", "types": "lib/index.d.ts", @@ -53,16 +53,16 @@ } }, "dependencies": { - "@aws-cdk/aws-iam": "~1.61.1", - "@aws-cdk/aws-kinesisfirehose": "~1.61.1", - "@aws-cdk/aws-s3": "~1.61.1", - "@aws-cdk/core": "~1.61.1", - "@aws-cdk/aws-logs": "~1.61.1", - "@aws-solutions-constructs/core": "~1.61.1", + "@aws-cdk/aws-iam": "~1.62.0", + "@aws-cdk/aws-kinesisfirehose": "~1.62.0", + "@aws-cdk/aws-s3": "~1.62.0", + "@aws-cdk/core": "~1.62.0", + "@aws-cdk/aws-logs": "~1.62.0", + "@aws-solutions-constructs/core": "~1.62.0", "constructs": "^3.0.4" }, "devDependencies": { - "@aws-cdk/assert": "~1.61.1", + "@aws-cdk/assert": "~1.62.0", "@types/jest": "^24.0.23", "@types/node": "^10.3.0" }, @@ -72,12 +72,12 @@ ] }, "peerDependencies": { - "@aws-cdk/aws-iam": "~1.61.1", - "@aws-cdk/aws-kinesisfirehose": "~1.61.1", - "@aws-cdk/aws-s3": "~1.61.1", - "@aws-cdk/core": "~1.61.1", - "@aws-cdk/aws-logs": "~1.61.1", - "@aws-solutions-constructs/core": "~1.61.1", + "@aws-cdk/aws-iam": "~1.62.0", + "@aws-cdk/aws-kinesisfirehose": "~1.62.0", + "@aws-cdk/aws-s3": "~1.62.0", + "@aws-cdk/core": "~1.62.0", + "@aws-cdk/aws-logs": "~1.62.0", + "@aws-solutions-constructs/core": "~1.62.0", "constructs": "^3.0.4" } } diff --git a/source/patterns/@aws-solutions-constructs/aws-kinesisstreams-lambda/package.json b/source/patterns/@aws-solutions-constructs/aws-kinesisstreams-lambda/package.json index d3b43d3cb..b27dc61cc 100644 --- a/source/patterns/@aws-solutions-constructs/aws-kinesisstreams-lambda/package.json +++ b/source/patterns/@aws-solutions-constructs/aws-kinesisstreams-lambda/package.json @@ -1,6 +1,6 @@ { "name": "@aws-solutions-constructs/aws-kinesisstreams-lambda", - "version": "1.61.1", + "version": "1.62.0", "description": "CDK constructs for defining an interaction between an Amazon Kinesis Data Stream and an AWS Lambda function.", "main": "lib/index.js", "types": "lib/index.d.ts", @@ -53,16 +53,16 @@ } }, "dependencies": { - "@aws-cdk/aws-iam": "~1.61.1", - "@aws-cdk/aws-kinesis": "~1.61.1", - "@aws-cdk/aws-kms": "~1.61.1", - "@aws-cdk/aws-lambda": "~1.61.1", - "@aws-cdk/core": "~1.61.1", - "@aws-solutions-constructs/core": "~1.61.1", + "@aws-cdk/aws-iam": "~1.62.0", + "@aws-cdk/aws-kinesis": "~1.62.0", + "@aws-cdk/aws-kms": "~1.62.0", + "@aws-cdk/aws-lambda": "~1.62.0", + "@aws-cdk/core": "~1.62.0", + "@aws-solutions-constructs/core": "~1.62.0", "constructs": "^3.0.4" }, "devDependencies": { - "@aws-cdk/assert": "~1.61.1", + "@aws-cdk/assert": "~1.62.0", "@types/jest": "^24.0.23", "@types/node": "^10.3.0" }, @@ -72,12 +72,12 @@ ] }, "peerDependencies": { - "@aws-cdk/aws-iam": "~1.61.1", - "@aws-cdk/aws-kinesis": "~1.61.1", - "@aws-cdk/aws-kms": "~1.61.1", - "@aws-cdk/aws-lambda": "~1.61.1", - "@aws-cdk/core": "~1.61.1", - "@aws-solutions-constructs/core": "~1.61.1", + "@aws-cdk/aws-iam": "~1.62.0", + "@aws-cdk/aws-kinesis": "~1.62.0", + "@aws-cdk/aws-kms": "~1.62.0", + "@aws-cdk/aws-lambda": "~1.62.0", + "@aws-cdk/core": "~1.62.0", + "@aws-solutions-constructs/core": "~1.62.0", "constructs": "^3.0.4" } } diff --git a/source/patterns/@aws-solutions-constructs/aws-lambda-dynamodb/package.json b/source/patterns/@aws-solutions-constructs/aws-lambda-dynamodb/package.json index 9fda01d75..fef04506a 100644 --- a/source/patterns/@aws-solutions-constructs/aws-lambda-dynamodb/package.json +++ b/source/patterns/@aws-solutions-constructs/aws-lambda-dynamodb/package.json @@ -1,6 +1,6 @@ { "name": "@aws-solutions-constructs/aws-lambda-dynamodb", - "version": "1.61.1", + "version": "1.62.0", "description": "CDK Constructs for AWS Lambda to AWS DynamoDB integration.", "main": "lib/index.js", "types": "lib/index.d.ts", @@ -53,14 +53,14 @@ } }, "dependencies": { - "@aws-cdk/aws-lambda": "~1.61.1", - "@aws-cdk/aws-dynamodb": "~1.61.1", - "@aws-cdk/core": "~1.61.1", - "@aws-solutions-constructs/core": "~1.61.1", + "@aws-cdk/aws-lambda": "~1.62.0", + "@aws-cdk/aws-dynamodb": "~1.62.0", + "@aws-cdk/core": "~1.62.0", + "@aws-solutions-constructs/core": "~1.62.0", "constructs": "^3.0.4" }, "devDependencies": { - "@aws-cdk/assert": "~1.61.1", + "@aws-cdk/assert": "~1.62.0", "@types/jest": "^24.0.23", "@types/node": "^10.3.0" }, @@ -70,10 +70,10 @@ ] }, "peerDependencies": { - "@aws-cdk/aws-lambda": "~1.61.1", - "@aws-cdk/aws-dynamodb": "~1.61.1", - "@aws-cdk/core": "~1.61.1", - "@aws-solutions-constructs/core": "~1.61.1", + "@aws-cdk/aws-lambda": "~1.62.0", + "@aws-cdk/aws-dynamodb": "~1.62.0", + "@aws-cdk/core": "~1.62.0", + "@aws-solutions-constructs/core": "~1.62.0", "constructs": "^3.0.4" } } diff --git a/source/patterns/@aws-solutions-constructs/aws-lambda-elasticsearch-kibana/package.json b/source/patterns/@aws-solutions-constructs/aws-lambda-elasticsearch-kibana/package.json index c175c88e7..329436fac 100644 --- a/source/patterns/@aws-solutions-constructs/aws-lambda-elasticsearch-kibana/package.json +++ b/source/patterns/@aws-solutions-constructs/aws-lambda-elasticsearch-kibana/package.json @@ -1,6 +1,6 @@ { "name": "@aws-solutions-constructs/aws-lambda-elasticsearch-kibana", - "version": "1.61.1", + "version": "1.62.0", "description": "CDK Constructs for AWS Lambda to AWS Elasticsearch with Kibana integration", "main": "lib/index.js", "types": "lib/index.d.ts", @@ -53,17 +53,17 @@ } }, "dependencies": { - "@aws-cdk/aws-lambda": "~1.61.1", - "@aws-cdk/core": "~1.61.1", - "@aws-cdk/aws-cognito": "~1.61.1", - "@aws-cdk/aws-elasticsearch": "~1.61.1", - "@aws-cdk/aws-iam": "~1.61.1", - "@aws-cdk/aws-cloudwatch": "~1.61.1", - "@aws-solutions-constructs/core": "~1.61.1", + "@aws-cdk/aws-lambda": "~1.62.0", + "@aws-cdk/core": "~1.62.0", + "@aws-cdk/aws-cognito": "~1.62.0", + "@aws-cdk/aws-elasticsearch": "~1.62.0", + "@aws-cdk/aws-iam": "~1.62.0", + "@aws-cdk/aws-cloudwatch": "~1.62.0", + "@aws-solutions-constructs/core": "~1.62.0", "constructs": "^3.0.4" }, "devDependencies": { - "@aws-cdk/assert": "~1.61.1", + "@aws-cdk/assert": "~1.62.0", "@types/jest": "^24.0.23", "@types/node": "^10.3.0" }, @@ -73,13 +73,13 @@ ] }, "peerDependencies": { - "@aws-cdk/aws-lambda": "~1.61.1", - "@aws-cdk/core": "~1.61.1", - "@aws-cdk/aws-cognito": "~1.61.1", - "@aws-cdk/aws-elasticsearch": "~1.61.1", - "@aws-solutions-constructs/core": "~1.61.1", - "@aws-cdk/aws-iam": "~1.61.1", - "@aws-cdk/aws-cloudwatch": "~1.61.1", + "@aws-cdk/aws-lambda": "~1.62.0", + "@aws-cdk/core": "~1.62.0", + "@aws-cdk/aws-cognito": "~1.62.0", + "@aws-cdk/aws-elasticsearch": "~1.62.0", + "@aws-solutions-constructs/core": "~1.62.0", + "@aws-cdk/aws-iam": "~1.62.0", + "@aws-cdk/aws-cloudwatch": "~1.62.0", "constructs": "^3.0.4" } } diff --git a/source/patterns/@aws-solutions-constructs/aws-lambda-s3/package.json b/source/patterns/@aws-solutions-constructs/aws-lambda-s3/package.json index 5988c363f..acd849267 100644 --- a/source/patterns/@aws-solutions-constructs/aws-lambda-s3/package.json +++ b/source/patterns/@aws-solutions-constructs/aws-lambda-s3/package.json @@ -1,6 +1,6 @@ { "name": "@aws-solutions-constructs/aws-lambda-s3", - "version": "1.61.1", + "version": "1.62.0", "description": "CDK constructs for defining an interaction between an AWS Lambda function and an Amazon S3 bucket.", "main": "lib/index.js", "types": "lib/index.d.ts", @@ -53,14 +53,14 @@ } }, "dependencies": { - "@aws-cdk/aws-lambda": "~1.61.1", - "@aws-cdk/aws-s3": "~1.61.1", - "@aws-cdk/core": "~1.61.1", - "@aws-solutions-constructs/core": "~1.61.1", + "@aws-cdk/aws-lambda": "~1.62.0", + "@aws-cdk/aws-s3": "~1.62.0", + "@aws-cdk/core": "~1.62.0", + "@aws-solutions-constructs/core": "~1.62.0", "constructs": "^3.0.4" }, "devDependencies": { - "@aws-cdk/assert": "~1.61.1", + "@aws-cdk/assert": "~1.62.0", "@types/jest": "^24.0.23", "@types/node": "^10.3.0" }, @@ -70,10 +70,10 @@ ] }, "peerDependencies": { - "@aws-cdk/aws-lambda": "~1.61.1", - "@aws-cdk/aws-s3": "~1.61.1", - "@aws-cdk/core": "~1.61.1", - "@aws-solutions-constructs/core": "~1.61.1", + "@aws-cdk/aws-lambda": "~1.62.0", + "@aws-cdk/aws-s3": "~1.62.0", + "@aws-cdk/core": "~1.62.0", + "@aws-solutions-constructs/core": "~1.62.0", "constructs": "^3.0.4" } } diff --git a/source/patterns/@aws-solutions-constructs/aws-lambda-sns/package.json b/source/patterns/@aws-solutions-constructs/aws-lambda-sns/package.json index f9b5a5187..b15cbfaf4 100644 --- a/source/patterns/@aws-solutions-constructs/aws-lambda-sns/package.json +++ b/source/patterns/@aws-solutions-constructs/aws-lambda-sns/package.json @@ -1,6 +1,6 @@ { "name": "@aws-solutions-constructs/aws-lambda-sns", - "version": "1.61.1", + "version": "1.62.0", "description": "CDK constructs for defining an interaction between an AWS Lambda function and an Amazon SNS topic.", "main": "lib/index.js", "types": "lib/index.d.ts", @@ -53,15 +53,15 @@ } }, "dependencies": { - "@aws-cdk/aws-lambda": "~1.61.1", - "@aws-cdk/aws-sns": "~1.61.1", - "@aws-cdk/aws-kms": "~1.61.1", - "@aws-cdk/core": "~1.61.1", - "@aws-solutions-constructs/core": "~1.61.1", + "@aws-cdk/aws-lambda": "~1.62.0", + "@aws-cdk/aws-sns": "~1.62.0", + "@aws-cdk/aws-kms": "~1.62.0", + "@aws-cdk/core": "~1.62.0", + "@aws-solutions-constructs/core": "~1.62.0", "constructs": "^3.0.4" }, "devDependencies": { - "@aws-cdk/assert": "~1.61.1", + "@aws-cdk/assert": "~1.62.0", "@types/jest": "^24.0.23", "@types/node": "^10.3.0" }, @@ -71,11 +71,11 @@ ] }, "peerDependencies": { - "@aws-cdk/aws-lambda": "~1.61.1", - "@aws-cdk/aws-sns": "~1.61.1", - "@aws-cdk/aws-kms": "~1.61.1", - "@aws-cdk/core": "~1.61.1", - "@aws-solutions-constructs/core": "~1.61.1", + "@aws-cdk/aws-lambda": "~1.62.0", + "@aws-cdk/aws-sns": "~1.62.0", + "@aws-cdk/aws-kms": "~1.62.0", + "@aws-cdk/core": "~1.62.0", + "@aws-solutions-constructs/core": "~1.62.0", "constructs": "^3.0.4" } } diff --git a/source/patterns/@aws-solutions-constructs/aws-lambda-sns/test/__snapshots__/lambda-sns.test.js.snap b/source/patterns/@aws-solutions-constructs/aws-lambda-sns/test/__snapshots__/lambda-sns.test.js.snap index 6fa0e4d8d..806f7bc44 100644 --- a/source/patterns/@aws-solutions-constructs/aws-lambda-sns/test/__snapshots__/lambda-sns.test.js.snap +++ b/source/patterns/@aws-solutions-constructs/aws-lambda-sns/test/__snapshots__/lambda-sns.test.js.snap @@ -396,7 +396,26 @@ Object { }, "lambdatosnsstackSnsTopic6292A14A": Object { "Properties": Object { - "KmsMasterKeyId": "alias/aws/sns", + "KmsMasterKeyId": Object { + "Fn::Join": Array [ + "", + Array [ + "arn:", + Object { + "Ref": "AWS::Partition", + }, + ":kms:", + Object { + "Ref": "AWS::Region", + }, + ":", + Object { + "Ref": "AWS::AccountId", + }, + ":alias/aws/sns", + ], + ], + }, }, "Type": "AWS::SNS::Topic", }, diff --git a/source/patterns/@aws-solutions-constructs/aws-lambda-sns/test/integ.deployFunction.expected.json b/source/patterns/@aws-solutions-constructs/aws-lambda-sns/test/integ.deployFunction.expected.json index 1a43f5b27..edac77200 100644 --- a/source/patterns/@aws-solutions-constructs/aws-lambda-sns/test/integ.deployFunction.expected.json +++ b/source/patterns/@aws-solutions-constructs/aws-lambda-sns/test/integ.deployFunction.expected.json @@ -178,7 +178,26 @@ "testlambdasnsSnsTopic57DFED98": { "Type": "AWS::SNS::Topic", "Properties": { - "KmsMasterKeyId": "alias/aws/sns" + "KmsMasterKeyId": { + "Fn::Join": [ + "", + [ + "arn:", + { + "Ref": "AWS::Partition" + }, + ":kms:", + { + "Ref": "AWS::Region" + }, + ":", + { + "Ref": "AWS::AccountId" + }, + ":alias/aws/sns" + ] + ] + } } }, "testlambdasnsSnsTopicPolicy4481ABC3": { diff --git a/source/patterns/@aws-solutions-constructs/aws-lambda-sns/test/integ.existingFunction.expected.json b/source/patterns/@aws-solutions-constructs/aws-lambda-sns/test/integ.existingFunction.expected.json index 8e79d3402..1d3184266 100644 --- a/source/patterns/@aws-solutions-constructs/aws-lambda-sns/test/integ.existingFunction.expected.json +++ b/source/patterns/@aws-solutions-constructs/aws-lambda-sns/test/integ.existingFunction.expected.json @@ -178,7 +178,26 @@ "testlambdasnsSnsTopic57DFED98": { "Type": "AWS::SNS::Topic", "Properties": { - "KmsMasterKeyId": "alias/aws/sns" + "KmsMasterKeyId": { + "Fn::Join": [ + "", + [ + "arn:", + { + "Ref": "AWS::Partition" + }, + ":kms:", + { + "Ref": "AWS::Region" + }, + ":", + { + "Ref": "AWS::AccountId" + }, + ":alias/aws/sns" + ] + ] + } } }, "testlambdasnsSnsTopicPolicy4481ABC3": { diff --git a/source/patterns/@aws-solutions-constructs/aws-lambda-sns/test/lambda-sns.test.ts b/source/patterns/@aws-solutions-constructs/aws-lambda-sns/test/lambda-sns.test.ts index 601abc04a..a16a69656 100644 --- a/source/patterns/@aws-solutions-constructs/aws-lambda-sns/test/lambda-sns.test.ts +++ b/source/patterns/@aws-solutions-constructs/aws-lambda-sns/test/lambda-sns.test.ts @@ -47,7 +47,26 @@ test('Test deployment with new Lambda function', () => { } }); expect(stack).toHaveResource("AWS::SNS::Topic", { - KmsMasterKeyId: "alias/aws/sns" + KmsMasterKeyId: { + "Fn::Join": [ + "", + [ + "arn:", + { + Ref: "AWS::Partition" + }, + ":kms:", + { + Ref: "AWS::Region" + }, + ":", + { + Ref: "AWS::AccountId" + }, + ":alias/aws/sns" + ] + ] + } }); }); diff --git a/source/patterns/@aws-solutions-constructs/aws-lambda-sqs-lambda/package.json b/source/patterns/@aws-solutions-constructs/aws-lambda-sqs-lambda/package.json index 19125510f..aad1dcea8 100755 --- a/source/patterns/@aws-solutions-constructs/aws-lambda-sqs-lambda/package.json +++ b/source/patterns/@aws-solutions-constructs/aws-lambda-sqs-lambda/package.json @@ -1,6 +1,6 @@ { "name": "@aws-solutions-constructs/aws-lambda-sqs-lambda", - "version": "1.61.1", + "version": "1.62.0", "description": "CDK construct that provisions (1) an AWS Lambda function that is configured to send messages to a queue; (2) an Amazon SQS queue; and (3) an AWS Lambda function configured to consume messages from the queue.", "main": "lib/index.js", "types": "lib/index.d.ts", @@ -53,16 +53,16 @@ } }, "dependencies": { - "@aws-cdk/aws-lambda": "~1.61.1", - "@aws-cdk/aws-sqs": "~1.61.1", - "@aws-cdk/core": "~1.61.1", - "@aws-solutions-constructs/core": "~1.61.1", - "@aws-solutions-constructs/aws-lambda-sqs": "~1.61.1", - "@aws-solutions-constructs/aws-sqs-lambda": "~1.61.1", + "@aws-cdk/aws-lambda": "~1.62.0", + "@aws-cdk/aws-sqs": "~1.62.0", + "@aws-cdk/core": "~1.62.0", + "@aws-solutions-constructs/core": "~1.62.0", + "@aws-solutions-constructs/aws-lambda-sqs": "~1.62.0", + "@aws-solutions-constructs/aws-sqs-lambda": "~1.62.0", "constructs": "^3.0.4" }, "devDependencies": { - "@aws-cdk/assert": "~1.61.1", + "@aws-cdk/assert": "~1.62.0", "@types/jest": "^24.0.23", "@types/node": "^10.3.0" }, @@ -72,12 +72,12 @@ ] }, "peerDependencies": { - "@aws-cdk/aws-lambda": "~1.61.1", - "@aws-cdk/aws-sqs": "~1.61.1", - "@aws-cdk/core": "~1.61.1", - "@aws-solutions-constructs/core": "~1.61.1", - "@aws-solutions-constructs/aws-lambda-sqs": "~1.61.1", - "@aws-solutions-constructs/aws-sqs-lambda": "~1.61.1", + "@aws-cdk/aws-lambda": "~1.62.0", + "@aws-cdk/aws-sqs": "~1.62.0", + "@aws-cdk/core": "~1.62.0", + "@aws-solutions-constructs/core": "~1.62.0", + "@aws-solutions-constructs/aws-lambda-sqs": "~1.62.0", + "@aws-solutions-constructs/aws-sqs-lambda": "~1.62.0", "constructs": "^3.0.4" } } diff --git a/source/patterns/@aws-solutions-constructs/aws-lambda-sqs/package.json b/source/patterns/@aws-solutions-constructs/aws-lambda-sqs/package.json index e5fe89f1c..3aef889a8 100755 --- a/source/patterns/@aws-solutions-constructs/aws-lambda-sqs/package.json +++ b/source/patterns/@aws-solutions-constructs/aws-lambda-sqs/package.json @@ -1,6 +1,6 @@ { "name": "@aws-solutions-constructs/aws-lambda-sqs", - "version": "1.61.1", + "version": "1.62.0", "description": "CDK constructs for defining an interaction between an AWS Lambda function and an Amazon SQS queue.", "main": "lib/index.js", "types": "lib/index.d.ts", @@ -53,14 +53,14 @@ } }, "dependencies": { - "@aws-cdk/aws-lambda": "~1.61.1", - "@aws-cdk/aws-sqs": "~1.61.1", - "@aws-cdk/core": "~1.61.1", - "@aws-solutions-constructs/core": "~1.61.1", + "@aws-cdk/aws-lambda": "~1.62.0", + "@aws-cdk/aws-sqs": "~1.62.0", + "@aws-cdk/core": "~1.62.0", + "@aws-solutions-constructs/core": "~1.62.0", "constructs": "^3.0.4" }, "devDependencies": { - "@aws-cdk/assert": "~1.61.1", + "@aws-cdk/assert": "~1.62.0", "@types/jest": "^24.0.23", "@types/node": "^10.3.0" }, @@ -70,10 +70,10 @@ ] }, "peerDependencies": { - "@aws-cdk/aws-lambda": "~1.61.1", - "@aws-cdk/aws-sqs": "~1.61.1", - "@aws-cdk/core": "~1.61.1", - "@aws-solutions-constructs/core": "~1.61.1", + "@aws-cdk/aws-lambda": "~1.62.0", + "@aws-cdk/aws-sqs": "~1.62.0", + "@aws-cdk/core": "~1.62.0", + "@aws-solutions-constructs/core": "~1.62.0", "constructs": "^3.0.4" } } diff --git a/source/patterns/@aws-solutions-constructs/aws-lambda-step-function/package.json b/source/patterns/@aws-solutions-constructs/aws-lambda-step-function/package.json index 3cfb454ac..eeecbe678 100644 --- a/source/patterns/@aws-solutions-constructs/aws-lambda-step-function/package.json +++ b/source/patterns/@aws-solutions-constructs/aws-lambda-step-function/package.json @@ -1,6 +1,6 @@ { "name": "@aws-solutions-constructs/aws-lambda-step-function", - "version": "1.61.1", + "version": "1.62.0", "description": "CDK constructs for defining an interaction between an AWS Lambda function and an AWS Step Function.", "main": "lib/index.js", "types": "lib/index.d.ts", @@ -53,16 +53,16 @@ } }, "dependencies": { - "@aws-cdk/aws-cloudwatch": "~1.61.1", - "@aws-cdk/aws-lambda": "~1.61.1", - "@aws-cdk/aws-stepfunctions": "~1.61.1", - "@aws-cdk/aws-logs": "~1.61.1", - "@aws-cdk/core": "~1.61.1", - "@aws-solutions-constructs/core": "~1.61.1", + "@aws-cdk/aws-cloudwatch": "~1.62.0", + "@aws-cdk/aws-lambda": "~1.62.0", + "@aws-cdk/aws-stepfunctions": "~1.62.0", + "@aws-cdk/aws-logs": "~1.62.0", + "@aws-cdk/core": "~1.62.0", + "@aws-solutions-constructs/core": "~1.62.0", "constructs": "^3.0.4" }, "devDependencies": { - "@aws-cdk/assert": "~1.61.1", + "@aws-cdk/assert": "~1.62.0", "@types/jest": "^24.0.23", "@types/node": "^10.3.0", "eslint-plugin-import": "^2.22.0" @@ -73,12 +73,12 @@ ] }, "peerDependencies": { - "@aws-cdk/aws-cloudwatch": "~1.61.1", - "@aws-cdk/aws-lambda": "~1.61.1", - "@aws-cdk/aws-stepfunctions": "~1.61.1", - "@aws-cdk/core": "~1.61.1", - "@aws-solutions-constructs/core": "~1.61.1", + "@aws-cdk/aws-cloudwatch": "~1.62.0", + "@aws-cdk/aws-lambda": "~1.62.0", + "@aws-cdk/aws-stepfunctions": "~1.62.0", + "@aws-cdk/core": "~1.62.0", + "@aws-solutions-constructs/core": "~1.62.0", "constructs": "^3.0.4", - "@aws-cdk/aws-logs": "~1.61.1" + "@aws-cdk/aws-logs": "~1.62.0" } } diff --git a/source/patterns/@aws-solutions-constructs/aws-s3-lambda/package.json b/source/patterns/@aws-solutions-constructs/aws-s3-lambda/package.json index 91f152cba..20cdcdae9 100644 --- a/source/patterns/@aws-solutions-constructs/aws-s3-lambda/package.json +++ b/source/patterns/@aws-solutions-constructs/aws-s3-lambda/package.json @@ -1,6 +1,6 @@ { "name": "@aws-solutions-constructs/aws-s3-lambda", - "version": "1.61.1", + "version": "1.62.0", "description": "CDK Constructs for AWS S3 to AWS Lambda integration", "main": "lib/index.js", "types": "lib/index.d.ts", @@ -53,17 +53,17 @@ } }, "dependencies": { - "@aws-cdk/aws-s3": "~1.61.1", - "@aws-cdk/aws-s3-notifications": "~1.61.1", - "@aws-cdk/aws-lambda": "~1.61.1", - "@aws-cdk/aws-lambda-event-sources": "~1.61.1", - "@aws-cdk/aws-iam": "~1.61.1", - "@aws-cdk/core": "~1.61.1", - "@aws-solutions-constructs/core": "~1.61.1", + "@aws-cdk/aws-s3": "~1.62.0", + "@aws-cdk/aws-s3-notifications": "~1.62.0", + "@aws-cdk/aws-lambda": "~1.62.0", + "@aws-cdk/aws-lambda-event-sources": "~1.62.0", + "@aws-cdk/aws-iam": "~1.62.0", + "@aws-cdk/core": "~1.62.0", + "@aws-solutions-constructs/core": "~1.62.0", "constructs": "^3.0.4" }, "devDependencies": { - "@aws-cdk/assert": "~1.61.1", + "@aws-cdk/assert": "~1.62.0", "@types/jest": "^24.0.23", "@types/node": "^10.3.0" }, @@ -73,13 +73,13 @@ ] }, "peerDependencies": { - "@aws-cdk/aws-s3": "~1.61.1", - "@aws-cdk/aws-lambda": "~1.61.1", - "@aws-cdk/aws-iam": "~1.61.1", - "@aws-cdk/core": "~1.61.1", - "@aws-solutions-constructs/core": "~1.61.1", - "@aws-cdk/aws-lambda-event-sources": "~1.61.1", - "@aws-cdk/aws-s3-notifications": "~1.61.1", + "@aws-cdk/aws-s3": "~1.62.0", + "@aws-cdk/aws-lambda": "~1.62.0", + "@aws-cdk/aws-iam": "~1.62.0", + "@aws-cdk/core": "~1.62.0", + "@aws-solutions-constructs/core": "~1.62.0", + "@aws-cdk/aws-lambda-event-sources": "~1.62.0", + "@aws-cdk/aws-s3-notifications": "~1.62.0", "constructs": "^3.0.4" } } diff --git a/source/patterns/@aws-solutions-constructs/aws-s3-step-function/package.json b/source/patterns/@aws-solutions-constructs/aws-s3-step-function/package.json index eaace7b04..65d0abca7 100644 --- a/source/patterns/@aws-solutions-constructs/aws-s3-step-function/package.json +++ b/source/patterns/@aws-solutions-constructs/aws-s3-step-function/package.json @@ -1,6 +1,6 @@ { "name": "@aws-solutions-constructs/aws-s3-step-function", - "version": "1.61.1", + "version": "1.62.0", "description": "CDK Constructs for AWS S3 to AWS Step Function integration", "main": "lib/index.js", "types": "lib/index.d.ts", @@ -53,22 +53,22 @@ } }, "dependencies": { - "@aws-cdk/aws-stepfunctions": "~1.61.1", - "@aws-cdk/aws-stepfunctions-tasks": "~1.61.1", - "@aws-cdk/core": "~1.61.1", - "@aws-cdk/aws-s3": "~1.61.1", - "@aws-cdk/aws-iam": "~1.61.1", - "@aws-cdk/aws-lambda": "~1.61.1", - "@aws-cdk/aws-cloudwatch": "~1.61.1", - "@aws-cdk/aws-cloudtrail": "~1.61.1", - "@aws-cdk/aws-events": "~1.61.1", - "@aws-cdk/aws-logs": "~1.61.1", - "@aws-solutions-constructs/core": "~1.61.1", - "@aws-solutions-constructs/aws-events-rule-step-function": "~1.61.1", + "@aws-cdk/aws-stepfunctions": "~1.62.0", + "@aws-cdk/aws-stepfunctions-tasks": "~1.62.0", + "@aws-cdk/core": "~1.62.0", + "@aws-cdk/aws-s3": "~1.62.0", + "@aws-cdk/aws-iam": "~1.62.0", + "@aws-cdk/aws-lambda": "~1.62.0", + "@aws-cdk/aws-cloudwatch": "~1.62.0", + "@aws-cdk/aws-cloudtrail": "~1.62.0", + "@aws-cdk/aws-events": "~1.62.0", + "@aws-cdk/aws-logs": "~1.62.0", + "@aws-solutions-constructs/core": "~1.62.0", + "@aws-solutions-constructs/aws-events-rule-step-function": "~1.62.0", "constructs": "^3.0.4" }, "devDependencies": { - "@aws-cdk/assert": "~1.61.1", + "@aws-cdk/assert": "~1.62.0", "@types/jest": "^24.0.23", "@types/node": "^10.3.0" }, @@ -78,18 +78,18 @@ ] }, "peerDependencies": { - "@aws-cdk/aws-stepfunctions": "~1.61.1", - "@aws-cdk/aws-stepfunctions-tasks": "~1.61.1", - "@aws-cdk/core": "~1.61.1", - "@aws-cdk/aws-s3": "~1.61.1", - "@aws-cdk/aws-iam": "~1.61.1", - "@aws-cdk/aws-lambda": "~1.61.1", - "@aws-cdk/aws-cloudwatch": "~1.61.1", - "@aws-cdk/aws-cloudtrail": "~1.61.1", - "@aws-cdk/aws-events": "~1.61.1", - "@aws-solutions-constructs/core": "~1.61.1", - "@aws-solutions-constructs/aws-events-rule-step-function": "~1.61.1", + "@aws-cdk/aws-stepfunctions": "~1.62.0", + "@aws-cdk/aws-stepfunctions-tasks": "~1.62.0", + "@aws-cdk/core": "~1.62.0", + "@aws-cdk/aws-s3": "~1.62.0", + "@aws-cdk/aws-iam": "~1.62.0", + "@aws-cdk/aws-lambda": "~1.62.0", + "@aws-cdk/aws-cloudwatch": "~1.62.0", + "@aws-cdk/aws-cloudtrail": "~1.62.0", + "@aws-cdk/aws-events": "~1.62.0", + "@aws-solutions-constructs/core": "~1.62.0", + "@aws-solutions-constructs/aws-events-rule-step-function": "~1.62.0", "constructs": "^3.0.4", - "@aws-cdk/aws-logs": "~1.61.1" + "@aws-cdk/aws-logs": "~1.62.0" } } diff --git a/source/patterns/@aws-solutions-constructs/aws-sns-lambda/package.json b/source/patterns/@aws-solutions-constructs/aws-sns-lambda/package.json index 41e2662bb..da28d3fa2 100644 --- a/source/patterns/@aws-solutions-constructs/aws-sns-lambda/package.json +++ b/source/patterns/@aws-solutions-constructs/aws-sns-lambda/package.json @@ -1,6 +1,6 @@ { "name": "@aws-solutions-constructs/aws-sns-lambda", - "version": "1.61.1", + "version": "1.62.0", "description": "CDK Constructs for AWS SNS to AWS Lambda integration", "main": "lib/index.js", "types": "lib/index.d.ts", @@ -53,17 +53,17 @@ } }, "dependencies": { - "@aws-cdk/aws-sns": "~1.61.1", - "@aws-cdk/aws-lambda": "~1.61.1", - "@aws-cdk/aws-lambda-event-sources": "~1.61.1", - "@aws-cdk/aws-iam": "~1.61.1", - "@aws-cdk/aws-kms": "~1.61.1", - "@aws-cdk/core": "~1.61.1", - "@aws-solutions-constructs/core": "~1.61.1", + "@aws-cdk/aws-sns": "~1.62.0", + "@aws-cdk/aws-lambda": "~1.62.0", + "@aws-cdk/aws-lambda-event-sources": "~1.62.0", + "@aws-cdk/aws-iam": "~1.62.0", + "@aws-cdk/aws-kms": "~1.62.0", + "@aws-cdk/core": "~1.62.0", + "@aws-solutions-constructs/core": "~1.62.0", "constructs": "^3.0.4" }, "devDependencies": { - "@aws-cdk/assert": "~1.61.1", + "@aws-cdk/assert": "~1.62.0", "@types/jest": "^24.0.23", "@types/node": "^10.3.0" }, @@ -73,13 +73,13 @@ ] }, "peerDependencies": { - "@aws-cdk/aws-sns": "~1.61.1", - "@aws-cdk/aws-lambda": "~1.61.1", - "@aws-cdk/aws-lambda-event-sources": "~1.61.1", - "@aws-cdk/aws-iam": "~1.61.1", - "@aws-cdk/core": "~1.61.1", - "@aws-solutions-constructs/core": "~1.61.1", - "@aws-cdk/aws-kms": "~1.61.1", + "@aws-cdk/aws-sns": "~1.62.0", + "@aws-cdk/aws-lambda": "~1.62.0", + "@aws-cdk/aws-lambda-event-sources": "~1.62.0", + "@aws-cdk/aws-iam": "~1.62.0", + "@aws-cdk/core": "~1.62.0", + "@aws-solutions-constructs/core": "~1.62.0", + "@aws-cdk/aws-kms": "~1.62.0", "constructs": "^3.0.4" } } diff --git a/source/patterns/@aws-solutions-constructs/aws-sns-lambda/test/__snapshots__/sns-lambda.test.js.snap b/source/patterns/@aws-solutions-constructs/aws-sns-lambda/test/__snapshots__/sns-lambda.test.js.snap index e367fabba..4b7dfbacd 100644 --- a/source/patterns/@aws-solutions-constructs/aws-sns-lambda/test/__snapshots__/sns-lambda.test.js.snap +++ b/source/patterns/@aws-solutions-constructs/aws-sns-lambda/test/__snapshots__/sns-lambda.test.js.snap @@ -208,7 +208,26 @@ Object { }, "testsnslambdaSnsTopic52CA159E": Object { "Properties": Object { - "KmsMasterKeyId": "alias/aws/sns", + "KmsMasterKeyId": Object { + "Fn::Join": Array [ + "", + Array [ + "arn:", + Object { + "Ref": "AWS::Partition", + }, + ":kms:", + Object { + "Ref": "AWS::Region", + }, + ":", + Object { + "Ref": "AWS::AccountId", + }, + ":alias/aws/sns", + ], + ], + }, }, "Type": "AWS::SNS::Topic", }, diff --git a/source/patterns/@aws-solutions-constructs/aws-sns-lambda/test/integ.no-arguments.expected.json b/source/patterns/@aws-solutions-constructs/aws-sns-lambda/test/integ.no-arguments.expected.json index b284885b6..4a36dcab4 100644 --- a/source/patterns/@aws-solutions-constructs/aws-sns-lambda/test/integ.no-arguments.expected.json +++ b/source/patterns/@aws-solutions-constructs/aws-sns-lambda/test/integ.no-arguments.expected.json @@ -193,7 +193,26 @@ "testsnslambdaSnsTopic52CA159E": { "Type": "AWS::SNS::Topic", "Properties": { - "KmsMasterKeyId": "alias/aws/sns" + "KmsMasterKeyId": { + "Fn::Join": [ + "", + [ + "arn:", + { + "Ref": "AWS::Partition" + }, + ":kms:", + { + "Ref": "AWS::Region" + }, + ":", + { + "Ref": "AWS::AccountId" + }, + ":alias/aws/sns" + ] + ] + } } }, "testsnslambdaSnsTopicPolicyDA4647EB": { diff --git a/source/patterns/@aws-solutions-constructs/aws-sns-sqs/package.json b/source/patterns/@aws-solutions-constructs/aws-sns-sqs/package.json index db5febbe1..2a9089ebb 100644 --- a/source/patterns/@aws-solutions-constructs/aws-sns-sqs/package.json +++ b/source/patterns/@aws-solutions-constructs/aws-sns-sqs/package.json @@ -1,6 +1,6 @@ { "name": "@aws-solutions-constructs/aws-sns-sqs", - "version": "1.61.1", + "version": "1.62.0", "description": "CDK constructs for defining an interaction between an Amazon SNS topic and an Amazon SQS queue.", "main": "lib/index.js", "types": "lib/index.d.ts", @@ -53,17 +53,17 @@ } }, "dependencies": { - "@aws-cdk/aws-iam": "~1.61.1", - "@aws-cdk/aws-sns": "~1.61.1", - "@aws-cdk/aws-sqs": "~1.61.1", - "@aws-cdk/aws-sns-subscriptions": "~1.61.1", - "@aws-cdk/aws-kms": "~1.61.1", - "@aws-cdk/core": "~1.61.1", - "@aws-solutions-constructs/core": "~1.61.1", + "@aws-cdk/aws-iam": "~1.62.0", + "@aws-cdk/aws-sns": "~1.62.0", + "@aws-cdk/aws-sqs": "~1.62.0", + "@aws-cdk/aws-sns-subscriptions": "~1.62.0", + "@aws-cdk/aws-kms": "~1.62.0", + "@aws-cdk/core": "~1.62.0", + "@aws-solutions-constructs/core": "~1.62.0", "constructs": "^3.0.4" }, "devDependencies": { - "@aws-cdk/assert": "~1.61.1", + "@aws-cdk/assert": "~1.62.0", "@types/jest": "^24.0.23", "@types/node": "^10.3.0" }, @@ -73,13 +73,13 @@ ] }, "peerDependencies": { - "@aws-cdk/aws-iam": "~1.61.1", - "@aws-cdk/aws-sns": "~1.61.1", - "@aws-cdk/aws-sqs": "~1.61.1", - "@aws-cdk/aws-sns-subscriptions": "~1.61.1", - "@aws-cdk/aws-kms": "~1.61.1", - "@aws-cdk/core": "~1.61.1", - "@aws-solutions-constructs/core": "~1.61.1", + "@aws-cdk/aws-iam": "~1.62.0", + "@aws-cdk/aws-sns": "~1.62.0", + "@aws-cdk/aws-sqs": "~1.62.0", + "@aws-cdk/aws-sns-subscriptions": "~1.62.0", + "@aws-cdk/aws-kms": "~1.62.0", + "@aws-cdk/core": "~1.62.0", + "@aws-solutions-constructs/core": "~1.62.0", "constructs": "^3.0.4" } } diff --git a/source/patterns/@aws-solutions-constructs/aws-sns-sqs/test/__snapshots__/sns-sqs.test.js.snap b/source/patterns/@aws-solutions-constructs/aws-sns-sqs/test/__snapshots__/sns-sqs.test.js.snap index cf07f6261..85a625326 100644 --- a/source/patterns/@aws-solutions-constructs/aws-sns-sqs/test/__snapshots__/sns-sqs.test.js.snap +++ b/source/patterns/@aws-solutions-constructs/aws-sns-sqs/test/__snapshots__/sns-sqs.test.js.snap @@ -69,7 +69,10 @@ Object { "testsnssqsSnsTopic2CD0065B": Object { "Properties": Object { "KmsMasterKeyId": Object { - "Ref": "EncryptionKey1B843E66", + "Fn::GetAtt": Array [ + "EncryptionKey1B843E66", + "Arn", + ], }, }, "Type": "AWS::SNS::Topic", @@ -560,7 +563,26 @@ Object { "Resources": Object { "snstosqsstackSnsTopicB387685B": Object { "Properties": Object { - "KmsMasterKeyId": "alias/aws/sns", + "KmsMasterKeyId": Object { + "Fn::Join": Array [ + "", + Array [ + "arn:", + Object { + "Ref": "AWS::Partition", + }, + ":kms:", + Object { + "Ref": "AWS::Region", + }, + ":", + Object { + "Ref": "AWS::AccountId", + }, + ":alias/aws/sns", + ], + ], + }, }, "Type": "AWS::SNS::Topic", }, @@ -981,7 +1003,10 @@ Object { "snstosqsstackSnsTopicB387685B": Object { "Properties": Object { "KmsMasterKeyId": Object { - "Ref": "importedkey38675D68", + "Fn::GetAtt": Array [ + "importedkey38675D68", + "Arn", + ], }, }, "Type": "AWS::SNS::Topic", diff --git a/source/patterns/@aws-solutions-constructs/aws-sns-sqs/test/integ.existing-kms-key.expected.json b/source/patterns/@aws-solutions-constructs/aws-sns-sqs/test/integ.existing-kms-key.expected.json index e4ef2a160..aafd57c27 100644 --- a/source/patterns/@aws-solutions-constructs/aws-sns-sqs/test/integ.existing-kms-key.expected.json +++ b/source/patterns/@aws-solutions-constructs/aws-sns-sqs/test/integ.existing-kms-key.expected.json @@ -143,7 +143,10 @@ "Type": "AWS::SNS::Topic", "Properties": { "KmsMasterKeyId": { - "Ref": "ImportedEncryptionKeyBE10B2FC" + "Fn::GetAtt": [ + "ImportedEncryptionKeyBE10B2FC", + "Arn" + ] } } }, diff --git a/source/patterns/@aws-solutions-constructs/aws-sns-sqs/test/integ.no-arguments.expected.json b/source/patterns/@aws-solutions-constructs/aws-sns-sqs/test/integ.no-arguments.expected.json index e57c7067a..d835eb482 100644 --- a/source/patterns/@aws-solutions-constructs/aws-sns-sqs/test/integ.no-arguments.expected.json +++ b/source/patterns/@aws-solutions-constructs/aws-sns-sqs/test/integ.no-arguments.expected.json @@ -80,7 +80,10 @@ "Type": "AWS::SNS::Topic", "Properties": { "KmsMasterKeyId": { - "Ref": "EncryptionKey1B843E66" + "Fn::GetAtt": [ + "EncryptionKey1B843E66", + "Arn" + ] } } }, diff --git a/source/patterns/@aws-solutions-constructs/aws-sns-sqs/test/integ.sns-managed-kms-key.expected.json b/source/patterns/@aws-solutions-constructs/aws-sns-sqs/test/integ.sns-managed-kms-key.expected.json index 3408036e3..2782b06b5 100644 --- a/source/patterns/@aws-solutions-constructs/aws-sns-sqs/test/integ.sns-managed-kms-key.expected.json +++ b/source/patterns/@aws-solutions-constructs/aws-sns-sqs/test/integ.sns-managed-kms-key.expected.json @@ -142,7 +142,26 @@ "testsnssqsSnsTopic2CD0065B": { "Type": "AWS::SNS::Topic", "Properties": { - "KmsMasterKeyId": "alias/aws/sns" + "KmsMasterKeyId": { + "Fn::Join": [ + "", + [ + "arn:", + { + "Ref": "AWS::Partition" + }, + ":kms:", + { + "Ref": "AWS::Region" + }, + ":", + { + "Ref": "AWS::AccountId" + }, + ":alias/aws/sns" + ] + ] + } } }, "testsnssqsSnsTopicPolicy604079F2": { diff --git a/source/patterns/@aws-solutions-constructs/aws-sns-sqs/test/sns-sqs.test.ts b/source/patterns/@aws-solutions-constructs/aws-sns-sqs/test/sns-sqs.test.ts index 5d22ec44e..61af7a52c 100644 --- a/source/patterns/@aws-solutions-constructs/aws-sns-sqs/test/sns-sqs.test.ts +++ b/source/patterns/@aws-solutions-constructs/aws-sns-sqs/test/sns-sqs.test.ts @@ -34,7 +34,10 @@ test('Pattern deployment w/ new Topic, new Queue and default props', () => { // Assertion 2 expect(stack).toHaveResource("AWS::SNS::Topic", { KmsMasterKeyId: { - Ref: "EncryptionKey1B843E66" + "Fn::GetAtt": [ + "EncryptionKey1B843E66", + "Arn" + ] } }); // Assertion 3 @@ -88,7 +91,10 @@ test('Pattern deployment w/ new topic, new queue, and overridden props', () => { expect(stack).toHaveResource("AWS::SNS::Topic", { TopicName: "new-topic", KmsMasterKeyId: { - Ref: "EncryptionKey1B843E66" + "Fn::GetAtt": [ + "EncryptionKey1B843E66", + "Arn" + ] } }); // Assertion 2 @@ -179,7 +185,10 @@ test('Test deployment with imported encryption key', () => { // Assertion 3 expect(stack).toHaveResource("AWS::SNS::Topic", { KmsMasterKeyId: { - Ref: "importedkey38675D68" + "Fn::GetAtt": [ + "importedkey38675D68", + "Arn" + ] } }); }); @@ -204,7 +213,26 @@ test('Test deployment with SNS managed KMS key', () => { expect(SynthUtils.toCloudFormation(stack)).toMatchSnapshot(); // Assertion 2 expect(stack).toHaveResource("AWS::SNS::Topic", { - KmsMasterKeyId: "alias/aws/sns" + KmsMasterKeyId: { + "Fn::Join": [ + "", + [ + "arn:", + { + Ref: "AWS::Partition" + }, + ":kms:", + { + Ref: "AWS::Region" + }, + ":", + { + Ref: "AWS::AccountId" + }, + ":alias/aws/sns" + ] + ] + } }); // Assertion 3 expect(stack).toHaveResource("AWS::SQS::Queue", { diff --git a/source/patterns/@aws-solutions-constructs/aws-sqs-lambda/package.json b/source/patterns/@aws-solutions-constructs/aws-sqs-lambda/package.json index d50eb52cb..2271e8cf3 100644 --- a/source/patterns/@aws-solutions-constructs/aws-sqs-lambda/package.json +++ b/source/patterns/@aws-solutions-constructs/aws-sqs-lambda/package.json @@ -1,6 +1,6 @@ { "name": "@aws-solutions-constructs/aws-sqs-lambda", - "version": "1.61.1", + "version": "1.62.0", "description": "CDK constructs for defining an interaction between an Amazon SQS queue and an AWS Lambda function.", "main": "lib/index.js", "types": "lib/index.d.ts", @@ -53,16 +53,16 @@ } }, "dependencies": { - "@aws-cdk/aws-lambda": "~1.61.1", - "@aws-cdk/aws-lambda-event-sources": "~1.61.1", - "@aws-cdk/aws-sqs": "~1.61.1", - "@aws-cdk/aws-kms": "~1.61.1", - "@aws-cdk/core": "~1.61.1", - "@aws-solutions-constructs/core": "~1.61.1", + "@aws-cdk/aws-lambda": "~1.62.0", + "@aws-cdk/aws-lambda-event-sources": "~1.62.0", + "@aws-cdk/aws-sqs": "~1.62.0", + "@aws-cdk/aws-kms": "~1.62.0", + "@aws-cdk/core": "~1.62.0", + "@aws-solutions-constructs/core": "~1.62.0", "constructs": "^3.0.4" }, "devDependencies": { - "@aws-cdk/assert": "~1.61.1", + "@aws-cdk/assert": "~1.62.0", "@types/jest": "^24.0.23", "@types/node": "^10.3.0" }, @@ -72,12 +72,12 @@ ] }, "peerDependencies": { - "@aws-cdk/aws-lambda": "~1.61.1", - "@aws-cdk/aws-lambda-event-sources": "~1.61.1", - "@aws-cdk/aws-sqs": "~1.61.1", - "@aws-cdk/aws-kms": "~1.61.1", - "@aws-cdk/core": "~1.61.1", - "@aws-solutions-constructs/core": "~1.61.1", + "@aws-cdk/aws-lambda": "~1.62.0", + "@aws-cdk/aws-lambda-event-sources": "~1.62.0", + "@aws-cdk/aws-sqs": "~1.62.0", + "@aws-cdk/aws-kms": "~1.62.0", + "@aws-cdk/core": "~1.62.0", + "@aws-solutions-constructs/core": "~1.62.0", "constructs": "^3.0.4" } } diff --git a/source/patterns/@aws-solutions-constructs/core/package.json b/source/patterns/@aws-solutions-constructs/core/package.json index 89ea2da67..31abd009f 100644 --- a/source/patterns/@aws-solutions-constructs/core/package.json +++ b/source/patterns/@aws-solutions-constructs/core/package.json @@ -1,6 +1,6 @@ { "name": "@aws-solutions-constructs/core", - "version": "1.61.1", + "version": "1.62.0", "description": "Core CDK Construct for patterns library", "main": "index.js", "types": "index.ts", @@ -52,28 +52,28 @@ } }, "dependencies": { - "@aws-cdk/aws-cloudfront": "~1.61.1", - "@aws-cdk/aws-cloudfront-origins": "~1.61.1", - "@aws-cdk/aws-dynamodb": "~1.61.1", - "@aws-cdk/aws-iot": "~1.61.1", - "@aws-cdk/aws-kinesis": "~1.61.1", - "@aws-cdk/aws-kinesisanalytics": "~1.61.1", - "@aws-cdk/aws-kinesisfirehose": "~1.61.1", - "@aws-cdk/aws-lambda": "~1.61.1", - "@aws-cdk/aws-lambda-event-sources": "~1.61.1", - "@aws-cdk/aws-logs": "~1.61.1", - "@aws-cdk/aws-s3": "~1.61.1", - "@aws-cdk/aws-sns": "~1.61.1", - "@aws-cdk/aws-sqs": "~1.61.1", - "@aws-cdk/core": "~1.61.1", - "@aws-cdk/aws-iam": "~1.61.1", - "@aws-cdk/aws-apigateway": "~1.61.1", - "@aws-cdk/aws-kms": "~1.61.1", - "@aws-cdk/aws-events": "~1.61.1", - "@aws-cdk/aws-cognito": "~1.61.1", - "@aws-cdk/aws-elasticsearch": "~1.61.1", - "@aws-cdk/aws-cloudwatch": "~1.61.1", - "@aws-cdk/aws-stepfunctions": "~1.61.1", + "@aws-cdk/aws-cloudfront": "~1.62.0", + "@aws-cdk/aws-cloudfront-origins": "~1.62.0", + "@aws-cdk/aws-dynamodb": "~1.62.0", + "@aws-cdk/aws-iot": "~1.62.0", + "@aws-cdk/aws-kinesis": "~1.62.0", + "@aws-cdk/aws-kinesisanalytics": "~1.62.0", + "@aws-cdk/aws-kinesisfirehose": "~1.62.0", + "@aws-cdk/aws-lambda": "~1.62.0", + "@aws-cdk/aws-lambda-event-sources": "~1.62.0", + "@aws-cdk/aws-logs": "~1.62.0", + "@aws-cdk/aws-s3": "~1.62.0", + "@aws-cdk/aws-sns": "~1.62.0", + "@aws-cdk/aws-sqs": "~1.62.0", + "@aws-cdk/core": "~1.62.0", + "@aws-cdk/aws-iam": "~1.62.0", + "@aws-cdk/aws-apigateway": "~1.62.0", + "@aws-cdk/aws-kms": "~1.62.0", + "@aws-cdk/aws-events": "~1.62.0", + "@aws-cdk/aws-cognito": "~1.62.0", + "@aws-cdk/aws-elasticsearch": "~1.62.0", + "@aws-cdk/aws-cloudwatch": "~1.62.0", + "@aws-cdk/aws-stepfunctions": "~1.62.0", "@types/deep-diff": "^1.0.0", "@types/npmlog": "^4.1.2", "deep-diff": "^1.0.2", @@ -81,7 +81,7 @@ "npmlog": "^4.1.2" }, "devDependencies": { - "@aws-cdk/assert": "~1.61.1", + "@aws-cdk/assert": "~1.62.0", "@types/jest": "^24.0.23", "@types/node": "^10.3.0" }, @@ -98,27 +98,27 @@ "@types/deep-diff" ], "peerDependencies": { - "@aws-cdk/aws-cloudfront": "~1.61.1", - "@aws-cdk/aws-dynamodb": "~1.61.1", - "@aws-cdk/aws-iot": "~1.61.1", - "@aws-cdk/aws-kinesis": "~1.61.1", - "@aws-cdk/aws-kinesisanalytics": "~1.61.1", - "@aws-cdk/aws-kinesisfirehose": "~1.61.1", - "@aws-cdk/aws-lambda": "~1.61.1", - "@aws-cdk/aws-lambda-event-sources": "~1.61.1", - "@aws-cdk/aws-logs": "~1.61.1", - "@aws-cdk/aws-s3": "~1.61.1", - "@aws-cdk/aws-sns": "~1.61.1", - "@aws-cdk/aws-sqs": "~1.61.1", - "@aws-cdk/core": "~1.61.1", - "@aws-cdk/aws-iam": "~1.61.1", - "@aws-cdk/aws-apigateway": "~1.61.1", - "@aws-cdk/aws-kms": "~1.61.1", - "@aws-cdk/aws-events": "~1.61.1", - "@aws-cdk/aws-cognito": "~1.61.1", - "@aws-cdk/aws-elasticsearch": "~1.61.1", - "@aws-cdk/aws-cloudwatch": "~1.61.1", - "@aws-cdk/aws-stepfunctions": "~1.61.1", - "@aws-cdk/aws-cloudfront-origins": "~1.61.1" + "@aws-cdk/aws-cloudfront": "~1.62.0", + "@aws-cdk/aws-dynamodb": "~1.62.0", + "@aws-cdk/aws-iot": "~1.62.0", + "@aws-cdk/aws-kinesis": "~1.62.0", + "@aws-cdk/aws-kinesisanalytics": "~1.62.0", + "@aws-cdk/aws-kinesisfirehose": "~1.62.0", + "@aws-cdk/aws-lambda": "~1.62.0", + "@aws-cdk/aws-lambda-event-sources": "~1.62.0", + "@aws-cdk/aws-logs": "~1.62.0", + "@aws-cdk/aws-s3": "~1.62.0", + "@aws-cdk/aws-sns": "~1.62.0", + "@aws-cdk/aws-sqs": "~1.62.0", + "@aws-cdk/core": "~1.62.0", + "@aws-cdk/aws-iam": "~1.62.0", + "@aws-cdk/aws-apigateway": "~1.62.0", + "@aws-cdk/aws-kms": "~1.62.0", + "@aws-cdk/aws-events": "~1.62.0", + "@aws-cdk/aws-cognito": "~1.62.0", + "@aws-cdk/aws-elasticsearch": "~1.62.0", + "@aws-cdk/aws-cloudwatch": "~1.62.0", + "@aws-cdk/aws-stepfunctions": "~1.62.0", + "@aws-cdk/aws-cloudfront-origins": "~1.62.0" } } diff --git a/source/patterns/@aws-solutions-constructs/core/test/__snapshots__/sns-helper.test.js.snap b/source/patterns/@aws-solutions-constructs/core/test/__snapshots__/sns-helper.test.js.snap index f62612e96..e9265b777 100644 --- a/source/patterns/@aws-solutions-constructs/core/test/__snapshots__/sns-helper.test.js.snap +++ b/source/patterns/@aws-solutions-constructs/core/test/__snapshots__/sns-helper.test.js.snap @@ -58,7 +58,10 @@ Object { "SnsTopic2C1570A4": Object { "Properties": Object { "KmsMasterKeyId": Object { - "Ref": "EncryptionKey1B843E66", + "Fn::GetAtt": Array [ + "EncryptionKey1B843E66", + "Arn", + ], }, "TopicName": "custom-topic", }, @@ -155,7 +158,26 @@ Object { "Resources": Object { "SnsTopic2C1570A4": Object { "Properties": Object { - "KmsMasterKeyId": "alias/aws/sns", + "KmsMasterKeyId": Object { + "Fn::Join": Array [ + "", + Array [ + "arn:", + Object { + "Ref": "AWS::Partition", + }, + ":kms:", + Object { + "Ref": "AWS::Region", + }, + ":", + Object { + "Ref": "AWS::AccountId", + }, + ":alias/aws/sns", + ], + ], + }, }, "Type": "AWS::SNS::Topic", }, @@ -303,7 +325,10 @@ Object { "SnsTopic2C1570A4": Object { "Properties": Object { "KmsMasterKeyId": Object { - "Ref": "EncryptionKey1B843E66", + "Fn::GetAtt": Array [ + "EncryptionKey1B843E66", + "Arn", + ], }, "TopicName": "custom-topic", }, diff --git a/source/patterns/@aws-solutions-constructs/core/test/sns-helper.test.ts b/source/patterns/@aws-solutions-constructs/core/test/sns-helper.test.ts index 4ff505d9f..293a85da7 100644 --- a/source/patterns/@aws-solutions-constructs/core/test/sns-helper.test.ts +++ b/source/patterns/@aws-solutions-constructs/core/test/sns-helper.test.ts @@ -29,7 +29,26 @@ test('Test deployment with no properties using AWS Managed KMS Key', () => { expect(SynthUtils.toCloudFormation(stack)).toMatchSnapshot(); // Assertion 2 expect(stack).toHaveResource("AWS::SNS::Topic", { - KmsMasterKeyId: "alias/aws/sns" + KmsMasterKeyId: { + "Fn::Join": [ + "", + [ + "arn:", + { + Ref: "AWS::Partition" + }, + ":kms:", + { + Ref: "AWS::Region" + }, + ":", + { + Ref: "AWS::AccountId" + }, + ":alias/aws/sns" + ] + ] + } }); }); @@ -79,7 +98,10 @@ test('Test deployment w/ imported encryption key', () => { // Assertion 2 expect(stack).toHaveResource("AWS::SNS::Topic", { KmsMasterKeyId: { - Ref: "EncryptionKey1B843E66" + "Fn::GetAtt": [ + "EncryptionKey1B843E66", + "Arn" + ] }, TopicName: "custom-topic" }); diff --git a/source/tools/cdk-integ-tools/package.json b/source/tools/cdk-integ-tools/package.json index 22b4ba6df..fb4ef08a6 100644 --- a/source/tools/cdk-integ-tools/package.json +++ b/source/tools/cdk-integ-tools/package.json @@ -31,9 +31,9 @@ "typescript": "~3.7.4" }, "dependencies": { - "@aws-cdk/cloudformation-diff": "~1.61.1", - "@aws-cdk/cx-api": "~1.61.1", - "aws-cdk": "~1.61.1", + "@aws-cdk/cloudformation-diff": "~1.62.0", + "@aws-cdk/cx-api": "~1.62.0", + "aws-cdk": "~1.62.0", "fs-extra": "^8.1.0", "yargs": "^15.1.0" }, diff --git a/source/use_cases/aws-s3-static-website/package.json b/source/use_cases/aws-s3-static-website/package.json index 48d72bc22..23b88b178 100644 --- a/source/use_cases/aws-s3-static-website/package.json +++ b/source/use_cases/aws-s3-static-website/package.json @@ -1,6 +1,6 @@ { "name": "@aws-solutions-constructs/aws-s3-static-website", - "version": "1.61.1", + "version": "1.62.0", "description": "Use case pattern for deploying a S3 static website.", "main": "lib/index.js", "types": "lib/index.d.ts", @@ -28,19 +28,19 @@ "build+lint+test": "npm run build && npm run lint && npm test && npm run integ-assert" }, "dependencies": { - "@aws-solutions-constructs/aws-cloudfront-s3": "~1.61.1", - "@aws-cdk/core": "~1.61.1", - "@aws-cdk/aws-lambda": "~1.61.1", - "@aws-cdk/aws-cloudfront": "~1.61.1", - "@aws-cdk/aws-s3": "~1.61.1", - "@aws-cdk/custom-resources": "~1.61.1", - "@aws-cdk/aws-cloudformation": "~1.61.1", - "@aws-cdk/aws-iam": "~1.61.1", - "@aws-solutions-constructs/core": "~1.61.1", + "@aws-solutions-constructs/aws-cloudfront-s3": "~1.62.0", + "@aws-cdk/core": "~1.62.0", + "@aws-cdk/aws-lambda": "~1.62.0", + "@aws-cdk/aws-cloudfront": "~1.62.0", + "@aws-cdk/aws-s3": "~1.62.0", + "@aws-cdk/custom-resources": "~1.62.0", + "@aws-cdk/aws-cloudformation": "~1.62.0", + "@aws-cdk/aws-iam": "~1.62.0", + "@aws-solutions-constructs/core": "~1.62.0", "source-map-support": "^0.5.16" }, "devDependencies": { - "@aws-cdk/assert": "~1.61.1", + "@aws-cdk/assert": "~1.62.0", "@types/jest": "^24.0.23", "@types/node": "^10.3.0" }, diff --git a/source/use_cases/aws-serverless-image-handler/package.json b/source/use_cases/aws-serverless-image-handler/package.json index 6fcb2bd03..fcee1f388 100644 --- a/source/use_cases/aws-serverless-image-handler/package.json +++ b/source/use_cases/aws-serverless-image-handler/package.json @@ -1,6 +1,6 @@ { "name": "@aws-solutions-constructs/aws-serverless-image-handler", - "version": "1.61.1", + "version": "1.62.0", "description": "Use case pattern for deploying a serverless image handler API.", "main": "lib/index.js", "types": "lib/index.d.ts", @@ -53,18 +53,18 @@ } }, "dependencies": { - "@aws-cdk/aws-apigateway": "~1.61.1", - "@aws-cdk/aws-cloudfront": "~1.61.1", - "@aws-cdk/aws-iam": "~1.61.1", - "@aws-cdk/aws-lambda": "~1.61.1", - "@aws-cdk/aws-s3": "~1.61.1", - "@aws-cdk/core": "~1.61.1", - "@aws-solutions-constructs/aws-cloudfront-apigateway-lambda": "~1.61.1", - "@aws-solutions-constructs/aws-lambda-s3": "~1.61.1", - "@aws-solutions-constructs/core": "~1.61.1" + "@aws-cdk/aws-apigateway": "~1.62.0", + "@aws-cdk/aws-cloudfront": "~1.62.0", + "@aws-cdk/aws-iam": "~1.62.0", + "@aws-cdk/aws-lambda": "~1.62.0", + "@aws-cdk/aws-s3": "~1.62.0", + "@aws-cdk/core": "~1.62.0", + "@aws-solutions-constructs/aws-cloudfront-apigateway-lambda": "~1.62.0", + "@aws-solutions-constructs/aws-lambda-s3": "~1.62.0", + "@aws-solutions-constructs/core": "~1.62.0" }, "devDependencies": { - "@aws-cdk/assert": "~1.61.1", + "@aws-cdk/assert": "~1.62.0", "@types/jest": "^24.0.23", "@types/node": "^10.3.0" }, @@ -74,14 +74,14 @@ ] }, "peerDependencies": { - "@aws-solutions-constructs/aws-cloudfront-apigateway-lambda": "~1.61.1", - "@aws-solutions-constructs/aws-lambda-s3": "~1.61.1", - "@aws-cdk/core": "~1.61.1", - "@aws-cdk/aws-lambda": "~1.61.1", - "@aws-cdk/aws-apigateway": "~1.61.1", - "@aws-cdk/aws-cloudfront": "~1.61.1", - "@aws-cdk/aws-s3": "~1.61.1", - "@aws-solutions-constructs/core": "~1.61.1", - "@aws-cdk/aws-iam": "~1.61.1" + "@aws-solutions-constructs/aws-cloudfront-apigateway-lambda": "~1.62.0", + "@aws-solutions-constructs/aws-lambda-s3": "~1.62.0", + "@aws-cdk/core": "~1.62.0", + "@aws-cdk/aws-lambda": "~1.62.0", + "@aws-cdk/aws-apigateway": "~1.62.0", + "@aws-cdk/aws-cloudfront": "~1.62.0", + "@aws-cdk/aws-s3": "~1.62.0", + "@aws-solutions-constructs/core": "~1.62.0", + "@aws-cdk/aws-iam": "~1.62.0" } } diff --git a/source/use_cases/aws-serverless-web-app/package.json b/source/use_cases/aws-serverless-web-app/package.json index bfecdaad3..bc4ae6247 100644 --- a/source/use_cases/aws-serverless-web-app/package.json +++ b/source/use_cases/aws-serverless-web-app/package.json @@ -1,6 +1,6 @@ { "name": "@aws-solutions-constructs/aws-serverless-web-app", - "version": "1.61.1", + "version": "1.62.0", "description": "Use case pattern for deploying a serverless web app.", "main": "lib/index.js", "types": "lib/index.d.ts", @@ -28,24 +28,24 @@ "build+lint+test": "npm run build && npm run lint && npm test && npm run integ-assert" }, "dependencies": { - "@aws-solutions-constructs/aws-cloudfront-s3": "~1.61.1", - "@aws-solutions-constructs/aws-cognito-apigateway-lambda": "~1.61.1", - "@aws-solutions-constructs/aws-lambda-dynamodb": "~1.61.1", - "@aws-cdk/core": "~1.61.1", - "@aws-cdk/aws-lambda": "~1.61.1", - "@aws-cdk/aws-cloudfront": "~1.61.1", - "@aws-cdk/aws-s3": "~1.61.1", - "@aws-cdk/custom-resources": "~1.61.1", - "@aws-cdk/aws-cloudformation": "~1.61.1", - "@aws-cdk/aws-iam": "~1.61.1", - "@aws-cdk/aws-cognito": "~1.61.1", - "@aws-cdk/aws-apigateway": "~1.61.1", - "@aws-cdk/aws-dynamodb": "~1.61.1", - "@aws-solutions-constructs/core": "~1.61.1", + "@aws-solutions-constructs/aws-cloudfront-s3": "~1.62.0", + "@aws-solutions-constructs/aws-cognito-apigateway-lambda": "~1.62.0", + "@aws-solutions-constructs/aws-lambda-dynamodb": "~1.62.0", + "@aws-cdk/core": "~1.62.0", + "@aws-cdk/aws-lambda": "~1.62.0", + "@aws-cdk/aws-cloudfront": "~1.62.0", + "@aws-cdk/aws-s3": "~1.62.0", + "@aws-cdk/custom-resources": "~1.62.0", + "@aws-cdk/aws-cloudformation": "~1.62.0", + "@aws-cdk/aws-iam": "~1.62.0", + "@aws-cdk/aws-cognito": "~1.62.0", + "@aws-cdk/aws-apigateway": "~1.62.0", + "@aws-cdk/aws-dynamodb": "~1.62.0", + "@aws-solutions-constructs/core": "~1.62.0", "source-map-support": "^0.5.16" }, "devDependencies": { - "@aws-cdk/assert": "~1.61.1", + "@aws-cdk/assert": "~1.62.0", "@types/jest": "^24.0.23", "@types/node": "^10.3.0" },