diff --git a/source/patterns/@aws-solutions-constructs/aws-eventbridge-sqs/lib/index.ts b/source/patterns/@aws-solutions-constructs/aws-eventbridge-sqs/lib/index.ts index 91cef2825..0cb89af0b 100644 --- a/source/patterns/@aws-solutions-constructs/aws-eventbridge-sqs/lib/index.ts +++ b/source/patterns/@aws-solutions-constructs/aws-eventbridge-sqs/lib/index.ts @@ -13,6 +13,7 @@ import * as sqs from 'aws-cdk-lib/aws-sqs'; import * as events from 'aws-cdk-lib/aws-events'; +import * as eventtargets from 'aws-cdk-lib/aws-events-targets'; import * as kms from 'aws-cdk-lib/aws-kms'; import * as defaults from '@aws-solutions-constructs/core'; import { ServicePrincipal } from 'aws-cdk-lib/aws-iam'; @@ -42,6 +43,15 @@ export interface EventbridgeToSqsProps { * @default - None */ readonly eventRuleProps: events.RuleProps; + /** + * Whether to deploy a DLQ for the Rule itself + * (this DLQ is would receive messages that can't be delivered to + * the target SQS queue)) + * + * This is new, so defaulting to false to avoid surprising existing clients + * @default - false + */ + readonly deployRuleDlq?: boolean; /** * Existing instance of SQS queue object, providing both this and queueProps will cause an error. * @@ -105,6 +115,7 @@ export class EventbridgeToSqs extends Construct { public readonly eventBus?: events.IEventBus; public readonly eventsRule: events.Rule; public readonly encryptionKey?: kms.IKey; + public readonly eventRuleDlq?: sqs.Queue; /** * @summary Constructs a new instance of the EventbridgeToSqs class. @@ -140,12 +151,19 @@ export class EventbridgeToSqs extends Construct { this.encryptionKey = buildQueueResponse.key; this.deadLetterQueue = buildQueueResponse.dlq; - const sqsEventTarget: events.IRuleTarget = { - bind: () => ({ - id: this.sqsQueue.queueName, - arn: this.sqsQueue.queueArn - }) - }; + let sqsEventTargetProps: eventtargets.SqsQueueProps = {}; + + if (defaults.CheckBooleanWithDefault(props.deployRuleDlq, false)) { + this.eventRuleDlq = defaults.buildQueue(this, 'ruleDlq', { + deployDeadLetterQueue: false, + enableEncryptionWithCustomerManagedKey: enableEncryptionParam, + encryptionKey: this.encryptionKey, + }).queue; + + sqsEventTargetProps = defaults.consolidateProps(sqsEventTargetProps, { deadLetterQueue: this.eventRuleDlq }); + } + + const sqsEventTarget = new eventtargets.SqsQueue(this.sqsQueue, sqsEventTargetProps); // build an event bus if existingEventBus is provided or eventBusProps are provided this.eventBus = defaults.buildEventBus(this, { @@ -163,7 +181,5 @@ export class EventbridgeToSqs extends Construct { this.sqsQueue.grantPurge(new ServicePrincipal('events.amazonaws.com')); } - // 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-eventbridge-sqs/test/eventbridge-sqs-queue.test.ts b/source/patterns/@aws-solutions-constructs/aws-eventbridge-sqs/test/eventbridge-sqs-queue.test.ts index 740f2c685..d5992d5df 100644 --- a/source/patterns/@aws-solutions-constructs/aws-eventbridge-sqs/test/eventbridge-sqs-queue.test.ts +++ b/source/patterns/@aws-solutions-constructs/aws-eventbridge-sqs/test/eventbridge-sqs-queue.test.ts @@ -15,7 +15,7 @@ import * as cdk from 'aws-cdk-lib'; import { EventbridgeToSqs, EventbridgeToSqsProps } from '../lib'; import * as events from "aws-cdk-lib/aws-events"; import * as sqs from "aws-cdk-lib/aws-sqs"; -import { Template } from 'aws-cdk-lib/assertions'; +import { Match, Template } from 'aws-cdk-lib/assertions'; import * as defaults from '@aws-solutions-constructs/core'; function deployNewStack(stack: cdk.Stack) { @@ -495,7 +495,7 @@ test('Queue purging flag grants correct permissions', () => { }, { Action: [ - "sqs:PurgeQueue", + "sqs:SendMessage", "sqs:GetQueueAttributes", "sqs:GetQueueUrl" ], @@ -512,7 +512,7 @@ test('Queue purging flag grants correct permissions', () => { }, { Action: [ - "sqs:SendMessage", + "sqs:PurgeQueue", "sqs:GetQueueAttributes", "sqs:GetQueueUrl" ], @@ -559,3 +559,51 @@ test('check that CheckSqsProps is being called', () => { }; expect(app).toThrowError("Error - Either provide queueProps or existingQueueObj, but not both.\n"); }); + +test.only('Check that rule dlq is not created by default', () => { + const stack = new cdk.Stack(); + const props: EventbridgeToSqsProps = { + eventRuleProps: { + schedule: events.Schedule.rate(cdk.Duration.minutes(5)) + } + }; + new EventbridgeToSqs(stack, 'test-eventbridge-sqs', props); + const template = Template.fromStack(stack); + template.resourceCountIs("AWS::SQS::Queue", 2); + template.hasResourceProperties("AWS::Events::Rule", { + Targets: [ + { + Id: "Target0", + DeadLetterConfig: Match.absent(), + } + ] + }); +}); + +test.only('Check that rule dlq is created when requested', () => { + const stack = new cdk.Stack(); + const props: EventbridgeToSqsProps = { + eventRuleProps: { + schedule: events.Schedule.rate(cdk.Duration.minutes(5)) + }, + deployRuleDlq: true + }; + new EventbridgeToSqs(stack, 'test-eventbridge-sqs', props); + const template = Template.fromStack(stack); + template.resourceCountIs("AWS::SQS::Queue", 3); + template.hasResourceProperties("AWS::Events::Rule", { + Targets: [ + { + Id: "Target0", + DeadLetterConfig: { + Arn: { + "Fn::GetAtt": [ + Match.stringLikeRegexp("testeventbridgesqsruleDlq.*"), + "Arn" + ] + } + }, + } + ] + }); +}); diff --git a/source/patterns/@aws-solutions-constructs/aws-eventbridge-sqs/test/integ.evtsqs-exist-bus.js.snapshot/cdk.out b/source/patterns/@aws-solutions-constructs/aws-eventbridge-sqs/test/integ.evtsqs-exist-bus.js.snapshot/cdk.out index 1f0068d32..91e1a8b99 100644 --- a/source/patterns/@aws-solutions-constructs/aws-eventbridge-sqs/test/integ.evtsqs-exist-bus.js.snapshot/cdk.out +++ b/source/patterns/@aws-solutions-constructs/aws-eventbridge-sqs/test/integ.evtsqs-exist-bus.js.snapshot/cdk.out @@ -1 +1 @@ -{"version":"36.0.0"} \ No newline at end of file +{"version":"39.0.0"} \ No newline at end of file diff --git a/source/patterns/@aws-solutions-constructs/aws-eventbridge-sqs/test/integ.evtsqs-exist-bus.js.snapshot/evtsqs-exist-bus.assets.json b/source/patterns/@aws-solutions-constructs/aws-eventbridge-sqs/test/integ.evtsqs-exist-bus.js.snapshot/evtsqs-exist-bus.assets.json index f880b5c10..0621d16cb 100644 --- a/source/patterns/@aws-solutions-constructs/aws-eventbridge-sqs/test/integ.evtsqs-exist-bus.js.snapshot/evtsqs-exist-bus.assets.json +++ b/source/patterns/@aws-solutions-constructs/aws-eventbridge-sqs/test/integ.evtsqs-exist-bus.js.snapshot/evtsqs-exist-bus.assets.json @@ -1,7 +1,7 @@ { - "version": "36.0.0", + "version": "39.0.0", "files": { - "7af5ea5f919ee11dba0f3d6b1c862aaeb33516536f0772e7558e77a6bf765846": { + "9acaa89ceee5e5b8ab6d77a48e9ba3aaa89df75c8f22ffdbeccaf7ef4ef6a3fd": { "source": { "path": "evtsqs-exist-bus.template.json", "packaging": "file" @@ -9,7 +9,7 @@ "destinations": { "current_account-current_region": { "bucketName": "cdk-hnb659fds-assets-${AWS::AccountId}-${AWS::Region}", - "objectKey": "7af5ea5f919ee11dba0f3d6b1c862aaeb33516536f0772e7558e77a6bf765846.json", + "objectKey": "9acaa89ceee5e5b8ab6d77a48e9ba3aaa89df75c8f22ffdbeccaf7ef4ef6a3fd.json", "assumeRoleArn": "arn:${AWS::Partition}:iam::${AWS::AccountId}:role/cdk-hnb659fds-file-publishing-role-${AWS::AccountId}-${AWS::Region}" } } diff --git a/source/patterns/@aws-solutions-constructs/aws-eventbridge-sqs/test/integ.evtsqs-exist-bus.js.snapshot/evtsqs-exist-bus.template.json b/source/patterns/@aws-solutions-constructs/aws-eventbridge-sqs/test/integ.evtsqs-exist-bus.js.snapshot/evtsqs-exist-bus.template.json index 8ededeea2..d50b82aeb 100644 --- a/source/patterns/@aws-solutions-constructs/aws-eventbridge-sqs/test/integ.evtsqs-exist-bus.js.snapshot/evtsqs-exist-bus.template.json +++ b/source/patterns/@aws-solutions-constructs/aws-eventbridge-sqs/test/integ.evtsqs-exist-bus.js.snapshot/evtsqs-exist-bus.template.json @@ -36,6 +36,13 @@ "kms:GenerateDataKey*", "kms:ReEncrypt*" ], + "Condition": { + "StringEquals": { + "aws:SourceAccount": { + "Ref": "AWS::AccountId" + } + } + }, "Effect": "Allow", "Principal": { "Service": "events.amazonaws.com" @@ -73,6 +80,13 @@ "sqs:GetQueueUrl", "sqs:SendMessage" ], + "Condition": { + "StringEquals": { + "aws:SourceAccount": { + "Ref": "AWS::AccountId" + } + } + }, "Effect": "Allow", "Principal": { "Service": "events.amazonaws.com" @@ -120,12 +134,7 @@ "Arn" ] }, - "Id": { - "Fn::GetAtt": [ - "MyQueueE6CA6235", - "QueueName" - ] - } + "Id": "Target0" } ] } diff --git a/source/patterns/@aws-solutions-constructs/aws-eventbridge-sqs/test/integ.evtsqs-exist-bus.js.snapshot/evtsqsexistbusIntegDefaultTestDeployAssertD6166996.assets.json b/source/patterns/@aws-solutions-constructs/aws-eventbridge-sqs/test/integ.evtsqs-exist-bus.js.snapshot/evtsqsexistbusIntegDefaultTestDeployAssertD6166996.assets.json index 9c468a598..ae3defb2a 100644 --- a/source/patterns/@aws-solutions-constructs/aws-eventbridge-sqs/test/integ.evtsqs-exist-bus.js.snapshot/evtsqsexistbusIntegDefaultTestDeployAssertD6166996.assets.json +++ b/source/patterns/@aws-solutions-constructs/aws-eventbridge-sqs/test/integ.evtsqs-exist-bus.js.snapshot/evtsqsexistbusIntegDefaultTestDeployAssertD6166996.assets.json @@ -1,5 +1,5 @@ { - "version": "36.0.0", + "version": "39.0.0", "files": { "21fbb51d7b23f6a6c262b46a9caee79d744a3ac019fd45422d988b96d44b2a22": { "source": { diff --git a/source/patterns/@aws-solutions-constructs/aws-eventbridge-sqs/test/integ.evtsqs-exist-bus.js.snapshot/integ.json b/source/patterns/@aws-solutions-constructs/aws-eventbridge-sqs/test/integ.evtsqs-exist-bus.js.snapshot/integ.json index 94d0fe401..4d0df763d 100644 --- a/source/patterns/@aws-solutions-constructs/aws-eventbridge-sqs/test/integ.evtsqs-exist-bus.js.snapshot/integ.json +++ b/source/patterns/@aws-solutions-constructs/aws-eventbridge-sqs/test/integ.evtsqs-exist-bus.js.snapshot/integ.json @@ -1,5 +1,5 @@ { - "version": "36.0.0", + "version": "39.0.0", "testCases": { "evtsqs-exist-bus/Integ/DefaultTest": { "stacks": [ diff --git a/source/patterns/@aws-solutions-constructs/aws-eventbridge-sqs/test/integ.evtsqs-exist-bus.js.snapshot/manifest.json b/source/patterns/@aws-solutions-constructs/aws-eventbridge-sqs/test/integ.evtsqs-exist-bus.js.snapshot/manifest.json index e84d8803e..f117325a8 100644 --- a/source/patterns/@aws-solutions-constructs/aws-eventbridge-sqs/test/integ.evtsqs-exist-bus.js.snapshot/manifest.json +++ b/source/patterns/@aws-solutions-constructs/aws-eventbridge-sqs/test/integ.evtsqs-exist-bus.js.snapshot/manifest.json @@ -1,5 +1,5 @@ { - "version": "36.0.0", + "version": "39.0.0", "artifacts": { "evtsqsexistbusIntegDefaultTestDeployAssertD6166996.assets": { "type": "cdk:asset-manifest", @@ -66,7 +66,7 @@ "validateOnSynth": false, "assumeRoleArn": "arn:${AWS::Partition}:iam::${AWS::AccountId}:role/cdk-hnb659fds-deploy-role-${AWS::AccountId}-${AWS::Region}", "cloudFormationExecutionRoleArn": "arn:${AWS::Partition}:iam::${AWS::AccountId}:role/cdk-hnb659fds-cfn-exec-role-${AWS::AccountId}-${AWS::Region}", - "stackTemplateAssetObjectUrl": "s3://cdk-hnb659fds-assets-${AWS::AccountId}-${AWS::Region}/7af5ea5f919ee11dba0f3d6b1c862aaeb33516536f0772e7558e77a6bf765846.json", + "stackTemplateAssetObjectUrl": "s3://cdk-hnb659fds-assets-${AWS::AccountId}-${AWS::Region}/9acaa89ceee5e5b8ab6d77a48e9ba3aaa89df75c8f22ffdbeccaf7ef4ef6a3fd.json", "requiresBootstrapStackVersion": 6, "bootstrapStackVersionSsmParameter": "/cdk-bootstrap/hnb659fds/version", "additionalDependencies": [ diff --git a/source/patterns/@aws-solutions-constructs/aws-eventbridge-sqs/test/integ.evtsqs-exist-bus.js.snapshot/tree.json b/source/patterns/@aws-solutions-constructs/aws-eventbridge-sqs/test/integ.evtsqs-exist-bus.js.snapshot/tree.json index 564f0ddd7..433fab91c 100644 --- a/source/patterns/@aws-solutions-constructs/aws-eventbridge-sqs/test/integ.evtsqs-exist-bus.js.snapshot/tree.json +++ b/source/patterns/@aws-solutions-constructs/aws-eventbridge-sqs/test/integ.evtsqs-exist-bus.js.snapshot/tree.json @@ -51,6 +51,13 @@ "kms:GenerateDataKey*", "kms:ReEncrypt*" ], + "Condition": { + "StringEquals": { + "aws:SourceAccount": { + "Ref": "AWS::AccountId" + } + } + }, "Effect": "Allow", "Principal": { "Service": "events.amazonaws.com" @@ -64,13 +71,13 @@ }, "constructInfo": { "fqn": "aws-cdk-lib.aws_kms.CfnKey", - "version": "2.118.0" + "version": "2.175.1" } } }, "constructInfo": { "fqn": "aws-cdk-lib.aws_kms.Key", - "version": "2.118.0" + "version": "2.175.1" } }, "MyQueue": { @@ -93,7 +100,7 @@ }, "constructInfo": { "fqn": "aws-cdk-lib.aws_sqs.CfnQueue", - "version": "2.118.0" + "version": "2.175.1" } }, "Policy": { @@ -114,6 +121,13 @@ "sqs:GetQueueUrl", "sqs:SendMessage" ], + "Condition": { + "StringEquals": { + "aws:SourceAccount": { + "Ref": "AWS::AccountId" + } + } + }, "Effect": "Allow", "Principal": { "Service": "events.amazonaws.com" @@ -137,19 +151,19 @@ }, "constructInfo": { "fqn": "aws-cdk-lib.aws_sqs.CfnQueuePolicy", - "version": "2.118.0" + "version": "2.175.1" } } }, "constructInfo": { "fqn": "aws-cdk-lib.aws_sqs.QueuePolicy", - "version": "2.118.0" + "version": "2.175.1" } } }, "constructInfo": { "fqn": "aws-cdk-lib.aws_sqs.Queue", - "version": "2.118.0" + "version": "2.175.1" } }, "existing-event-bus": { @@ -167,13 +181,13 @@ }, "constructInfo": { "fqn": "aws-cdk-lib.aws_events.CfnEventBus", - "version": "2.118.0" + "version": "2.175.1" } } }, "constructInfo": { "fqn": "aws-cdk-lib.aws_events.EventBus", - "version": "2.118.0" + "version": "2.175.1" } }, "construct": { @@ -201,12 +215,7 @@ "state": "ENABLED", "targets": [ { - "id": { - "Fn::GetAtt": [ - "MyQueueE6CA6235", - "QueueName" - ] - }, + "id": "Target0", "arn": { "Fn::GetAtt": [ "MyQueueE6CA6235", @@ -219,19 +228,19 @@ }, "constructInfo": { "fqn": "aws-cdk-lib.aws_events.CfnRule", - "version": "2.118.0" + "version": "2.175.1" } } }, "constructInfo": { "fqn": "aws-cdk-lib.aws_events.Rule", - "version": "2.118.0" + "version": "2.175.1" } } }, "constructInfo": { - "fqn": "@aws-solutions-constructs/aws-eventbridge-sqs.EventbridgeToSqs", - "version": "2.50.0" + "fqn": "constructs.Construct", + "version": "10.4.2" } }, "Integ": { @@ -247,7 +256,7 @@ "path": "evtsqs-exist-bus/Integ/DefaultTest/Default", "constructInfo": { "fqn": "constructs.Construct", - "version": "10.0.0" + "version": "10.4.2" } }, "DeployAssert": { @@ -259,7 +268,7 @@ "path": "evtsqs-exist-bus/Integ/DefaultTest/DeployAssert/BootstrapVersion", "constructInfo": { "fqn": "aws-cdk-lib.CfnParameter", - "version": "2.118.0" + "version": "2.175.1" } }, "CheckBootstrapVersion": { @@ -267,25 +276,25 @@ "path": "evtsqs-exist-bus/Integ/DefaultTest/DeployAssert/CheckBootstrapVersion", "constructInfo": { "fqn": "aws-cdk-lib.CfnRule", - "version": "2.118.0" + "version": "2.175.1" } } }, "constructInfo": { "fqn": "aws-cdk-lib.Stack", - "version": "2.118.0" + "version": "2.175.1" } } }, "constructInfo": { "fqn": "@aws-cdk/integ-tests-alpha.IntegTestCase", - "version": "2.118.0-alpha.0" + "version": "2.175.1-alpha.0" } } }, "constructInfo": { "fqn": "@aws-cdk/integ-tests-alpha.IntegTest", - "version": "2.118.0-alpha.0" + "version": "2.175.1-alpha.0" } }, "BootstrapVersion": { @@ -293,7 +302,7 @@ "path": "evtsqs-exist-bus/BootstrapVersion", "constructInfo": { "fqn": "aws-cdk-lib.CfnParameter", - "version": "2.118.0" + "version": "2.175.1" } }, "CheckBootstrapVersion": { @@ -301,13 +310,13 @@ "path": "evtsqs-exist-bus/CheckBootstrapVersion", "constructInfo": { "fqn": "aws-cdk-lib.CfnRule", - "version": "2.118.0" + "version": "2.175.1" } } }, "constructInfo": { "fqn": "aws-cdk-lib.Stack", - "version": "2.118.0" + "version": "2.175.1" } }, "Tree": { @@ -315,13 +324,13 @@ "path": "Tree", "constructInfo": { "fqn": "constructs.Construct", - "version": "10.0.0" + "version": "10.4.2" } } }, "constructInfo": { "fqn": "aws-cdk-lib.App", - "version": "2.118.0" + "version": "2.175.1" } } } \ No newline at end of file diff --git a/source/patterns/@aws-solutions-constructs/aws-eventbridge-sqs/test/integ.evtsqs-exist-queue.js.snapshot/cdk.out b/source/patterns/@aws-solutions-constructs/aws-eventbridge-sqs/test/integ.evtsqs-exist-queue.js.snapshot/cdk.out index 1f0068d32..91e1a8b99 100644 --- a/source/patterns/@aws-solutions-constructs/aws-eventbridge-sqs/test/integ.evtsqs-exist-queue.js.snapshot/cdk.out +++ b/source/patterns/@aws-solutions-constructs/aws-eventbridge-sqs/test/integ.evtsqs-exist-queue.js.snapshot/cdk.out @@ -1 +1 @@ -{"version":"36.0.0"} \ No newline at end of file +{"version":"39.0.0"} \ No newline at end of file diff --git a/source/patterns/@aws-solutions-constructs/aws-eventbridge-sqs/test/integ.evtsqs-exist-queue.js.snapshot/evtsqs-exist-queue.assets.json b/source/patterns/@aws-solutions-constructs/aws-eventbridge-sqs/test/integ.evtsqs-exist-queue.js.snapshot/evtsqs-exist-queue.assets.json index 77e9bc21b..52574aa45 100644 --- a/source/patterns/@aws-solutions-constructs/aws-eventbridge-sqs/test/integ.evtsqs-exist-queue.js.snapshot/evtsqs-exist-queue.assets.json +++ b/source/patterns/@aws-solutions-constructs/aws-eventbridge-sqs/test/integ.evtsqs-exist-queue.js.snapshot/evtsqs-exist-queue.assets.json @@ -1,7 +1,7 @@ { - "version": "36.0.0", + "version": "39.0.0", "files": { - "2697c1685077d157ce278d357ebcc8c55dea9ffc2724999c41d2dc9e19d34488": { + "bb75e888bd5f0a0df7bf9ed3d576b15265d8f06c81dcf8f344d1a7e6f7aac889": { "source": { "path": "evtsqs-exist-queue.template.json", "packaging": "file" @@ -9,7 +9,7 @@ "destinations": { "current_account-current_region": { "bucketName": "cdk-hnb659fds-assets-${AWS::AccountId}-${AWS::Region}", - "objectKey": "2697c1685077d157ce278d357ebcc8c55dea9ffc2724999c41d2dc9e19d34488.json", + "objectKey": "bb75e888bd5f0a0df7bf9ed3d576b15265d8f06c81dcf8f344d1a7e6f7aac889.json", "assumeRoleArn": "arn:${AWS::Partition}:iam::${AWS::AccountId}:role/cdk-hnb659fds-file-publishing-role-${AWS::AccountId}-${AWS::Region}" } } diff --git a/source/patterns/@aws-solutions-constructs/aws-eventbridge-sqs/test/integ.evtsqs-exist-queue.js.snapshot/evtsqs-exist-queue.template.json b/source/patterns/@aws-solutions-constructs/aws-eventbridge-sqs/test/integ.evtsqs-exist-queue.js.snapshot/evtsqs-exist-queue.template.json index c6570f5bc..e1482eb3a 100644 --- a/source/patterns/@aws-solutions-constructs/aws-eventbridge-sqs/test/integ.evtsqs-exist-queue.js.snapshot/evtsqs-exist-queue.template.json +++ b/source/patterns/@aws-solutions-constructs/aws-eventbridge-sqs/test/integ.evtsqs-exist-queue.js.snapshot/evtsqs-exist-queue.template.json @@ -36,6 +36,13 @@ "kms:GenerateDataKey*", "kms:ReEncrypt*" ], + "Condition": { + "StringEquals": { + "aws:SourceAccount": { + "Ref": "AWS::AccountId" + } + } + }, "Effect": "Allow", "Principal": { "Service": "events.amazonaws.com" @@ -73,6 +80,13 @@ "sqs:GetQueueUrl", "sqs:SendMessage" ], + "Condition": { + "StringEquals": { + "aws:SourceAccount": { + "Ref": "AWS::AccountId" + } + } + }, "Effect": "Allow", "Principal": { "Service": "events.amazonaws.com" @@ -107,12 +121,7 @@ "Arn" ] }, - "Id": { - "Fn::GetAtt": [ - "MyQueueE6CA6235", - "QueueName" - ] - } + "Id": "Target0" } ] } diff --git a/source/patterns/@aws-solutions-constructs/aws-eventbridge-sqs/test/integ.evtsqs-exist-queue.js.snapshot/evtsqsexistqueueIntegDefaultTestDeployAssert4E2D04AB.assets.json b/source/patterns/@aws-solutions-constructs/aws-eventbridge-sqs/test/integ.evtsqs-exist-queue.js.snapshot/evtsqsexistqueueIntegDefaultTestDeployAssert4E2D04AB.assets.json index decd901ee..827cbb3e9 100644 --- a/source/patterns/@aws-solutions-constructs/aws-eventbridge-sqs/test/integ.evtsqs-exist-queue.js.snapshot/evtsqsexistqueueIntegDefaultTestDeployAssert4E2D04AB.assets.json +++ b/source/patterns/@aws-solutions-constructs/aws-eventbridge-sqs/test/integ.evtsqs-exist-queue.js.snapshot/evtsqsexistqueueIntegDefaultTestDeployAssert4E2D04AB.assets.json @@ -1,5 +1,5 @@ { - "version": "36.0.0", + "version": "39.0.0", "files": { "21fbb51d7b23f6a6c262b46a9caee79d744a3ac019fd45422d988b96d44b2a22": { "source": { diff --git a/source/patterns/@aws-solutions-constructs/aws-eventbridge-sqs/test/integ.evtsqs-exist-queue.js.snapshot/integ.json b/source/patterns/@aws-solutions-constructs/aws-eventbridge-sqs/test/integ.evtsqs-exist-queue.js.snapshot/integ.json index b06a3fcab..c1a5fd067 100644 --- a/source/patterns/@aws-solutions-constructs/aws-eventbridge-sqs/test/integ.evtsqs-exist-queue.js.snapshot/integ.json +++ b/source/patterns/@aws-solutions-constructs/aws-eventbridge-sqs/test/integ.evtsqs-exist-queue.js.snapshot/integ.json @@ -1,5 +1,5 @@ { - "version": "36.0.0", + "version": "39.0.0", "testCases": { "evtsqs-exist-queue/Integ/DefaultTest": { "stacks": [ diff --git a/source/patterns/@aws-solutions-constructs/aws-eventbridge-sqs/test/integ.evtsqs-exist-queue.js.snapshot/manifest.json b/source/patterns/@aws-solutions-constructs/aws-eventbridge-sqs/test/integ.evtsqs-exist-queue.js.snapshot/manifest.json index d9ee7dfa1..aefde9c97 100644 --- a/source/patterns/@aws-solutions-constructs/aws-eventbridge-sqs/test/integ.evtsqs-exist-queue.js.snapshot/manifest.json +++ b/source/patterns/@aws-solutions-constructs/aws-eventbridge-sqs/test/integ.evtsqs-exist-queue.js.snapshot/manifest.json @@ -1,5 +1,5 @@ { - "version": "36.0.0", + "version": "39.0.0", "artifacts": { "evtsqsexistqueueIntegDefaultTestDeployAssert4E2D04AB.assets": { "type": "cdk:asset-manifest", @@ -66,7 +66,7 @@ "validateOnSynth": false, "assumeRoleArn": "arn:${AWS::Partition}:iam::${AWS::AccountId}:role/cdk-hnb659fds-deploy-role-${AWS::AccountId}-${AWS::Region}", "cloudFormationExecutionRoleArn": "arn:${AWS::Partition}:iam::${AWS::AccountId}:role/cdk-hnb659fds-cfn-exec-role-${AWS::AccountId}-${AWS::Region}", - "stackTemplateAssetObjectUrl": "s3://cdk-hnb659fds-assets-${AWS::AccountId}-${AWS::Region}/2697c1685077d157ce278d357ebcc8c55dea9ffc2724999c41d2dc9e19d34488.json", + "stackTemplateAssetObjectUrl": "s3://cdk-hnb659fds-assets-${AWS::AccountId}-${AWS::Region}/bb75e888bd5f0a0df7bf9ed3d576b15265d8f06c81dcf8f344d1a7e6f7aac889.json", "requiresBootstrapStackVersion": 6, "bootstrapStackVersionSsmParameter": "/cdk-bootstrap/hnb659fds/version", "additionalDependencies": [ diff --git a/source/patterns/@aws-solutions-constructs/aws-eventbridge-sqs/test/integ.evtsqs-exist-queue.js.snapshot/tree.json b/source/patterns/@aws-solutions-constructs/aws-eventbridge-sqs/test/integ.evtsqs-exist-queue.js.snapshot/tree.json index 401c25770..7239cd544 100644 --- a/source/patterns/@aws-solutions-constructs/aws-eventbridge-sqs/test/integ.evtsqs-exist-queue.js.snapshot/tree.json +++ b/source/patterns/@aws-solutions-constructs/aws-eventbridge-sqs/test/integ.evtsqs-exist-queue.js.snapshot/tree.json @@ -51,6 +51,13 @@ "kms:GenerateDataKey*", "kms:ReEncrypt*" ], + "Condition": { + "StringEquals": { + "aws:SourceAccount": { + "Ref": "AWS::AccountId" + } + } + }, "Effect": "Allow", "Principal": { "Service": "events.amazonaws.com" @@ -64,13 +71,13 @@ }, "constructInfo": { "fqn": "aws-cdk-lib.aws_kms.CfnKey", - "version": "2.118.0" + "version": "2.175.1" } } }, "constructInfo": { "fqn": "aws-cdk-lib.aws_kms.Key", - "version": "2.118.0" + "version": "2.175.1" } }, "MyQueue": { @@ -93,7 +100,7 @@ }, "constructInfo": { "fqn": "aws-cdk-lib.aws_sqs.CfnQueue", - "version": "2.118.0" + "version": "2.175.1" } }, "Policy": { @@ -114,6 +121,13 @@ "sqs:GetQueueUrl", "sqs:SendMessage" ], + "Condition": { + "StringEquals": { + "aws:SourceAccount": { + "Ref": "AWS::AccountId" + } + } + }, "Effect": "Allow", "Principal": { "Service": "events.amazonaws.com" @@ -137,19 +151,19 @@ }, "constructInfo": { "fqn": "aws-cdk-lib.aws_sqs.CfnQueuePolicy", - "version": "2.118.0" + "version": "2.175.1" } } }, "constructInfo": { "fqn": "aws-cdk-lib.aws_sqs.QueuePolicy", - "version": "2.118.0" + "version": "2.175.1" } } }, "constructInfo": { "fqn": "aws-cdk-lib.aws_sqs.Queue", - "version": "2.118.0" + "version": "2.175.1" } }, "construct": { @@ -170,12 +184,7 @@ "state": "ENABLED", "targets": [ { - "id": { - "Fn::GetAtt": [ - "MyQueueE6CA6235", - "QueueName" - ] - }, + "id": "Target0", "arn": { "Fn::GetAtt": [ "MyQueueE6CA6235", @@ -188,19 +197,19 @@ }, "constructInfo": { "fqn": "aws-cdk-lib.aws_events.CfnRule", - "version": "2.118.0" + "version": "2.175.1" } } }, "constructInfo": { "fqn": "aws-cdk-lib.aws_events.Rule", - "version": "2.118.0" + "version": "2.175.1" } } }, "constructInfo": { - "fqn": "@aws-solutions-constructs/aws-eventbridge-sqs.EventbridgeToSqs", - "version": "2.50.0" + "fqn": "constructs.Construct", + "version": "10.4.2" } }, "Integ": { @@ -216,7 +225,7 @@ "path": "evtsqs-exist-queue/Integ/DefaultTest/Default", "constructInfo": { "fqn": "constructs.Construct", - "version": "10.0.0" + "version": "10.4.2" } }, "DeployAssert": { @@ -228,7 +237,7 @@ "path": "evtsqs-exist-queue/Integ/DefaultTest/DeployAssert/BootstrapVersion", "constructInfo": { "fqn": "aws-cdk-lib.CfnParameter", - "version": "2.118.0" + "version": "2.175.1" } }, "CheckBootstrapVersion": { @@ -236,25 +245,25 @@ "path": "evtsqs-exist-queue/Integ/DefaultTest/DeployAssert/CheckBootstrapVersion", "constructInfo": { "fqn": "aws-cdk-lib.CfnRule", - "version": "2.118.0" + "version": "2.175.1" } } }, "constructInfo": { "fqn": "aws-cdk-lib.Stack", - "version": "2.118.0" + "version": "2.175.1" } } }, "constructInfo": { "fqn": "@aws-cdk/integ-tests-alpha.IntegTestCase", - "version": "2.118.0-alpha.0" + "version": "2.175.1-alpha.0" } } }, "constructInfo": { "fqn": "@aws-cdk/integ-tests-alpha.IntegTest", - "version": "2.118.0-alpha.0" + "version": "2.175.1-alpha.0" } }, "BootstrapVersion": { @@ -262,7 +271,7 @@ "path": "evtsqs-exist-queue/BootstrapVersion", "constructInfo": { "fqn": "aws-cdk-lib.CfnParameter", - "version": "2.118.0" + "version": "2.175.1" } }, "CheckBootstrapVersion": { @@ -270,13 +279,13 @@ "path": "evtsqs-exist-queue/CheckBootstrapVersion", "constructInfo": { "fqn": "aws-cdk-lib.CfnRule", - "version": "2.118.0" + "version": "2.175.1" } } }, "constructInfo": { "fqn": "aws-cdk-lib.Stack", - "version": "2.118.0" + "version": "2.175.1" } }, "Tree": { @@ -284,13 +293,13 @@ "path": "Tree", "constructInfo": { "fqn": "constructs.Construct", - "version": "10.0.0" + "version": "10.4.2" } } }, "constructInfo": { "fqn": "aws-cdk-lib.App", - "version": "2.118.0" + "version": "2.175.1" } } } \ No newline at end of file diff --git a/source/patterns/@aws-solutions-constructs/aws-eventbridge-sqs/test/integ.evtsqs-new-bus.js.snapshot/cdk.out b/source/patterns/@aws-solutions-constructs/aws-eventbridge-sqs/test/integ.evtsqs-new-bus.js.snapshot/cdk.out index 1f0068d32..91e1a8b99 100644 --- a/source/patterns/@aws-solutions-constructs/aws-eventbridge-sqs/test/integ.evtsqs-new-bus.js.snapshot/cdk.out +++ b/source/patterns/@aws-solutions-constructs/aws-eventbridge-sqs/test/integ.evtsqs-new-bus.js.snapshot/cdk.out @@ -1 +1 @@ -{"version":"36.0.0"} \ No newline at end of file +{"version":"39.0.0"} \ No newline at end of file diff --git a/source/patterns/@aws-solutions-constructs/aws-eventbridge-sqs/test/integ.evtsqs-new-bus.js.snapshot/evtsqs-new-bus.assets.json b/source/patterns/@aws-solutions-constructs/aws-eventbridge-sqs/test/integ.evtsqs-new-bus.js.snapshot/evtsqs-new-bus.assets.json index 0825580df..d68c82c66 100644 --- a/source/patterns/@aws-solutions-constructs/aws-eventbridge-sqs/test/integ.evtsqs-new-bus.js.snapshot/evtsqs-new-bus.assets.json +++ b/source/patterns/@aws-solutions-constructs/aws-eventbridge-sqs/test/integ.evtsqs-new-bus.js.snapshot/evtsqs-new-bus.assets.json @@ -1,7 +1,7 @@ { - "version": "36.0.0", + "version": "39.0.0", "files": { - "a2a18c623e59a5226bac912a05f575bc9cb6154d1e56b7235749902bc64d8891": { + "27199aa6c7c08a4ce1c5f93749614c11dfbcaf1cf107c511259e8990949b1eef": { "source": { "path": "evtsqs-new-bus.template.json", "packaging": "file" @@ -9,7 +9,7 @@ "destinations": { "current_account-current_region": { "bucketName": "cdk-hnb659fds-assets-${AWS::AccountId}-${AWS::Region}", - "objectKey": "a2a18c623e59a5226bac912a05f575bc9cb6154d1e56b7235749902bc64d8891.json", + "objectKey": "27199aa6c7c08a4ce1c5f93749614c11dfbcaf1cf107c511259e8990949b1eef.json", "assumeRoleArn": "arn:${AWS::Partition}:iam::${AWS::AccountId}:role/cdk-hnb659fds-file-publishing-role-${AWS::AccountId}-${AWS::Region}" } } diff --git a/source/patterns/@aws-solutions-constructs/aws-eventbridge-sqs/test/integ.evtsqs-new-bus.js.snapshot/evtsqs-new-bus.template.json b/source/patterns/@aws-solutions-constructs/aws-eventbridge-sqs/test/integ.evtsqs-new-bus.js.snapshot/evtsqs-new-bus.template.json index cfea356d1..88a9c9f79 100644 --- a/source/patterns/@aws-solutions-constructs/aws-eventbridge-sqs/test/integ.evtsqs-new-bus.js.snapshot/evtsqs-new-bus.template.json +++ b/source/patterns/@aws-solutions-constructs/aws-eventbridge-sqs/test/integ.evtsqs-new-bus.js.snapshot/evtsqs-new-bus.template.json @@ -115,6 +115,13 @@ "kms:GenerateDataKey*", "kms:ReEncrypt*" ], + "Condition": { + "StringEquals": { + "aws:SourceAccount": { + "Ref": "AWS::AccountId" + } + } + }, "Effect": "Allow", "Principal": { "Service": "events.amazonaws.com" @@ -217,6 +224,13 @@ "sqs:GetQueueUrl", "sqs:SendMessage" ], + "Condition": { + "StringEquals": { + "aws:SourceAccount": { + "Ref": "AWS::AccountId" + } + } + }, "Effect": "Allow", "Principal": { "Service": "events.amazonaws.com" @@ -264,12 +278,7 @@ "Arn" ] }, - "Id": { - "Fn::GetAtt": [ - "constructqueue481DC1EC", - "QueueName" - ] - } + "Id": "Target0" } ] } diff --git a/source/patterns/@aws-solutions-constructs/aws-eventbridge-sqs/test/integ.evtsqs-new-bus.js.snapshot/evtsqsnewbusIntegDefaultTestDeployAssertA45AD5F2.assets.json b/source/patterns/@aws-solutions-constructs/aws-eventbridge-sqs/test/integ.evtsqs-new-bus.js.snapshot/evtsqsnewbusIntegDefaultTestDeployAssertA45AD5F2.assets.json index cb47a70e8..5e6a34f9f 100644 --- a/source/patterns/@aws-solutions-constructs/aws-eventbridge-sqs/test/integ.evtsqs-new-bus.js.snapshot/evtsqsnewbusIntegDefaultTestDeployAssertA45AD5F2.assets.json +++ b/source/patterns/@aws-solutions-constructs/aws-eventbridge-sqs/test/integ.evtsqs-new-bus.js.snapshot/evtsqsnewbusIntegDefaultTestDeployAssertA45AD5F2.assets.json @@ -1,5 +1,5 @@ { - "version": "36.0.0", + "version": "39.0.0", "files": { "21fbb51d7b23f6a6c262b46a9caee79d744a3ac019fd45422d988b96d44b2a22": { "source": { diff --git a/source/patterns/@aws-solutions-constructs/aws-eventbridge-sqs/test/integ.evtsqs-new-bus.js.snapshot/integ.json b/source/patterns/@aws-solutions-constructs/aws-eventbridge-sqs/test/integ.evtsqs-new-bus.js.snapshot/integ.json index 9433a5711..cc17c43c1 100644 --- a/source/patterns/@aws-solutions-constructs/aws-eventbridge-sqs/test/integ.evtsqs-new-bus.js.snapshot/integ.json +++ b/source/patterns/@aws-solutions-constructs/aws-eventbridge-sqs/test/integ.evtsqs-new-bus.js.snapshot/integ.json @@ -1,5 +1,5 @@ { - "version": "36.0.0", + "version": "39.0.0", "testCases": { "evtsqs-new-bus/Integ/DefaultTest": { "stacks": [ diff --git a/source/patterns/@aws-solutions-constructs/aws-eventbridge-sqs/test/integ.evtsqs-new-bus.js.snapshot/manifest.json b/source/patterns/@aws-solutions-constructs/aws-eventbridge-sqs/test/integ.evtsqs-new-bus.js.snapshot/manifest.json index de111df96..16c58898a 100644 --- a/source/patterns/@aws-solutions-constructs/aws-eventbridge-sqs/test/integ.evtsqs-new-bus.js.snapshot/manifest.json +++ b/source/patterns/@aws-solutions-constructs/aws-eventbridge-sqs/test/integ.evtsqs-new-bus.js.snapshot/manifest.json @@ -1,5 +1,5 @@ { - "version": "36.0.0", + "version": "39.0.0", "artifacts": { "evtsqsnewbusIntegDefaultTestDeployAssertA45AD5F2.assets": { "type": "cdk:asset-manifest", @@ -66,7 +66,7 @@ "validateOnSynth": false, "assumeRoleArn": "arn:${AWS::Partition}:iam::${AWS::AccountId}:role/cdk-hnb659fds-deploy-role-${AWS::AccountId}-${AWS::Region}", "cloudFormationExecutionRoleArn": "arn:${AWS::Partition}:iam::${AWS::AccountId}:role/cdk-hnb659fds-cfn-exec-role-${AWS::AccountId}-${AWS::Region}", - "stackTemplateAssetObjectUrl": "s3://cdk-hnb659fds-assets-${AWS::AccountId}-${AWS::Region}/a2a18c623e59a5226bac912a05f575bc9cb6154d1e56b7235749902bc64d8891.json", + "stackTemplateAssetObjectUrl": "s3://cdk-hnb659fds-assets-${AWS::AccountId}-${AWS::Region}/27199aa6c7c08a4ce1c5f93749614c11dfbcaf1cf107c511259e8990949b1eef.json", "requiresBootstrapStackVersion": 6, "bootstrapStackVersionSsmParameter": "/cdk-bootstrap/hnb659fds/version", "additionalDependencies": [ @@ -141,24 +141,6 @@ "type": "aws:cdk:logicalId", "data": "CheckBootstrapVersion" } - ], - "constructdeadLetterQueueD87A77D4": [ - { - "type": "aws:cdk:logicalId", - "data": "constructdeadLetterQueueD87A77D4", - "trace": [ - "!!DESTRUCTIVE_CHANGES: WILL_DESTROY" - ] - } - ], - "constructdeadLetterQueuePolicyBA602BC6": [ - { - "type": "aws:cdk:logicalId", - "data": "constructdeadLetterQueuePolicyBA602BC6", - "trace": [ - "!!DESTRUCTIVE_CHANGES: WILL_DESTROY" - ] - } ] }, "displayName": "evtsqs-new-bus" diff --git a/source/patterns/@aws-solutions-constructs/aws-eventbridge-sqs/test/integ.evtsqs-new-bus.js.snapshot/tree.json b/source/patterns/@aws-solutions-constructs/aws-eventbridge-sqs/test/integ.evtsqs-new-bus.js.snapshot/tree.json index 0bd54b663..cb92a7c76 100644 --- a/source/patterns/@aws-solutions-constructs/aws-eventbridge-sqs/test/integ.evtsqs-new-bus.js.snapshot/tree.json +++ b/source/patterns/@aws-solutions-constructs/aws-eventbridge-sqs/test/integ.evtsqs-new-bus.js.snapshot/tree.json @@ -27,7 +27,7 @@ }, "constructInfo": { "fqn": "aws-cdk-lib.aws_sqs.CfnQueue", - "version": "2.143.0" + "version": "2.175.1" } }, "Policy": { @@ -110,19 +110,19 @@ }, "constructInfo": { "fqn": "aws-cdk-lib.aws_sqs.CfnQueuePolicy", - "version": "2.143.0" + "version": "2.175.1" } } }, "constructInfo": { "fqn": "aws-cdk-lib.aws_sqs.QueuePolicy", - "version": "2.143.0" + "version": "2.175.1" } } }, "constructInfo": { "fqn": "aws-cdk-lib.aws_sqs.Queue", - "version": "2.143.0" + "version": "2.175.1" } }, "'queueKey'": { @@ -168,6 +168,13 @@ "kms:GenerateDataKey*", "kms:ReEncrypt*" ], + "Condition": { + "StringEquals": { + "aws:SourceAccount": { + "Ref": "AWS::AccountId" + } + } + }, "Effect": "Allow", "Principal": { "Service": "events.amazonaws.com" @@ -181,13 +188,13 @@ }, "constructInfo": { "fqn": "aws-cdk-lib.aws_kms.CfnKey", - "version": "2.143.0" + "version": "2.175.1" } } }, "constructInfo": { "fqn": "aws-cdk-lib.aws_kms.Key", - "version": "2.143.0" + "version": "2.175.1" } }, "queue": { @@ -219,7 +226,7 @@ }, "constructInfo": { "fqn": "aws-cdk-lib.aws_sqs.CfnQueue", - "version": "2.143.0" + "version": "2.175.1" } }, "Policy": { @@ -296,6 +303,13 @@ "sqs:GetQueueUrl", "sqs:SendMessage" ], + "Condition": { + "StringEquals": { + "aws:SourceAccount": { + "Ref": "AWS::AccountId" + } + } + }, "Effect": "Allow", "Principal": { "Service": "events.amazonaws.com" @@ -319,19 +333,19 @@ }, "constructInfo": { "fqn": "aws-cdk-lib.aws_sqs.CfnQueuePolicy", - "version": "2.143.0" + "version": "2.175.1" } } }, "constructInfo": { "fqn": "aws-cdk-lib.aws_sqs.QueuePolicy", - "version": "2.143.0" + "version": "2.175.1" } } }, "constructInfo": { "fqn": "aws-cdk-lib.aws_sqs.Queue", - "version": "2.143.0" + "version": "2.175.1" } }, "CustomEventBus": { @@ -349,13 +363,13 @@ }, "constructInfo": { "fqn": "aws-cdk-lib.aws_events.CfnEventBus", - "version": "2.143.0" + "version": "2.175.1" } } }, "constructInfo": { "fqn": "aws-cdk-lib.aws_events.EventBus", - "version": "2.143.0" + "version": "2.175.1" } }, "EventsRule": { @@ -379,12 +393,7 @@ "state": "ENABLED", "targets": [ { - "id": { - "Fn::GetAtt": [ - "constructqueue481DC1EC", - "QueueName" - ] - }, + "id": "Target0", "arn": { "Fn::GetAtt": [ "constructqueue481DC1EC", @@ -397,19 +406,19 @@ }, "constructInfo": { "fqn": "aws-cdk-lib.aws_events.CfnRule", - "version": "2.143.0" + "version": "2.175.1" } } }, "constructInfo": { "fqn": "aws-cdk-lib.aws_events.Rule", - "version": "2.143.0" + "version": "2.175.1" } } }, "constructInfo": { - "fqn": "@aws-solutions-constructs/aws-eventbridge-sqs.EventbridgeToSqs", - "version": "2.58.1" + "fqn": "constructs.Construct", + "version": "10.4.2" } }, "Integ": { @@ -425,7 +434,7 @@ "path": "evtsqs-new-bus/Integ/DefaultTest/Default", "constructInfo": { "fqn": "constructs.Construct", - "version": "10.3.0" + "version": "10.4.2" } }, "DeployAssert": { @@ -437,7 +446,7 @@ "path": "evtsqs-new-bus/Integ/DefaultTest/DeployAssert/BootstrapVersion", "constructInfo": { "fqn": "aws-cdk-lib.CfnParameter", - "version": "2.143.0" + "version": "2.175.1" } }, "CheckBootstrapVersion": { @@ -445,25 +454,25 @@ "path": "evtsqs-new-bus/Integ/DefaultTest/DeployAssert/CheckBootstrapVersion", "constructInfo": { "fqn": "aws-cdk-lib.CfnRule", - "version": "2.143.0" + "version": "2.175.1" } } }, "constructInfo": { "fqn": "aws-cdk-lib.Stack", - "version": "2.143.0" + "version": "2.175.1" } } }, "constructInfo": { "fqn": "@aws-cdk/integ-tests-alpha.IntegTestCase", - "version": "2.143.0-alpha.0" + "version": "2.175.1-alpha.0" } } }, "constructInfo": { "fqn": "@aws-cdk/integ-tests-alpha.IntegTest", - "version": "2.143.0-alpha.0" + "version": "2.175.1-alpha.0" } }, "BootstrapVersion": { @@ -471,7 +480,7 @@ "path": "evtsqs-new-bus/BootstrapVersion", "constructInfo": { "fqn": "aws-cdk-lib.CfnParameter", - "version": "2.143.0" + "version": "2.175.1" } }, "CheckBootstrapVersion": { @@ -479,13 +488,13 @@ "path": "evtsqs-new-bus/CheckBootstrapVersion", "constructInfo": { "fqn": "aws-cdk-lib.CfnRule", - "version": "2.143.0" + "version": "2.175.1" } } }, "constructInfo": { "fqn": "aws-cdk-lib.Stack", - "version": "2.143.0" + "version": "2.175.1" } }, "Tree": { @@ -493,13 +502,13 @@ "path": "Tree", "constructInfo": { "fqn": "constructs.Construct", - "version": "10.3.0" + "version": "10.4.2" } } }, "constructInfo": { "fqn": "aws-cdk-lib.App", - "version": "2.143.0" + "version": "2.175.1" } } } \ No newline at end of file diff --git a/source/patterns/@aws-solutions-constructs/aws-eventbridge-sqs/test/integ.evtsqs-no-arg.js.snapshot/cdk.out b/source/patterns/@aws-solutions-constructs/aws-eventbridge-sqs/test/integ.evtsqs-no-arg.js.snapshot/cdk.out index 1f0068d32..91e1a8b99 100644 --- a/source/patterns/@aws-solutions-constructs/aws-eventbridge-sqs/test/integ.evtsqs-no-arg.js.snapshot/cdk.out +++ b/source/patterns/@aws-solutions-constructs/aws-eventbridge-sqs/test/integ.evtsqs-no-arg.js.snapshot/cdk.out @@ -1 +1 @@ -{"version":"36.0.0"} \ No newline at end of file +{"version":"39.0.0"} \ No newline at end of file diff --git a/source/patterns/@aws-solutions-constructs/aws-eventbridge-sqs/test/integ.evtsqs-no-arg.js.snapshot/evtsqs-no-arg.assets.json b/source/patterns/@aws-solutions-constructs/aws-eventbridge-sqs/test/integ.evtsqs-no-arg.js.snapshot/evtsqs-no-arg.assets.json index 628574ce1..ba5722dec 100644 --- a/source/patterns/@aws-solutions-constructs/aws-eventbridge-sqs/test/integ.evtsqs-no-arg.js.snapshot/evtsqs-no-arg.assets.json +++ b/source/patterns/@aws-solutions-constructs/aws-eventbridge-sqs/test/integ.evtsqs-no-arg.js.snapshot/evtsqs-no-arg.assets.json @@ -1,7 +1,7 @@ { - "version": "36.0.0", + "version": "39.0.0", "files": { - "a6726326640c7e698b4f726d418cf48992aaa44d833e18e95076d704bd9a4b72": { + "1480529f284d8b8bbe89c4ff3d449121fde3bd303d6c6cba82dbb2fe4bc9667f": { "source": { "path": "evtsqs-no-arg.template.json", "packaging": "file" @@ -9,7 +9,7 @@ "destinations": { "current_account-current_region": { "bucketName": "cdk-hnb659fds-assets-${AWS::AccountId}-${AWS::Region}", - "objectKey": "a6726326640c7e698b4f726d418cf48992aaa44d833e18e95076d704bd9a4b72.json", + "objectKey": "1480529f284d8b8bbe89c4ff3d449121fde3bd303d6c6cba82dbb2fe4bc9667f.json", "assumeRoleArn": "arn:${AWS::Partition}:iam::${AWS::AccountId}:role/cdk-hnb659fds-file-publishing-role-${AWS::AccountId}-${AWS::Region}" } } diff --git a/source/patterns/@aws-solutions-constructs/aws-eventbridge-sqs/test/integ.evtsqs-no-arg.js.snapshot/evtsqs-no-arg.template.json b/source/patterns/@aws-solutions-constructs/aws-eventbridge-sqs/test/integ.evtsqs-no-arg.js.snapshot/evtsqs-no-arg.template.json index 4eed0a180..e1812966d 100644 --- a/source/patterns/@aws-solutions-constructs/aws-eventbridge-sqs/test/integ.evtsqs-no-arg.js.snapshot/evtsqs-no-arg.template.json +++ b/source/patterns/@aws-solutions-constructs/aws-eventbridge-sqs/test/integ.evtsqs-no-arg.js.snapshot/evtsqs-no-arg.template.json @@ -115,6 +115,13 @@ "kms:GenerateDataKey*", "kms:ReEncrypt*" ], + "Condition": { + "StringEquals": { + "aws:SourceAccount": { + "Ref": "AWS::AccountId" + } + } + }, "Effect": "Allow", "Principal": { "Service": "events.amazonaws.com" @@ -217,6 +224,13 @@ "sqs:GetQueueUrl", "sqs:SendMessage" ], + "Condition": { + "StringEquals": { + "aws:SourceAccount": { + "Ref": "AWS::AccountId" + } + } + }, "Effect": "Allow", "Principal": { "Service": "events.amazonaws.com" @@ -251,12 +265,7 @@ "Arn" ] }, - "Id": { - "Fn::GetAtt": [ - "constructqueue481DC1EC", - "QueueName" - ] - } + "Id": "Target0" } ] } diff --git a/source/patterns/@aws-solutions-constructs/aws-eventbridge-sqs/test/integ.evtsqs-no-arg.js.snapshot/evtsqsnoargIntegDefaultTestDeployAssertB5DFB718.assets.json b/source/patterns/@aws-solutions-constructs/aws-eventbridge-sqs/test/integ.evtsqs-no-arg.js.snapshot/evtsqsnoargIntegDefaultTestDeployAssertB5DFB718.assets.json index 246a54424..48e18caee 100644 --- a/source/patterns/@aws-solutions-constructs/aws-eventbridge-sqs/test/integ.evtsqs-no-arg.js.snapshot/evtsqsnoargIntegDefaultTestDeployAssertB5DFB718.assets.json +++ b/source/patterns/@aws-solutions-constructs/aws-eventbridge-sqs/test/integ.evtsqs-no-arg.js.snapshot/evtsqsnoargIntegDefaultTestDeployAssertB5DFB718.assets.json @@ -1,5 +1,5 @@ { - "version": "36.0.0", + "version": "39.0.0", "files": { "21fbb51d7b23f6a6c262b46a9caee79d744a3ac019fd45422d988b96d44b2a22": { "source": { diff --git a/source/patterns/@aws-solutions-constructs/aws-eventbridge-sqs/test/integ.evtsqs-no-arg.js.snapshot/integ.json b/source/patterns/@aws-solutions-constructs/aws-eventbridge-sqs/test/integ.evtsqs-no-arg.js.snapshot/integ.json index dcecbc066..a8647ff14 100644 --- a/source/patterns/@aws-solutions-constructs/aws-eventbridge-sqs/test/integ.evtsqs-no-arg.js.snapshot/integ.json +++ b/source/patterns/@aws-solutions-constructs/aws-eventbridge-sqs/test/integ.evtsqs-no-arg.js.snapshot/integ.json @@ -1,5 +1,5 @@ { - "version": "36.0.0", + "version": "39.0.0", "testCases": { "evtsqs-no-arg/Integ/DefaultTest": { "stacks": [ diff --git a/source/patterns/@aws-solutions-constructs/aws-eventbridge-sqs/test/integ.evtsqs-no-arg.js.snapshot/manifest.json b/source/patterns/@aws-solutions-constructs/aws-eventbridge-sqs/test/integ.evtsqs-no-arg.js.snapshot/manifest.json index 13963d501..623a8b952 100644 --- a/source/patterns/@aws-solutions-constructs/aws-eventbridge-sqs/test/integ.evtsqs-no-arg.js.snapshot/manifest.json +++ b/source/patterns/@aws-solutions-constructs/aws-eventbridge-sqs/test/integ.evtsqs-no-arg.js.snapshot/manifest.json @@ -1,5 +1,5 @@ { - "version": "36.0.0", + "version": "39.0.0", "artifacts": { "evtsqsnoargIntegDefaultTestDeployAssertB5DFB718.assets": { "type": "cdk:asset-manifest", @@ -66,7 +66,7 @@ "validateOnSynth": false, "assumeRoleArn": "arn:${AWS::Partition}:iam::${AWS::AccountId}:role/cdk-hnb659fds-deploy-role-${AWS::AccountId}-${AWS::Region}", "cloudFormationExecutionRoleArn": "arn:${AWS::Partition}:iam::${AWS::AccountId}:role/cdk-hnb659fds-cfn-exec-role-${AWS::AccountId}-${AWS::Region}", - "stackTemplateAssetObjectUrl": "s3://cdk-hnb659fds-assets-${AWS::AccountId}-${AWS::Region}/a6726326640c7e698b4f726d418cf48992aaa44d833e18e95076d704bd9a4b72.json", + "stackTemplateAssetObjectUrl": "s3://cdk-hnb659fds-assets-${AWS::AccountId}-${AWS::Region}/1480529f284d8b8bbe89c4ff3d449121fde3bd303d6c6cba82dbb2fe4bc9667f.json", "requiresBootstrapStackVersion": 6, "bootstrapStackVersionSsmParameter": "/cdk-bootstrap/hnb659fds/version", "additionalDependencies": [ @@ -135,24 +135,6 @@ "type": "aws:cdk:logicalId", "data": "CheckBootstrapVersion" } - ], - "constructdeadLetterQueueD87A77D4": [ - { - "type": "aws:cdk:logicalId", - "data": "constructdeadLetterQueueD87A77D4", - "trace": [ - "!!DESTRUCTIVE_CHANGES: WILL_DESTROY" - ] - } - ], - "constructdeadLetterQueuePolicyBA602BC6": [ - { - "type": "aws:cdk:logicalId", - "data": "constructdeadLetterQueuePolicyBA602BC6", - "trace": [ - "!!DESTRUCTIVE_CHANGES: WILL_DESTROY" - ] - } ] }, "displayName": "evtsqs-no-arg" diff --git a/source/patterns/@aws-solutions-constructs/aws-eventbridge-sqs/test/integ.evtsqs-no-arg.js.snapshot/tree.json b/source/patterns/@aws-solutions-constructs/aws-eventbridge-sqs/test/integ.evtsqs-no-arg.js.snapshot/tree.json index 670103d90..87e275e6c 100644 --- a/source/patterns/@aws-solutions-constructs/aws-eventbridge-sqs/test/integ.evtsqs-no-arg.js.snapshot/tree.json +++ b/source/patterns/@aws-solutions-constructs/aws-eventbridge-sqs/test/integ.evtsqs-no-arg.js.snapshot/tree.json @@ -27,7 +27,7 @@ }, "constructInfo": { "fqn": "aws-cdk-lib.aws_sqs.CfnQueue", - "version": "2.143.0" + "version": "2.175.1" } }, "Policy": { @@ -110,19 +110,19 @@ }, "constructInfo": { "fqn": "aws-cdk-lib.aws_sqs.CfnQueuePolicy", - "version": "2.143.0" + "version": "2.175.1" } } }, "constructInfo": { "fqn": "aws-cdk-lib.aws_sqs.QueuePolicy", - "version": "2.143.0" + "version": "2.175.1" } } }, "constructInfo": { "fqn": "aws-cdk-lib.aws_sqs.Queue", - "version": "2.143.0" + "version": "2.175.1" } }, "'queueKey'": { @@ -168,6 +168,13 @@ "kms:GenerateDataKey*", "kms:ReEncrypt*" ], + "Condition": { + "StringEquals": { + "aws:SourceAccount": { + "Ref": "AWS::AccountId" + } + } + }, "Effect": "Allow", "Principal": { "Service": "events.amazonaws.com" @@ -181,13 +188,13 @@ }, "constructInfo": { "fqn": "aws-cdk-lib.aws_kms.CfnKey", - "version": "2.143.0" + "version": "2.175.1" } } }, "constructInfo": { "fqn": "aws-cdk-lib.aws_kms.Key", - "version": "2.143.0" + "version": "2.175.1" } }, "queue": { @@ -219,7 +226,7 @@ }, "constructInfo": { "fqn": "aws-cdk-lib.aws_sqs.CfnQueue", - "version": "2.143.0" + "version": "2.175.1" } }, "Policy": { @@ -296,6 +303,13 @@ "sqs:GetQueueUrl", "sqs:SendMessage" ], + "Condition": { + "StringEquals": { + "aws:SourceAccount": { + "Ref": "AWS::AccountId" + } + } + }, "Effect": "Allow", "Principal": { "Service": "events.amazonaws.com" @@ -319,19 +333,19 @@ }, "constructInfo": { "fqn": "aws-cdk-lib.aws_sqs.CfnQueuePolicy", - "version": "2.143.0" + "version": "2.175.1" } } }, "constructInfo": { "fqn": "aws-cdk-lib.aws_sqs.QueuePolicy", - "version": "2.143.0" + "version": "2.175.1" } } }, "constructInfo": { "fqn": "aws-cdk-lib.aws_sqs.Queue", - "version": "2.143.0" + "version": "2.175.1" } }, "EventsRule": { @@ -348,12 +362,7 @@ "state": "ENABLED", "targets": [ { - "id": { - "Fn::GetAtt": [ - "constructqueue481DC1EC", - "QueueName" - ] - }, + "id": "Target0", "arn": { "Fn::GetAtt": [ "constructqueue481DC1EC", @@ -366,19 +375,19 @@ }, "constructInfo": { "fqn": "aws-cdk-lib.aws_events.CfnRule", - "version": "2.143.0" + "version": "2.175.1" } } }, "constructInfo": { "fqn": "aws-cdk-lib.aws_events.Rule", - "version": "2.143.0" + "version": "2.175.1" } } }, "constructInfo": { - "fqn": "@aws-solutions-constructs/aws-eventbridge-sqs.EventbridgeToSqs", - "version": "2.58.1" + "fqn": "constructs.Construct", + "version": "10.4.2" } }, "Integ": { @@ -394,7 +403,7 @@ "path": "evtsqs-no-arg/Integ/DefaultTest/Default", "constructInfo": { "fqn": "constructs.Construct", - "version": "10.3.0" + "version": "10.4.2" } }, "DeployAssert": { @@ -406,7 +415,7 @@ "path": "evtsqs-no-arg/Integ/DefaultTest/DeployAssert/BootstrapVersion", "constructInfo": { "fqn": "aws-cdk-lib.CfnParameter", - "version": "2.143.0" + "version": "2.175.1" } }, "CheckBootstrapVersion": { @@ -414,25 +423,25 @@ "path": "evtsqs-no-arg/Integ/DefaultTest/DeployAssert/CheckBootstrapVersion", "constructInfo": { "fqn": "aws-cdk-lib.CfnRule", - "version": "2.143.0" + "version": "2.175.1" } } }, "constructInfo": { "fqn": "aws-cdk-lib.Stack", - "version": "2.143.0" + "version": "2.175.1" } } }, "constructInfo": { "fqn": "@aws-cdk/integ-tests-alpha.IntegTestCase", - "version": "2.143.0-alpha.0" + "version": "2.175.1-alpha.0" } } }, "constructInfo": { "fqn": "@aws-cdk/integ-tests-alpha.IntegTest", - "version": "2.143.0-alpha.0" + "version": "2.175.1-alpha.0" } }, "BootstrapVersion": { @@ -440,7 +449,7 @@ "path": "evtsqs-no-arg/BootstrapVersion", "constructInfo": { "fqn": "aws-cdk-lib.CfnParameter", - "version": "2.143.0" + "version": "2.175.1" } }, "CheckBootstrapVersion": { @@ -448,13 +457,13 @@ "path": "evtsqs-no-arg/CheckBootstrapVersion", "constructInfo": { "fqn": "aws-cdk-lib.CfnRule", - "version": "2.143.0" + "version": "2.175.1" } } }, "constructInfo": { "fqn": "aws-cdk-lib.Stack", - "version": "2.143.0" + "version": "2.175.1" } }, "Tree": { @@ -462,13 +471,13 @@ "path": "Tree", "constructInfo": { "fqn": "constructs.Construct", - "version": "10.3.0" + "version": "10.4.2" } } }, "constructInfo": { "fqn": "aws-cdk-lib.App", - "version": "2.143.0" + "version": "2.175.1" } } } \ No newline at end of file diff --git a/source/patterns/@aws-solutions-constructs/aws-eventbridge-sqs/test/integ.evtsqs-rule-dlq.js.snapshot/cdk.out b/source/patterns/@aws-solutions-constructs/aws-eventbridge-sqs/test/integ.evtsqs-rule-dlq.js.snapshot/cdk.out new file mode 100644 index 000000000..91e1a8b99 --- /dev/null +++ b/source/patterns/@aws-solutions-constructs/aws-eventbridge-sqs/test/integ.evtsqs-rule-dlq.js.snapshot/cdk.out @@ -0,0 +1 @@ +{"version":"39.0.0"} \ No newline at end of file diff --git a/source/patterns/@aws-solutions-constructs/aws-eventbridge-sqs/test/integ.evtsqs-rule-dlq.js.snapshot/evtsqs-rule-dlq.assets.json b/source/patterns/@aws-solutions-constructs/aws-eventbridge-sqs/test/integ.evtsqs-rule-dlq.js.snapshot/evtsqs-rule-dlq.assets.json new file mode 100644 index 000000000..eef38a17f --- /dev/null +++ b/source/patterns/@aws-solutions-constructs/aws-eventbridge-sqs/test/integ.evtsqs-rule-dlq.js.snapshot/evtsqs-rule-dlq.assets.json @@ -0,0 +1,19 @@ +{ + "version": "39.0.0", + "files": { + "c8bcea9c40e35cbce6c3f7b2773147c387557f313756f0cd69e7f9dda062ceab": { + "source": { + "path": "evtsqs-rule-dlq.template.json", + "packaging": "file" + }, + "destinations": { + "current_account-current_region": { + "bucketName": "cdk-hnb659fds-assets-${AWS::AccountId}-${AWS::Region}", + "objectKey": "c8bcea9c40e35cbce6c3f7b2773147c387557f313756f0cd69e7f9dda062ceab.json", + "assumeRoleArn": "arn:${AWS::Partition}:iam::${AWS::AccountId}:role/cdk-hnb659fds-file-publishing-role-${AWS::AccountId}-${AWS::Region}" + } + } + } + }, + "dockerImages": {} +} \ No newline at end of file diff --git a/source/patterns/@aws-solutions-constructs/aws-eventbridge-sqs/test/integ.evtsqs-rule-dlq.js.snapshot/evtsqs-rule-dlq.template.json b/source/patterns/@aws-solutions-constructs/aws-eventbridge-sqs/test/integ.evtsqs-rule-dlq.js.snapshot/evtsqs-rule-dlq.template.json new file mode 100644 index 000000000..367f10aad --- /dev/null +++ b/source/patterns/@aws-solutions-constructs/aws-eventbridge-sqs/test/integ.evtsqs-rule-dlq.js.snapshot/evtsqs-rule-dlq.template.json @@ -0,0 +1,361 @@ +{ + "Resources": { + "constructqueuedlq6B66D1E6": { + "Type": "AWS::SQS::Queue", + "Properties": { + "KmsMasterKeyId": "alias/aws/sqs" + }, + "UpdateReplacePolicy": "Delete", + "DeletionPolicy": "Delete" + }, + "constructqueuedlqPolicy3B6CC54E": { + "Type": "AWS::SQS::QueuePolicy", + "Properties": { + "PolicyDocument": { + "Statement": [ + { + "Action": [ + "sqs:AddPermission", + "sqs:DeleteMessage", + "sqs:GetQueueAttributes", + "sqs:ReceiveMessage", + "sqs:RemovePermission", + "sqs:SendMessage", + "sqs:SetQueueAttributes" + ], + "Effect": "Allow", + "Principal": { + "AWS": { + "Fn::Join": [ + "", + [ + "arn:", + { + "Ref": "AWS::Partition" + }, + ":iam::", + { + "Ref": "AWS::AccountId" + }, + ":root" + ] + ] + } + }, + "Resource": { + "Fn::GetAtt": [ + "constructqueuedlq6B66D1E6", + "Arn" + ] + }, + "Sid": "QueueOwnerOnlyAccess" + }, + { + "Action": "SQS:*", + "Condition": { + "Bool": { + "aws:SecureTransport": "false" + } + }, + "Effect": "Deny", + "Principal": { + "AWS": "*" + }, + "Resource": { + "Fn::GetAtt": [ + "constructqueuedlq6B66D1E6", + "Arn" + ] + }, + "Sid": "HttpsOnly" + } + ], + "Version": "2012-10-17" + }, + "Queues": [ + { + "Ref": "constructqueuedlq6B66D1E6" + } + ] + } + }, + "constructqueue481DC1EC": { + "Type": "AWS::SQS::Queue", + "Properties": { + "KmsMasterKeyId": "alias/aws/sqs", + "RedrivePolicy": { + "deadLetterTargetArn": { + "Fn::GetAtt": [ + "constructqueuedlq6B66D1E6", + "Arn" + ] + }, + "maxReceiveCount": 15 + } + }, + "UpdateReplacePolicy": "Delete", + "DeletionPolicy": "Delete" + }, + "constructqueuePolicy5B0256B1": { + "Type": "AWS::SQS::QueuePolicy", + "Properties": { + "PolicyDocument": { + "Statement": [ + { + "Action": [ + "sqs:AddPermission", + "sqs:DeleteMessage", + "sqs:GetQueueAttributes", + "sqs:ReceiveMessage", + "sqs:RemovePermission", + "sqs:SendMessage", + "sqs:SetQueueAttributes" + ], + "Effect": "Allow", + "Principal": { + "AWS": { + "Fn::Join": [ + "", + [ + "arn:", + { + "Ref": "AWS::Partition" + }, + ":iam::", + { + "Ref": "AWS::AccountId" + }, + ":root" + ] + ] + } + }, + "Resource": { + "Fn::GetAtt": [ + "constructqueue481DC1EC", + "Arn" + ] + }, + "Sid": "QueueOwnerOnlyAccess" + }, + { + "Action": "SQS:*", + "Condition": { + "Bool": { + "aws:SecureTransport": "false" + } + }, + "Effect": "Deny", + "Principal": { + "AWS": "*" + }, + "Resource": { + "Fn::GetAtt": [ + "constructqueue481DC1EC", + "Arn" + ] + }, + "Sid": "HttpsOnly" + }, + { + "Action": [ + "sqs:GetQueueAttributes", + "sqs:GetQueueUrl", + "sqs:SendMessage" + ], + "Condition": { + "ArnEquals": { + "aws:SourceArn": { + "Fn::GetAtt": [ + "constructEventsRule43880ADB", + "Arn" + ] + } + } + }, + "Effect": "Allow", + "Principal": { + "Service": "events.amazonaws.com" + }, + "Resource": { + "Fn::GetAtt": [ + "constructqueue481DC1EC", + "Arn" + ] + } + } + ], + "Version": "2012-10-17" + }, + "Queues": [ + { + "Ref": "constructqueue481DC1EC" + } + ] + } + }, + "constructruleDlq7D359AE9": { + "Type": "AWS::SQS::Queue", + "Properties": { + "KmsMasterKeyId": "alias/aws/sqs" + }, + "UpdateReplacePolicy": "Delete", + "DeletionPolicy": "Delete" + }, + "constructruleDlqPolicyE4AB8569": { + "Type": "AWS::SQS::QueuePolicy", + "Properties": { + "PolicyDocument": { + "Statement": [ + { + "Action": [ + "sqs:AddPermission", + "sqs:DeleteMessage", + "sqs:GetQueueAttributes", + "sqs:ReceiveMessage", + "sqs:RemovePermission", + "sqs:SendMessage", + "sqs:SetQueueAttributes" + ], + "Effect": "Allow", + "Principal": { + "AWS": { + "Fn::Join": [ + "", + [ + "arn:", + { + "Ref": "AWS::Partition" + }, + ":iam::", + { + "Ref": "AWS::AccountId" + }, + ":root" + ] + ] + } + }, + "Resource": { + "Fn::GetAtt": [ + "constructruleDlq7D359AE9", + "Arn" + ] + }, + "Sid": "QueueOwnerOnlyAccess" + }, + { + "Action": "SQS:*", + "Condition": { + "Bool": { + "aws:SecureTransport": "false" + } + }, + "Effect": "Deny", + "Principal": { + "AWS": "*" + }, + "Resource": { + "Fn::GetAtt": [ + "constructruleDlq7D359AE9", + "Arn" + ] + }, + "Sid": "HttpsOnly" + }, + { + "Action": "sqs:SendMessage", + "Condition": { + "ArnEquals": { + "aws:SourceArn": { + "Fn::GetAtt": [ + "constructEventsRule43880ADB", + "Arn" + ] + } + } + }, + "Effect": "Allow", + "Principal": { + "Service": "events.amazonaws.com" + }, + "Resource": { + "Fn::GetAtt": [ + "constructruleDlq7D359AE9", + "Arn" + ] + }, + "Sid": "AllowEventRuleevtsqsruledlqconstructEventsRule62503343" + } + ], + "Version": "2012-10-17" + }, + "Queues": [ + { + "Ref": "constructruleDlq7D359AE9" + } + ] + } + }, + "constructEventsRule43880ADB": { + "Type": "AWS::Events::Rule", + "Properties": { + "ScheduleExpression": "rate(1 minute)", + "State": "ENABLED", + "Targets": [ + { + "Arn": { + "Fn::GetAtt": [ + "constructqueue481DC1EC", + "Arn" + ] + }, + "DeadLetterConfig": { + "Arn": { + "Fn::GetAtt": [ + "constructruleDlq7D359AE9", + "Arn" + ] + } + }, + "Id": "Target0" + } + ] + } + } + }, + "Parameters": { + "BootstrapVersion": { + "Type": "AWS::SSM::Parameter::Value", + "Default": "/cdk-bootstrap/hnb659fds/version", + "Description": "Version of the CDK Bootstrap resources in this environment, automatically retrieved from SSM Parameter Store. [cdk:skip]" + } + }, + "Rules": { + "CheckBootstrapVersion": { + "Assertions": [ + { + "Assert": { + "Fn::Not": [ + { + "Fn::Contains": [ + [ + "1", + "2", + "3", + "4", + "5" + ], + { + "Ref": "BootstrapVersion" + } + ] + } + ] + }, + "AssertDescription": "CDK bootstrap stack version 6 required. Please run 'cdk bootstrap' with a recent version of the CDK CLI." + } + ] + } + } +} \ No newline at end of file diff --git a/source/patterns/@aws-solutions-constructs/aws-eventbridge-sqs/test/integ.evtsqs-rule-dlq.js.snapshot/evtsqsruledlqIntegDefaultTestDeployAssertE0D1E1C2.assets.json b/source/patterns/@aws-solutions-constructs/aws-eventbridge-sqs/test/integ.evtsqs-rule-dlq.js.snapshot/evtsqsruledlqIntegDefaultTestDeployAssertE0D1E1C2.assets.json new file mode 100644 index 000000000..ee51f74a8 --- /dev/null +++ b/source/patterns/@aws-solutions-constructs/aws-eventbridge-sqs/test/integ.evtsqs-rule-dlq.js.snapshot/evtsqsruledlqIntegDefaultTestDeployAssertE0D1E1C2.assets.json @@ -0,0 +1,19 @@ +{ + "version": "39.0.0", + "files": { + "21fbb51d7b23f6a6c262b46a9caee79d744a3ac019fd45422d988b96d44b2a22": { + "source": { + "path": "evtsqsruledlqIntegDefaultTestDeployAssertE0D1E1C2.template.json", + "packaging": "file" + }, + "destinations": { + "current_account-current_region": { + "bucketName": "cdk-hnb659fds-assets-${AWS::AccountId}-${AWS::Region}", + "objectKey": "21fbb51d7b23f6a6c262b46a9caee79d744a3ac019fd45422d988b96d44b2a22.json", + "assumeRoleArn": "arn:${AWS::Partition}:iam::${AWS::AccountId}:role/cdk-hnb659fds-file-publishing-role-${AWS::AccountId}-${AWS::Region}" + } + } + } + }, + "dockerImages": {} +} \ No newline at end of file diff --git a/source/patterns/@aws-solutions-constructs/aws-eventbridge-sqs/test/integ.evtsqs-rule-dlq.js.snapshot/evtsqsruledlqIntegDefaultTestDeployAssertE0D1E1C2.template.json b/source/patterns/@aws-solutions-constructs/aws-eventbridge-sqs/test/integ.evtsqs-rule-dlq.js.snapshot/evtsqsruledlqIntegDefaultTestDeployAssertE0D1E1C2.template.json new file mode 100644 index 000000000..ad9d0fb73 --- /dev/null +++ b/source/patterns/@aws-solutions-constructs/aws-eventbridge-sqs/test/integ.evtsqs-rule-dlq.js.snapshot/evtsqsruledlqIntegDefaultTestDeployAssertE0D1E1C2.template.json @@ -0,0 +1,36 @@ +{ + "Parameters": { + "BootstrapVersion": { + "Type": "AWS::SSM::Parameter::Value", + "Default": "/cdk-bootstrap/hnb659fds/version", + "Description": "Version of the CDK Bootstrap resources in this environment, automatically retrieved from SSM Parameter Store. [cdk:skip]" + } + }, + "Rules": { + "CheckBootstrapVersion": { + "Assertions": [ + { + "Assert": { + "Fn::Not": [ + { + "Fn::Contains": [ + [ + "1", + "2", + "3", + "4", + "5" + ], + { + "Ref": "BootstrapVersion" + } + ] + } + ] + }, + "AssertDescription": "CDK bootstrap stack version 6 required. Please run 'cdk bootstrap' with a recent version of the CDK CLI." + } + ] + } + } +} \ No newline at end of file diff --git a/source/patterns/@aws-solutions-constructs/aws-eventbridge-sqs/test/integ.evtsqs-rule-dlq.js.snapshot/integ.json b/source/patterns/@aws-solutions-constructs/aws-eventbridge-sqs/test/integ.evtsqs-rule-dlq.js.snapshot/integ.json new file mode 100644 index 000000000..9c25cce83 --- /dev/null +++ b/source/patterns/@aws-solutions-constructs/aws-eventbridge-sqs/test/integ.evtsqs-rule-dlq.js.snapshot/integ.json @@ -0,0 +1,12 @@ +{ + "version": "39.0.0", + "testCases": { + "evtsqs-rule-dlq/Integ/DefaultTest": { + "stacks": [ + "evtsqs-rule-dlq" + ], + "assertionStack": "evtsqs-rule-dlq/Integ/DefaultTest/DeployAssert", + "assertionStackName": "evtsqsruledlqIntegDefaultTestDeployAssertE0D1E1C2" + } + } +} \ No newline at end of file diff --git a/source/patterns/@aws-solutions-constructs/aws-eventbridge-sqs/test/integ.evtsqs-rule-dlq.js.snapshot/manifest.json b/source/patterns/@aws-solutions-constructs/aws-eventbridge-sqs/test/integ.evtsqs-rule-dlq.js.snapshot/manifest.json new file mode 100644 index 000000000..d42cb8a12 --- /dev/null +++ b/source/patterns/@aws-solutions-constructs/aws-eventbridge-sqs/test/integ.evtsqs-rule-dlq.js.snapshot/manifest.json @@ -0,0 +1,158 @@ +{ + "version": "39.0.0", + "artifacts": { + "evtsqsruledlqIntegDefaultTestDeployAssertE0D1E1C2.assets": { + "type": "cdk:asset-manifest", + "properties": { + "file": "evtsqsruledlqIntegDefaultTestDeployAssertE0D1E1C2.assets.json", + "requiresBootstrapStackVersion": 6, + "bootstrapStackVersionSsmParameter": "/cdk-bootstrap/hnb659fds/version" + } + }, + "evtsqsruledlqIntegDefaultTestDeployAssertE0D1E1C2": { + "type": "aws:cloudformation:stack", + "environment": "aws://unknown-account/unknown-region", + "properties": { + "templateFile": "evtsqsruledlqIntegDefaultTestDeployAssertE0D1E1C2.template.json", + "terminationProtection": false, + "validateOnSynth": false, + "assumeRoleArn": "arn:${AWS::Partition}:iam::${AWS::AccountId}:role/cdk-hnb659fds-deploy-role-${AWS::AccountId}-${AWS::Region}", + "cloudFormationExecutionRoleArn": "arn:${AWS::Partition}:iam::${AWS::AccountId}:role/cdk-hnb659fds-cfn-exec-role-${AWS::AccountId}-${AWS::Region}", + "stackTemplateAssetObjectUrl": "s3://cdk-hnb659fds-assets-${AWS::AccountId}-${AWS::Region}/21fbb51d7b23f6a6c262b46a9caee79d744a3ac019fd45422d988b96d44b2a22.json", + "requiresBootstrapStackVersion": 6, + "bootstrapStackVersionSsmParameter": "/cdk-bootstrap/hnb659fds/version", + "additionalDependencies": [ + "evtsqsruledlqIntegDefaultTestDeployAssertE0D1E1C2.assets" + ], + "lookupRole": { + "arn": "arn:${AWS::Partition}:iam::${AWS::AccountId}:role/cdk-hnb659fds-lookup-role-${AWS::AccountId}-${AWS::Region}", + "requiresBootstrapStackVersion": 8, + "bootstrapStackVersionSsmParameter": "/cdk-bootstrap/hnb659fds/version" + } + }, + "dependencies": [ + "evtsqsruledlqIntegDefaultTestDeployAssertE0D1E1C2.assets" + ], + "metadata": { + "/evtsqs-rule-dlq/Integ/DefaultTest/DeployAssert/BootstrapVersion": [ + { + "type": "aws:cdk:logicalId", + "data": "BootstrapVersion" + } + ], + "/evtsqs-rule-dlq/Integ/DefaultTest/DeployAssert/CheckBootstrapVersion": [ + { + "type": "aws:cdk:logicalId", + "data": "CheckBootstrapVersion" + } + ] + }, + "displayName": "evtsqs-rule-dlq/Integ/DefaultTest/DeployAssert" + }, + "evtsqs-rule-dlq.assets": { + "type": "cdk:asset-manifest", + "properties": { + "file": "evtsqs-rule-dlq.assets.json", + "requiresBootstrapStackVersion": 6, + "bootstrapStackVersionSsmParameter": "/cdk-bootstrap/hnb659fds/version" + } + }, + "evtsqs-rule-dlq": { + "type": "aws:cloudformation:stack", + "environment": "aws://unknown-account/unknown-region", + "properties": { + "templateFile": "evtsqs-rule-dlq.template.json", + "terminationProtection": false, + "validateOnSynth": false, + "assumeRoleArn": "arn:${AWS::Partition}:iam::${AWS::AccountId}:role/cdk-hnb659fds-deploy-role-${AWS::AccountId}-${AWS::Region}", + "cloudFormationExecutionRoleArn": "arn:${AWS::Partition}:iam::${AWS::AccountId}:role/cdk-hnb659fds-cfn-exec-role-${AWS::AccountId}-${AWS::Region}", + "stackTemplateAssetObjectUrl": "s3://cdk-hnb659fds-assets-${AWS::AccountId}-${AWS::Region}/c8bcea9c40e35cbce6c3f7b2773147c387557f313756f0cd69e7f9dda062ceab.json", + "requiresBootstrapStackVersion": 6, + "bootstrapStackVersionSsmParameter": "/cdk-bootstrap/hnb659fds/version", + "additionalDependencies": [ + "evtsqs-rule-dlq.assets" + ], + "lookupRole": { + "arn": "arn:${AWS::Partition}:iam::${AWS::AccountId}:role/cdk-hnb659fds-lookup-role-${AWS::AccountId}-${AWS::Region}", + "requiresBootstrapStackVersion": 8, + "bootstrapStackVersionSsmParameter": "/cdk-bootstrap/hnb659fds/version" + } + }, + "dependencies": [ + "evtsqs-rule-dlq.assets" + ], + "metadata": { + "/evtsqs-rule-dlq/construct/queue-dlq/Resource": [ + { + "type": "aws:cdk:logicalId", + "data": "constructqueuedlq6B66D1E6" + } + ], + "/evtsqs-rule-dlq/construct/queue-dlq/Policy/Resource": [ + { + "type": "aws:cdk:logicalId", + "data": "constructqueuedlqPolicy3B6CC54E" + } + ], + "/evtsqs-rule-dlq/construct/queue/Resource": [ + { + "type": "aws:cdk:logicalId", + "data": "constructqueue481DC1EC" + } + ], + "/evtsqs-rule-dlq/construct/queue/Policy/Resource": [ + { + "type": "aws:cdk:logicalId", + "data": "constructqueuePolicy5B0256B1" + } + ], + "/evtsqs-rule-dlq/construct/ruleDlq/Resource": [ + { + "type": "aws:cdk:logicalId", + "data": "constructruleDlq7D359AE9" + } + ], + "/evtsqs-rule-dlq/construct/ruleDlq/Policy/Resource": [ + { + "type": "aws:cdk:logicalId", + "data": "constructruleDlqPolicyE4AB8569" + } + ], + "/evtsqs-rule-dlq/construct/EventsRule/Resource": [ + { + "type": "aws:cdk:logicalId", + "data": "constructEventsRule43880ADB" + } + ], + "/evtsqs-rule-dlq/BootstrapVersion": [ + { + "type": "aws:cdk:logicalId", + "data": "BootstrapVersion" + } + ], + "/evtsqs-rule-dlq/CheckBootstrapVersion": [ + { + "type": "aws:cdk:logicalId", + "data": "CheckBootstrapVersion" + } + ], + "constructqueueKey0638E1FB": [ + { + "type": "aws:cdk:logicalId", + "data": "constructqueueKey0638E1FB", + "trace": [ + "!!DESTRUCTIVE_CHANGES: WILL_DESTROY" + ] + } + ] + }, + "displayName": "evtsqs-rule-dlq" + }, + "Tree": { + "type": "cdk:tree", + "properties": { + "file": "tree.json" + } + } + } +} \ No newline at end of file diff --git a/source/patterns/@aws-solutions-constructs/aws-eventbridge-sqs/test/integ.evtsqs-rule-dlq.js.snapshot/tree.json b/source/patterns/@aws-solutions-constructs/aws-eventbridge-sqs/test/integ.evtsqs-rule-dlq.js.snapshot/tree.json new file mode 100644 index 000000000..6aa3dff37 --- /dev/null +++ b/source/patterns/@aws-solutions-constructs/aws-eventbridge-sqs/test/integ.evtsqs-rule-dlq.js.snapshot/tree.json @@ -0,0 +1,554 @@ +{ + "version": "tree-0.1", + "tree": { + "id": "App", + "path": "", + "children": { + "evtsqs-rule-dlq": { + "id": "evtsqs-rule-dlq", + "path": "evtsqs-rule-dlq", + "children": { + "construct": { + "id": "construct", + "path": "evtsqs-rule-dlq/construct", + "children": { + "queue-dlq": { + "id": "queue-dlq", + "path": "evtsqs-rule-dlq/construct/queue-dlq", + "children": { + "Resource": { + "id": "Resource", + "path": "evtsqs-rule-dlq/construct/queue-dlq/Resource", + "attributes": { + "aws:cdk:cloudformation:type": "AWS::SQS::Queue", + "aws:cdk:cloudformation:props": { + "kmsMasterKeyId": "alias/aws/sqs" + } + }, + "constructInfo": { + "fqn": "aws-cdk-lib.aws_sqs.CfnQueue", + "version": "2.175.1" + } + }, + "Policy": { + "id": "Policy", + "path": "evtsqs-rule-dlq/construct/queue-dlq/Policy", + "children": { + "Resource": { + "id": "Resource", + "path": "evtsqs-rule-dlq/construct/queue-dlq/Policy/Resource", + "attributes": { + "aws:cdk:cloudformation:type": "AWS::SQS::QueuePolicy", + "aws:cdk:cloudformation:props": { + "policyDocument": { + "Statement": [ + { + "Action": [ + "sqs:AddPermission", + "sqs:DeleteMessage", + "sqs:GetQueueAttributes", + "sqs:ReceiveMessage", + "sqs:RemovePermission", + "sqs:SendMessage", + "sqs:SetQueueAttributes" + ], + "Effect": "Allow", + "Principal": { + "AWS": { + "Fn::Join": [ + "", + [ + "arn:", + { + "Ref": "AWS::Partition" + }, + ":iam::", + { + "Ref": "AWS::AccountId" + }, + ":root" + ] + ] + } + }, + "Resource": { + "Fn::GetAtt": [ + "constructqueuedlq6B66D1E6", + "Arn" + ] + }, + "Sid": "QueueOwnerOnlyAccess" + }, + { + "Action": "SQS:*", + "Condition": { + "Bool": { + "aws:SecureTransport": "false" + } + }, + "Effect": "Deny", + "Principal": { + "AWS": "*" + }, + "Resource": { + "Fn::GetAtt": [ + "constructqueuedlq6B66D1E6", + "Arn" + ] + }, + "Sid": "HttpsOnly" + } + ], + "Version": "2012-10-17" + }, + "queues": [ + { + "Ref": "constructqueuedlq6B66D1E6" + } + ] + } + }, + "constructInfo": { + "fqn": "aws-cdk-lib.aws_sqs.CfnQueuePolicy", + "version": "2.175.1" + } + } + }, + "constructInfo": { + "fqn": "aws-cdk-lib.aws_sqs.QueuePolicy", + "version": "2.175.1" + } + } + }, + "constructInfo": { + "fqn": "aws-cdk-lib.aws_sqs.Queue", + "version": "2.175.1" + } + }, + "queue": { + "id": "queue", + "path": "evtsqs-rule-dlq/construct/queue", + "children": { + "Resource": { + "id": "Resource", + "path": "evtsqs-rule-dlq/construct/queue/Resource", + "attributes": { + "aws:cdk:cloudformation:type": "AWS::SQS::Queue", + "aws:cdk:cloudformation:props": { + "kmsMasterKeyId": "alias/aws/sqs", + "redrivePolicy": { + "deadLetterTargetArn": { + "Fn::GetAtt": [ + "constructqueuedlq6B66D1E6", + "Arn" + ] + }, + "maxReceiveCount": 15 + } + } + }, + "constructInfo": { + "fqn": "aws-cdk-lib.aws_sqs.CfnQueue", + "version": "2.175.1" + } + }, + "Policy": { + "id": "Policy", + "path": "evtsqs-rule-dlq/construct/queue/Policy", + "children": { + "Resource": { + "id": "Resource", + "path": "evtsqs-rule-dlq/construct/queue/Policy/Resource", + "attributes": { + "aws:cdk:cloudformation:type": "AWS::SQS::QueuePolicy", + "aws:cdk:cloudformation:props": { + "policyDocument": { + "Statement": [ + { + "Action": [ + "sqs:AddPermission", + "sqs:DeleteMessage", + "sqs:GetQueueAttributes", + "sqs:ReceiveMessage", + "sqs:RemovePermission", + "sqs:SendMessage", + "sqs:SetQueueAttributes" + ], + "Effect": "Allow", + "Principal": { + "AWS": { + "Fn::Join": [ + "", + [ + "arn:", + { + "Ref": "AWS::Partition" + }, + ":iam::", + { + "Ref": "AWS::AccountId" + }, + ":root" + ] + ] + } + }, + "Resource": { + "Fn::GetAtt": [ + "constructqueue481DC1EC", + "Arn" + ] + }, + "Sid": "QueueOwnerOnlyAccess" + }, + { + "Action": "SQS:*", + "Condition": { + "Bool": { + "aws:SecureTransport": "false" + } + }, + "Effect": "Deny", + "Principal": { + "AWS": "*" + }, + "Resource": { + "Fn::GetAtt": [ + "constructqueue481DC1EC", + "Arn" + ] + }, + "Sid": "HttpsOnly" + }, + { + "Action": [ + "sqs:GetQueueAttributes", + "sqs:GetQueueUrl", + "sqs:SendMessage" + ], + "Condition": { + "ArnEquals": { + "aws:SourceArn": { + "Fn::GetAtt": [ + "constructEventsRule43880ADB", + "Arn" + ] + } + } + }, + "Effect": "Allow", + "Principal": { + "Service": "events.amazonaws.com" + }, + "Resource": { + "Fn::GetAtt": [ + "constructqueue481DC1EC", + "Arn" + ] + } + } + ], + "Version": "2012-10-17" + }, + "queues": [ + { + "Ref": "constructqueue481DC1EC" + } + ] + } + }, + "constructInfo": { + "fqn": "aws-cdk-lib.aws_sqs.CfnQueuePolicy", + "version": "2.175.1" + } + } + }, + "constructInfo": { + "fqn": "aws-cdk-lib.aws_sqs.QueuePolicy", + "version": "2.175.1" + } + } + }, + "constructInfo": { + "fqn": "aws-cdk-lib.aws_sqs.Queue", + "version": "2.175.1" + } + }, + "ruleDlq": { + "id": "ruleDlq", + "path": "evtsqs-rule-dlq/construct/ruleDlq", + "children": { + "Resource": { + "id": "Resource", + "path": "evtsqs-rule-dlq/construct/ruleDlq/Resource", + "attributes": { + "aws:cdk:cloudformation:type": "AWS::SQS::Queue", + "aws:cdk:cloudformation:props": { + "kmsMasterKeyId": "alias/aws/sqs" + } + }, + "constructInfo": { + "fqn": "aws-cdk-lib.aws_sqs.CfnQueue", + "version": "2.175.1" + } + }, + "Policy": { + "id": "Policy", + "path": "evtsqs-rule-dlq/construct/ruleDlq/Policy", + "children": { + "Resource": { + "id": "Resource", + "path": "evtsqs-rule-dlq/construct/ruleDlq/Policy/Resource", + "attributes": { + "aws:cdk:cloudformation:type": "AWS::SQS::QueuePolicy", + "aws:cdk:cloudformation:props": { + "policyDocument": { + "Statement": [ + { + "Action": [ + "sqs:AddPermission", + "sqs:DeleteMessage", + "sqs:GetQueueAttributes", + "sqs:ReceiveMessage", + "sqs:RemovePermission", + "sqs:SendMessage", + "sqs:SetQueueAttributes" + ], + "Effect": "Allow", + "Principal": { + "AWS": { + "Fn::Join": [ + "", + [ + "arn:", + { + "Ref": "AWS::Partition" + }, + ":iam::", + { + "Ref": "AWS::AccountId" + }, + ":root" + ] + ] + } + }, + "Resource": { + "Fn::GetAtt": [ + "constructruleDlq7D359AE9", + "Arn" + ] + }, + "Sid": "QueueOwnerOnlyAccess" + }, + { + "Action": "SQS:*", + "Condition": { + "Bool": { + "aws:SecureTransport": "false" + } + }, + "Effect": "Deny", + "Principal": { + "AWS": "*" + }, + "Resource": { + "Fn::GetAtt": [ + "constructruleDlq7D359AE9", + "Arn" + ] + }, + "Sid": "HttpsOnly" + }, + { + "Action": "sqs:SendMessage", + "Condition": { + "ArnEquals": { + "aws:SourceArn": { + "Fn::GetAtt": [ + "constructEventsRule43880ADB", + "Arn" + ] + } + } + }, + "Effect": "Allow", + "Principal": { + "Service": "events.amazonaws.com" + }, + "Resource": { + "Fn::GetAtt": [ + "constructruleDlq7D359AE9", + "Arn" + ] + }, + "Sid": "AllowEventRuleevtsqsruledlqconstructEventsRule62503343" + } + ], + "Version": "2012-10-17" + }, + "queues": [ + { + "Ref": "constructruleDlq7D359AE9" + } + ] + } + }, + "constructInfo": { + "fqn": "aws-cdk-lib.aws_sqs.CfnQueuePolicy", + "version": "2.175.1" + } + } + }, + "constructInfo": { + "fqn": "aws-cdk-lib.aws_sqs.QueuePolicy", + "version": "2.175.1" + } + } + }, + "constructInfo": { + "fqn": "aws-cdk-lib.aws_sqs.Queue", + "version": "2.175.1" + } + }, + "EventsRule": { + "id": "EventsRule", + "path": "evtsqs-rule-dlq/construct/EventsRule", + "children": { + "Resource": { + "id": "Resource", + "path": "evtsqs-rule-dlq/construct/EventsRule/Resource", + "attributes": { + "aws:cdk:cloudformation:type": "AWS::Events::Rule", + "aws:cdk:cloudformation:props": { + "scheduleExpression": "rate(1 minute)", + "state": "ENABLED", + "targets": [ + { + "id": "Target0", + "arn": { + "Fn::GetAtt": [ + "constructqueue481DC1EC", + "Arn" + ] + }, + "deadLetterConfig": { + "arn": { + "Fn::GetAtt": [ + "constructruleDlq7D359AE9", + "Arn" + ] + } + } + } + ] + } + }, + "constructInfo": { + "fqn": "aws-cdk-lib.aws_events.CfnRule", + "version": "2.175.1" + } + } + }, + "constructInfo": { + "fqn": "aws-cdk-lib.aws_events.Rule", + "version": "2.175.1" + } + } + }, + "constructInfo": { + "fqn": "@aws-solutions-constructs/aws-eventbridge-sqs.EventbridgeToSqs", + "version": "2.76.0" + } + }, + "Integ": { + "id": "Integ", + "path": "evtsqs-rule-dlq/Integ", + "children": { + "DefaultTest": { + "id": "DefaultTest", + "path": "evtsqs-rule-dlq/Integ/DefaultTest", + "children": { + "Default": { + "id": "Default", + "path": "evtsqs-rule-dlq/Integ/DefaultTest/Default", + "constructInfo": { + "fqn": "constructs.Construct", + "version": "10.4.2" + } + }, + "DeployAssert": { + "id": "DeployAssert", + "path": "evtsqs-rule-dlq/Integ/DefaultTest/DeployAssert", + "children": { + "BootstrapVersion": { + "id": "BootstrapVersion", + "path": "evtsqs-rule-dlq/Integ/DefaultTest/DeployAssert/BootstrapVersion", + "constructInfo": { + "fqn": "aws-cdk-lib.CfnParameter", + "version": "2.175.1" + } + }, + "CheckBootstrapVersion": { + "id": "CheckBootstrapVersion", + "path": "evtsqs-rule-dlq/Integ/DefaultTest/DeployAssert/CheckBootstrapVersion", + "constructInfo": { + "fqn": "aws-cdk-lib.CfnRule", + "version": "2.175.1" + } + } + }, + "constructInfo": { + "fqn": "aws-cdk-lib.Stack", + "version": "2.175.1" + } + } + }, + "constructInfo": { + "fqn": "@aws-cdk/integ-tests-alpha.IntegTestCase", + "version": "2.175.1-alpha.0" + } + } + }, + "constructInfo": { + "fqn": "@aws-cdk/integ-tests-alpha.IntegTest", + "version": "2.175.1-alpha.0" + } + }, + "BootstrapVersion": { + "id": "BootstrapVersion", + "path": "evtsqs-rule-dlq/BootstrapVersion", + "constructInfo": { + "fqn": "aws-cdk-lib.CfnParameter", + "version": "2.175.1" + } + }, + "CheckBootstrapVersion": { + "id": "CheckBootstrapVersion", + "path": "evtsqs-rule-dlq/CheckBootstrapVersion", + "constructInfo": { + "fqn": "aws-cdk-lib.CfnRule", + "version": "2.175.1" + } + } + }, + "constructInfo": { + "fqn": "aws-cdk-lib.Stack", + "version": "2.175.1" + } + }, + "Tree": { + "id": "Tree", + "path": "Tree", + "constructInfo": { + "fqn": "constructs.Construct", + "version": "10.4.2" + } + } + }, + "constructInfo": { + "fqn": "aws-cdk-lib.App", + "version": "2.175.1" + } + } +} \ No newline at end of file diff --git a/source/patterns/@aws-solutions-constructs/aws-eventbridge-sqs/test/integ.evtsqs-rule-dlq.ts b/source/patterns/@aws-solutions-constructs/aws-eventbridge-sqs/test/integ.evtsqs-rule-dlq.ts new file mode 100644 index 000000000..099c5b31d --- /dev/null +++ b/source/patterns/@aws-solutions-constructs/aws-eventbridge-sqs/test/integ.evtsqs-rule-dlq.ts @@ -0,0 +1,35 @@ +/** + * Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"). You may not use this file except in compliance + * with the License. A copy of the License is located at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * or in the 'license' file accompanying this file. This file is distributed on an 'AS IS' BASIS, WITHOUT WARRANTIES + * OR CONDITIONS OF ANY KIND, express or implied. See the License for the specific language governing permissions + * and limitations under the License. + */ + +import { Duration } from 'aws-cdk-lib'; +import { EventbridgeToSqsProps, EventbridgeToSqs } from '../lib'; +import * as events from 'aws-cdk-lib/aws-events'; +import { App, Stack } from 'aws-cdk-lib'; +import { generateIntegStackName } from '@aws-solutions-constructs/core'; +import { IntegTest } from '@aws-cdk/integ-tests-alpha'; + +const app = new App(); +const stack = new Stack(app, generateIntegStackName(__filename)); + +const props: EventbridgeToSqsProps = { + eventRuleProps: { + schedule: events.Schedule.rate(Duration.minutes(1)) + }, + deployRuleDlq: true, + enableEncryptionWithCustomerManagedKey: false +}; + +new EventbridgeToSqs(stack, 'construct', props); +new IntegTest(stack, 'Integ', { testCases: [ + stack +] }); diff --git a/source/patterns/@aws-solutions-constructs/core/lib/sqs-helper.ts b/source/patterns/@aws-solutions-constructs/core/lib/sqs-helper.ts index 36ccfe629..ee3757bb1 100644 --- a/source/patterns/@aws-solutions-constructs/core/lib/sqs-helper.ts +++ b/source/patterns/@aws-solutions-constructs/core/lib/sqs-helper.ts @@ -58,7 +58,7 @@ export interface BuildQueueProps { * * @default - None */ - readonly encryptionKey?: kms.Key; + readonly encryptionKey?: kms.IKey; /** * Optional user provided properties to override the default properties for the KMS encryption key used to encrypt the SQS Queue with. *