From c508279b6f69a1126e8b58bf6bfc13d246ea2a9e Mon Sep 17 00:00:00 2001 From: biffgaut <78155736+biffgaut@users.noreply.github.com> Date: Mon, 21 Oct 2024 12:40:38 -0400 Subject: [PATCH 1/3] feat(aws-sqs-pipes-stepfunctions): new construct (#1220) * Define construct interface * Udpates, new architecture diagram * Ryan's comments * TYpo * Initial package.json file * Working implementation of pipes-helper.ts * core functionality complete * Implement Construct * Update lint ignore list * Update to match core changes * cfnGuard settings * cfnGuard queue issues * Corrected optional props * Sync docs and props code --- DESIGN_GUIDELINES.md | 6 +- .../aws-fargate-s3/lib/index.ts | 8 +- .../aws-sqs-pipes-stepfunctions/.eslintignore | 7 + .../aws-sqs-pipes-stepfunctions/.gitignore | 16 + .../aws-sqs-pipes-stepfunctions/.npmignore | 21 + .../aws-sqs-pipes-stepfunctions/README.md | 100 ++ .../architecture.png | Bin 0 -> 58677 bytes .../integ.config.json | 0 .../aws-sqs-pipes-stepfunctions/lib/index.ts | 206 +++ .../aws-sqs-pipes-stepfunctions/package.json | 96 ++ .../cdk.out | 1 + .../integ.json | 12 + .../manifest.json | 205 +++ .../sqspstp-custom-log-level.assets.json | 19 + .../sqspstp-custom-log-level.template.json | 654 +++++++++ ...efaultTestDeployAssertD542618D.assets.json | 19 + ...aultTestDeployAssertD542618D.template.json | 36 + .../tree.json | 957 +++++++++++++ .../test/integ.sqspstp-custom-log-level.ts | 35 + .../cdk.out | 1 + .../integ.json | 12 + .../manifest.json | 205 +++ .../sqspstp-existing-queue.assets.json | 19 + .../sqspstp-existing-queue.template.json | 654 +++++++++ ...efaultTestDeployAssert6DA9FDD7.assets.json | 19 + ...aultTestDeployAssert6DA9FDD7.template.json | 36 + .../tree.json | 957 +++++++++++++ .../test/integ.sqspstp-existing-queue.ts | 38 + .../integ.sqspstp-filter.js.snapshot/cdk.out | 1 + .../integ.json | 12 + .../manifest.json | 205 +++ .../sqspstp-filter.assets.json | 19 + .../sqspstp-filter.template.json | 662 +++++++++ ...efaultTestDeployAssert0C52837E.assets.json | 19 + ...aultTestDeployAssert0C52837E.template.json | 36 + .../tree.json | 965 +++++++++++++ .../test/integ.sqspstp-filter.ts | 47 + .../index.js | 9 + .../cdk.out | 1 + .../integ.json | 12 + .../manifest.json | 223 +++ ...stp-lambda-function-enrichment.assets.json | 32 + ...p-lambda-function-enrichment.template.json | 757 ++++++++++ ...efaultTestDeployAssert1F2A8125.assets.json | 19 + ...aultTestDeployAssert1F2A8125.template.json | 36 + .../tree.json | 1127 +++++++++++++++ ...nteg.sqspstp-lambda-function-enrichment.ts | 43 + .../cdk.out | 1 + .../integ.json | 12 + .../manifest.json | 199 +++ .../sqspstp-logs-off.assets.json | 19 + .../sqspstp-logs-off.template.json | 601 ++++++++ ...efaultTestDeployAssert25C29ACD.assets.json | 19 + ...aultTestDeployAssert25C29ACD.template.json | 36 + .../tree.json | 902 ++++++++++++ .../test/integ.sqspstp-logs-off.ts | 35 + .../cdk.out | 1 + .../integ.json | 12 + .../manifest.json | 205 +++ .../sqspstp-no-arguments.assets.json | 19 + .../sqspstp-no-arguments.template.json | 654 +++++++++ ...efaultTestDeployAssert83953622.assets.json | 19 + ...aultTestDeployAssert83953622.template.json | 36 + .../tree.json | 957 +++++++++++++ .../test/integ.sqspstp-no-arguments.ts | 34 + .../cdk.out | 1 + .../integ.json | 12 + .../manifest.json | 205 +++ .../sqspstp-set-queue-batch-size.assets.json | 19 + ...sqspstp-set-queue-batch-size.template.json | 658 +++++++++ ...efaultTestDeployAssertA1752E9D.assets.json | 19 + ...aultTestDeployAssertA1752E9D.template.json | 36 + .../tree.json | 961 +++++++++++++ .../integ.sqspstp-set-queue-batch-size.ts | 41 + .../cdk.out | 1 + .../integ.json | 12 + .../manifest.json | 241 ++++ ...spstp-state-machine-enrichment.assets.json | 19 + ...stp-state-machine-enrichment.template.json | 868 ++++++++++++ ...efaultTestDeployAssert47A5DE6D.assets.json | 19 + ...aultTestDeployAssert47A5DE6D.template.json | 36 + .../tree.json | 1252 +++++++++++++++++ .../integ.sqspstp-state-machine-enrichment.ts | 40 + .../test/lambda/index.js | 9 + .../test/sqs-pipes-stepfunctions.test.ts | 425 ++++++ .../@aws-solutions-constructs/core/index.ts | 2 + .../core/lib/apigateway-defaults.ts | 4 +- .../lib/cloudfront-distribution-helper.ts | 4 +- .../core/lib/kendra-defaults.ts | 4 +- .../core/lib/kendra-helper.ts | 4 +- .../core/lib/pipes-defaults.ts | 31 + .../core/lib/pipes-helper.ts | 257 ++++ .../core/lib/step-function-helper.ts | 6 +- .../core/lib/utils.ts | 36 + .../core/test/pipes-helper.test.ts | 811 +++++++++++ .../core/test/test-helper.ts | 7 +- .../core/test/utils.test.ts | 13 + 97 files changed, 18356 insertions(+), 22 deletions(-) create mode 100644 source/patterns/@aws-solutions-constructs/aws-sqs-pipes-stepfunctions/.eslintignore create mode 100644 source/patterns/@aws-solutions-constructs/aws-sqs-pipes-stepfunctions/.gitignore create mode 100644 source/patterns/@aws-solutions-constructs/aws-sqs-pipes-stepfunctions/.npmignore create mode 100644 source/patterns/@aws-solutions-constructs/aws-sqs-pipes-stepfunctions/README.md create mode 100644 source/patterns/@aws-solutions-constructs/aws-sqs-pipes-stepfunctions/architecture.png create mode 100644 source/patterns/@aws-solutions-constructs/aws-sqs-pipes-stepfunctions/integ.config.json create mode 100644 source/patterns/@aws-solutions-constructs/aws-sqs-pipes-stepfunctions/lib/index.ts create mode 100644 source/patterns/@aws-solutions-constructs/aws-sqs-pipes-stepfunctions/package.json create mode 100644 source/patterns/@aws-solutions-constructs/aws-sqs-pipes-stepfunctions/test/integ.sqspstp-custom-log-level.js.snapshot/cdk.out create mode 100644 source/patterns/@aws-solutions-constructs/aws-sqs-pipes-stepfunctions/test/integ.sqspstp-custom-log-level.js.snapshot/integ.json create mode 100644 source/patterns/@aws-solutions-constructs/aws-sqs-pipes-stepfunctions/test/integ.sqspstp-custom-log-level.js.snapshot/manifest.json create mode 100644 source/patterns/@aws-solutions-constructs/aws-sqs-pipes-stepfunctions/test/integ.sqspstp-custom-log-level.js.snapshot/sqspstp-custom-log-level.assets.json create mode 100644 source/patterns/@aws-solutions-constructs/aws-sqs-pipes-stepfunctions/test/integ.sqspstp-custom-log-level.js.snapshot/sqspstp-custom-log-level.template.json create mode 100644 source/patterns/@aws-solutions-constructs/aws-sqs-pipes-stepfunctions/test/integ.sqspstp-custom-log-level.js.snapshot/sqspstpcustomloglevelIntegDefaultTestDeployAssertD542618D.assets.json create mode 100644 source/patterns/@aws-solutions-constructs/aws-sqs-pipes-stepfunctions/test/integ.sqspstp-custom-log-level.js.snapshot/sqspstpcustomloglevelIntegDefaultTestDeployAssertD542618D.template.json create mode 100644 source/patterns/@aws-solutions-constructs/aws-sqs-pipes-stepfunctions/test/integ.sqspstp-custom-log-level.js.snapshot/tree.json create mode 100644 source/patterns/@aws-solutions-constructs/aws-sqs-pipes-stepfunctions/test/integ.sqspstp-custom-log-level.ts create mode 100644 source/patterns/@aws-solutions-constructs/aws-sqs-pipes-stepfunctions/test/integ.sqspstp-existing-queue.js.snapshot/cdk.out create mode 100644 source/patterns/@aws-solutions-constructs/aws-sqs-pipes-stepfunctions/test/integ.sqspstp-existing-queue.js.snapshot/integ.json create mode 100644 source/patterns/@aws-solutions-constructs/aws-sqs-pipes-stepfunctions/test/integ.sqspstp-existing-queue.js.snapshot/manifest.json create mode 100644 source/patterns/@aws-solutions-constructs/aws-sqs-pipes-stepfunctions/test/integ.sqspstp-existing-queue.js.snapshot/sqspstp-existing-queue.assets.json create mode 100644 source/patterns/@aws-solutions-constructs/aws-sqs-pipes-stepfunctions/test/integ.sqspstp-existing-queue.js.snapshot/sqspstp-existing-queue.template.json create mode 100644 source/patterns/@aws-solutions-constructs/aws-sqs-pipes-stepfunctions/test/integ.sqspstp-existing-queue.js.snapshot/sqspstpexistingqueueIntegDefaultTestDeployAssert6DA9FDD7.assets.json create mode 100644 source/patterns/@aws-solutions-constructs/aws-sqs-pipes-stepfunctions/test/integ.sqspstp-existing-queue.js.snapshot/sqspstpexistingqueueIntegDefaultTestDeployAssert6DA9FDD7.template.json create mode 100644 source/patterns/@aws-solutions-constructs/aws-sqs-pipes-stepfunctions/test/integ.sqspstp-existing-queue.js.snapshot/tree.json create mode 100644 source/patterns/@aws-solutions-constructs/aws-sqs-pipes-stepfunctions/test/integ.sqspstp-existing-queue.ts create mode 100644 source/patterns/@aws-solutions-constructs/aws-sqs-pipes-stepfunctions/test/integ.sqspstp-filter.js.snapshot/cdk.out create mode 100644 source/patterns/@aws-solutions-constructs/aws-sqs-pipes-stepfunctions/test/integ.sqspstp-filter.js.snapshot/integ.json create mode 100644 source/patterns/@aws-solutions-constructs/aws-sqs-pipes-stepfunctions/test/integ.sqspstp-filter.js.snapshot/manifest.json create mode 100644 source/patterns/@aws-solutions-constructs/aws-sqs-pipes-stepfunctions/test/integ.sqspstp-filter.js.snapshot/sqspstp-filter.assets.json create mode 100644 source/patterns/@aws-solutions-constructs/aws-sqs-pipes-stepfunctions/test/integ.sqspstp-filter.js.snapshot/sqspstp-filter.template.json create mode 100644 source/patterns/@aws-solutions-constructs/aws-sqs-pipes-stepfunctions/test/integ.sqspstp-filter.js.snapshot/sqspstpfilterIntegDefaultTestDeployAssert0C52837E.assets.json create mode 100644 source/patterns/@aws-solutions-constructs/aws-sqs-pipes-stepfunctions/test/integ.sqspstp-filter.js.snapshot/sqspstpfilterIntegDefaultTestDeployAssert0C52837E.template.json create mode 100644 source/patterns/@aws-solutions-constructs/aws-sqs-pipes-stepfunctions/test/integ.sqspstp-filter.js.snapshot/tree.json create mode 100644 source/patterns/@aws-solutions-constructs/aws-sqs-pipes-stepfunctions/test/integ.sqspstp-filter.ts create mode 100644 source/patterns/@aws-solutions-constructs/aws-sqs-pipes-stepfunctions/test/integ.sqspstp-lambda-function-enrichment.js.snapshot/asset.33adcab38bd8c4e154734b436a40ee81920a89cd6c787ce62302c33df5e1dfcb/index.js create mode 100644 source/patterns/@aws-solutions-constructs/aws-sqs-pipes-stepfunctions/test/integ.sqspstp-lambda-function-enrichment.js.snapshot/cdk.out create mode 100644 source/patterns/@aws-solutions-constructs/aws-sqs-pipes-stepfunctions/test/integ.sqspstp-lambda-function-enrichment.js.snapshot/integ.json create mode 100644 source/patterns/@aws-solutions-constructs/aws-sqs-pipes-stepfunctions/test/integ.sqspstp-lambda-function-enrichment.js.snapshot/manifest.json create mode 100644 source/patterns/@aws-solutions-constructs/aws-sqs-pipes-stepfunctions/test/integ.sqspstp-lambda-function-enrichment.js.snapshot/sqspstp-lambda-function-enrichment.assets.json create mode 100644 source/patterns/@aws-solutions-constructs/aws-sqs-pipes-stepfunctions/test/integ.sqspstp-lambda-function-enrichment.js.snapshot/sqspstp-lambda-function-enrichment.template.json create mode 100644 source/patterns/@aws-solutions-constructs/aws-sqs-pipes-stepfunctions/test/integ.sqspstp-lambda-function-enrichment.js.snapshot/sqspstplambdafunctionenrichmentIntegDefaultTestDeployAssert1F2A8125.assets.json create mode 100644 source/patterns/@aws-solutions-constructs/aws-sqs-pipes-stepfunctions/test/integ.sqspstp-lambda-function-enrichment.js.snapshot/sqspstplambdafunctionenrichmentIntegDefaultTestDeployAssert1F2A8125.template.json create mode 100644 source/patterns/@aws-solutions-constructs/aws-sqs-pipes-stepfunctions/test/integ.sqspstp-lambda-function-enrichment.js.snapshot/tree.json create mode 100644 source/patterns/@aws-solutions-constructs/aws-sqs-pipes-stepfunctions/test/integ.sqspstp-lambda-function-enrichment.ts create mode 100644 source/patterns/@aws-solutions-constructs/aws-sqs-pipes-stepfunctions/test/integ.sqspstp-logs-off.js.snapshot/cdk.out create mode 100644 source/patterns/@aws-solutions-constructs/aws-sqs-pipes-stepfunctions/test/integ.sqspstp-logs-off.js.snapshot/integ.json create mode 100644 source/patterns/@aws-solutions-constructs/aws-sqs-pipes-stepfunctions/test/integ.sqspstp-logs-off.js.snapshot/manifest.json create mode 100644 source/patterns/@aws-solutions-constructs/aws-sqs-pipes-stepfunctions/test/integ.sqspstp-logs-off.js.snapshot/sqspstp-logs-off.assets.json create mode 100644 source/patterns/@aws-solutions-constructs/aws-sqs-pipes-stepfunctions/test/integ.sqspstp-logs-off.js.snapshot/sqspstp-logs-off.template.json create mode 100644 source/patterns/@aws-solutions-constructs/aws-sqs-pipes-stepfunctions/test/integ.sqspstp-logs-off.js.snapshot/sqspstplogsoffIntegDefaultTestDeployAssert25C29ACD.assets.json create mode 100644 source/patterns/@aws-solutions-constructs/aws-sqs-pipes-stepfunctions/test/integ.sqspstp-logs-off.js.snapshot/sqspstplogsoffIntegDefaultTestDeployAssert25C29ACD.template.json create mode 100644 source/patterns/@aws-solutions-constructs/aws-sqs-pipes-stepfunctions/test/integ.sqspstp-logs-off.js.snapshot/tree.json create mode 100644 source/patterns/@aws-solutions-constructs/aws-sqs-pipes-stepfunctions/test/integ.sqspstp-logs-off.ts create mode 100644 source/patterns/@aws-solutions-constructs/aws-sqs-pipes-stepfunctions/test/integ.sqspstp-no-arguments.js.snapshot/cdk.out create mode 100644 source/patterns/@aws-solutions-constructs/aws-sqs-pipes-stepfunctions/test/integ.sqspstp-no-arguments.js.snapshot/integ.json create mode 100644 source/patterns/@aws-solutions-constructs/aws-sqs-pipes-stepfunctions/test/integ.sqspstp-no-arguments.js.snapshot/manifest.json create mode 100644 source/patterns/@aws-solutions-constructs/aws-sqs-pipes-stepfunctions/test/integ.sqspstp-no-arguments.js.snapshot/sqspstp-no-arguments.assets.json create mode 100644 source/patterns/@aws-solutions-constructs/aws-sqs-pipes-stepfunctions/test/integ.sqspstp-no-arguments.js.snapshot/sqspstp-no-arguments.template.json create mode 100644 source/patterns/@aws-solutions-constructs/aws-sqs-pipes-stepfunctions/test/integ.sqspstp-no-arguments.js.snapshot/sqspstpnoargumentsIntegDefaultTestDeployAssert83953622.assets.json create mode 100644 source/patterns/@aws-solutions-constructs/aws-sqs-pipes-stepfunctions/test/integ.sqspstp-no-arguments.js.snapshot/sqspstpnoargumentsIntegDefaultTestDeployAssert83953622.template.json create mode 100644 source/patterns/@aws-solutions-constructs/aws-sqs-pipes-stepfunctions/test/integ.sqspstp-no-arguments.js.snapshot/tree.json create mode 100644 source/patterns/@aws-solutions-constructs/aws-sqs-pipes-stepfunctions/test/integ.sqspstp-no-arguments.ts create mode 100644 source/patterns/@aws-solutions-constructs/aws-sqs-pipes-stepfunctions/test/integ.sqspstp-set-queue-batch-size.js.snapshot/cdk.out create mode 100644 source/patterns/@aws-solutions-constructs/aws-sqs-pipes-stepfunctions/test/integ.sqspstp-set-queue-batch-size.js.snapshot/integ.json create mode 100644 source/patterns/@aws-solutions-constructs/aws-sqs-pipes-stepfunctions/test/integ.sqspstp-set-queue-batch-size.js.snapshot/manifest.json create mode 100644 source/patterns/@aws-solutions-constructs/aws-sqs-pipes-stepfunctions/test/integ.sqspstp-set-queue-batch-size.js.snapshot/sqspstp-set-queue-batch-size.assets.json create mode 100644 source/patterns/@aws-solutions-constructs/aws-sqs-pipes-stepfunctions/test/integ.sqspstp-set-queue-batch-size.js.snapshot/sqspstp-set-queue-batch-size.template.json create mode 100644 source/patterns/@aws-solutions-constructs/aws-sqs-pipes-stepfunctions/test/integ.sqspstp-set-queue-batch-size.js.snapshot/sqspstpsetqueuebatchsizeIntegDefaultTestDeployAssertA1752E9D.assets.json create mode 100644 source/patterns/@aws-solutions-constructs/aws-sqs-pipes-stepfunctions/test/integ.sqspstp-set-queue-batch-size.js.snapshot/sqspstpsetqueuebatchsizeIntegDefaultTestDeployAssertA1752E9D.template.json create mode 100644 source/patterns/@aws-solutions-constructs/aws-sqs-pipes-stepfunctions/test/integ.sqspstp-set-queue-batch-size.js.snapshot/tree.json create mode 100644 source/patterns/@aws-solutions-constructs/aws-sqs-pipes-stepfunctions/test/integ.sqspstp-set-queue-batch-size.ts create mode 100644 source/patterns/@aws-solutions-constructs/aws-sqs-pipes-stepfunctions/test/integ.sqspstp-state-machine-enrichment.js.snapshot/cdk.out create mode 100644 source/patterns/@aws-solutions-constructs/aws-sqs-pipes-stepfunctions/test/integ.sqspstp-state-machine-enrichment.js.snapshot/integ.json create mode 100644 source/patterns/@aws-solutions-constructs/aws-sqs-pipes-stepfunctions/test/integ.sqspstp-state-machine-enrichment.js.snapshot/manifest.json create mode 100644 source/patterns/@aws-solutions-constructs/aws-sqs-pipes-stepfunctions/test/integ.sqspstp-state-machine-enrichment.js.snapshot/sqspstp-state-machine-enrichment.assets.json create mode 100644 source/patterns/@aws-solutions-constructs/aws-sqs-pipes-stepfunctions/test/integ.sqspstp-state-machine-enrichment.js.snapshot/sqspstp-state-machine-enrichment.template.json create mode 100644 source/patterns/@aws-solutions-constructs/aws-sqs-pipes-stepfunctions/test/integ.sqspstp-state-machine-enrichment.js.snapshot/sqspstpstatemachineenrichmentIntegDefaultTestDeployAssert47A5DE6D.assets.json create mode 100644 source/patterns/@aws-solutions-constructs/aws-sqs-pipes-stepfunctions/test/integ.sqspstp-state-machine-enrichment.js.snapshot/sqspstpstatemachineenrichmentIntegDefaultTestDeployAssert47A5DE6D.template.json create mode 100644 source/patterns/@aws-solutions-constructs/aws-sqs-pipes-stepfunctions/test/integ.sqspstp-state-machine-enrichment.js.snapshot/tree.json create mode 100644 source/patterns/@aws-solutions-constructs/aws-sqs-pipes-stepfunctions/test/integ.sqspstp-state-machine-enrichment.ts create mode 100644 source/patterns/@aws-solutions-constructs/aws-sqs-pipes-stepfunctions/test/lambda/index.js create mode 100644 source/patterns/@aws-solutions-constructs/aws-sqs-pipes-stepfunctions/test/sqs-pipes-stepfunctions.test.ts create mode 100644 source/patterns/@aws-solutions-constructs/core/lib/pipes-defaults.ts create mode 100644 source/patterns/@aws-solutions-constructs/core/lib/pipes-helper.ts create mode 100644 source/patterns/@aws-solutions-constructs/core/test/pipes-helper.test.ts diff --git a/DESIGN_GUIDELINES.md b/DESIGN_GUIDELINES.md index a7cf6f699..4c06c52e3 100644 --- a/DESIGN_GUIDELINES.md +++ b/DESIGN_GUIDELINES.md @@ -332,9 +332,9 @@ Existing Inconsistencies would not be published, that’s for our internal use | deadLetterQueueProps? | [`sqs.QueueProps`](https://docs.aws.amazon.com/cdk/api/v2/docs/aws-cdk-lib.aws_sqs.QueueProps.html)|Optional user provided props to override the default props for the SQS queue.| | maxReceiveCount | `int` | The number of times a message can be unsuccessfully dequeued before being moved to the dead letter queue. Defaults to `15`. | | enableQueuePurging | `boolean` | Whether to grant additional permissions to the Lambda function enabling it to purge the SQS queue. Defaults to `false`. | This is only on 2 constructs, docs talk about a Lambda function role.| -|enableEncryptionWithCustomerManagedKey?|`boolean`|If no key is provided, this flag determines whether the queue is encrypted with a new CMK or an AWS managed key. |This flag is ignored if any of the following are defined: queueProps.encryptionMasterKey, encryptionKey or encryptionKeyProps.| -|encryptionKey?|[`kms.Key`](https://docs.aws.amazon.com/cdk/api/v2/docs/aws-cdk-lib.aws_kms.Key.html)|An optional, imported encryption key to encrypt the SQS Queue with.|Sending messages from an AWS service to an encrypted queue [requires a Customer Master key](https://docs.aws.amazon.com/AWSSimpleQueueService/latest/SQSDeveloperGuide/sqs-key-management.html#compatibility-with-aws-services). Those constructs require these properties. | -|encryptionKeyProps?|[`kms.KeyProps`](https://docs.aws.amazon.com/cdk/api/v2/docs/aws-cdk-lib.aws_kms.Key.html#construct-props)|Optional user provided properties to override the default properties for the KMS encryption key used to encrypt the SQS queue with.| +|enableEncryptionWithCustomerManagedKey? or encryptQueueWithCmk?|`boolean`|If no key is provided, this flag determines whether the queue is encrypted with a new CMK or an AWS managed key. |In early constructs, the enableEncryptionKeyWithCustomerManagedKey name was used. Later constructs saw name collisions with this name and services like SNS, so the new queue specific name was adopted. This flag is ignored if any of the following are defined: queueProps.encryptionMasterKey, encryptionKey or encryptionKeyProps.| +|encryptionKey? or queueEncryptionKey?|[`kms.Key`](https://docs.aws.amazon.com/cdk/api/v2/docs/aws-cdk-lib.aws_kms.Key.html)|An optional, imported encryption key to encrypt the SQS Queue with.|Sending messages from an AWS service to an encrypted queue [requires a Customer Master key](https://docs.aws.amazon.com/AWSSimpleQueueService/latest/SQSDeveloperGuide/sqs-key-management.html#compatibility-with-aws-services). Those constructs require these properties. In early constructs, the enableEncryptionKeyWithCustomerManagedKey name was used. Later constructs saw name collisions with this name and services like SNS, so the new queue specific name was adopted. | +|encryptionKeyProps? or queueEncryptionKeyProps?|[`kms.KeyProps`](https://docs.aws.amazon.com/cdk/api/v2/docs/aws-cdk-lib.aws_kms.Key.html#construct-props)|Optional user provided properties to override the default properties for the KMS encryption key used to encrypt the SQS queue with.|In early constructs, the enableEncryptionKeyWithCustomerManagedKey name was used. Later constructs saw name collisions with this name and services like SNS, so the new queue specific name was adopted. | **Required Construct Properties** diff --git a/source/patterns/@aws-solutions-constructs/aws-fargate-s3/lib/index.ts b/source/patterns/@aws-solutions-constructs/aws-fargate-s3/lib/index.ts index d04dbf50d..1fae0770f 100644 --- a/source/patterns/@aws-solutions-constructs/aws-fargate-s3/lib/index.ts +++ b/source/patterns/@aws-solutions-constructs/aws-fargate-s3/lib/index.ts @@ -240,14 +240,10 @@ export class FargateToS3 extends Construct { } // Add environment variables - const bucketArnEnvironmentVariableName = this.SetStringWithDefault(props.bucketArnEnvironmentVariableName, 'S3_BUCKET_ARN'); + const bucketArnEnvironmentVariableName = defaults.CheckStringWithDefault(props.bucketArnEnvironmentVariableName, 'S3_BUCKET_ARN'); this.container.addEnvironment(bucketArnEnvironmentVariableName, this.s3BucketInterface.bucketArn); - const bucketEnvironmentVariableName = this.SetStringWithDefault(props.bucketEnvironmentVariableName, 'S3_BUCKET_NAME'); + const bucketEnvironmentVariableName = defaults.CheckStringWithDefault(props.bucketEnvironmentVariableName, 'S3_BUCKET_NAME'); this.container.addEnvironment(bucketEnvironmentVariableName, this.s3BucketInterface.bucketName); } - - private SetStringWithDefault(value: string | undefined, defaultValue: string) { - return value || defaultValue; - } } diff --git a/source/patterns/@aws-solutions-constructs/aws-sqs-pipes-stepfunctions/.eslintignore b/source/patterns/@aws-solutions-constructs/aws-sqs-pipes-stepfunctions/.eslintignore new file mode 100644 index 000000000..4866847c3 --- /dev/null +++ b/source/patterns/@aws-solutions-constructs/aws-sqs-pipes-stepfunctions/.eslintignore @@ -0,0 +1,7 @@ +lib/*.js +test/*.js +*.d.ts +coverage +test/integ.*.js.snapshot/ +test/cdk-integ.out.integ.*.snapshot +test/lambda \ No newline at end of file diff --git a/source/patterns/@aws-solutions-constructs/aws-sqs-pipes-stepfunctions/.gitignore b/source/patterns/@aws-solutions-constructs/aws-sqs-pipes-stepfunctions/.gitignore new file mode 100644 index 000000000..8626f2274 --- /dev/null +++ b/source/patterns/@aws-solutions-constructs/aws-sqs-pipes-stepfunctions/.gitignore @@ -0,0 +1,16 @@ +lib/*.js +test/*.js +!test/lambda/* +*.js.map +*.d.ts +node_modules +*.generated.ts +dist +.jsii + +.LAST_BUILD +.nyc_output +coverage +.nycrc +.LAST_PACKAGE +*.snk \ No newline at end of file diff --git a/source/patterns/@aws-solutions-constructs/aws-sqs-pipes-stepfunctions/.npmignore b/source/patterns/@aws-solutions-constructs/aws-sqs-pipes-stepfunctions/.npmignore new file mode 100644 index 000000000..f66791629 --- /dev/null +++ b/source/patterns/@aws-solutions-constructs/aws-sqs-pipes-stepfunctions/.npmignore @@ -0,0 +1,21 @@ +# Exclude typescript source and config +*.ts +tsconfig.json +coverage +.nyc_output +*.tgz +*.snk +*.tsbuildinfo + +# Include javascript files and typescript declarations +!*.js +!*.d.ts + +# Exclude jsii outdir +dist + +# Include .jsii +!.jsii + +# Include .jsii +!.jsii \ No newline at end of file diff --git a/source/patterns/@aws-solutions-constructs/aws-sqs-pipes-stepfunctions/README.md b/source/patterns/@aws-solutions-constructs/aws-sqs-pipes-stepfunctions/README.md new file mode 100644 index 000000000..2ce7bff79 --- /dev/null +++ b/source/patterns/@aws-solutions-constructs/aws-sqs-pipes-stepfunctions/README.md @@ -0,0 +1,100 @@ +# aws-sqs-pipes-stepfunctions module + + +--- + +![Stability: Experimental](https://img.shields.io/badge/stability-Experimental-important.svg?style=for-the-badge) + +--- + + +| **Reference Documentation**:| https://docs.aws.amazon.com/solutions/latest/constructs/| +|:-------------|:-------------| +
+ +| **Language** | **Package** | +|:-------------|-----------------| +|![Python Logo](https://docs.aws.amazon.com/cdk/api/latest/img/python32.png) Python|`aws_solutions_constructs.aws_sqs_pipes_stepfunctions`| +|![Typescript Logo](https://docs.aws.amazon.com/cdk/api/latest/img/typescript32.png) Typescript|`@aws-solutions-constructs/aws-sqs-pipes-stepfunctions`| +|![Java Logo](https://docs.aws.amazon.com/cdk/api/latest/img/java32.png) Java|`software.amazon.awsconstructs.services.sqspipesstepfunctions`| + +## Overview +This AWS Solutions Construct implements an AWS SQS queue whose messages are passed to an AWS Step Functions state machine by an Amazon Eventbridge pipe. + +Here is a minimal deployable pattern definition: + +Typescript +``` typescript +import { Construct } from 'constructs'; +import { Stack, StackProps } from 'aws-cdk-lib'; +import * as stepfunctions from 'aws-cdk-lib/aws-stepfunctions'; +import { SqsToPipesToStepfunctions, SqsToPipesToStepfunctionsProps } from "@aws-solutions-constructs/aws-sqs-pipes-stepfunctions"; + +const startState = new stepfunctions.Pass(this, 'StartState'); + +new SqsToPipesToStepfunctions(this, 'SqsToLambdaToStepfunctionsPattern', { + stateMachineProps: { + definition: startState + } +}); +``` + +## Pattern Construct Props + +| **Name** | **Type** | **Description** | +|:-------------|:----------------|-----------------| +|existingQueueObj?|[`sqs.Queue`](https://docs.aws.amazon.com/cdk/api/v2/docs/aws-cdk-lib.aws_sqs.Queue.html)|An optional, existing SQS queue to be used instead of the default queue. Providing both this and `queueProps` will cause an error.| +|queueProps?|[`sqs.QueueProps`](https://docs.aws.amazon.com/cdk/api/v2/docs/aws-cdk-lib.aws_sqs.QueueProps.html)|Optional user provided properties to override the default properties for the SQS queue.| +|encryptQueueWithCmk|`boolean`|Whether to encrypt the Queue with a customer managed KMS key (CMK). This is the default behavior, and this property defaults to true - if it is explicitly set to false then the Queue is encrypted with an Amazon managed KMS key. For a completely unencrypted Queue (not recommended), create the Queue separately from the construct and pass it in using the existingQueueObject. Since SNS subscriptions do not currently support SQS queues with AWS managed encryption keys, setting this to false will always result in an error from the underlying CDK - we have still included this property for consistency with topics and to be ready if the services one day support this functionality.| +|queueEncryptionKeyProps?|[`kms.KeyProps`](https://docs.aws.amazon.com/cdk/api/v2/docs/aws-cdk-lib.aws_kms.Key.html#construct-props)|An optional subset of key properties to override the default properties used by constructs (`enableKeyRotation: true`). These properties will be used in constructing the CMK used to encrypt the SQS queue.| +|existingQueueEncryptionKey?|[`kms.Key`](https://docs.aws.amazon.com/cdk/api/v2/docs/aws-cdk-lib.aws_kms.Key.html)|An optional CMK that will be used by the construct to encrypt the new SQS queue.| +|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/v2/docs/aws-cdk-lib.aws_sqs.QueueProps.html)|Optional user-provided props to override the default props for the dead letter SQS queue.| +|maxReceiveCount?|`number`|The number of times a message can be unsuccessfully dequeued before being moved to the dead letter queue. Defaults to 15.| +|stateMachineProps|[`sfn.StateMachineProps`](https://docs.aws.amazon.com/cdk/api/v2/docs/aws-cdk-lib.aws_stepfunctions.StateMachineProps.html)|User provided props for the sfn.StateMachine.| +|createCloudWatchAlarms?|`boolean`|Whether to create recommended CloudWatch alarms| +| logGroupProps? | [logs.logGroupProps ](https://docs.aws.amazon.com/cdk/api/v2/docs/aws-cdk-lib.aws_logs.LogGroupProps.html)| Optional user provided props to override the default props for for the CloudWatchLogs LogGroup for the state machine. | +|pipeProps?|[ pipes.CfnPipeProps ](https://docs.aws.amazon.com/cdk/api/v2/docs/aws-cdk-lib.aws_pipes.CfnPipeProps.html)|Optional customer provided settings for the EventBridge pipe. source, target, roleArn and enrichment settings are set by the construct and cannot be overriden here. The construct will generate default sourceParameters, targetParameters and logConfiguration (found [here](link)) that can be overriden by populating those values in these props. If the client wants to implement enrichment or a filter, this is where that information can be provided. Any other props can be freely overridden. If a client wants to set values such as batchSize, that can be done here in the sourceParameters property.| +| enrichmentFunction? | [lambda.Function ](https://docs.aws.amazon.com/cdk/api/v2/docs/aws-cdk-lib.aws_lambda.Function.html) | Optional - Lambda function that the construct will configure to be called to enrich the message between source and target. The construct will configure the pipe IAM role to allow invoking the function (but will not affect the IArole assigned to the function). Specifying both this and enrichmentStateMachine is an error. Default - undefined | +| enrichmentStateMachine? | [sfn.StateMachine ](https://docs.aws.amazon.com/cdk/api/v2/docs/aws-cdk-lib.aws_stepfunctions.StateMachine.html) | Optional - Step Functions state machine that the construct will configure to be called to enrich the message between source and target. The construct will configure the pipe IAM role to allow executing the state machine (but will not affect the IAM role assigned to the state machine). Specifying both this and enrichmentStateMachine is an error. Default - undefined | +|logLevel?|PipesLogLevel|Threshold for what messages the new pipe sends to the log, PipesLogLevel.OFF, PipesLogLevel.ERROR, PipesLogLevel.INFO, PipesLogLevel.TRACE. The default is INFO. Setting the level to OFF will prevent any log group from being created. Providing pipeProps.logConfiguration will controls all aspects of logging and any construct provided log configuration is disabled. If pipeProps.logConfiguration is provided then specifying this or pipeLogProps is an error. | +|pipeLogProps?|[logs.LogGroupProps]()| Default behavior is for the this construct to create a new CloudWatch Logs log group for the pipe. These props are used to override defaults set by AWS or this construct. If there are concerns about the cost of log storage, this is where a client can specify a shorter retention duration (in days) | + +## Pattern Properties + +| **Name** | **Type** | **Description** | +|:-------------|:----------------|-----------------| +|stateMachine|[`sfn.StateMachine`](https://docs.aws.amazon.com/cdk/api/v2/docs/aws-cdk-lib.aws_stepfunctions.StateMachine.html)|Returns an instance of StateMachine created by the construct.| +|stateMachineLogGroup|[`logs.ILogGroup`](https://docs.aws.amazon.com/cdk/api/v2/docs/aws-cdk-lib.aws_logs.ILogGroup.html)|Returns an instance of the ILogGroup created by the construct for StateMachine| +|cloudwatchAlarms?|[`cloudwatch.Alarm[]`](https://docs.aws.amazon.com/cdk/api/v2/docs/aws-cdk-lib.aws_cloudwatch.Alarm.html)|Returns a list of alarms created by the construct.| +|sqsQueue|[`sqs.Queue`](https://docs.aws.amazon.com/cdk/api/v2/docs/aws-cdk-lib.aws_sqs.Queue.html)|Returns an instance of the SQS queue created by the pattern. | +|deadLetterQueue?|[`sqs.Queue`](https://docs.aws.amazon.com/cdk/api/v2/docs/aws-cdk-lib.aws_sqs.Queue.html)|Returns an instance of the dead letter queue created by the pattern, if one is deployed.| +|encryptionKey?|[kms.IKey](https://docs.aws.amazon.com/cdk/api/v2/docs/aws-cdk-lib.aws_kms.IKey.html)|Returns an instance of kms.Key used for the SQS queue if key is customer managed.| +|pipe|[ pipes.CfnPipe](https://docs.aws.amazon.com/cdk/api/v2/docs/aws-cdk-lib.aws_pipes.CfnPipe.html)| The L1 pipe construct created by this Solutions Construct. | +| pipeRole | [iam.Role ](https://docs.aws.amazon.com/cdk/api/v2/docs/aws-cdk-lib.aws_iam.Role.html) | The role created that allows the pipe to access both the source and the target. | + +## Default settings + +Out of the box implementation of the Construct without any override will set the following defaults: + +### 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 + +### AWS Step Functions State Machine +* Deploy Step Functions standard state machine +* Create CloudWatch log group with /vendedlogs/ prefix in name +* Deploy best practices CloudWatch Alarms for the Step Functions + +### AWS EventBridge Pipe +* Pipe configured with an SQS queue source and state machine target +* A least privilege IAM role assigned to the pipe to access the queue and state machine +* CloudWatch logs set up at the 'INFO' level +* Encrypted with an AWS managed KMS key + +## Architecture +![Architecture Diagram](architecture.png) + +*** +© Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. \ No newline at end of file diff --git a/source/patterns/@aws-solutions-constructs/aws-sqs-pipes-stepfunctions/architecture.png b/source/patterns/@aws-solutions-constructs/aws-sqs-pipes-stepfunctions/architecture.png new file mode 100644 index 0000000000000000000000000000000000000000..1838dfc7cfdf2278f6615e2d5f7c2b715bfb26fd GIT binary patch literal 58677 zcmeFZg@)qPc@Z@ZqnSmbm%WeuuDR3YuX6 zF|=2!YwtXZ_roN^wl8VDx$)WSGWo4e^;Y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>U4REP zJR6GH3B|mp+^JqDQ*dOBi**AN(_&}oDwyjhqS>plXjy`xr=;H!JRTM3@w^k#voR+L zEq!lSAb$ntf2oOTKn6F&15DrPXvsQ?;8sT%3lc0}Szkn#R40HK20uVT zoSY8j0WPl>YMpXImamxVzT>2M&cxzxK+)_30@-$e*Fp9o87I^z2`%^Dl!*vCM8sWJ z?DLvLXuh2P_qS&$7OBGyid+T|WFwhsldZ<4B$viG$ht2&)M)Jo&HyAp`Tck1_s?Wl zYui|#ip;TNT3!KO$MH-2%#+)xDXf~Dy%*E9_J$MMpR;Rw03aZna|fC86RzFw-@bvm zhtT2ykv}31EIqxU*SYUiwi>$|$_zXBFm=2^DspV6Yrd0-a5Wo|#ylH@c}=cf*WeQX z$bFCIiU@1Xj**OYb2Bq7(8L5)3jMI zEaeN|`hJ6*Dx@OoQ9eq9Ij!5i0(l=ku9NRVBW7z@+x|qlX1<8}1pH60x9JLO5w%<< zXkPf`;z+*ol;0+LVE4dY6^hY&h&qXv9;WFo(g2<7oIXCMmYyJ6W&_AmSm*Q#k+IUA zi6Z&30`!BCcKQ1hJWPNJ-dLaNKd9>!laUUx+b1G9{^MO7KwTePUW)TCV)tv#cLsSM zc;ORmJ8{UozkUb$Cj%%{B|^f#?F}T9_S^poY+Rc)fBu210(SWB79d0a{xMjTC&(ye z3s%>WfdBdSTX2eqAvD3!_?LBr4`{R1lUaEGHjR)_l) Ffjf$jX>`@V6qRYpf&xE zp(y_k^Y_(!RlWHBKZX(owp9iU_O}^_j2eVTiNo9 console.log(event)" + }, + "Handler": "index.handler", + "Role": { + "Fn::GetAtt": [ + "lambdas3stptestServiceRoleF17BB6C7", + "Arn" + ] + }, + "Runtime": "nodejs20.x" + }, + "DependsOn": [ + "lambdas3stptestServiceRoleF17BB6C7" + ], + "Metadata": { + "cfn_nag": { + "rules_to_suppress": [ + { + "id": "W58", + "reason": "This Lambda Function is created for integration testing purposes only and is not part of an actual construct" + }, + { + "id": "W89", + "reason": "This Lambda Function is created for integration testing purposes only and is not part of an actual construct" + }, + { + "id": "W92", + "reason": "This Lambda Function is created for integration testing purposes only and is not part of an actual construct" + } + ] + } + } + }, + "testsqspipesstatesconstructqueuedlq420A82FD": { + "Type": "AWS::SQS::Queue", + "Properties": { + "KmsMasterKeyId": "alias/aws/sqs" + }, + "UpdateReplacePolicy": "Delete", + "DeletionPolicy": "Delete" + }, + "testsqspipesstatesconstructqueuedlqPolicyB1D70483": { + "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": [ + "testsqspipesstatesconstructqueuedlq420A82FD", + "Arn" + ] + }, + "Sid": "QueueOwnerOnlyAccess" + }, + { + "Action": "SQS:*", + "Condition": { + "Bool": { + "aws:SecureTransport": "false" + } + }, + "Effect": "Deny", + "Principal": { + "AWS": "*" + }, + "Resource": { + "Fn::GetAtt": [ + "testsqspipesstatesconstructqueuedlq420A82FD", + "Arn" + ] + }, + "Sid": "HttpsOnly" + } + ], + "Version": "2012-10-17" + }, + "Queues": [ + { + "Ref": "testsqspipesstatesconstructqueuedlq420A82FD" + } + ] + } + }, + "testsqspipesstatesconstructqueueA7C76715": { + "Type": "AWS::SQS::Queue", + "Properties": { + "KmsMasterKeyId": "alias/aws/sqs", + "RedrivePolicy": { + "deadLetterTargetArn": { + "Fn::GetAtt": [ + "testsqspipesstatesconstructqueuedlq420A82FD", + "Arn" + ] + }, + "maxReceiveCount": 15 + } + }, + "UpdateReplacePolicy": "Delete", + "DeletionPolicy": "Delete" + }, + "testsqspipesstatesconstructqueuePolicyFD32B562": { + "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": [ + "testsqspipesstatesconstructqueueA7C76715", + "Arn" + ] + }, + "Sid": "QueueOwnerOnlyAccess" + }, + { + "Action": "SQS:*", + "Condition": { + "Bool": { + "aws:SecureTransport": "false" + } + }, + "Effect": "Deny", + "Principal": { + "AWS": "*" + }, + "Resource": { + "Fn::GetAtt": [ + "testsqspipesstatesconstructqueueA7C76715", + "Arn" + ] + }, + "Sid": "HttpsOnly" + } + ], + "Version": "2012-10-17" + }, + "Queues": [ + { + "Ref": "testsqspipesstatesconstructqueueA7C76715" + } + ] + } + }, + "testsqspipesstatesconstructStateMachineLogGroupADE94F1D": { + "Type": "AWS::Logs::LogGroup", + "Properties": { + "LogGroupName": { + "Fn::Join": [ + "", + [ + "/aws/vendedlogs/states/constructs/sqspstp-custom-log-leveltest-sqs-pipes-states-constructStateMachineLog-", + { + "Fn::Select": [ + 2, + { + "Fn::Split": [ + "/", + { + "Ref": "AWS::StackId" + } + ] + } + ] + } + ] + ] + } + }, + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Retain", + "Metadata": { + "cfn_nag": { + "rules_to_suppress": [ + { + "id": "W86", + "reason": "Retention period for CloudWatchLogs LogGroups are set to 'Never Expire' to preserve customer data indefinitely" + }, + { + "id": "W84", + "reason": "By default CloudWatchLogs LogGroups data is encrypted using the CloudWatch server-side encryption keys (AWS Managed Keys)" + } + ] + } + } + }, + "testsqspipesstatesconstructStateMachineRoleBF97BFC0": { + "Type": "AWS::IAM::Role", + "Properties": { + "AssumeRolePolicyDocument": { + "Statement": [ + { + "Action": "sts:AssumeRole", + "Effect": "Allow", + "Principal": { + "Service": "states.amazonaws.com" + } + } + ], + "Version": "2012-10-17" + } + } + }, + "testsqspipesstatesconstructStateMachineRoleDefaultPolicyD1BA2BF2": { + "Type": "AWS::IAM::Policy", + "Properties": { + "PolicyDocument": { + "Statement": [ + { + "Action": "lambda:InvokeFunction", + "Effect": "Allow", + "Resource": [ + { + "Fn::GetAtt": [ + "lambdas3stptest9FBDC6CE", + "Arn" + ] + }, + { + "Fn::Join": [ + "", + [ + { + "Fn::GetAtt": [ + "lambdas3stptest9FBDC6CE", + "Arn" + ] + }, + ":*" + ] + ] + } + ] + }, + { + "Action": [ + "logs:CreateLogDelivery", + "logs:DeleteLogDelivery", + "logs:DescribeLogGroups", + "logs:DescribeResourcePolicies", + "logs:GetLogDelivery", + "logs:ListLogDeliveries", + "logs:PutResourcePolicy", + "logs:UpdateLogDelivery" + ], + "Effect": "Allow", + "Resource": "*" + } + ], + "Version": "2012-10-17" + }, + "PolicyName": "testsqspipesstatesconstructStateMachineRoleDefaultPolicyD1BA2BF2", + "Roles": [ + { + "Ref": "testsqspipesstatesconstructStateMachineRoleBF97BFC0" + } + ] + }, + "Metadata": { + "cfn_nag": { + "rules_to_suppress": [ + { + "id": "W12", + "reason": "These are CDK defaults. The 'LogDelivery' actions do not support resource-level authorizations. Any logging is done by State Machine code" + } + ] + } + } + }, + "testsqspipesstatesconstructStateMachine29272AA9": { + "Type": "AWS::StepFunctions::StateMachine", + "Properties": { + "DefinitionString": { + "Fn::Join": [ + "", + [ + "{\"StartAt\":\"tasks3stp-test\",\"States\":{\"tasks3stp-test\":{\"End\":true,\"Retry\":[{\"ErrorEquals\":[\"Lambda.ClientExecutionTimeoutException\",\"Lambda.ServiceException\",\"Lambda.AWSLambdaException\",\"Lambda.SdkClientException\"],\"IntervalSeconds\":2,\"MaxAttempts\":6,\"BackoffRate\":2}],\"Type\":\"Task\",\"Resource\":\"arn:", + { + "Ref": "AWS::Partition" + }, + ":states:::lambda:invoke\",\"Parameters\":{\"FunctionName\":\"", + { + "Fn::GetAtt": [ + "lambdas3stptest9FBDC6CE", + "Arn" + ] + }, + "\",\"Payload.$\":\"$\"}}}}" + ] + ] + }, + "LoggingConfiguration": { + "Destinations": [ + { + "CloudWatchLogsLogGroup": { + "LogGroupArn": { + "Fn::GetAtt": [ + "testsqspipesstatesconstructStateMachineLogGroupADE94F1D", + "Arn" + ] + } + } + } + ], + "Level": "ERROR" + }, + "RoleArn": { + "Fn::GetAtt": [ + "testsqspipesstatesconstructStateMachineRoleBF97BFC0", + "Arn" + ] + } + }, + "DependsOn": [ + "testsqspipesstatesconstructStateMachineRoleDefaultPolicyD1BA2BF2", + "testsqspipesstatesconstructStateMachineRoleBF97BFC0" + ], + "UpdateReplacePolicy": "Delete", + "DeletionPolicy": "Delete" + }, + "testsqspipesstatesconstructExecutionFailedAlarm1002FF55": { + "Type": "AWS::CloudWatch::Alarm", + "Properties": { + "AlarmDescription": "Alarm for the number of executions that failed exceeded the threshold of 1. ", + "ComparisonOperator": "GreaterThanOrEqualToThreshold", + "Dimensions": [ + { + "Name": "StateMachineArn", + "Value": { + "Ref": "testsqspipesstatesconstructStateMachine29272AA9" + } + } + ], + "EvaluationPeriods": 1, + "MetricName": "ExecutionsFailed", + "Namespace": "AWS/States", + "Period": 300, + "Statistic": "Sum", + "Threshold": 1 + } + }, + "testsqspipesstatesconstructExecutionThrottledAlarm0242B01A": { + "Type": "AWS::CloudWatch::Alarm", + "Properties": { + "AlarmDescription": "Alarm for the number of executions that throttled exceeded the threshold of 1. ", + "ComparisonOperator": "GreaterThanOrEqualToThreshold", + "Dimensions": [ + { + "Name": "StateMachineArn", + "Value": { + "Ref": "testsqspipesstatesconstructStateMachine29272AA9" + } + } + ], + "EvaluationPeriods": 1, + "MetricName": "ExecutionThrottled", + "Namespace": "AWS/States", + "Period": 300, + "Statistic": "Sum", + "Threshold": 1 + } + }, + "testsqspipesstatesconstructExecutionAbortedAlarm14349A7B": { + "Type": "AWS::CloudWatch::Alarm", + "Properties": { + "AlarmDescription": "Alarm for the number of executions that aborted exceeded the threshold of 1. ", + "ComparisonOperator": "GreaterThanOrEqualToThreshold", + "Dimensions": [ + { + "Name": "StateMachineArn", + "Value": { + "Ref": "testsqspipesstatesconstructStateMachine29272AA9" + } + } + ], + "EvaluationPeriods": 1, + "MetricName": "ExecutionsAborted", + "Namespace": "AWS/States", + "Period": 300, + "Statistic": "Maximum", + "Threshold": 1 + } + }, + "testsqspipesstatesconstructPipeRoletestsqspipesstatesconstruct2CC9A13C": { + "Type": "AWS::IAM::Role", + "Properties": { + "AssumeRolePolicyDocument": { + "Statement": [ + { + "Action": "sts:AssumeRole", + "Effect": "Allow", + "Principal": { + "Service": "pipes.amazonaws.com" + } + } + ], + "Version": "2012-10-17" + }, + "Policies": [ + { + "PolicyDocument": { + "Statement": [ + { + "Action": [ + "sqs:DeleteMessage", + "sqs:GetQueueAttributes", + "sqs:ReceiveMessage" + ], + "Effect": "Allow", + "Resource": { + "Fn::GetAtt": [ + "testsqspipesstatesconstructqueueA7C76715", + "Arn" + ] + } + } + ], + "Version": "2012-10-17" + }, + "PolicyName": "sourcePolicy" + }, + { + "PolicyDocument": { + "Statement": [ + { + "Action": "states:StartExecution", + "Effect": "Allow", + "Resource": { + "Ref": "testsqspipesstatesconstructStateMachine29272AA9" + } + } + ], + "Version": "2012-10-17" + }, + "PolicyName": "targetPolicy" + } + ] + }, + "Metadata": { + "guard": { + "SuppressedRules": [ + "IAM_NO_INLINE_POLICY_CHECK" + ] + } + } + }, + "testsqspipesstatesconstructLogGrouptestsqspipesstatesconstructF827FE15": { + "Type": "AWS::Logs::LogGroup", + "Properties": { + "LogGroupName": { + "Fn::Join": [ + "", + [ + "/aws/vendedlogs/pipes/constructs/sqspstp-custom-log-leveltest-sqs-pipes-states-constructPipesLog-", + { + "Fn::Select": [ + 2, + { + "Fn::Split": [ + "/", + { + "Ref": "AWS::StackId" + } + ] + } + ] + } + ] + ] + } + }, + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Retain", + "Metadata": { + "cfn_nag": { + "rules_to_suppress": [ + { + "id": "W86", + "reason": "Retention period for CloudWatchLogs LogGroups are set to 'Never Expire' to preserve customer data indefinitely" + }, + { + "id": "W84", + "reason": "By default CloudWatchLogs LogGroups data is encrypted using the CloudWatch server-side encryption keys (AWS Managed Keys)" + } + ] + } + } + }, + "testsqspipesstatesconstructpipetestsqspipesstatesconstruct71A64A15": { + "Type": "AWS::Pipes::Pipe", + "Properties": { + "LogConfiguration": { + "CloudwatchLogsLogDestination": { + "LogGroupArn": { + "Fn::GetAtt": [ + "testsqspipesstatesconstructLogGrouptestsqspipesstatesconstructF827FE15", + "Arn" + ] + } + }, + "Level": "TRACE" + }, + "RoleArn": { + "Fn::GetAtt": [ + "testsqspipesstatesconstructPipeRoletestsqspipesstatesconstruct2CC9A13C", + "Arn" + ] + }, + "Source": { + "Fn::GetAtt": [ + "testsqspipesstatesconstructqueueA7C76715", + "Arn" + ] + }, + "SourceParameters": {}, + "Target": { + "Ref": "testsqspipesstatesconstructStateMachine29272AA9" + }, + "TargetParameters": { + "StepFunctionStateMachineParameters": { + "InvocationType": "FIRE_AND_FORGET" + } + } + } + } + }, + "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-sqs-pipes-stepfunctions/test/integ.sqspstp-custom-log-level.js.snapshot/sqspstpcustomloglevelIntegDefaultTestDeployAssertD542618D.assets.json b/source/patterns/@aws-solutions-constructs/aws-sqs-pipes-stepfunctions/test/integ.sqspstp-custom-log-level.js.snapshot/sqspstpcustomloglevelIntegDefaultTestDeployAssertD542618D.assets.json new file mode 100644 index 000000000..62a2e7917 --- /dev/null +++ b/source/patterns/@aws-solutions-constructs/aws-sqs-pipes-stepfunctions/test/integ.sqspstp-custom-log-level.js.snapshot/sqspstpcustomloglevelIntegDefaultTestDeployAssertD542618D.assets.json @@ -0,0 +1,19 @@ +{ + "version": "38.0.1", + "files": { + "21fbb51d7b23f6a6c262b46a9caee79d744a3ac019fd45422d988b96d44b2a22": { + "source": { + "path": "sqspstpcustomloglevelIntegDefaultTestDeployAssertD542618D.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-sqs-pipes-stepfunctions/test/integ.sqspstp-custom-log-level.js.snapshot/sqspstpcustomloglevelIntegDefaultTestDeployAssertD542618D.template.json b/source/patterns/@aws-solutions-constructs/aws-sqs-pipes-stepfunctions/test/integ.sqspstp-custom-log-level.js.snapshot/sqspstpcustomloglevelIntegDefaultTestDeployAssertD542618D.template.json new file mode 100644 index 000000000..ad9d0fb73 --- /dev/null +++ b/source/patterns/@aws-solutions-constructs/aws-sqs-pipes-stepfunctions/test/integ.sqspstp-custom-log-level.js.snapshot/sqspstpcustomloglevelIntegDefaultTestDeployAssertD542618D.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-sqs-pipes-stepfunctions/test/integ.sqspstp-custom-log-level.js.snapshot/tree.json b/source/patterns/@aws-solutions-constructs/aws-sqs-pipes-stepfunctions/test/integ.sqspstp-custom-log-level.js.snapshot/tree.json new file mode 100644 index 000000000..ca04d4cd6 --- /dev/null +++ b/source/patterns/@aws-solutions-constructs/aws-sqs-pipes-stepfunctions/test/integ.sqspstp-custom-log-level.js.snapshot/tree.json @@ -0,0 +1,957 @@ +{ + "version": "tree-0.1", + "tree": { + "id": "App", + "path": "", + "children": { + "sqspstp-custom-log-level": { + "id": "sqspstp-custom-log-level", + "path": "sqspstp-custom-log-level", + "children": { + "lambdas3stp-test": { + "id": "lambdas3stp-test", + "path": "sqspstp-custom-log-level/lambdas3stp-test", + "children": { + "ServiceRole": { + "id": "ServiceRole", + "path": "sqspstp-custom-log-level/lambdas3stp-test/ServiceRole", + "children": { + "ImportServiceRole": { + "id": "ImportServiceRole", + "path": "sqspstp-custom-log-level/lambdas3stp-test/ServiceRole/ImportServiceRole", + "constructInfo": { + "fqn": "aws-cdk-lib.Resource", + "version": "2.161.0" + } + }, + "Resource": { + "id": "Resource", + "path": "sqspstp-custom-log-level/lambdas3stp-test/ServiceRole/Resource", + "attributes": { + "aws:cdk:cloudformation:type": "AWS::IAM::Role", + "aws:cdk:cloudformation:props": { + "assumeRolePolicyDocument": { + "Statement": [ + { + "Action": "sts:AssumeRole", + "Effect": "Allow", + "Principal": { + "Service": "lambda.amazonaws.com" + } + } + ], + "Version": "2012-10-17" + }, + "managedPolicyArns": [ + { + "Fn::Join": [ + "", + [ + "arn:", + { + "Ref": "AWS::Partition" + }, + ":iam::aws:policy/service-role/AWSLambdaBasicExecutionRole" + ] + ] + } + ] + } + }, + "constructInfo": { + "fqn": "aws-cdk-lib.aws_iam.CfnRole", + "version": "2.161.0" + } + } + }, + "constructInfo": { + "fqn": "aws-cdk-lib.aws_iam.Role", + "version": "2.161.0" + } + }, + "Resource": { + "id": "Resource", + "path": "sqspstp-custom-log-level/lambdas3stp-test/Resource", + "attributes": { + "aws:cdk:cloudformation:type": "AWS::Lambda::Function", + "aws:cdk:cloudformation:props": { + "code": { + "zipFile": "exports.handler = async (event) => console.log(event)" + }, + "handler": "index.handler", + "role": { + "Fn::GetAtt": [ + "lambdas3stptestServiceRoleF17BB6C7", + "Arn" + ] + }, + "runtime": "nodejs20.x" + } + }, + "constructInfo": { + "fqn": "aws-cdk-lib.aws_lambda.CfnFunction", + "version": "2.161.0" + } + } + }, + "constructInfo": { + "fqn": "aws-cdk-lib.aws_lambda.Function", + "version": "2.161.0" + } + }, + "tasks3stp-test": { + "id": "tasks3stp-test", + "path": "sqspstp-custom-log-level/tasks3stp-test", + "constructInfo": { + "fqn": "aws-cdk-lib.aws_stepfunctions_tasks.LambdaInvoke", + "version": "2.161.0" + } + }, + "test-sqs-pipes-states-construct": { + "id": "test-sqs-pipes-states-construct", + "path": "sqspstp-custom-log-level/test-sqs-pipes-states-construct", + "children": { + "queue-dlq": { + "id": "queue-dlq", + "path": "sqspstp-custom-log-level/test-sqs-pipes-states-construct/queue-dlq", + "children": { + "Resource": { + "id": "Resource", + "path": "sqspstp-custom-log-level/test-sqs-pipes-states-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.161.0" + } + }, + "Policy": { + "id": "Policy", + "path": "sqspstp-custom-log-level/test-sqs-pipes-states-construct/queue-dlq/Policy", + "children": { + "Resource": { + "id": "Resource", + "path": "sqspstp-custom-log-level/test-sqs-pipes-states-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": [ + "testsqspipesstatesconstructqueuedlq420A82FD", + "Arn" + ] + }, + "Sid": "QueueOwnerOnlyAccess" + }, + { + "Action": "SQS:*", + "Condition": { + "Bool": { + "aws:SecureTransport": "false" + } + }, + "Effect": "Deny", + "Principal": { + "AWS": "*" + }, + "Resource": { + "Fn::GetAtt": [ + "testsqspipesstatesconstructqueuedlq420A82FD", + "Arn" + ] + }, + "Sid": "HttpsOnly" + } + ], + "Version": "2012-10-17" + }, + "queues": [ + { + "Ref": "testsqspipesstatesconstructqueuedlq420A82FD" + } + ] + } + }, + "constructInfo": { + "fqn": "aws-cdk-lib.aws_sqs.CfnQueuePolicy", + "version": "2.161.0" + } + } + }, + "constructInfo": { + "fqn": "aws-cdk-lib.aws_sqs.QueuePolicy", + "version": "2.161.0" + } + } + }, + "constructInfo": { + "fqn": "aws-cdk-lib.aws_sqs.Queue", + "version": "2.161.0" + } + }, + "queue": { + "id": "queue", + "path": "sqspstp-custom-log-level/test-sqs-pipes-states-construct/queue", + "children": { + "Resource": { + "id": "Resource", + "path": "sqspstp-custom-log-level/test-sqs-pipes-states-construct/queue/Resource", + "attributes": { + "aws:cdk:cloudformation:type": "AWS::SQS::Queue", + "aws:cdk:cloudformation:props": { + "kmsMasterKeyId": "alias/aws/sqs", + "redrivePolicy": { + "deadLetterTargetArn": { + "Fn::GetAtt": [ + "testsqspipesstatesconstructqueuedlq420A82FD", + "Arn" + ] + }, + "maxReceiveCount": 15 + } + } + }, + "constructInfo": { + "fqn": "aws-cdk-lib.aws_sqs.CfnQueue", + "version": "2.161.0" + } + }, + "Policy": { + "id": "Policy", + "path": "sqspstp-custom-log-level/test-sqs-pipes-states-construct/queue/Policy", + "children": { + "Resource": { + "id": "Resource", + "path": "sqspstp-custom-log-level/test-sqs-pipes-states-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": [ + "testsqspipesstatesconstructqueueA7C76715", + "Arn" + ] + }, + "Sid": "QueueOwnerOnlyAccess" + }, + { + "Action": "SQS:*", + "Condition": { + "Bool": { + "aws:SecureTransport": "false" + } + }, + "Effect": "Deny", + "Principal": { + "AWS": "*" + }, + "Resource": { + "Fn::GetAtt": [ + "testsqspipesstatesconstructqueueA7C76715", + "Arn" + ] + }, + "Sid": "HttpsOnly" + } + ], + "Version": "2012-10-17" + }, + "queues": [ + { + "Ref": "testsqspipesstatesconstructqueueA7C76715" + } + ] + } + }, + "constructInfo": { + "fqn": "aws-cdk-lib.aws_sqs.CfnQueuePolicy", + "version": "2.161.0" + } + } + }, + "constructInfo": { + "fqn": "aws-cdk-lib.aws_sqs.QueuePolicy", + "version": "2.161.0" + } + } + }, + "constructInfo": { + "fqn": "aws-cdk-lib.aws_sqs.Queue", + "version": "2.161.0" + } + }, + "StateMachineLogGroup": { + "id": "StateMachineLogGroup", + "path": "sqspstp-custom-log-level/test-sqs-pipes-states-construct/StateMachineLogGroup", + "children": { + "Resource": { + "id": "Resource", + "path": "sqspstp-custom-log-level/test-sqs-pipes-states-construct/StateMachineLogGroup/Resource", + "attributes": { + "aws:cdk:cloudformation:type": "AWS::Logs::LogGroup", + "aws:cdk:cloudformation:props": { + "logGroupName": { + "Fn::Join": [ + "", + [ + "/aws/vendedlogs/states/constructs/sqspstp-custom-log-leveltest-sqs-pipes-states-constructStateMachineLog-", + { + "Fn::Select": [ + 2, + { + "Fn::Split": [ + "/", + { + "Ref": "AWS::StackId" + } + ] + } + ] + } + ] + ] + } + } + }, + "constructInfo": { + "fqn": "aws-cdk-lib.aws_logs.CfnLogGroup", + "version": "2.161.0" + } + } + }, + "constructInfo": { + "fqn": "aws-cdk-lib.aws_logs.LogGroup", + "version": "2.161.0" + } + }, + "StateMachine": { + "id": "StateMachine", + "path": "sqspstp-custom-log-level/test-sqs-pipes-states-construct/StateMachine", + "children": { + "Role": { + "id": "Role", + "path": "sqspstp-custom-log-level/test-sqs-pipes-states-construct/StateMachine/Role", + "children": { + "ImportRole": { + "id": "ImportRole", + "path": "sqspstp-custom-log-level/test-sqs-pipes-states-construct/StateMachine/Role/ImportRole", + "constructInfo": { + "fqn": "aws-cdk-lib.Resource", + "version": "2.161.0" + } + }, + "Resource": { + "id": "Resource", + "path": "sqspstp-custom-log-level/test-sqs-pipes-states-construct/StateMachine/Role/Resource", + "attributes": { + "aws:cdk:cloudformation:type": "AWS::IAM::Role", + "aws:cdk:cloudformation:props": { + "assumeRolePolicyDocument": { + "Statement": [ + { + "Action": "sts:AssumeRole", + "Effect": "Allow", + "Principal": { + "Service": "states.amazonaws.com" + } + } + ], + "Version": "2012-10-17" + } + } + }, + "constructInfo": { + "fqn": "aws-cdk-lib.aws_iam.CfnRole", + "version": "2.161.0" + } + }, + "DefaultPolicy": { + "id": "DefaultPolicy", + "path": "sqspstp-custom-log-level/test-sqs-pipes-states-construct/StateMachine/Role/DefaultPolicy", + "children": { + "Resource": { + "id": "Resource", + "path": "sqspstp-custom-log-level/test-sqs-pipes-states-construct/StateMachine/Role/DefaultPolicy/Resource", + "attributes": { + "aws:cdk:cloudformation:type": "AWS::IAM::Policy", + "aws:cdk:cloudformation:props": { + "policyDocument": { + "Statement": [ + { + "Action": "lambda:InvokeFunction", + "Effect": "Allow", + "Resource": [ + { + "Fn::GetAtt": [ + "lambdas3stptest9FBDC6CE", + "Arn" + ] + }, + { + "Fn::Join": [ + "", + [ + { + "Fn::GetAtt": [ + "lambdas3stptest9FBDC6CE", + "Arn" + ] + }, + ":*" + ] + ] + } + ] + }, + { + "Action": [ + "logs:CreateLogDelivery", + "logs:DeleteLogDelivery", + "logs:DescribeLogGroups", + "logs:DescribeResourcePolicies", + "logs:GetLogDelivery", + "logs:ListLogDeliveries", + "logs:PutResourcePolicy", + "logs:UpdateLogDelivery" + ], + "Effect": "Allow", + "Resource": "*" + } + ], + "Version": "2012-10-17" + }, + "policyName": "testsqspipesstatesconstructStateMachineRoleDefaultPolicyD1BA2BF2", + "roles": [ + { + "Ref": "testsqspipesstatesconstructStateMachineRoleBF97BFC0" + } + ] + } + }, + "constructInfo": { + "fqn": "aws-cdk-lib.aws_iam.CfnPolicy", + "version": "2.161.0" + } + } + }, + "constructInfo": { + "fqn": "aws-cdk-lib.aws_iam.Policy", + "version": "2.161.0" + } + } + }, + "constructInfo": { + "fqn": "aws-cdk-lib.aws_iam.Role", + "version": "2.161.0" + } + }, + "Resource": { + "id": "Resource", + "path": "sqspstp-custom-log-level/test-sqs-pipes-states-construct/StateMachine/Resource", + "attributes": { + "aws:cdk:cloudformation:type": "AWS::StepFunctions::StateMachine", + "aws:cdk:cloudformation:props": { + "definitionString": { + "Fn::Join": [ + "", + [ + "{\"StartAt\":\"tasks3stp-test\",\"States\":{\"tasks3stp-test\":{\"End\":true,\"Retry\":[{\"ErrorEquals\":[\"Lambda.ClientExecutionTimeoutException\",\"Lambda.ServiceException\",\"Lambda.AWSLambdaException\",\"Lambda.SdkClientException\"],\"IntervalSeconds\":2,\"MaxAttempts\":6,\"BackoffRate\":2}],\"Type\":\"Task\",\"Resource\":\"arn:", + { + "Ref": "AWS::Partition" + }, + ":states:::lambda:invoke\",\"Parameters\":{\"FunctionName\":\"", + { + "Fn::GetAtt": [ + "lambdas3stptest9FBDC6CE", + "Arn" + ] + }, + "\",\"Payload.$\":\"$\"}}}}" + ] + ] + }, + "loggingConfiguration": { + "destinations": [ + { + "cloudWatchLogsLogGroup": { + "logGroupArn": { + "Fn::GetAtt": [ + "testsqspipesstatesconstructStateMachineLogGroupADE94F1D", + "Arn" + ] + } + } + } + ], + "level": "ERROR" + }, + "roleArn": { + "Fn::GetAtt": [ + "testsqspipesstatesconstructStateMachineRoleBF97BFC0", + "Arn" + ] + } + } + }, + "constructInfo": { + "fqn": "aws-cdk-lib.aws_stepfunctions.CfnStateMachine", + "version": "2.161.0" + } + } + }, + "constructInfo": { + "fqn": "aws-cdk-lib.aws_stepfunctions.StateMachine", + "version": "2.161.0" + } + }, + "ExecutionFailedAlarm": { + "id": "ExecutionFailedAlarm", + "path": "sqspstp-custom-log-level/test-sqs-pipes-states-construct/ExecutionFailedAlarm", + "children": { + "Resource": { + "id": "Resource", + "path": "sqspstp-custom-log-level/test-sqs-pipes-states-construct/ExecutionFailedAlarm/Resource", + "attributes": { + "aws:cdk:cloudformation:type": "AWS::CloudWatch::Alarm", + "aws:cdk:cloudformation:props": { + "alarmDescription": "Alarm for the number of executions that failed exceeded the threshold of 1. ", + "comparisonOperator": "GreaterThanOrEqualToThreshold", + "dimensions": [ + { + "name": "StateMachineArn", + "value": { + "Ref": "testsqspipesstatesconstructStateMachine29272AA9" + } + } + ], + "evaluationPeriods": 1, + "metricName": "ExecutionsFailed", + "namespace": "AWS/States", + "period": 300, + "statistic": "Sum", + "threshold": 1 + } + }, + "constructInfo": { + "fqn": "aws-cdk-lib.aws_cloudwatch.CfnAlarm", + "version": "2.161.0" + } + } + }, + "constructInfo": { + "fqn": "aws-cdk-lib.aws_cloudwatch.Alarm", + "version": "2.161.0" + } + }, + "ExecutionThrottledAlarm": { + "id": "ExecutionThrottledAlarm", + "path": "sqspstp-custom-log-level/test-sqs-pipes-states-construct/ExecutionThrottledAlarm", + "children": { + "Resource": { + "id": "Resource", + "path": "sqspstp-custom-log-level/test-sqs-pipes-states-construct/ExecutionThrottledAlarm/Resource", + "attributes": { + "aws:cdk:cloudformation:type": "AWS::CloudWatch::Alarm", + "aws:cdk:cloudformation:props": { + "alarmDescription": "Alarm for the number of executions that throttled exceeded the threshold of 1. ", + "comparisonOperator": "GreaterThanOrEqualToThreshold", + "dimensions": [ + { + "name": "StateMachineArn", + "value": { + "Ref": "testsqspipesstatesconstructStateMachine29272AA9" + } + } + ], + "evaluationPeriods": 1, + "metricName": "ExecutionThrottled", + "namespace": "AWS/States", + "period": 300, + "statistic": "Sum", + "threshold": 1 + } + }, + "constructInfo": { + "fqn": "aws-cdk-lib.aws_cloudwatch.CfnAlarm", + "version": "2.161.0" + } + } + }, + "constructInfo": { + "fqn": "aws-cdk-lib.aws_cloudwatch.Alarm", + "version": "2.161.0" + } + }, + "ExecutionAbortedAlarm": { + "id": "ExecutionAbortedAlarm", + "path": "sqspstp-custom-log-level/test-sqs-pipes-states-construct/ExecutionAbortedAlarm", + "children": { + "Resource": { + "id": "Resource", + "path": "sqspstp-custom-log-level/test-sqs-pipes-states-construct/ExecutionAbortedAlarm/Resource", + "attributes": { + "aws:cdk:cloudformation:type": "AWS::CloudWatch::Alarm", + "aws:cdk:cloudformation:props": { + "alarmDescription": "Alarm for the number of executions that aborted exceeded the threshold of 1. ", + "comparisonOperator": "GreaterThanOrEqualToThreshold", + "dimensions": [ + { + "name": "StateMachineArn", + "value": { + "Ref": "testsqspipesstatesconstructStateMachine29272AA9" + } + } + ], + "evaluationPeriods": 1, + "metricName": "ExecutionsAborted", + "namespace": "AWS/States", + "period": 300, + "statistic": "Maximum", + "threshold": 1 + } + }, + "constructInfo": { + "fqn": "aws-cdk-lib.aws_cloudwatch.CfnAlarm", + "version": "2.161.0" + } + } + }, + "constructInfo": { + "fqn": "aws-cdk-lib.aws_cloudwatch.Alarm", + "version": "2.161.0" + } + }, + "PipeRole--test-sqs-pipes-states-construct": { + "id": "PipeRole--test-sqs-pipes-states-construct", + "path": "sqspstp-custom-log-level/test-sqs-pipes-states-construct/PipeRole--test-sqs-pipes-states-construct", + "children": { + "ImportPipeRole--test-sqs-pipes-states-construct": { + "id": "ImportPipeRole--test-sqs-pipes-states-construct", + "path": "sqspstp-custom-log-level/test-sqs-pipes-states-construct/PipeRole--test-sqs-pipes-states-construct/ImportPipeRole--test-sqs-pipes-states-construct", + "constructInfo": { + "fqn": "aws-cdk-lib.Resource", + "version": "2.161.0" + } + }, + "Resource": { + "id": "Resource", + "path": "sqspstp-custom-log-level/test-sqs-pipes-states-construct/PipeRole--test-sqs-pipes-states-construct/Resource", + "attributes": { + "aws:cdk:cloudformation:type": "AWS::IAM::Role", + "aws:cdk:cloudformation:props": { + "assumeRolePolicyDocument": { + "Statement": [ + { + "Action": "sts:AssumeRole", + "Effect": "Allow", + "Principal": { + "Service": "pipes.amazonaws.com" + } + } + ], + "Version": "2012-10-17" + }, + "policies": [ + { + "policyName": "sourcePolicy", + "policyDocument": { + "Statement": [ + { + "Action": [ + "sqs:DeleteMessage", + "sqs:GetQueueAttributes", + "sqs:ReceiveMessage" + ], + "Effect": "Allow", + "Resource": { + "Fn::GetAtt": [ + "testsqspipesstatesconstructqueueA7C76715", + "Arn" + ] + } + } + ], + "Version": "2012-10-17" + } + }, + { + "policyName": "targetPolicy", + "policyDocument": { + "Statement": [ + { + "Action": "states:StartExecution", + "Effect": "Allow", + "Resource": { + "Ref": "testsqspipesstatesconstructStateMachine29272AA9" + } + } + ], + "Version": "2012-10-17" + } + } + ] + } + }, + "constructInfo": { + "fqn": "aws-cdk-lib.aws_iam.CfnRole", + "version": "2.161.0" + } + } + }, + "constructInfo": { + "fqn": "aws-cdk-lib.aws_iam.Role", + "version": "2.161.0" + } + }, + "LogGroup-test-sqs-pipes-states-construct": { + "id": "LogGroup-test-sqs-pipes-states-construct", + "path": "sqspstp-custom-log-level/test-sqs-pipes-states-construct/LogGroup-test-sqs-pipes-states-construct", + "children": { + "Resource": { + "id": "Resource", + "path": "sqspstp-custom-log-level/test-sqs-pipes-states-construct/LogGroup-test-sqs-pipes-states-construct/Resource", + "attributes": { + "aws:cdk:cloudformation:type": "AWS::Logs::LogGroup", + "aws:cdk:cloudformation:props": { + "logGroupName": { + "Fn::Join": [ + "", + [ + "/aws/vendedlogs/pipes/constructs/sqspstp-custom-log-leveltest-sqs-pipes-states-constructPipesLog-", + { + "Fn::Select": [ + 2, + { + "Fn::Split": [ + "/", + { + "Ref": "AWS::StackId" + } + ] + } + ] + } + ] + ] + } + } + }, + "constructInfo": { + "fqn": "aws-cdk-lib.aws_logs.CfnLogGroup", + "version": "2.161.0" + } + } + }, + "constructInfo": { + "fqn": "aws-cdk-lib.aws_logs.LogGroup", + "version": "2.161.0" + } + }, + "pipe-test-sqs-pipes-states-construct": { + "id": "pipe-test-sqs-pipes-states-construct", + "path": "sqspstp-custom-log-level/test-sqs-pipes-states-construct/pipe-test-sqs-pipes-states-construct", + "attributes": { + "aws:cdk:cloudformation:type": "AWS::Pipes::Pipe", + "aws:cdk:cloudformation:props": { + "logConfiguration": { + "cloudwatchLogsLogDestination": { + "logGroupArn": { + "Fn::GetAtt": [ + "testsqspipesstatesconstructLogGrouptestsqspipesstatesconstructF827FE15", + "Arn" + ] + } + }, + "level": "TRACE" + }, + "roleArn": { + "Fn::GetAtt": [ + "testsqspipesstatesconstructPipeRoletestsqspipesstatesconstruct2CC9A13C", + "Arn" + ] + }, + "source": { + "Fn::GetAtt": [ + "testsqspipesstatesconstructqueueA7C76715", + "Arn" + ] + }, + "sourceParameters": {}, + "target": { + "Ref": "testsqspipesstatesconstructStateMachine29272AA9" + }, + "targetParameters": { + "stepFunctionStateMachineParameters": { + "invocationType": "FIRE_AND_FORGET" + } + } + } + }, + "constructInfo": { + "fqn": "aws-cdk-lib.aws_pipes.CfnPipe", + "version": "2.161.0" + } + } + }, + "constructInfo": { + "fqn": "@aws-solutions-constructs/aws-sqs-pipes-stepfunctions.SqsToPipesToStepfunctions", + "version": "2.72.0" + } + }, + "Integ": { + "id": "Integ", + "path": "sqspstp-custom-log-level/Integ", + "children": { + "DefaultTest": { + "id": "DefaultTest", + "path": "sqspstp-custom-log-level/Integ/DefaultTest", + "children": { + "Default": { + "id": "Default", + "path": "sqspstp-custom-log-level/Integ/DefaultTest/Default", + "constructInfo": { + "fqn": "constructs.Construct", + "version": "10.4.2" + } + }, + "DeployAssert": { + "id": "DeployAssert", + "path": "sqspstp-custom-log-level/Integ/DefaultTest/DeployAssert", + "children": { + "BootstrapVersion": { + "id": "BootstrapVersion", + "path": "sqspstp-custom-log-level/Integ/DefaultTest/DeployAssert/BootstrapVersion", + "constructInfo": { + "fqn": "aws-cdk-lib.CfnParameter", + "version": "2.161.0" + } + }, + "CheckBootstrapVersion": { + "id": "CheckBootstrapVersion", + "path": "sqspstp-custom-log-level/Integ/DefaultTest/DeployAssert/CheckBootstrapVersion", + "constructInfo": { + "fqn": "aws-cdk-lib.CfnRule", + "version": "2.161.0" + } + } + }, + "constructInfo": { + "fqn": "aws-cdk-lib.Stack", + "version": "2.161.0" + } + } + }, + "constructInfo": { + "fqn": "@aws-cdk/integ-tests-alpha.IntegTestCase", + "version": "2.161.0-alpha.0" + } + } + }, + "constructInfo": { + "fqn": "@aws-cdk/integ-tests-alpha.IntegTest", + "version": "2.161.0-alpha.0" + } + }, + "BootstrapVersion": { + "id": "BootstrapVersion", + "path": "sqspstp-custom-log-level/BootstrapVersion", + "constructInfo": { + "fqn": "aws-cdk-lib.CfnParameter", + "version": "2.161.0" + } + }, + "CheckBootstrapVersion": { + "id": "CheckBootstrapVersion", + "path": "sqspstp-custom-log-level/CheckBootstrapVersion", + "constructInfo": { + "fqn": "aws-cdk-lib.CfnRule", + "version": "2.161.0" + } + } + }, + "constructInfo": { + "fqn": "aws-cdk-lib.Stack", + "version": "2.161.0" + } + }, + "Tree": { + "id": "Tree", + "path": "Tree", + "constructInfo": { + "fqn": "constructs.Construct", + "version": "10.4.2" + } + } + }, + "constructInfo": { + "fqn": "aws-cdk-lib.App", + "version": "2.161.0" + } + } +} \ No newline at end of file diff --git a/source/patterns/@aws-solutions-constructs/aws-sqs-pipes-stepfunctions/test/integ.sqspstp-custom-log-level.ts b/source/patterns/@aws-solutions-constructs/aws-sqs-pipes-stepfunctions/test/integ.sqspstp-custom-log-level.ts new file mode 100644 index 000000000..28d8098bb --- /dev/null +++ b/source/patterns/@aws-solutions-constructs/aws-sqs-pipes-stepfunctions/test/integ.sqspstp-custom-log-level.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. + */ + +/// !cdk-integ * +import { App, Stack } from "aws-cdk-lib"; +import { SqsToPipesToStepfunctions, SqsToPipesToStepfunctionsProps } from "../lib"; +import { generateIntegStackName } from '@aws-solutions-constructs/core'; +import { IntegTest } from '@aws-cdk/integ-tests-alpha'; +import * as defaults from '@aws-solutions-constructs/core'; + +const app = new App(); +const stack = new Stack(app, generateIntegStackName(__filename)); + +const props: SqsToPipesToStepfunctionsProps = { + stateMachineProps: { + definitionBody: defaults.CreateTestStateMachineDefinitionBody(stack, 's3stp-test') + }, + logLevel: defaults.PipesLogLevel.TRACE +}; + +new SqsToPipesToStepfunctions(stack, 'test-sqs-pipes-states-construct', props); + +new IntegTest(stack, 'Integ', { testCases: [ + stack +] }); diff --git a/source/patterns/@aws-solutions-constructs/aws-sqs-pipes-stepfunctions/test/integ.sqspstp-existing-queue.js.snapshot/cdk.out b/source/patterns/@aws-solutions-constructs/aws-sqs-pipes-stepfunctions/test/integ.sqspstp-existing-queue.js.snapshot/cdk.out new file mode 100644 index 000000000..c6e612584 --- /dev/null +++ b/source/patterns/@aws-solutions-constructs/aws-sqs-pipes-stepfunctions/test/integ.sqspstp-existing-queue.js.snapshot/cdk.out @@ -0,0 +1 @@ +{"version":"38.0.1"} \ No newline at end of file diff --git a/source/patterns/@aws-solutions-constructs/aws-sqs-pipes-stepfunctions/test/integ.sqspstp-existing-queue.js.snapshot/integ.json b/source/patterns/@aws-solutions-constructs/aws-sqs-pipes-stepfunctions/test/integ.sqspstp-existing-queue.js.snapshot/integ.json new file mode 100644 index 000000000..c2912b8a8 --- /dev/null +++ b/source/patterns/@aws-solutions-constructs/aws-sqs-pipes-stepfunctions/test/integ.sqspstp-existing-queue.js.snapshot/integ.json @@ -0,0 +1,12 @@ +{ + "version": "38.0.1", + "testCases": { + "sqspstp-existing-queue/Integ/DefaultTest": { + "stacks": [ + "sqspstp-existing-queue" + ], + "assertionStack": "sqspstp-existing-queue/Integ/DefaultTest/DeployAssert", + "assertionStackName": "sqspstpexistingqueueIntegDefaultTestDeployAssert6DA9FDD7" + } + } +} \ No newline at end of file diff --git a/source/patterns/@aws-solutions-constructs/aws-sqs-pipes-stepfunctions/test/integ.sqspstp-existing-queue.js.snapshot/manifest.json b/source/patterns/@aws-solutions-constructs/aws-sqs-pipes-stepfunctions/test/integ.sqspstp-existing-queue.js.snapshot/manifest.json new file mode 100644 index 000000000..c6d50adff --- /dev/null +++ b/source/patterns/@aws-solutions-constructs/aws-sqs-pipes-stepfunctions/test/integ.sqspstp-existing-queue.js.snapshot/manifest.json @@ -0,0 +1,205 @@ +{ + "version": "38.0.1", + "artifacts": { + "sqspstpexistingqueueIntegDefaultTestDeployAssert6DA9FDD7.assets": { + "type": "cdk:asset-manifest", + "properties": { + "file": "sqspstpexistingqueueIntegDefaultTestDeployAssert6DA9FDD7.assets.json", + "requiresBootstrapStackVersion": 6, + "bootstrapStackVersionSsmParameter": "/cdk-bootstrap/hnb659fds/version" + } + }, + "sqspstpexistingqueueIntegDefaultTestDeployAssert6DA9FDD7": { + "type": "aws:cloudformation:stack", + "environment": "aws://unknown-account/unknown-region", + "properties": { + "templateFile": "sqspstpexistingqueueIntegDefaultTestDeployAssert6DA9FDD7.template.json", + "terminationProtection": false, + "validateOnSynth": false, + "notificationArns": [], + "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": [ + "sqspstpexistingqueueIntegDefaultTestDeployAssert6DA9FDD7.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": [ + "sqspstpexistingqueueIntegDefaultTestDeployAssert6DA9FDD7.assets" + ], + "metadata": { + "/sqspstp-existing-queue/Integ/DefaultTest/DeployAssert/BootstrapVersion": [ + { + "type": "aws:cdk:logicalId", + "data": "BootstrapVersion" + } + ], + "/sqspstp-existing-queue/Integ/DefaultTest/DeployAssert/CheckBootstrapVersion": [ + { + "type": "aws:cdk:logicalId", + "data": "CheckBootstrapVersion" + } + ] + }, + "displayName": "sqspstp-existing-queue/Integ/DefaultTest/DeployAssert" + }, + "sqspstp-existing-queue.assets": { + "type": "cdk:asset-manifest", + "properties": { + "file": "sqspstp-existing-queue.assets.json", + "requiresBootstrapStackVersion": 6, + "bootstrapStackVersionSsmParameter": "/cdk-bootstrap/hnb659fds/version" + } + }, + "sqspstp-existing-queue": { + "type": "aws:cloudformation:stack", + "environment": "aws://unknown-account/unknown-region", + "properties": { + "templateFile": "sqspstp-existing-queue.template.json", + "terminationProtection": false, + "validateOnSynth": false, + "notificationArns": [], + "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}/999c1d09e8422479a8bfc5e3959a462993a6ac0e0a1c76a7c54d28735f9b564b.json", + "requiresBootstrapStackVersion": 6, + "bootstrapStackVersionSsmParameter": "/cdk-bootstrap/hnb659fds/version", + "additionalDependencies": [ + "sqspstp-existing-queue.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": [ + "sqspstp-existing-queue.assets" + ], + "metadata": { + "/sqspstp-existing-queue/existing-queue-dlq/Resource": [ + { + "type": "aws:cdk:logicalId", + "data": "existingqueuedlq98283DB9" + } + ], + "/sqspstp-existing-queue/existing-queue-dlq/Policy/Resource": [ + { + "type": "aws:cdk:logicalId", + "data": "existingqueuedlqPolicyAA729260" + } + ], + "/sqspstp-existing-queue/existing-queue/Resource": [ + { + "type": "aws:cdk:logicalId", + "data": "existingqueue03D57A53" + } + ], + "/sqspstp-existing-queue/existing-queue/Policy/Resource": [ + { + "type": "aws:cdk:logicalId", + "data": "existingqueuePolicy8BCB024D" + } + ], + "/sqspstp-existing-queue/lambdas3stp-test/ServiceRole/Resource": [ + { + "type": "aws:cdk:logicalId", + "data": "lambdas3stptestServiceRoleF17BB6C7" + } + ], + "/sqspstp-existing-queue/lambdas3stp-test/Resource": [ + { + "type": "aws:cdk:logicalId", + "data": "lambdas3stptest9FBDC6CE" + } + ], + "/sqspstp-existing-queue/test-sqs-pipes-states-construct/StateMachineLogGroup/Resource": [ + { + "type": "aws:cdk:logicalId", + "data": "testsqspipesstatesconstructStateMachineLogGroupADE94F1D" + } + ], + "/sqspstp-existing-queue/test-sqs-pipes-states-construct/StateMachine/Role/Resource": [ + { + "type": "aws:cdk:logicalId", + "data": "testsqspipesstatesconstructStateMachineRoleBF97BFC0" + } + ], + "/sqspstp-existing-queue/test-sqs-pipes-states-construct/StateMachine/Role/DefaultPolicy/Resource": [ + { + "type": "aws:cdk:logicalId", + "data": "testsqspipesstatesconstructStateMachineRoleDefaultPolicyD1BA2BF2" + } + ], + "/sqspstp-existing-queue/test-sqs-pipes-states-construct/StateMachine/Resource": [ + { + "type": "aws:cdk:logicalId", + "data": "testsqspipesstatesconstructStateMachine29272AA9" + } + ], + "/sqspstp-existing-queue/test-sqs-pipes-states-construct/ExecutionFailedAlarm/Resource": [ + { + "type": "aws:cdk:logicalId", + "data": "testsqspipesstatesconstructExecutionFailedAlarm1002FF55" + } + ], + "/sqspstp-existing-queue/test-sqs-pipes-states-construct/ExecutionThrottledAlarm/Resource": [ + { + "type": "aws:cdk:logicalId", + "data": "testsqspipesstatesconstructExecutionThrottledAlarm0242B01A" + } + ], + "/sqspstp-existing-queue/test-sqs-pipes-states-construct/ExecutionAbortedAlarm/Resource": [ + { + "type": "aws:cdk:logicalId", + "data": "testsqspipesstatesconstructExecutionAbortedAlarm14349A7B" + } + ], + "/sqspstp-existing-queue/test-sqs-pipes-states-construct/PipeRole--test-sqs-pipes-states-construct/Resource": [ + { + "type": "aws:cdk:logicalId", + "data": "testsqspipesstatesconstructPipeRoletestsqspipesstatesconstruct2CC9A13C" + } + ], + "/sqspstp-existing-queue/test-sqs-pipes-states-construct/LogGroup-test-sqs-pipes-states-construct/Resource": [ + { + "type": "aws:cdk:logicalId", + "data": "testsqspipesstatesconstructLogGrouptestsqspipesstatesconstructF827FE15" + } + ], + "/sqspstp-existing-queue/test-sqs-pipes-states-construct/pipe-test-sqs-pipes-states-construct": [ + { + "type": "aws:cdk:logicalId", + "data": "testsqspipesstatesconstructpipetestsqspipesstatesconstruct71A64A15" + } + ], + "/sqspstp-existing-queue/BootstrapVersion": [ + { + "type": "aws:cdk:logicalId", + "data": "BootstrapVersion" + } + ], + "/sqspstp-existing-queue/CheckBootstrapVersion": [ + { + "type": "aws:cdk:logicalId", + "data": "CheckBootstrapVersion" + } + ] + }, + "displayName": "sqspstp-existing-queue" + }, + "Tree": { + "type": "cdk:tree", + "properties": { + "file": "tree.json" + } + } + } +} \ No newline at end of file diff --git a/source/patterns/@aws-solutions-constructs/aws-sqs-pipes-stepfunctions/test/integ.sqspstp-existing-queue.js.snapshot/sqspstp-existing-queue.assets.json b/source/patterns/@aws-solutions-constructs/aws-sqs-pipes-stepfunctions/test/integ.sqspstp-existing-queue.js.snapshot/sqspstp-existing-queue.assets.json new file mode 100644 index 000000000..49143e2cc --- /dev/null +++ b/source/patterns/@aws-solutions-constructs/aws-sqs-pipes-stepfunctions/test/integ.sqspstp-existing-queue.js.snapshot/sqspstp-existing-queue.assets.json @@ -0,0 +1,19 @@ +{ + "version": "38.0.1", + "files": { + "999c1d09e8422479a8bfc5e3959a462993a6ac0e0a1c76a7c54d28735f9b564b": { + "source": { + "path": "sqspstp-existing-queue.template.json", + "packaging": "file" + }, + "destinations": { + "current_account-current_region": { + "bucketName": "cdk-hnb659fds-assets-${AWS::AccountId}-${AWS::Region}", + "objectKey": "999c1d09e8422479a8bfc5e3959a462993a6ac0e0a1c76a7c54d28735f9b564b.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-sqs-pipes-stepfunctions/test/integ.sqspstp-existing-queue.js.snapshot/sqspstp-existing-queue.template.json b/source/patterns/@aws-solutions-constructs/aws-sqs-pipes-stepfunctions/test/integ.sqspstp-existing-queue.js.snapshot/sqspstp-existing-queue.template.json new file mode 100644 index 000000000..e67918972 --- /dev/null +++ b/source/patterns/@aws-solutions-constructs/aws-sqs-pipes-stepfunctions/test/integ.sqspstp-existing-queue.js.snapshot/sqspstp-existing-queue.template.json @@ -0,0 +1,654 @@ +{ + "Resources": { + "existingqueuedlq98283DB9": { + "Type": "AWS::SQS::Queue", + "Properties": { + "KmsMasterKeyId": "alias/aws/sqs" + }, + "UpdateReplacePolicy": "Delete", + "DeletionPolicy": "Delete" + }, + "existingqueuedlqPolicyAA729260": { + "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": [ + "existingqueuedlq98283DB9", + "Arn" + ] + }, + "Sid": "QueueOwnerOnlyAccess" + }, + { + "Action": "SQS:*", + "Condition": { + "Bool": { + "aws:SecureTransport": "false" + } + }, + "Effect": "Deny", + "Principal": { + "AWS": "*" + }, + "Resource": { + "Fn::GetAtt": [ + "existingqueuedlq98283DB9", + "Arn" + ] + }, + "Sid": "HttpsOnly" + } + ], + "Version": "2012-10-17" + }, + "Queues": [ + { + "Ref": "existingqueuedlq98283DB9" + } + ] + } + }, + "existingqueue03D57A53": { + "Type": "AWS::SQS::Queue", + "Properties": { + "KmsMasterKeyId": "alias/aws/sqs", + "RedrivePolicy": { + "deadLetterTargetArn": { + "Fn::GetAtt": [ + "existingqueuedlq98283DB9", + "Arn" + ] + }, + "maxReceiveCount": 15 + } + }, + "UpdateReplacePolicy": "Delete", + "DeletionPolicy": "Delete" + }, + "existingqueuePolicy8BCB024D": { + "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": [ + "existingqueue03D57A53", + "Arn" + ] + }, + "Sid": "QueueOwnerOnlyAccess" + }, + { + "Action": "SQS:*", + "Condition": { + "Bool": { + "aws:SecureTransport": "false" + } + }, + "Effect": "Deny", + "Principal": { + "AWS": "*" + }, + "Resource": { + "Fn::GetAtt": [ + "existingqueue03D57A53", + "Arn" + ] + }, + "Sid": "HttpsOnly" + } + ], + "Version": "2012-10-17" + }, + "Queues": [ + { + "Ref": "existingqueue03D57A53" + } + ] + } + }, + "lambdas3stptestServiceRoleF17BB6C7": { + "Type": "AWS::IAM::Role", + "Properties": { + "AssumeRolePolicyDocument": { + "Statement": [ + { + "Action": "sts:AssumeRole", + "Effect": "Allow", + "Principal": { + "Service": "lambda.amazonaws.com" + } + } + ], + "Version": "2012-10-17" + }, + "ManagedPolicyArns": [ + { + "Fn::Join": [ + "", + [ + "arn:", + { + "Ref": "AWS::Partition" + }, + ":iam::aws:policy/service-role/AWSLambdaBasicExecutionRole" + ] + ] + } + ] + } + }, + "lambdas3stptest9FBDC6CE": { + "Type": "AWS::Lambda::Function", + "Properties": { + "Code": { + "ZipFile": "exports.handler = async (event) => console.log(event)" + }, + "Handler": "index.handler", + "Role": { + "Fn::GetAtt": [ + "lambdas3stptestServiceRoleF17BB6C7", + "Arn" + ] + }, + "Runtime": "nodejs20.x" + }, + "DependsOn": [ + "lambdas3stptestServiceRoleF17BB6C7" + ], + "Metadata": { + "cfn_nag": { + "rules_to_suppress": [ + { + "id": "W58", + "reason": "This Lambda Function is created for integration testing purposes only and is not part of an actual construct" + }, + { + "id": "W89", + "reason": "This Lambda Function is created for integration testing purposes only and is not part of an actual construct" + }, + { + "id": "W92", + "reason": "This Lambda Function is created for integration testing purposes only and is not part of an actual construct" + } + ] + } + } + }, + "testsqspipesstatesconstructStateMachineLogGroupADE94F1D": { + "Type": "AWS::Logs::LogGroup", + "Properties": { + "LogGroupName": { + "Fn::Join": [ + "", + [ + "/aws/vendedlogs/states/constructs/sqspstp-existing-queuetest-sqs-pipes-states-constructStateMachineLog-", + { + "Fn::Select": [ + 2, + { + "Fn::Split": [ + "/", + { + "Ref": "AWS::StackId" + } + ] + } + ] + } + ] + ] + } + }, + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Retain", + "Metadata": { + "cfn_nag": { + "rules_to_suppress": [ + { + "id": "W86", + "reason": "Retention period for CloudWatchLogs LogGroups are set to 'Never Expire' to preserve customer data indefinitely" + }, + { + "id": "W84", + "reason": "By default CloudWatchLogs LogGroups data is encrypted using the CloudWatch server-side encryption keys (AWS Managed Keys)" + } + ] + } + } + }, + "testsqspipesstatesconstructStateMachineRoleBF97BFC0": { + "Type": "AWS::IAM::Role", + "Properties": { + "AssumeRolePolicyDocument": { + "Statement": [ + { + "Action": "sts:AssumeRole", + "Effect": "Allow", + "Principal": { + "Service": "states.amazonaws.com" + } + } + ], + "Version": "2012-10-17" + } + } + }, + "testsqspipesstatesconstructStateMachineRoleDefaultPolicyD1BA2BF2": { + "Type": "AWS::IAM::Policy", + "Properties": { + "PolicyDocument": { + "Statement": [ + { + "Action": "lambda:InvokeFunction", + "Effect": "Allow", + "Resource": [ + { + "Fn::GetAtt": [ + "lambdas3stptest9FBDC6CE", + "Arn" + ] + }, + { + "Fn::Join": [ + "", + [ + { + "Fn::GetAtt": [ + "lambdas3stptest9FBDC6CE", + "Arn" + ] + }, + ":*" + ] + ] + } + ] + }, + { + "Action": [ + "logs:CreateLogDelivery", + "logs:DeleteLogDelivery", + "logs:DescribeLogGroups", + "logs:DescribeResourcePolicies", + "logs:GetLogDelivery", + "logs:ListLogDeliveries", + "logs:PutResourcePolicy", + "logs:UpdateLogDelivery" + ], + "Effect": "Allow", + "Resource": "*" + } + ], + "Version": "2012-10-17" + }, + "PolicyName": "testsqspipesstatesconstructStateMachineRoleDefaultPolicyD1BA2BF2", + "Roles": [ + { + "Ref": "testsqspipesstatesconstructStateMachineRoleBF97BFC0" + } + ] + }, + "Metadata": { + "cfn_nag": { + "rules_to_suppress": [ + { + "id": "W12", + "reason": "These are CDK defaults. The 'LogDelivery' actions do not support resource-level authorizations. Any logging is done by State Machine code" + } + ] + } + } + }, + "testsqspipesstatesconstructStateMachine29272AA9": { + "Type": "AWS::StepFunctions::StateMachine", + "Properties": { + "DefinitionString": { + "Fn::Join": [ + "", + [ + "{\"StartAt\":\"tasks3stp-test\",\"States\":{\"tasks3stp-test\":{\"End\":true,\"Retry\":[{\"ErrorEquals\":[\"Lambda.ClientExecutionTimeoutException\",\"Lambda.ServiceException\",\"Lambda.AWSLambdaException\",\"Lambda.SdkClientException\"],\"IntervalSeconds\":2,\"MaxAttempts\":6,\"BackoffRate\":2}],\"Type\":\"Task\",\"Resource\":\"arn:", + { + "Ref": "AWS::Partition" + }, + ":states:::lambda:invoke\",\"Parameters\":{\"FunctionName\":\"", + { + "Fn::GetAtt": [ + "lambdas3stptest9FBDC6CE", + "Arn" + ] + }, + "\",\"Payload.$\":\"$\"}}}}" + ] + ] + }, + "LoggingConfiguration": { + "Destinations": [ + { + "CloudWatchLogsLogGroup": { + "LogGroupArn": { + "Fn::GetAtt": [ + "testsqspipesstatesconstructStateMachineLogGroupADE94F1D", + "Arn" + ] + } + } + } + ], + "Level": "ERROR" + }, + "RoleArn": { + "Fn::GetAtt": [ + "testsqspipesstatesconstructStateMachineRoleBF97BFC0", + "Arn" + ] + } + }, + "DependsOn": [ + "testsqspipesstatesconstructStateMachineRoleDefaultPolicyD1BA2BF2", + "testsqspipesstatesconstructStateMachineRoleBF97BFC0" + ], + "UpdateReplacePolicy": "Delete", + "DeletionPolicy": "Delete" + }, + "testsqspipesstatesconstructExecutionFailedAlarm1002FF55": { + "Type": "AWS::CloudWatch::Alarm", + "Properties": { + "AlarmDescription": "Alarm for the number of executions that failed exceeded the threshold of 1. ", + "ComparisonOperator": "GreaterThanOrEqualToThreshold", + "Dimensions": [ + { + "Name": "StateMachineArn", + "Value": { + "Ref": "testsqspipesstatesconstructStateMachine29272AA9" + } + } + ], + "EvaluationPeriods": 1, + "MetricName": "ExecutionsFailed", + "Namespace": "AWS/States", + "Period": 300, + "Statistic": "Sum", + "Threshold": 1 + } + }, + "testsqspipesstatesconstructExecutionThrottledAlarm0242B01A": { + "Type": "AWS::CloudWatch::Alarm", + "Properties": { + "AlarmDescription": "Alarm for the number of executions that throttled exceeded the threshold of 1. ", + "ComparisonOperator": "GreaterThanOrEqualToThreshold", + "Dimensions": [ + { + "Name": "StateMachineArn", + "Value": { + "Ref": "testsqspipesstatesconstructStateMachine29272AA9" + } + } + ], + "EvaluationPeriods": 1, + "MetricName": "ExecutionThrottled", + "Namespace": "AWS/States", + "Period": 300, + "Statistic": "Sum", + "Threshold": 1 + } + }, + "testsqspipesstatesconstructExecutionAbortedAlarm14349A7B": { + "Type": "AWS::CloudWatch::Alarm", + "Properties": { + "AlarmDescription": "Alarm for the number of executions that aborted exceeded the threshold of 1. ", + "ComparisonOperator": "GreaterThanOrEqualToThreshold", + "Dimensions": [ + { + "Name": "StateMachineArn", + "Value": { + "Ref": "testsqspipesstatesconstructStateMachine29272AA9" + } + } + ], + "EvaluationPeriods": 1, + "MetricName": "ExecutionsAborted", + "Namespace": "AWS/States", + "Period": 300, + "Statistic": "Maximum", + "Threshold": 1 + } + }, + "testsqspipesstatesconstructPipeRoletestsqspipesstatesconstruct2CC9A13C": { + "Type": "AWS::IAM::Role", + "Properties": { + "AssumeRolePolicyDocument": { + "Statement": [ + { + "Action": "sts:AssumeRole", + "Effect": "Allow", + "Principal": { + "Service": "pipes.amazonaws.com" + } + } + ], + "Version": "2012-10-17" + }, + "Policies": [ + { + "PolicyDocument": { + "Statement": [ + { + "Action": [ + "sqs:DeleteMessage", + "sqs:GetQueueAttributes", + "sqs:ReceiveMessage" + ], + "Effect": "Allow", + "Resource": { + "Fn::GetAtt": [ + "existingqueue03D57A53", + "Arn" + ] + } + } + ], + "Version": "2012-10-17" + }, + "PolicyName": "sourcePolicy" + }, + { + "PolicyDocument": { + "Statement": [ + { + "Action": "states:StartExecution", + "Effect": "Allow", + "Resource": { + "Ref": "testsqspipesstatesconstructStateMachine29272AA9" + } + } + ], + "Version": "2012-10-17" + }, + "PolicyName": "targetPolicy" + } + ] + }, + "Metadata": { + "guard": { + "SuppressedRules": [ + "IAM_NO_INLINE_POLICY_CHECK" + ] + } + } + }, + "testsqspipesstatesconstructLogGrouptestsqspipesstatesconstructF827FE15": { + "Type": "AWS::Logs::LogGroup", + "Properties": { + "LogGroupName": { + "Fn::Join": [ + "", + [ + "/aws/vendedlogs/pipes/constructs/sqspstp-existing-queuetest-sqs-pipes-states-constructPipesLog-", + { + "Fn::Select": [ + 2, + { + "Fn::Split": [ + "/", + { + "Ref": "AWS::StackId" + } + ] + } + ] + } + ] + ] + } + }, + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Retain", + "Metadata": { + "cfn_nag": { + "rules_to_suppress": [ + { + "id": "W86", + "reason": "Retention period for CloudWatchLogs LogGroups are set to 'Never Expire' to preserve customer data indefinitely" + }, + { + "id": "W84", + "reason": "By default CloudWatchLogs LogGroups data is encrypted using the CloudWatch server-side encryption keys (AWS Managed Keys)" + } + ] + } + } + }, + "testsqspipesstatesconstructpipetestsqspipesstatesconstruct71A64A15": { + "Type": "AWS::Pipes::Pipe", + "Properties": { + "LogConfiguration": { + "CloudwatchLogsLogDestination": { + "LogGroupArn": { + "Fn::GetAtt": [ + "testsqspipesstatesconstructLogGrouptestsqspipesstatesconstructF827FE15", + "Arn" + ] + } + }, + "Level": "INFO" + }, + "RoleArn": { + "Fn::GetAtt": [ + "testsqspipesstatesconstructPipeRoletestsqspipesstatesconstruct2CC9A13C", + "Arn" + ] + }, + "Source": { + "Fn::GetAtt": [ + "existingqueue03D57A53", + "Arn" + ] + }, + "SourceParameters": {}, + "Target": { + "Ref": "testsqspipesstatesconstructStateMachine29272AA9" + }, + "TargetParameters": { + "StepFunctionStateMachineParameters": { + "InvocationType": "FIRE_AND_FORGET" + } + } + } + } + }, + "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-sqs-pipes-stepfunctions/test/integ.sqspstp-existing-queue.js.snapshot/sqspstpexistingqueueIntegDefaultTestDeployAssert6DA9FDD7.assets.json b/source/patterns/@aws-solutions-constructs/aws-sqs-pipes-stepfunctions/test/integ.sqspstp-existing-queue.js.snapshot/sqspstpexistingqueueIntegDefaultTestDeployAssert6DA9FDD7.assets.json new file mode 100644 index 000000000..5f89f68ba --- /dev/null +++ b/source/patterns/@aws-solutions-constructs/aws-sqs-pipes-stepfunctions/test/integ.sqspstp-existing-queue.js.snapshot/sqspstpexistingqueueIntegDefaultTestDeployAssert6DA9FDD7.assets.json @@ -0,0 +1,19 @@ +{ + "version": "38.0.1", + "files": { + "21fbb51d7b23f6a6c262b46a9caee79d744a3ac019fd45422d988b96d44b2a22": { + "source": { + "path": "sqspstpexistingqueueIntegDefaultTestDeployAssert6DA9FDD7.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-sqs-pipes-stepfunctions/test/integ.sqspstp-existing-queue.js.snapshot/sqspstpexistingqueueIntegDefaultTestDeployAssert6DA9FDD7.template.json b/source/patterns/@aws-solutions-constructs/aws-sqs-pipes-stepfunctions/test/integ.sqspstp-existing-queue.js.snapshot/sqspstpexistingqueueIntegDefaultTestDeployAssert6DA9FDD7.template.json new file mode 100644 index 000000000..ad9d0fb73 --- /dev/null +++ b/source/patterns/@aws-solutions-constructs/aws-sqs-pipes-stepfunctions/test/integ.sqspstp-existing-queue.js.snapshot/sqspstpexistingqueueIntegDefaultTestDeployAssert6DA9FDD7.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-sqs-pipes-stepfunctions/test/integ.sqspstp-existing-queue.js.snapshot/tree.json b/source/patterns/@aws-solutions-constructs/aws-sqs-pipes-stepfunctions/test/integ.sqspstp-existing-queue.js.snapshot/tree.json new file mode 100644 index 000000000..49e851c4a --- /dev/null +++ b/source/patterns/@aws-solutions-constructs/aws-sqs-pipes-stepfunctions/test/integ.sqspstp-existing-queue.js.snapshot/tree.json @@ -0,0 +1,957 @@ +{ + "version": "tree-0.1", + "tree": { + "id": "App", + "path": "", + "children": { + "sqspstp-existing-queue": { + "id": "sqspstp-existing-queue", + "path": "sqspstp-existing-queue", + "children": { + "existing-queue-dlq": { + "id": "existing-queue-dlq", + "path": "sqspstp-existing-queue/existing-queue-dlq", + "children": { + "Resource": { + "id": "Resource", + "path": "sqspstp-existing-queue/existing-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.161.0" + } + }, + "Policy": { + "id": "Policy", + "path": "sqspstp-existing-queue/existing-queue-dlq/Policy", + "children": { + "Resource": { + "id": "Resource", + "path": "sqspstp-existing-queue/existing-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": [ + "existingqueuedlq98283DB9", + "Arn" + ] + }, + "Sid": "QueueOwnerOnlyAccess" + }, + { + "Action": "SQS:*", + "Condition": { + "Bool": { + "aws:SecureTransport": "false" + } + }, + "Effect": "Deny", + "Principal": { + "AWS": "*" + }, + "Resource": { + "Fn::GetAtt": [ + "existingqueuedlq98283DB9", + "Arn" + ] + }, + "Sid": "HttpsOnly" + } + ], + "Version": "2012-10-17" + }, + "queues": [ + { + "Ref": "existingqueuedlq98283DB9" + } + ] + } + }, + "constructInfo": { + "fqn": "aws-cdk-lib.aws_sqs.CfnQueuePolicy", + "version": "2.161.0" + } + } + }, + "constructInfo": { + "fqn": "aws-cdk-lib.aws_sqs.QueuePolicy", + "version": "2.161.0" + } + } + }, + "constructInfo": { + "fqn": "aws-cdk-lib.aws_sqs.Queue", + "version": "2.161.0" + } + }, + "existing-queue": { + "id": "existing-queue", + "path": "sqspstp-existing-queue/existing-queue", + "children": { + "Resource": { + "id": "Resource", + "path": "sqspstp-existing-queue/existing-queue/Resource", + "attributes": { + "aws:cdk:cloudformation:type": "AWS::SQS::Queue", + "aws:cdk:cloudformation:props": { + "kmsMasterKeyId": "alias/aws/sqs", + "redrivePolicy": { + "deadLetterTargetArn": { + "Fn::GetAtt": [ + "existingqueuedlq98283DB9", + "Arn" + ] + }, + "maxReceiveCount": 15 + } + } + }, + "constructInfo": { + "fqn": "aws-cdk-lib.aws_sqs.CfnQueue", + "version": "2.161.0" + } + }, + "Policy": { + "id": "Policy", + "path": "sqspstp-existing-queue/existing-queue/Policy", + "children": { + "Resource": { + "id": "Resource", + "path": "sqspstp-existing-queue/existing-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": [ + "existingqueue03D57A53", + "Arn" + ] + }, + "Sid": "QueueOwnerOnlyAccess" + }, + { + "Action": "SQS:*", + "Condition": { + "Bool": { + "aws:SecureTransport": "false" + } + }, + "Effect": "Deny", + "Principal": { + "AWS": "*" + }, + "Resource": { + "Fn::GetAtt": [ + "existingqueue03D57A53", + "Arn" + ] + }, + "Sid": "HttpsOnly" + } + ], + "Version": "2012-10-17" + }, + "queues": [ + { + "Ref": "existingqueue03D57A53" + } + ] + } + }, + "constructInfo": { + "fqn": "aws-cdk-lib.aws_sqs.CfnQueuePolicy", + "version": "2.161.0" + } + } + }, + "constructInfo": { + "fqn": "aws-cdk-lib.aws_sqs.QueuePolicy", + "version": "2.161.0" + } + } + }, + "constructInfo": { + "fqn": "aws-cdk-lib.aws_sqs.Queue", + "version": "2.161.0" + } + }, + "lambdas3stp-test": { + "id": "lambdas3stp-test", + "path": "sqspstp-existing-queue/lambdas3stp-test", + "children": { + "ServiceRole": { + "id": "ServiceRole", + "path": "sqspstp-existing-queue/lambdas3stp-test/ServiceRole", + "children": { + "ImportServiceRole": { + "id": "ImportServiceRole", + "path": "sqspstp-existing-queue/lambdas3stp-test/ServiceRole/ImportServiceRole", + "constructInfo": { + "fqn": "aws-cdk-lib.Resource", + "version": "2.161.0" + } + }, + "Resource": { + "id": "Resource", + "path": "sqspstp-existing-queue/lambdas3stp-test/ServiceRole/Resource", + "attributes": { + "aws:cdk:cloudformation:type": "AWS::IAM::Role", + "aws:cdk:cloudformation:props": { + "assumeRolePolicyDocument": { + "Statement": [ + { + "Action": "sts:AssumeRole", + "Effect": "Allow", + "Principal": { + "Service": "lambda.amazonaws.com" + } + } + ], + "Version": "2012-10-17" + }, + "managedPolicyArns": [ + { + "Fn::Join": [ + "", + [ + "arn:", + { + "Ref": "AWS::Partition" + }, + ":iam::aws:policy/service-role/AWSLambdaBasicExecutionRole" + ] + ] + } + ] + } + }, + "constructInfo": { + "fqn": "aws-cdk-lib.aws_iam.CfnRole", + "version": "2.161.0" + } + } + }, + "constructInfo": { + "fqn": "aws-cdk-lib.aws_iam.Role", + "version": "2.161.0" + } + }, + "Resource": { + "id": "Resource", + "path": "sqspstp-existing-queue/lambdas3stp-test/Resource", + "attributes": { + "aws:cdk:cloudformation:type": "AWS::Lambda::Function", + "aws:cdk:cloudformation:props": { + "code": { + "zipFile": "exports.handler = async (event) => console.log(event)" + }, + "handler": "index.handler", + "role": { + "Fn::GetAtt": [ + "lambdas3stptestServiceRoleF17BB6C7", + "Arn" + ] + }, + "runtime": "nodejs20.x" + } + }, + "constructInfo": { + "fqn": "aws-cdk-lib.aws_lambda.CfnFunction", + "version": "2.161.0" + } + } + }, + "constructInfo": { + "fqn": "aws-cdk-lib.aws_lambda.Function", + "version": "2.161.0" + } + }, + "tasks3stp-test": { + "id": "tasks3stp-test", + "path": "sqspstp-existing-queue/tasks3stp-test", + "constructInfo": { + "fqn": "aws-cdk-lib.aws_stepfunctions_tasks.LambdaInvoke", + "version": "2.161.0" + } + }, + "test-sqs-pipes-states-construct": { + "id": "test-sqs-pipes-states-construct", + "path": "sqspstp-existing-queue/test-sqs-pipes-states-construct", + "children": { + "StateMachineLogGroup": { + "id": "StateMachineLogGroup", + "path": "sqspstp-existing-queue/test-sqs-pipes-states-construct/StateMachineLogGroup", + "children": { + "Resource": { + "id": "Resource", + "path": "sqspstp-existing-queue/test-sqs-pipes-states-construct/StateMachineLogGroup/Resource", + "attributes": { + "aws:cdk:cloudformation:type": "AWS::Logs::LogGroup", + "aws:cdk:cloudformation:props": { + "logGroupName": { + "Fn::Join": [ + "", + [ + "/aws/vendedlogs/states/constructs/sqspstp-existing-queuetest-sqs-pipes-states-constructStateMachineLog-", + { + "Fn::Select": [ + 2, + { + "Fn::Split": [ + "/", + { + "Ref": "AWS::StackId" + } + ] + } + ] + } + ] + ] + } + } + }, + "constructInfo": { + "fqn": "aws-cdk-lib.aws_logs.CfnLogGroup", + "version": "2.161.0" + } + } + }, + "constructInfo": { + "fqn": "aws-cdk-lib.aws_logs.LogGroup", + "version": "2.161.0" + } + }, + "StateMachine": { + "id": "StateMachine", + "path": "sqspstp-existing-queue/test-sqs-pipes-states-construct/StateMachine", + "children": { + "Role": { + "id": "Role", + "path": "sqspstp-existing-queue/test-sqs-pipes-states-construct/StateMachine/Role", + "children": { + "ImportRole": { + "id": "ImportRole", + "path": "sqspstp-existing-queue/test-sqs-pipes-states-construct/StateMachine/Role/ImportRole", + "constructInfo": { + "fqn": "aws-cdk-lib.Resource", + "version": "2.161.0" + } + }, + "Resource": { + "id": "Resource", + "path": "sqspstp-existing-queue/test-sqs-pipes-states-construct/StateMachine/Role/Resource", + "attributes": { + "aws:cdk:cloudformation:type": "AWS::IAM::Role", + "aws:cdk:cloudformation:props": { + "assumeRolePolicyDocument": { + "Statement": [ + { + "Action": "sts:AssumeRole", + "Effect": "Allow", + "Principal": { + "Service": "states.amazonaws.com" + } + } + ], + "Version": "2012-10-17" + } + } + }, + "constructInfo": { + "fqn": "aws-cdk-lib.aws_iam.CfnRole", + "version": "2.161.0" + } + }, + "DefaultPolicy": { + "id": "DefaultPolicy", + "path": "sqspstp-existing-queue/test-sqs-pipes-states-construct/StateMachine/Role/DefaultPolicy", + "children": { + "Resource": { + "id": "Resource", + "path": "sqspstp-existing-queue/test-sqs-pipes-states-construct/StateMachine/Role/DefaultPolicy/Resource", + "attributes": { + "aws:cdk:cloudformation:type": "AWS::IAM::Policy", + "aws:cdk:cloudformation:props": { + "policyDocument": { + "Statement": [ + { + "Action": "lambda:InvokeFunction", + "Effect": "Allow", + "Resource": [ + { + "Fn::GetAtt": [ + "lambdas3stptest9FBDC6CE", + "Arn" + ] + }, + { + "Fn::Join": [ + "", + [ + { + "Fn::GetAtt": [ + "lambdas3stptest9FBDC6CE", + "Arn" + ] + }, + ":*" + ] + ] + } + ] + }, + { + "Action": [ + "logs:CreateLogDelivery", + "logs:DeleteLogDelivery", + "logs:DescribeLogGroups", + "logs:DescribeResourcePolicies", + "logs:GetLogDelivery", + "logs:ListLogDeliveries", + "logs:PutResourcePolicy", + "logs:UpdateLogDelivery" + ], + "Effect": "Allow", + "Resource": "*" + } + ], + "Version": "2012-10-17" + }, + "policyName": "testsqspipesstatesconstructStateMachineRoleDefaultPolicyD1BA2BF2", + "roles": [ + { + "Ref": "testsqspipesstatesconstructStateMachineRoleBF97BFC0" + } + ] + } + }, + "constructInfo": { + "fqn": "aws-cdk-lib.aws_iam.CfnPolicy", + "version": "2.161.0" + } + } + }, + "constructInfo": { + "fqn": "aws-cdk-lib.aws_iam.Policy", + "version": "2.161.0" + } + } + }, + "constructInfo": { + "fqn": "aws-cdk-lib.aws_iam.Role", + "version": "2.161.0" + } + }, + "Resource": { + "id": "Resource", + "path": "sqspstp-existing-queue/test-sqs-pipes-states-construct/StateMachine/Resource", + "attributes": { + "aws:cdk:cloudformation:type": "AWS::StepFunctions::StateMachine", + "aws:cdk:cloudformation:props": { + "definitionString": { + "Fn::Join": [ + "", + [ + "{\"StartAt\":\"tasks3stp-test\",\"States\":{\"tasks3stp-test\":{\"End\":true,\"Retry\":[{\"ErrorEquals\":[\"Lambda.ClientExecutionTimeoutException\",\"Lambda.ServiceException\",\"Lambda.AWSLambdaException\",\"Lambda.SdkClientException\"],\"IntervalSeconds\":2,\"MaxAttempts\":6,\"BackoffRate\":2}],\"Type\":\"Task\",\"Resource\":\"arn:", + { + "Ref": "AWS::Partition" + }, + ":states:::lambda:invoke\",\"Parameters\":{\"FunctionName\":\"", + { + "Fn::GetAtt": [ + "lambdas3stptest9FBDC6CE", + "Arn" + ] + }, + "\",\"Payload.$\":\"$\"}}}}" + ] + ] + }, + "loggingConfiguration": { + "destinations": [ + { + "cloudWatchLogsLogGroup": { + "logGroupArn": { + "Fn::GetAtt": [ + "testsqspipesstatesconstructStateMachineLogGroupADE94F1D", + "Arn" + ] + } + } + } + ], + "level": "ERROR" + }, + "roleArn": { + "Fn::GetAtt": [ + "testsqspipesstatesconstructStateMachineRoleBF97BFC0", + "Arn" + ] + } + } + }, + "constructInfo": { + "fqn": "aws-cdk-lib.aws_stepfunctions.CfnStateMachine", + "version": "2.161.0" + } + } + }, + "constructInfo": { + "fqn": "aws-cdk-lib.aws_stepfunctions.StateMachine", + "version": "2.161.0" + } + }, + "ExecutionFailedAlarm": { + "id": "ExecutionFailedAlarm", + "path": "sqspstp-existing-queue/test-sqs-pipes-states-construct/ExecutionFailedAlarm", + "children": { + "Resource": { + "id": "Resource", + "path": "sqspstp-existing-queue/test-sqs-pipes-states-construct/ExecutionFailedAlarm/Resource", + "attributes": { + "aws:cdk:cloudformation:type": "AWS::CloudWatch::Alarm", + "aws:cdk:cloudformation:props": { + "alarmDescription": "Alarm for the number of executions that failed exceeded the threshold of 1. ", + "comparisonOperator": "GreaterThanOrEqualToThreshold", + "dimensions": [ + { + "name": "StateMachineArn", + "value": { + "Ref": "testsqspipesstatesconstructStateMachine29272AA9" + } + } + ], + "evaluationPeriods": 1, + "metricName": "ExecutionsFailed", + "namespace": "AWS/States", + "period": 300, + "statistic": "Sum", + "threshold": 1 + } + }, + "constructInfo": { + "fqn": "aws-cdk-lib.aws_cloudwatch.CfnAlarm", + "version": "2.161.0" + } + } + }, + "constructInfo": { + "fqn": "aws-cdk-lib.aws_cloudwatch.Alarm", + "version": "2.161.0" + } + }, + "ExecutionThrottledAlarm": { + "id": "ExecutionThrottledAlarm", + "path": "sqspstp-existing-queue/test-sqs-pipes-states-construct/ExecutionThrottledAlarm", + "children": { + "Resource": { + "id": "Resource", + "path": "sqspstp-existing-queue/test-sqs-pipes-states-construct/ExecutionThrottledAlarm/Resource", + "attributes": { + "aws:cdk:cloudformation:type": "AWS::CloudWatch::Alarm", + "aws:cdk:cloudformation:props": { + "alarmDescription": "Alarm for the number of executions that throttled exceeded the threshold of 1. ", + "comparisonOperator": "GreaterThanOrEqualToThreshold", + "dimensions": [ + { + "name": "StateMachineArn", + "value": { + "Ref": "testsqspipesstatesconstructStateMachine29272AA9" + } + } + ], + "evaluationPeriods": 1, + "metricName": "ExecutionThrottled", + "namespace": "AWS/States", + "period": 300, + "statistic": "Sum", + "threshold": 1 + } + }, + "constructInfo": { + "fqn": "aws-cdk-lib.aws_cloudwatch.CfnAlarm", + "version": "2.161.0" + } + } + }, + "constructInfo": { + "fqn": "aws-cdk-lib.aws_cloudwatch.Alarm", + "version": "2.161.0" + } + }, + "ExecutionAbortedAlarm": { + "id": "ExecutionAbortedAlarm", + "path": "sqspstp-existing-queue/test-sqs-pipes-states-construct/ExecutionAbortedAlarm", + "children": { + "Resource": { + "id": "Resource", + "path": "sqspstp-existing-queue/test-sqs-pipes-states-construct/ExecutionAbortedAlarm/Resource", + "attributes": { + "aws:cdk:cloudformation:type": "AWS::CloudWatch::Alarm", + "aws:cdk:cloudformation:props": { + "alarmDescription": "Alarm for the number of executions that aborted exceeded the threshold of 1. ", + "comparisonOperator": "GreaterThanOrEqualToThreshold", + "dimensions": [ + { + "name": "StateMachineArn", + "value": { + "Ref": "testsqspipesstatesconstructStateMachine29272AA9" + } + } + ], + "evaluationPeriods": 1, + "metricName": "ExecutionsAborted", + "namespace": "AWS/States", + "period": 300, + "statistic": "Maximum", + "threshold": 1 + } + }, + "constructInfo": { + "fqn": "aws-cdk-lib.aws_cloudwatch.CfnAlarm", + "version": "2.161.0" + } + } + }, + "constructInfo": { + "fqn": "aws-cdk-lib.aws_cloudwatch.Alarm", + "version": "2.161.0" + } + }, + "PipeRole--test-sqs-pipes-states-construct": { + "id": "PipeRole--test-sqs-pipes-states-construct", + "path": "sqspstp-existing-queue/test-sqs-pipes-states-construct/PipeRole--test-sqs-pipes-states-construct", + "children": { + "ImportPipeRole--test-sqs-pipes-states-construct": { + "id": "ImportPipeRole--test-sqs-pipes-states-construct", + "path": "sqspstp-existing-queue/test-sqs-pipes-states-construct/PipeRole--test-sqs-pipes-states-construct/ImportPipeRole--test-sqs-pipes-states-construct", + "constructInfo": { + "fqn": "aws-cdk-lib.Resource", + "version": "2.161.0" + } + }, + "Resource": { + "id": "Resource", + "path": "sqspstp-existing-queue/test-sqs-pipes-states-construct/PipeRole--test-sqs-pipes-states-construct/Resource", + "attributes": { + "aws:cdk:cloudformation:type": "AWS::IAM::Role", + "aws:cdk:cloudformation:props": { + "assumeRolePolicyDocument": { + "Statement": [ + { + "Action": "sts:AssumeRole", + "Effect": "Allow", + "Principal": { + "Service": "pipes.amazonaws.com" + } + } + ], + "Version": "2012-10-17" + }, + "policies": [ + { + "policyName": "sourcePolicy", + "policyDocument": { + "Statement": [ + { + "Action": [ + "sqs:DeleteMessage", + "sqs:GetQueueAttributes", + "sqs:ReceiveMessage" + ], + "Effect": "Allow", + "Resource": { + "Fn::GetAtt": [ + "existingqueue03D57A53", + "Arn" + ] + } + } + ], + "Version": "2012-10-17" + } + }, + { + "policyName": "targetPolicy", + "policyDocument": { + "Statement": [ + { + "Action": "states:StartExecution", + "Effect": "Allow", + "Resource": { + "Ref": "testsqspipesstatesconstructStateMachine29272AA9" + } + } + ], + "Version": "2012-10-17" + } + } + ] + } + }, + "constructInfo": { + "fqn": "aws-cdk-lib.aws_iam.CfnRole", + "version": "2.161.0" + } + } + }, + "constructInfo": { + "fqn": "aws-cdk-lib.aws_iam.Role", + "version": "2.161.0" + } + }, + "LogGroup-test-sqs-pipes-states-construct": { + "id": "LogGroup-test-sqs-pipes-states-construct", + "path": "sqspstp-existing-queue/test-sqs-pipes-states-construct/LogGroup-test-sqs-pipes-states-construct", + "children": { + "Resource": { + "id": "Resource", + "path": "sqspstp-existing-queue/test-sqs-pipes-states-construct/LogGroup-test-sqs-pipes-states-construct/Resource", + "attributes": { + "aws:cdk:cloudformation:type": "AWS::Logs::LogGroup", + "aws:cdk:cloudformation:props": { + "logGroupName": { + "Fn::Join": [ + "", + [ + "/aws/vendedlogs/pipes/constructs/sqspstp-existing-queuetest-sqs-pipes-states-constructPipesLog-", + { + "Fn::Select": [ + 2, + { + "Fn::Split": [ + "/", + { + "Ref": "AWS::StackId" + } + ] + } + ] + } + ] + ] + } + } + }, + "constructInfo": { + "fqn": "aws-cdk-lib.aws_logs.CfnLogGroup", + "version": "2.161.0" + } + } + }, + "constructInfo": { + "fqn": "aws-cdk-lib.aws_logs.LogGroup", + "version": "2.161.0" + } + }, + "pipe-test-sqs-pipes-states-construct": { + "id": "pipe-test-sqs-pipes-states-construct", + "path": "sqspstp-existing-queue/test-sqs-pipes-states-construct/pipe-test-sqs-pipes-states-construct", + "attributes": { + "aws:cdk:cloudformation:type": "AWS::Pipes::Pipe", + "aws:cdk:cloudformation:props": { + "logConfiguration": { + "cloudwatchLogsLogDestination": { + "logGroupArn": { + "Fn::GetAtt": [ + "testsqspipesstatesconstructLogGrouptestsqspipesstatesconstructF827FE15", + "Arn" + ] + } + }, + "level": "INFO" + }, + "roleArn": { + "Fn::GetAtt": [ + "testsqspipesstatesconstructPipeRoletestsqspipesstatesconstruct2CC9A13C", + "Arn" + ] + }, + "source": { + "Fn::GetAtt": [ + "existingqueue03D57A53", + "Arn" + ] + }, + "sourceParameters": {}, + "target": { + "Ref": "testsqspipesstatesconstructStateMachine29272AA9" + }, + "targetParameters": { + "stepFunctionStateMachineParameters": { + "invocationType": "FIRE_AND_FORGET" + } + } + } + }, + "constructInfo": { + "fqn": "aws-cdk-lib.aws_pipes.CfnPipe", + "version": "2.161.0" + } + } + }, + "constructInfo": { + "fqn": "@aws-solutions-constructs/aws-sqs-pipes-stepfunctions.SqsToPipesToStepfunctions", + "version": "2.72.0" + } + }, + "Integ": { + "id": "Integ", + "path": "sqspstp-existing-queue/Integ", + "children": { + "DefaultTest": { + "id": "DefaultTest", + "path": "sqspstp-existing-queue/Integ/DefaultTest", + "children": { + "Default": { + "id": "Default", + "path": "sqspstp-existing-queue/Integ/DefaultTest/Default", + "constructInfo": { + "fqn": "constructs.Construct", + "version": "10.4.2" + } + }, + "DeployAssert": { + "id": "DeployAssert", + "path": "sqspstp-existing-queue/Integ/DefaultTest/DeployAssert", + "children": { + "BootstrapVersion": { + "id": "BootstrapVersion", + "path": "sqspstp-existing-queue/Integ/DefaultTest/DeployAssert/BootstrapVersion", + "constructInfo": { + "fqn": "aws-cdk-lib.CfnParameter", + "version": "2.161.0" + } + }, + "CheckBootstrapVersion": { + "id": "CheckBootstrapVersion", + "path": "sqspstp-existing-queue/Integ/DefaultTest/DeployAssert/CheckBootstrapVersion", + "constructInfo": { + "fqn": "aws-cdk-lib.CfnRule", + "version": "2.161.0" + } + } + }, + "constructInfo": { + "fqn": "aws-cdk-lib.Stack", + "version": "2.161.0" + } + } + }, + "constructInfo": { + "fqn": "@aws-cdk/integ-tests-alpha.IntegTestCase", + "version": "2.161.0-alpha.0" + } + } + }, + "constructInfo": { + "fqn": "@aws-cdk/integ-tests-alpha.IntegTest", + "version": "2.161.0-alpha.0" + } + }, + "BootstrapVersion": { + "id": "BootstrapVersion", + "path": "sqspstp-existing-queue/BootstrapVersion", + "constructInfo": { + "fqn": "aws-cdk-lib.CfnParameter", + "version": "2.161.0" + } + }, + "CheckBootstrapVersion": { + "id": "CheckBootstrapVersion", + "path": "sqspstp-existing-queue/CheckBootstrapVersion", + "constructInfo": { + "fqn": "aws-cdk-lib.CfnRule", + "version": "2.161.0" + } + } + }, + "constructInfo": { + "fqn": "aws-cdk-lib.Stack", + "version": "2.161.0" + } + }, + "Tree": { + "id": "Tree", + "path": "Tree", + "constructInfo": { + "fqn": "constructs.Construct", + "version": "10.4.2" + } + } + }, + "constructInfo": { + "fqn": "aws-cdk-lib.App", + "version": "2.161.0" + } + } +} \ No newline at end of file diff --git a/source/patterns/@aws-solutions-constructs/aws-sqs-pipes-stepfunctions/test/integ.sqspstp-existing-queue.ts b/source/patterns/@aws-solutions-constructs/aws-sqs-pipes-stepfunctions/test/integ.sqspstp-existing-queue.ts new file mode 100644 index 000000000..b0defa7a5 --- /dev/null +++ b/source/patterns/@aws-solutions-constructs/aws-sqs-pipes-stepfunctions/test/integ.sqspstp-existing-queue.ts @@ -0,0 +1,38 @@ +/** + * 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. + */ + +/// !cdk-integ * +import { App, Stack } from "aws-cdk-lib"; +import { SqsToPipesToStepfunctions, SqsToPipesToStepfunctionsProps } from "../lib"; +import { generateIntegStackName } from '@aws-solutions-constructs/core'; +import { IntegTest } from '@aws-cdk/integ-tests-alpha'; +import * as defaults from '@aws-solutions-constructs/core'; + +const app = new App(); +const stack = new Stack(app, generateIntegStackName(__filename)); + +const buildQueueResponse = defaults.buildQueue(stack, 'existing-queue', {}); +const existingQueue = buildQueueResponse.queue; + +const props: SqsToPipesToStepfunctionsProps = { + stateMachineProps: { + definitionBody: defaults.CreateTestStateMachineDefinitionBody(stack, 's3stp-test') + }, + existingQueueObj: existingQueue, +}; + +new SqsToPipesToStepfunctions(stack, 'test-sqs-pipes-states-construct', props); + +new IntegTest(stack, 'Integ', { testCases: [ + stack +] }); diff --git a/source/patterns/@aws-solutions-constructs/aws-sqs-pipes-stepfunctions/test/integ.sqspstp-filter.js.snapshot/cdk.out b/source/patterns/@aws-solutions-constructs/aws-sqs-pipes-stepfunctions/test/integ.sqspstp-filter.js.snapshot/cdk.out new file mode 100644 index 000000000..c6e612584 --- /dev/null +++ b/source/patterns/@aws-solutions-constructs/aws-sqs-pipes-stepfunctions/test/integ.sqspstp-filter.js.snapshot/cdk.out @@ -0,0 +1 @@ +{"version":"38.0.1"} \ No newline at end of file diff --git a/source/patterns/@aws-solutions-constructs/aws-sqs-pipes-stepfunctions/test/integ.sqspstp-filter.js.snapshot/integ.json b/source/patterns/@aws-solutions-constructs/aws-sqs-pipes-stepfunctions/test/integ.sqspstp-filter.js.snapshot/integ.json new file mode 100644 index 000000000..1a5d1089f --- /dev/null +++ b/source/patterns/@aws-solutions-constructs/aws-sqs-pipes-stepfunctions/test/integ.sqspstp-filter.js.snapshot/integ.json @@ -0,0 +1,12 @@ +{ + "version": "38.0.1", + "testCases": { + "sqspstp-filter/Integ/DefaultTest": { + "stacks": [ + "sqspstp-filter" + ], + "assertionStack": "sqspstp-filter/Integ/DefaultTest/DeployAssert", + "assertionStackName": "sqspstpfilterIntegDefaultTestDeployAssert0C52837E" + } + } +} \ No newline at end of file diff --git a/source/patterns/@aws-solutions-constructs/aws-sqs-pipes-stepfunctions/test/integ.sqspstp-filter.js.snapshot/manifest.json b/source/patterns/@aws-solutions-constructs/aws-sqs-pipes-stepfunctions/test/integ.sqspstp-filter.js.snapshot/manifest.json new file mode 100644 index 000000000..55c5b08b0 --- /dev/null +++ b/source/patterns/@aws-solutions-constructs/aws-sqs-pipes-stepfunctions/test/integ.sqspstp-filter.js.snapshot/manifest.json @@ -0,0 +1,205 @@ +{ + "version": "38.0.1", + "artifacts": { + "sqspstpfilterIntegDefaultTestDeployAssert0C52837E.assets": { + "type": "cdk:asset-manifest", + "properties": { + "file": "sqspstpfilterIntegDefaultTestDeployAssert0C52837E.assets.json", + "requiresBootstrapStackVersion": 6, + "bootstrapStackVersionSsmParameter": "/cdk-bootstrap/hnb659fds/version" + } + }, + "sqspstpfilterIntegDefaultTestDeployAssert0C52837E": { + "type": "aws:cloudformation:stack", + "environment": "aws://unknown-account/unknown-region", + "properties": { + "templateFile": "sqspstpfilterIntegDefaultTestDeployAssert0C52837E.template.json", + "terminationProtection": false, + "validateOnSynth": false, + "notificationArns": [], + "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": [ + "sqspstpfilterIntegDefaultTestDeployAssert0C52837E.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": [ + "sqspstpfilterIntegDefaultTestDeployAssert0C52837E.assets" + ], + "metadata": { + "/sqspstp-filter/Integ/DefaultTest/DeployAssert/BootstrapVersion": [ + { + "type": "aws:cdk:logicalId", + "data": "BootstrapVersion" + } + ], + "/sqspstp-filter/Integ/DefaultTest/DeployAssert/CheckBootstrapVersion": [ + { + "type": "aws:cdk:logicalId", + "data": "CheckBootstrapVersion" + } + ] + }, + "displayName": "sqspstp-filter/Integ/DefaultTest/DeployAssert" + }, + "sqspstp-filter.assets": { + "type": "cdk:asset-manifest", + "properties": { + "file": "sqspstp-filter.assets.json", + "requiresBootstrapStackVersion": 6, + "bootstrapStackVersionSsmParameter": "/cdk-bootstrap/hnb659fds/version" + } + }, + "sqspstp-filter": { + "type": "aws:cloudformation:stack", + "environment": "aws://unknown-account/unknown-region", + "properties": { + "templateFile": "sqspstp-filter.template.json", + "terminationProtection": false, + "validateOnSynth": false, + "notificationArns": [], + "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}/9718069baa56a46ca68c34209de1d1f4f856a5c5137b748f79e84785db1e5ec0.json", + "requiresBootstrapStackVersion": 6, + "bootstrapStackVersionSsmParameter": "/cdk-bootstrap/hnb659fds/version", + "additionalDependencies": [ + "sqspstp-filter.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": [ + "sqspstp-filter.assets" + ], + "metadata": { + "/sqspstp-filter/lambdas3stp-test/ServiceRole/Resource": [ + { + "type": "aws:cdk:logicalId", + "data": "lambdas3stptestServiceRoleF17BB6C7" + } + ], + "/sqspstp-filter/lambdas3stp-test/Resource": [ + { + "type": "aws:cdk:logicalId", + "data": "lambdas3stptest9FBDC6CE" + } + ], + "/sqspstp-filter/test-sqs-pipes-states-construct/queue-dlq/Resource": [ + { + "type": "aws:cdk:logicalId", + "data": "testsqspipesstatesconstructqueuedlq420A82FD" + } + ], + "/sqspstp-filter/test-sqs-pipes-states-construct/queue-dlq/Policy/Resource": [ + { + "type": "aws:cdk:logicalId", + "data": "testsqspipesstatesconstructqueuedlqPolicyB1D70483" + } + ], + "/sqspstp-filter/test-sqs-pipes-states-construct/queue/Resource": [ + { + "type": "aws:cdk:logicalId", + "data": "testsqspipesstatesconstructqueueA7C76715" + } + ], + "/sqspstp-filter/test-sqs-pipes-states-construct/queue/Policy/Resource": [ + { + "type": "aws:cdk:logicalId", + "data": "testsqspipesstatesconstructqueuePolicyFD32B562" + } + ], + "/sqspstp-filter/test-sqs-pipes-states-construct/StateMachineLogGroup/Resource": [ + { + "type": "aws:cdk:logicalId", + "data": "testsqspipesstatesconstructStateMachineLogGroupADE94F1D" + } + ], + "/sqspstp-filter/test-sqs-pipes-states-construct/StateMachine/Role/Resource": [ + { + "type": "aws:cdk:logicalId", + "data": "testsqspipesstatesconstructStateMachineRoleBF97BFC0" + } + ], + "/sqspstp-filter/test-sqs-pipes-states-construct/StateMachine/Role/DefaultPolicy/Resource": [ + { + "type": "aws:cdk:logicalId", + "data": "testsqspipesstatesconstructStateMachineRoleDefaultPolicyD1BA2BF2" + } + ], + "/sqspstp-filter/test-sqs-pipes-states-construct/StateMachine/Resource": [ + { + "type": "aws:cdk:logicalId", + "data": "testsqspipesstatesconstructStateMachine29272AA9" + } + ], + "/sqspstp-filter/test-sqs-pipes-states-construct/ExecutionFailedAlarm/Resource": [ + { + "type": "aws:cdk:logicalId", + "data": "testsqspipesstatesconstructExecutionFailedAlarm1002FF55" + } + ], + "/sqspstp-filter/test-sqs-pipes-states-construct/ExecutionThrottledAlarm/Resource": [ + { + "type": "aws:cdk:logicalId", + "data": "testsqspipesstatesconstructExecutionThrottledAlarm0242B01A" + } + ], + "/sqspstp-filter/test-sqs-pipes-states-construct/ExecutionAbortedAlarm/Resource": [ + { + "type": "aws:cdk:logicalId", + "data": "testsqspipesstatesconstructExecutionAbortedAlarm14349A7B" + } + ], + "/sqspstp-filter/test-sqs-pipes-states-construct/PipeRole--test-sqs-pipes-states-construct/Resource": [ + { + "type": "aws:cdk:logicalId", + "data": "testsqspipesstatesconstructPipeRoletestsqspipesstatesconstruct2CC9A13C" + } + ], + "/sqspstp-filter/test-sqs-pipes-states-construct/LogGroup-test-sqs-pipes-states-construct/Resource": [ + { + "type": "aws:cdk:logicalId", + "data": "testsqspipesstatesconstructLogGrouptestsqspipesstatesconstructF827FE15" + } + ], + "/sqspstp-filter/test-sqs-pipes-states-construct/pipe-test-sqs-pipes-states-construct": [ + { + "type": "aws:cdk:logicalId", + "data": "testsqspipesstatesconstructpipetestsqspipesstatesconstruct71A64A15" + } + ], + "/sqspstp-filter/BootstrapVersion": [ + { + "type": "aws:cdk:logicalId", + "data": "BootstrapVersion" + } + ], + "/sqspstp-filter/CheckBootstrapVersion": [ + { + "type": "aws:cdk:logicalId", + "data": "CheckBootstrapVersion" + } + ] + }, + "displayName": "sqspstp-filter" + }, + "Tree": { + "type": "cdk:tree", + "properties": { + "file": "tree.json" + } + } + } +} \ No newline at end of file diff --git a/source/patterns/@aws-solutions-constructs/aws-sqs-pipes-stepfunctions/test/integ.sqspstp-filter.js.snapshot/sqspstp-filter.assets.json b/source/patterns/@aws-solutions-constructs/aws-sqs-pipes-stepfunctions/test/integ.sqspstp-filter.js.snapshot/sqspstp-filter.assets.json new file mode 100644 index 000000000..9b4a526a3 --- /dev/null +++ b/source/patterns/@aws-solutions-constructs/aws-sqs-pipes-stepfunctions/test/integ.sqspstp-filter.js.snapshot/sqspstp-filter.assets.json @@ -0,0 +1,19 @@ +{ + "version": "38.0.1", + "files": { + "9718069baa56a46ca68c34209de1d1f4f856a5c5137b748f79e84785db1e5ec0": { + "source": { + "path": "sqspstp-filter.template.json", + "packaging": "file" + }, + "destinations": { + "current_account-current_region": { + "bucketName": "cdk-hnb659fds-assets-${AWS::AccountId}-${AWS::Region}", + "objectKey": "9718069baa56a46ca68c34209de1d1f4f856a5c5137b748f79e84785db1e5ec0.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-sqs-pipes-stepfunctions/test/integ.sqspstp-filter.js.snapshot/sqspstp-filter.template.json b/source/patterns/@aws-solutions-constructs/aws-sqs-pipes-stepfunctions/test/integ.sqspstp-filter.js.snapshot/sqspstp-filter.template.json new file mode 100644 index 000000000..01d7b5a37 --- /dev/null +++ b/source/patterns/@aws-solutions-constructs/aws-sqs-pipes-stepfunctions/test/integ.sqspstp-filter.js.snapshot/sqspstp-filter.template.json @@ -0,0 +1,662 @@ +{ + "Resources": { + "lambdas3stptestServiceRoleF17BB6C7": { + "Type": "AWS::IAM::Role", + "Properties": { + "AssumeRolePolicyDocument": { + "Statement": [ + { + "Action": "sts:AssumeRole", + "Effect": "Allow", + "Principal": { + "Service": "lambda.amazonaws.com" + } + } + ], + "Version": "2012-10-17" + }, + "ManagedPolicyArns": [ + { + "Fn::Join": [ + "", + [ + "arn:", + { + "Ref": "AWS::Partition" + }, + ":iam::aws:policy/service-role/AWSLambdaBasicExecutionRole" + ] + ] + } + ] + } + }, + "lambdas3stptest9FBDC6CE": { + "Type": "AWS::Lambda::Function", + "Properties": { + "Code": { + "ZipFile": "exports.handler = async (event) => console.log(event)" + }, + "Handler": "index.handler", + "Role": { + "Fn::GetAtt": [ + "lambdas3stptestServiceRoleF17BB6C7", + "Arn" + ] + }, + "Runtime": "nodejs20.x" + }, + "DependsOn": [ + "lambdas3stptestServiceRoleF17BB6C7" + ], + "Metadata": { + "cfn_nag": { + "rules_to_suppress": [ + { + "id": "W58", + "reason": "This Lambda Function is created for integration testing purposes only and is not part of an actual construct" + }, + { + "id": "W89", + "reason": "This Lambda Function is created for integration testing purposes only and is not part of an actual construct" + }, + { + "id": "W92", + "reason": "This Lambda Function is created for integration testing purposes only and is not part of an actual construct" + } + ] + } + } + }, + "testsqspipesstatesconstructqueuedlq420A82FD": { + "Type": "AWS::SQS::Queue", + "Properties": { + "KmsMasterKeyId": "alias/aws/sqs" + }, + "UpdateReplacePolicy": "Delete", + "DeletionPolicy": "Delete" + }, + "testsqspipesstatesconstructqueuedlqPolicyB1D70483": { + "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": [ + "testsqspipesstatesconstructqueuedlq420A82FD", + "Arn" + ] + }, + "Sid": "QueueOwnerOnlyAccess" + }, + { + "Action": "SQS:*", + "Condition": { + "Bool": { + "aws:SecureTransport": "false" + } + }, + "Effect": "Deny", + "Principal": { + "AWS": "*" + }, + "Resource": { + "Fn::GetAtt": [ + "testsqspipesstatesconstructqueuedlq420A82FD", + "Arn" + ] + }, + "Sid": "HttpsOnly" + } + ], + "Version": "2012-10-17" + }, + "Queues": [ + { + "Ref": "testsqspipesstatesconstructqueuedlq420A82FD" + } + ] + } + }, + "testsqspipesstatesconstructqueueA7C76715": { + "Type": "AWS::SQS::Queue", + "Properties": { + "KmsMasterKeyId": "alias/aws/sqs", + "RedrivePolicy": { + "deadLetterTargetArn": { + "Fn::GetAtt": [ + "testsqspipesstatesconstructqueuedlq420A82FD", + "Arn" + ] + }, + "maxReceiveCount": 15 + } + }, + "UpdateReplacePolicy": "Delete", + "DeletionPolicy": "Delete" + }, + "testsqspipesstatesconstructqueuePolicyFD32B562": { + "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": [ + "testsqspipesstatesconstructqueueA7C76715", + "Arn" + ] + }, + "Sid": "QueueOwnerOnlyAccess" + }, + { + "Action": "SQS:*", + "Condition": { + "Bool": { + "aws:SecureTransport": "false" + } + }, + "Effect": "Deny", + "Principal": { + "AWS": "*" + }, + "Resource": { + "Fn::GetAtt": [ + "testsqspipesstatesconstructqueueA7C76715", + "Arn" + ] + }, + "Sid": "HttpsOnly" + } + ], + "Version": "2012-10-17" + }, + "Queues": [ + { + "Ref": "testsqspipesstatesconstructqueueA7C76715" + } + ] + } + }, + "testsqspipesstatesconstructStateMachineLogGroupADE94F1D": { + "Type": "AWS::Logs::LogGroup", + "Properties": { + "LogGroupName": { + "Fn::Join": [ + "", + [ + "/aws/vendedlogs/states/constructs/sqspstp-filtertest-sqs-pipes-states-constructStateMachineLog-", + { + "Fn::Select": [ + 2, + { + "Fn::Split": [ + "/", + { + "Ref": "AWS::StackId" + } + ] + } + ] + } + ] + ] + } + }, + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Retain", + "Metadata": { + "cfn_nag": { + "rules_to_suppress": [ + { + "id": "W86", + "reason": "Retention period for CloudWatchLogs LogGroups are set to 'Never Expire' to preserve customer data indefinitely" + }, + { + "id": "W84", + "reason": "By default CloudWatchLogs LogGroups data is encrypted using the CloudWatch server-side encryption keys (AWS Managed Keys)" + } + ] + } + } + }, + "testsqspipesstatesconstructStateMachineRoleBF97BFC0": { + "Type": "AWS::IAM::Role", + "Properties": { + "AssumeRolePolicyDocument": { + "Statement": [ + { + "Action": "sts:AssumeRole", + "Effect": "Allow", + "Principal": { + "Service": "states.amazonaws.com" + } + } + ], + "Version": "2012-10-17" + } + } + }, + "testsqspipesstatesconstructStateMachineRoleDefaultPolicyD1BA2BF2": { + "Type": "AWS::IAM::Policy", + "Properties": { + "PolicyDocument": { + "Statement": [ + { + "Action": "lambda:InvokeFunction", + "Effect": "Allow", + "Resource": [ + { + "Fn::GetAtt": [ + "lambdas3stptest9FBDC6CE", + "Arn" + ] + }, + { + "Fn::Join": [ + "", + [ + { + "Fn::GetAtt": [ + "lambdas3stptest9FBDC6CE", + "Arn" + ] + }, + ":*" + ] + ] + } + ] + }, + { + "Action": [ + "logs:CreateLogDelivery", + "logs:DeleteLogDelivery", + "logs:DescribeLogGroups", + "logs:DescribeResourcePolicies", + "logs:GetLogDelivery", + "logs:ListLogDeliveries", + "logs:PutResourcePolicy", + "logs:UpdateLogDelivery" + ], + "Effect": "Allow", + "Resource": "*" + } + ], + "Version": "2012-10-17" + }, + "PolicyName": "testsqspipesstatesconstructStateMachineRoleDefaultPolicyD1BA2BF2", + "Roles": [ + { + "Ref": "testsqspipesstatesconstructStateMachineRoleBF97BFC0" + } + ] + }, + "Metadata": { + "cfn_nag": { + "rules_to_suppress": [ + { + "id": "W12", + "reason": "These are CDK defaults. The 'LogDelivery' actions do not support resource-level authorizations. Any logging is done by State Machine code" + } + ] + } + } + }, + "testsqspipesstatesconstructStateMachine29272AA9": { + "Type": "AWS::StepFunctions::StateMachine", + "Properties": { + "DefinitionString": { + "Fn::Join": [ + "", + [ + "{\"StartAt\":\"tasks3stp-test\",\"States\":{\"tasks3stp-test\":{\"End\":true,\"Retry\":[{\"ErrorEquals\":[\"Lambda.ClientExecutionTimeoutException\",\"Lambda.ServiceException\",\"Lambda.AWSLambdaException\",\"Lambda.SdkClientException\"],\"IntervalSeconds\":2,\"MaxAttempts\":6,\"BackoffRate\":2}],\"Type\":\"Task\",\"Resource\":\"arn:", + { + "Ref": "AWS::Partition" + }, + ":states:::lambda:invoke\",\"Parameters\":{\"FunctionName\":\"", + { + "Fn::GetAtt": [ + "lambdas3stptest9FBDC6CE", + "Arn" + ] + }, + "\",\"Payload.$\":\"$\"}}}}" + ] + ] + }, + "LoggingConfiguration": { + "Destinations": [ + { + "CloudWatchLogsLogGroup": { + "LogGroupArn": { + "Fn::GetAtt": [ + "testsqspipesstatesconstructStateMachineLogGroupADE94F1D", + "Arn" + ] + } + } + } + ], + "Level": "ERROR" + }, + "RoleArn": { + "Fn::GetAtt": [ + "testsqspipesstatesconstructStateMachineRoleBF97BFC0", + "Arn" + ] + } + }, + "DependsOn": [ + "testsqspipesstatesconstructStateMachineRoleDefaultPolicyD1BA2BF2", + "testsqspipesstatesconstructStateMachineRoleBF97BFC0" + ], + "UpdateReplacePolicy": "Delete", + "DeletionPolicy": "Delete" + }, + "testsqspipesstatesconstructExecutionFailedAlarm1002FF55": { + "Type": "AWS::CloudWatch::Alarm", + "Properties": { + "AlarmDescription": "Alarm for the number of executions that failed exceeded the threshold of 1. ", + "ComparisonOperator": "GreaterThanOrEqualToThreshold", + "Dimensions": [ + { + "Name": "StateMachineArn", + "Value": { + "Ref": "testsqspipesstatesconstructStateMachine29272AA9" + } + } + ], + "EvaluationPeriods": 1, + "MetricName": "ExecutionsFailed", + "Namespace": "AWS/States", + "Period": 300, + "Statistic": "Sum", + "Threshold": 1 + } + }, + "testsqspipesstatesconstructExecutionThrottledAlarm0242B01A": { + "Type": "AWS::CloudWatch::Alarm", + "Properties": { + "AlarmDescription": "Alarm for the number of executions that throttled exceeded the threshold of 1. ", + "ComparisonOperator": "GreaterThanOrEqualToThreshold", + "Dimensions": [ + { + "Name": "StateMachineArn", + "Value": { + "Ref": "testsqspipesstatesconstructStateMachine29272AA9" + } + } + ], + "EvaluationPeriods": 1, + "MetricName": "ExecutionThrottled", + "Namespace": "AWS/States", + "Period": 300, + "Statistic": "Sum", + "Threshold": 1 + } + }, + "testsqspipesstatesconstructExecutionAbortedAlarm14349A7B": { + "Type": "AWS::CloudWatch::Alarm", + "Properties": { + "AlarmDescription": "Alarm for the number of executions that aborted exceeded the threshold of 1. ", + "ComparisonOperator": "GreaterThanOrEqualToThreshold", + "Dimensions": [ + { + "Name": "StateMachineArn", + "Value": { + "Ref": "testsqspipesstatesconstructStateMachine29272AA9" + } + } + ], + "EvaluationPeriods": 1, + "MetricName": "ExecutionsAborted", + "Namespace": "AWS/States", + "Period": 300, + "Statistic": "Maximum", + "Threshold": 1 + } + }, + "testsqspipesstatesconstructPipeRoletestsqspipesstatesconstruct2CC9A13C": { + "Type": "AWS::IAM::Role", + "Properties": { + "AssumeRolePolicyDocument": { + "Statement": [ + { + "Action": "sts:AssumeRole", + "Effect": "Allow", + "Principal": { + "Service": "pipes.amazonaws.com" + } + } + ], + "Version": "2012-10-17" + }, + "Policies": [ + { + "PolicyDocument": { + "Statement": [ + { + "Action": [ + "sqs:DeleteMessage", + "sqs:GetQueueAttributes", + "sqs:ReceiveMessage" + ], + "Effect": "Allow", + "Resource": { + "Fn::GetAtt": [ + "testsqspipesstatesconstructqueueA7C76715", + "Arn" + ] + } + } + ], + "Version": "2012-10-17" + }, + "PolicyName": "sourcePolicy" + }, + { + "PolicyDocument": { + "Statement": [ + { + "Action": "states:StartExecution", + "Effect": "Allow", + "Resource": { + "Ref": "testsqspipesstatesconstructStateMachine29272AA9" + } + } + ], + "Version": "2012-10-17" + }, + "PolicyName": "targetPolicy" + } + ] + }, + "Metadata": { + "guard": { + "SuppressedRules": [ + "IAM_NO_INLINE_POLICY_CHECK" + ] + } + } + }, + "testsqspipesstatesconstructLogGrouptestsqspipesstatesconstructF827FE15": { + "Type": "AWS::Logs::LogGroup", + "Properties": { + "LogGroupName": { + "Fn::Join": [ + "", + [ + "/aws/vendedlogs/pipes/constructs/sqspstp-filtertest-sqs-pipes-states-constructPipesLog-", + { + "Fn::Select": [ + 2, + { + "Fn::Split": [ + "/", + { + "Ref": "AWS::StackId" + } + ] + } + ] + } + ] + ] + } + }, + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Retain", + "Metadata": { + "cfn_nag": { + "rules_to_suppress": [ + { + "id": "W86", + "reason": "Retention period for CloudWatchLogs LogGroups are set to 'Never Expire' to preserve customer data indefinitely" + }, + { + "id": "W84", + "reason": "By default CloudWatchLogs LogGroups data is encrypted using the CloudWatch server-side encryption keys (AWS Managed Keys)" + } + ] + } + } + }, + "testsqspipesstatesconstructpipetestsqspipesstatesconstruct71A64A15": { + "Type": "AWS::Pipes::Pipe", + "Properties": { + "LogConfiguration": { + "CloudwatchLogsLogDestination": { + "LogGroupArn": { + "Fn::GetAtt": [ + "testsqspipesstatesconstructLogGrouptestsqspipesstatesconstructF827FE15", + "Arn" + ] + } + }, + "Level": "INFO" + }, + "RoleArn": { + "Fn::GetAtt": [ + "testsqspipesstatesconstructPipeRoletestsqspipesstatesconstruct2CC9A13C", + "Arn" + ] + }, + "Source": { + "Fn::GetAtt": [ + "testsqspipesstatesconstructqueueA7C76715", + "Arn" + ] + }, + "SourceParameters": { + "FilterCriteria": { + "Filters": [ + { + "Pattern": "{\n \"body\": {\n \"state\": [\"open\"]\n }\n}" + } + ] + } + }, + "Target": { + "Ref": "testsqspipesstatesconstructStateMachine29272AA9" + }, + "TargetParameters": { + "StepFunctionStateMachineParameters": { + "InvocationType": "FIRE_AND_FORGET" + } + } + } + } + }, + "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-sqs-pipes-stepfunctions/test/integ.sqspstp-filter.js.snapshot/sqspstpfilterIntegDefaultTestDeployAssert0C52837E.assets.json b/source/patterns/@aws-solutions-constructs/aws-sqs-pipes-stepfunctions/test/integ.sqspstp-filter.js.snapshot/sqspstpfilterIntegDefaultTestDeployAssert0C52837E.assets.json new file mode 100644 index 000000000..54bc044e7 --- /dev/null +++ b/source/patterns/@aws-solutions-constructs/aws-sqs-pipes-stepfunctions/test/integ.sqspstp-filter.js.snapshot/sqspstpfilterIntegDefaultTestDeployAssert0C52837E.assets.json @@ -0,0 +1,19 @@ +{ + "version": "38.0.1", + "files": { + "21fbb51d7b23f6a6c262b46a9caee79d744a3ac019fd45422d988b96d44b2a22": { + "source": { + "path": "sqspstpfilterIntegDefaultTestDeployAssert0C52837E.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-sqs-pipes-stepfunctions/test/integ.sqspstp-filter.js.snapshot/sqspstpfilterIntegDefaultTestDeployAssert0C52837E.template.json b/source/patterns/@aws-solutions-constructs/aws-sqs-pipes-stepfunctions/test/integ.sqspstp-filter.js.snapshot/sqspstpfilterIntegDefaultTestDeployAssert0C52837E.template.json new file mode 100644 index 000000000..ad9d0fb73 --- /dev/null +++ b/source/patterns/@aws-solutions-constructs/aws-sqs-pipes-stepfunctions/test/integ.sqspstp-filter.js.snapshot/sqspstpfilterIntegDefaultTestDeployAssert0C52837E.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-sqs-pipes-stepfunctions/test/integ.sqspstp-filter.js.snapshot/tree.json b/source/patterns/@aws-solutions-constructs/aws-sqs-pipes-stepfunctions/test/integ.sqspstp-filter.js.snapshot/tree.json new file mode 100644 index 000000000..a57e56adb --- /dev/null +++ b/source/patterns/@aws-solutions-constructs/aws-sqs-pipes-stepfunctions/test/integ.sqspstp-filter.js.snapshot/tree.json @@ -0,0 +1,965 @@ +{ + "version": "tree-0.1", + "tree": { + "id": "App", + "path": "", + "children": { + "sqspstp-filter": { + "id": "sqspstp-filter", + "path": "sqspstp-filter", + "children": { + "lambdas3stp-test": { + "id": "lambdas3stp-test", + "path": "sqspstp-filter/lambdas3stp-test", + "children": { + "ServiceRole": { + "id": "ServiceRole", + "path": "sqspstp-filter/lambdas3stp-test/ServiceRole", + "children": { + "ImportServiceRole": { + "id": "ImportServiceRole", + "path": "sqspstp-filter/lambdas3stp-test/ServiceRole/ImportServiceRole", + "constructInfo": { + "fqn": "aws-cdk-lib.Resource", + "version": "2.161.0" + } + }, + "Resource": { + "id": "Resource", + "path": "sqspstp-filter/lambdas3stp-test/ServiceRole/Resource", + "attributes": { + "aws:cdk:cloudformation:type": "AWS::IAM::Role", + "aws:cdk:cloudformation:props": { + "assumeRolePolicyDocument": { + "Statement": [ + { + "Action": "sts:AssumeRole", + "Effect": "Allow", + "Principal": { + "Service": "lambda.amazonaws.com" + } + } + ], + "Version": "2012-10-17" + }, + "managedPolicyArns": [ + { + "Fn::Join": [ + "", + [ + "arn:", + { + "Ref": "AWS::Partition" + }, + ":iam::aws:policy/service-role/AWSLambdaBasicExecutionRole" + ] + ] + } + ] + } + }, + "constructInfo": { + "fqn": "aws-cdk-lib.aws_iam.CfnRole", + "version": "2.161.0" + } + } + }, + "constructInfo": { + "fqn": "aws-cdk-lib.aws_iam.Role", + "version": "2.161.0" + } + }, + "Resource": { + "id": "Resource", + "path": "sqspstp-filter/lambdas3stp-test/Resource", + "attributes": { + "aws:cdk:cloudformation:type": "AWS::Lambda::Function", + "aws:cdk:cloudformation:props": { + "code": { + "zipFile": "exports.handler = async (event) => console.log(event)" + }, + "handler": "index.handler", + "role": { + "Fn::GetAtt": [ + "lambdas3stptestServiceRoleF17BB6C7", + "Arn" + ] + }, + "runtime": "nodejs20.x" + } + }, + "constructInfo": { + "fqn": "aws-cdk-lib.aws_lambda.CfnFunction", + "version": "2.161.0" + } + } + }, + "constructInfo": { + "fqn": "aws-cdk-lib.aws_lambda.Function", + "version": "2.161.0" + } + }, + "tasks3stp-test": { + "id": "tasks3stp-test", + "path": "sqspstp-filter/tasks3stp-test", + "constructInfo": { + "fqn": "aws-cdk-lib.aws_stepfunctions_tasks.LambdaInvoke", + "version": "2.161.0" + } + }, + "test-sqs-pipes-states-construct": { + "id": "test-sqs-pipes-states-construct", + "path": "sqspstp-filter/test-sqs-pipes-states-construct", + "children": { + "queue-dlq": { + "id": "queue-dlq", + "path": "sqspstp-filter/test-sqs-pipes-states-construct/queue-dlq", + "children": { + "Resource": { + "id": "Resource", + "path": "sqspstp-filter/test-sqs-pipes-states-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.161.0" + } + }, + "Policy": { + "id": "Policy", + "path": "sqspstp-filter/test-sqs-pipes-states-construct/queue-dlq/Policy", + "children": { + "Resource": { + "id": "Resource", + "path": "sqspstp-filter/test-sqs-pipes-states-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": [ + "testsqspipesstatesconstructqueuedlq420A82FD", + "Arn" + ] + }, + "Sid": "QueueOwnerOnlyAccess" + }, + { + "Action": "SQS:*", + "Condition": { + "Bool": { + "aws:SecureTransport": "false" + } + }, + "Effect": "Deny", + "Principal": { + "AWS": "*" + }, + "Resource": { + "Fn::GetAtt": [ + "testsqspipesstatesconstructqueuedlq420A82FD", + "Arn" + ] + }, + "Sid": "HttpsOnly" + } + ], + "Version": "2012-10-17" + }, + "queues": [ + { + "Ref": "testsqspipesstatesconstructqueuedlq420A82FD" + } + ] + } + }, + "constructInfo": { + "fqn": "aws-cdk-lib.aws_sqs.CfnQueuePolicy", + "version": "2.161.0" + } + } + }, + "constructInfo": { + "fqn": "aws-cdk-lib.aws_sqs.QueuePolicy", + "version": "2.161.0" + } + } + }, + "constructInfo": { + "fqn": "aws-cdk-lib.aws_sqs.Queue", + "version": "2.161.0" + } + }, + "queue": { + "id": "queue", + "path": "sqspstp-filter/test-sqs-pipes-states-construct/queue", + "children": { + "Resource": { + "id": "Resource", + "path": "sqspstp-filter/test-sqs-pipes-states-construct/queue/Resource", + "attributes": { + "aws:cdk:cloudformation:type": "AWS::SQS::Queue", + "aws:cdk:cloudformation:props": { + "kmsMasterKeyId": "alias/aws/sqs", + "redrivePolicy": { + "deadLetterTargetArn": { + "Fn::GetAtt": [ + "testsqspipesstatesconstructqueuedlq420A82FD", + "Arn" + ] + }, + "maxReceiveCount": 15 + } + } + }, + "constructInfo": { + "fqn": "aws-cdk-lib.aws_sqs.CfnQueue", + "version": "2.161.0" + } + }, + "Policy": { + "id": "Policy", + "path": "sqspstp-filter/test-sqs-pipes-states-construct/queue/Policy", + "children": { + "Resource": { + "id": "Resource", + "path": "sqspstp-filter/test-sqs-pipes-states-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": [ + "testsqspipesstatesconstructqueueA7C76715", + "Arn" + ] + }, + "Sid": "QueueOwnerOnlyAccess" + }, + { + "Action": "SQS:*", + "Condition": { + "Bool": { + "aws:SecureTransport": "false" + } + }, + "Effect": "Deny", + "Principal": { + "AWS": "*" + }, + "Resource": { + "Fn::GetAtt": [ + "testsqspipesstatesconstructqueueA7C76715", + "Arn" + ] + }, + "Sid": "HttpsOnly" + } + ], + "Version": "2012-10-17" + }, + "queues": [ + { + "Ref": "testsqspipesstatesconstructqueueA7C76715" + } + ] + } + }, + "constructInfo": { + "fqn": "aws-cdk-lib.aws_sqs.CfnQueuePolicy", + "version": "2.161.0" + } + } + }, + "constructInfo": { + "fqn": "aws-cdk-lib.aws_sqs.QueuePolicy", + "version": "2.161.0" + } + } + }, + "constructInfo": { + "fqn": "aws-cdk-lib.aws_sqs.Queue", + "version": "2.161.0" + } + }, + "StateMachineLogGroup": { + "id": "StateMachineLogGroup", + "path": "sqspstp-filter/test-sqs-pipes-states-construct/StateMachineLogGroup", + "children": { + "Resource": { + "id": "Resource", + "path": "sqspstp-filter/test-sqs-pipes-states-construct/StateMachineLogGroup/Resource", + "attributes": { + "aws:cdk:cloudformation:type": "AWS::Logs::LogGroup", + "aws:cdk:cloudformation:props": { + "logGroupName": { + "Fn::Join": [ + "", + [ + "/aws/vendedlogs/states/constructs/sqspstp-filtertest-sqs-pipes-states-constructStateMachineLog-", + { + "Fn::Select": [ + 2, + { + "Fn::Split": [ + "/", + { + "Ref": "AWS::StackId" + } + ] + } + ] + } + ] + ] + } + } + }, + "constructInfo": { + "fqn": "aws-cdk-lib.aws_logs.CfnLogGroup", + "version": "2.161.0" + } + } + }, + "constructInfo": { + "fqn": "aws-cdk-lib.aws_logs.LogGroup", + "version": "2.161.0" + } + }, + "StateMachine": { + "id": "StateMachine", + "path": "sqspstp-filter/test-sqs-pipes-states-construct/StateMachine", + "children": { + "Role": { + "id": "Role", + "path": "sqspstp-filter/test-sqs-pipes-states-construct/StateMachine/Role", + "children": { + "ImportRole": { + "id": "ImportRole", + "path": "sqspstp-filter/test-sqs-pipes-states-construct/StateMachine/Role/ImportRole", + "constructInfo": { + "fqn": "aws-cdk-lib.Resource", + "version": "2.161.0" + } + }, + "Resource": { + "id": "Resource", + "path": "sqspstp-filter/test-sqs-pipes-states-construct/StateMachine/Role/Resource", + "attributes": { + "aws:cdk:cloudformation:type": "AWS::IAM::Role", + "aws:cdk:cloudformation:props": { + "assumeRolePolicyDocument": { + "Statement": [ + { + "Action": "sts:AssumeRole", + "Effect": "Allow", + "Principal": { + "Service": "states.amazonaws.com" + } + } + ], + "Version": "2012-10-17" + } + } + }, + "constructInfo": { + "fqn": "aws-cdk-lib.aws_iam.CfnRole", + "version": "2.161.0" + } + }, + "DefaultPolicy": { + "id": "DefaultPolicy", + "path": "sqspstp-filter/test-sqs-pipes-states-construct/StateMachine/Role/DefaultPolicy", + "children": { + "Resource": { + "id": "Resource", + "path": "sqspstp-filter/test-sqs-pipes-states-construct/StateMachine/Role/DefaultPolicy/Resource", + "attributes": { + "aws:cdk:cloudformation:type": "AWS::IAM::Policy", + "aws:cdk:cloudformation:props": { + "policyDocument": { + "Statement": [ + { + "Action": "lambda:InvokeFunction", + "Effect": "Allow", + "Resource": [ + { + "Fn::GetAtt": [ + "lambdas3stptest9FBDC6CE", + "Arn" + ] + }, + { + "Fn::Join": [ + "", + [ + { + "Fn::GetAtt": [ + "lambdas3stptest9FBDC6CE", + "Arn" + ] + }, + ":*" + ] + ] + } + ] + }, + { + "Action": [ + "logs:CreateLogDelivery", + "logs:DeleteLogDelivery", + "logs:DescribeLogGroups", + "logs:DescribeResourcePolicies", + "logs:GetLogDelivery", + "logs:ListLogDeliveries", + "logs:PutResourcePolicy", + "logs:UpdateLogDelivery" + ], + "Effect": "Allow", + "Resource": "*" + } + ], + "Version": "2012-10-17" + }, + "policyName": "testsqspipesstatesconstructStateMachineRoleDefaultPolicyD1BA2BF2", + "roles": [ + { + "Ref": "testsqspipesstatesconstructStateMachineRoleBF97BFC0" + } + ] + } + }, + "constructInfo": { + "fqn": "aws-cdk-lib.aws_iam.CfnPolicy", + "version": "2.161.0" + } + } + }, + "constructInfo": { + "fqn": "aws-cdk-lib.aws_iam.Policy", + "version": "2.161.0" + } + } + }, + "constructInfo": { + "fqn": "aws-cdk-lib.aws_iam.Role", + "version": "2.161.0" + } + }, + "Resource": { + "id": "Resource", + "path": "sqspstp-filter/test-sqs-pipes-states-construct/StateMachine/Resource", + "attributes": { + "aws:cdk:cloudformation:type": "AWS::StepFunctions::StateMachine", + "aws:cdk:cloudformation:props": { + "definitionString": { + "Fn::Join": [ + "", + [ + "{\"StartAt\":\"tasks3stp-test\",\"States\":{\"tasks3stp-test\":{\"End\":true,\"Retry\":[{\"ErrorEquals\":[\"Lambda.ClientExecutionTimeoutException\",\"Lambda.ServiceException\",\"Lambda.AWSLambdaException\",\"Lambda.SdkClientException\"],\"IntervalSeconds\":2,\"MaxAttempts\":6,\"BackoffRate\":2}],\"Type\":\"Task\",\"Resource\":\"arn:", + { + "Ref": "AWS::Partition" + }, + ":states:::lambda:invoke\",\"Parameters\":{\"FunctionName\":\"", + { + "Fn::GetAtt": [ + "lambdas3stptest9FBDC6CE", + "Arn" + ] + }, + "\",\"Payload.$\":\"$\"}}}}" + ] + ] + }, + "loggingConfiguration": { + "destinations": [ + { + "cloudWatchLogsLogGroup": { + "logGroupArn": { + "Fn::GetAtt": [ + "testsqspipesstatesconstructStateMachineLogGroupADE94F1D", + "Arn" + ] + } + } + } + ], + "level": "ERROR" + }, + "roleArn": { + "Fn::GetAtt": [ + "testsqspipesstatesconstructStateMachineRoleBF97BFC0", + "Arn" + ] + } + } + }, + "constructInfo": { + "fqn": "aws-cdk-lib.aws_stepfunctions.CfnStateMachine", + "version": "2.161.0" + } + } + }, + "constructInfo": { + "fqn": "aws-cdk-lib.aws_stepfunctions.StateMachine", + "version": "2.161.0" + } + }, + "ExecutionFailedAlarm": { + "id": "ExecutionFailedAlarm", + "path": "sqspstp-filter/test-sqs-pipes-states-construct/ExecutionFailedAlarm", + "children": { + "Resource": { + "id": "Resource", + "path": "sqspstp-filter/test-sqs-pipes-states-construct/ExecutionFailedAlarm/Resource", + "attributes": { + "aws:cdk:cloudformation:type": "AWS::CloudWatch::Alarm", + "aws:cdk:cloudformation:props": { + "alarmDescription": "Alarm for the number of executions that failed exceeded the threshold of 1. ", + "comparisonOperator": "GreaterThanOrEqualToThreshold", + "dimensions": [ + { + "name": "StateMachineArn", + "value": { + "Ref": "testsqspipesstatesconstructStateMachine29272AA9" + } + } + ], + "evaluationPeriods": 1, + "metricName": "ExecutionsFailed", + "namespace": "AWS/States", + "period": 300, + "statistic": "Sum", + "threshold": 1 + } + }, + "constructInfo": { + "fqn": "aws-cdk-lib.aws_cloudwatch.CfnAlarm", + "version": "2.161.0" + } + } + }, + "constructInfo": { + "fqn": "aws-cdk-lib.aws_cloudwatch.Alarm", + "version": "2.161.0" + } + }, + "ExecutionThrottledAlarm": { + "id": "ExecutionThrottledAlarm", + "path": "sqspstp-filter/test-sqs-pipes-states-construct/ExecutionThrottledAlarm", + "children": { + "Resource": { + "id": "Resource", + "path": "sqspstp-filter/test-sqs-pipes-states-construct/ExecutionThrottledAlarm/Resource", + "attributes": { + "aws:cdk:cloudformation:type": "AWS::CloudWatch::Alarm", + "aws:cdk:cloudformation:props": { + "alarmDescription": "Alarm for the number of executions that throttled exceeded the threshold of 1. ", + "comparisonOperator": "GreaterThanOrEqualToThreshold", + "dimensions": [ + { + "name": "StateMachineArn", + "value": { + "Ref": "testsqspipesstatesconstructStateMachine29272AA9" + } + } + ], + "evaluationPeriods": 1, + "metricName": "ExecutionThrottled", + "namespace": "AWS/States", + "period": 300, + "statistic": "Sum", + "threshold": 1 + } + }, + "constructInfo": { + "fqn": "aws-cdk-lib.aws_cloudwatch.CfnAlarm", + "version": "2.161.0" + } + } + }, + "constructInfo": { + "fqn": "aws-cdk-lib.aws_cloudwatch.Alarm", + "version": "2.161.0" + } + }, + "ExecutionAbortedAlarm": { + "id": "ExecutionAbortedAlarm", + "path": "sqspstp-filter/test-sqs-pipes-states-construct/ExecutionAbortedAlarm", + "children": { + "Resource": { + "id": "Resource", + "path": "sqspstp-filter/test-sqs-pipes-states-construct/ExecutionAbortedAlarm/Resource", + "attributes": { + "aws:cdk:cloudformation:type": "AWS::CloudWatch::Alarm", + "aws:cdk:cloudformation:props": { + "alarmDescription": "Alarm for the number of executions that aborted exceeded the threshold of 1. ", + "comparisonOperator": "GreaterThanOrEqualToThreshold", + "dimensions": [ + { + "name": "StateMachineArn", + "value": { + "Ref": "testsqspipesstatesconstructStateMachine29272AA9" + } + } + ], + "evaluationPeriods": 1, + "metricName": "ExecutionsAborted", + "namespace": "AWS/States", + "period": 300, + "statistic": "Maximum", + "threshold": 1 + } + }, + "constructInfo": { + "fqn": "aws-cdk-lib.aws_cloudwatch.CfnAlarm", + "version": "2.161.0" + } + } + }, + "constructInfo": { + "fqn": "aws-cdk-lib.aws_cloudwatch.Alarm", + "version": "2.161.0" + } + }, + "PipeRole--test-sqs-pipes-states-construct": { + "id": "PipeRole--test-sqs-pipes-states-construct", + "path": "sqspstp-filter/test-sqs-pipes-states-construct/PipeRole--test-sqs-pipes-states-construct", + "children": { + "ImportPipeRole--test-sqs-pipes-states-construct": { + "id": "ImportPipeRole--test-sqs-pipes-states-construct", + "path": "sqspstp-filter/test-sqs-pipes-states-construct/PipeRole--test-sqs-pipes-states-construct/ImportPipeRole--test-sqs-pipes-states-construct", + "constructInfo": { + "fqn": "aws-cdk-lib.Resource", + "version": "2.161.0" + } + }, + "Resource": { + "id": "Resource", + "path": "sqspstp-filter/test-sqs-pipes-states-construct/PipeRole--test-sqs-pipes-states-construct/Resource", + "attributes": { + "aws:cdk:cloudformation:type": "AWS::IAM::Role", + "aws:cdk:cloudformation:props": { + "assumeRolePolicyDocument": { + "Statement": [ + { + "Action": "sts:AssumeRole", + "Effect": "Allow", + "Principal": { + "Service": "pipes.amazonaws.com" + } + } + ], + "Version": "2012-10-17" + }, + "policies": [ + { + "policyName": "sourcePolicy", + "policyDocument": { + "Statement": [ + { + "Action": [ + "sqs:DeleteMessage", + "sqs:GetQueueAttributes", + "sqs:ReceiveMessage" + ], + "Effect": "Allow", + "Resource": { + "Fn::GetAtt": [ + "testsqspipesstatesconstructqueueA7C76715", + "Arn" + ] + } + } + ], + "Version": "2012-10-17" + } + }, + { + "policyName": "targetPolicy", + "policyDocument": { + "Statement": [ + { + "Action": "states:StartExecution", + "Effect": "Allow", + "Resource": { + "Ref": "testsqspipesstatesconstructStateMachine29272AA9" + } + } + ], + "Version": "2012-10-17" + } + } + ] + } + }, + "constructInfo": { + "fqn": "aws-cdk-lib.aws_iam.CfnRole", + "version": "2.161.0" + } + } + }, + "constructInfo": { + "fqn": "aws-cdk-lib.aws_iam.Role", + "version": "2.161.0" + } + }, + "LogGroup-test-sqs-pipes-states-construct": { + "id": "LogGroup-test-sqs-pipes-states-construct", + "path": "sqspstp-filter/test-sqs-pipes-states-construct/LogGroup-test-sqs-pipes-states-construct", + "children": { + "Resource": { + "id": "Resource", + "path": "sqspstp-filter/test-sqs-pipes-states-construct/LogGroup-test-sqs-pipes-states-construct/Resource", + "attributes": { + "aws:cdk:cloudformation:type": "AWS::Logs::LogGroup", + "aws:cdk:cloudformation:props": { + "logGroupName": { + "Fn::Join": [ + "", + [ + "/aws/vendedlogs/pipes/constructs/sqspstp-filtertest-sqs-pipes-states-constructPipesLog-", + { + "Fn::Select": [ + 2, + { + "Fn::Split": [ + "/", + { + "Ref": "AWS::StackId" + } + ] + } + ] + } + ] + ] + } + } + }, + "constructInfo": { + "fqn": "aws-cdk-lib.aws_logs.CfnLogGroup", + "version": "2.161.0" + } + } + }, + "constructInfo": { + "fqn": "aws-cdk-lib.aws_logs.LogGroup", + "version": "2.161.0" + } + }, + "pipe-test-sqs-pipes-states-construct": { + "id": "pipe-test-sqs-pipes-states-construct", + "path": "sqspstp-filter/test-sqs-pipes-states-construct/pipe-test-sqs-pipes-states-construct", + "attributes": { + "aws:cdk:cloudformation:type": "AWS::Pipes::Pipe", + "aws:cdk:cloudformation:props": { + "logConfiguration": { + "cloudwatchLogsLogDestination": { + "logGroupArn": { + "Fn::GetAtt": [ + "testsqspipesstatesconstructLogGrouptestsqspipesstatesconstructF827FE15", + "Arn" + ] + } + }, + "level": "INFO" + }, + "roleArn": { + "Fn::GetAtt": [ + "testsqspipesstatesconstructPipeRoletestsqspipesstatesconstruct2CC9A13C", + "Arn" + ] + }, + "source": { + "Fn::GetAtt": [ + "testsqspipesstatesconstructqueueA7C76715", + "Arn" + ] + }, + "sourceParameters": { + "filterCriteria": { + "filters": [ + { + "pattern": "{\n \"body\": {\n \"state\": [\"open\"]\n }\n}" + } + ] + } + }, + "target": { + "Ref": "testsqspipesstatesconstructStateMachine29272AA9" + }, + "targetParameters": { + "stepFunctionStateMachineParameters": { + "invocationType": "FIRE_AND_FORGET" + } + } + } + }, + "constructInfo": { + "fqn": "aws-cdk-lib.aws_pipes.CfnPipe", + "version": "2.161.0" + } + } + }, + "constructInfo": { + "fqn": "@aws-solutions-constructs/aws-sqs-pipes-stepfunctions.SqsToPipesToStepfunctions", + "version": "2.72.0" + } + }, + "Integ": { + "id": "Integ", + "path": "sqspstp-filter/Integ", + "children": { + "DefaultTest": { + "id": "DefaultTest", + "path": "sqspstp-filter/Integ/DefaultTest", + "children": { + "Default": { + "id": "Default", + "path": "sqspstp-filter/Integ/DefaultTest/Default", + "constructInfo": { + "fqn": "constructs.Construct", + "version": "10.4.2" + } + }, + "DeployAssert": { + "id": "DeployAssert", + "path": "sqspstp-filter/Integ/DefaultTest/DeployAssert", + "children": { + "BootstrapVersion": { + "id": "BootstrapVersion", + "path": "sqspstp-filter/Integ/DefaultTest/DeployAssert/BootstrapVersion", + "constructInfo": { + "fqn": "aws-cdk-lib.CfnParameter", + "version": "2.161.0" + } + }, + "CheckBootstrapVersion": { + "id": "CheckBootstrapVersion", + "path": "sqspstp-filter/Integ/DefaultTest/DeployAssert/CheckBootstrapVersion", + "constructInfo": { + "fqn": "aws-cdk-lib.CfnRule", + "version": "2.161.0" + } + } + }, + "constructInfo": { + "fqn": "aws-cdk-lib.Stack", + "version": "2.161.0" + } + } + }, + "constructInfo": { + "fqn": "@aws-cdk/integ-tests-alpha.IntegTestCase", + "version": "2.161.0-alpha.0" + } + } + }, + "constructInfo": { + "fqn": "@aws-cdk/integ-tests-alpha.IntegTest", + "version": "2.161.0-alpha.0" + } + }, + "BootstrapVersion": { + "id": "BootstrapVersion", + "path": "sqspstp-filter/BootstrapVersion", + "constructInfo": { + "fqn": "aws-cdk-lib.CfnParameter", + "version": "2.161.0" + } + }, + "CheckBootstrapVersion": { + "id": "CheckBootstrapVersion", + "path": "sqspstp-filter/CheckBootstrapVersion", + "constructInfo": { + "fqn": "aws-cdk-lib.CfnRule", + "version": "2.161.0" + } + } + }, + "constructInfo": { + "fqn": "aws-cdk-lib.Stack", + "version": "2.161.0" + } + }, + "Tree": { + "id": "Tree", + "path": "Tree", + "constructInfo": { + "fqn": "constructs.Construct", + "version": "10.4.2" + } + } + }, + "constructInfo": { + "fqn": "aws-cdk-lib.App", + "version": "2.161.0" + } + } +} \ No newline at end of file diff --git a/source/patterns/@aws-solutions-constructs/aws-sqs-pipes-stepfunctions/test/integ.sqspstp-filter.ts b/source/patterns/@aws-solutions-constructs/aws-sqs-pipes-stepfunctions/test/integ.sqspstp-filter.ts new file mode 100644 index 000000000..47a5a20e0 --- /dev/null +++ b/source/patterns/@aws-solutions-constructs/aws-sqs-pipes-stepfunctions/test/integ.sqspstp-filter.ts @@ -0,0 +1,47 @@ +/** + * 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. + */ + +/// !cdk-integ * +import { App, Stack } from "aws-cdk-lib"; +import { SqsToPipesToStepfunctions, SqsToPipesToStepfunctionsProps } from "../lib"; +import { generateIntegStackName } from '@aws-solutions-constructs/core'; +import { IntegTest } from '@aws-cdk/integ-tests-alpha'; +import * as defaults from '@aws-solutions-constructs/core'; + +const app = new App(); +const stack = new Stack(app, generateIntegStackName(__filename)); + +const testFilterPattern = `{ + "body": { + "state": ["open"] + } +}`; + +const props: SqsToPipesToStepfunctionsProps = { + stateMachineProps: { + definitionBody: defaults.CreateTestStateMachineDefinitionBody(stack, 's3stp-test') + }, + pipeProps: { + sourceParameters: { + filterCriteria: { + filters: [{ pattern: testFilterPattern }], + }, + } + } +}; + +new SqsToPipesToStepfunctions(stack, 'test-sqs-pipes-states-construct', props); + +new IntegTest(stack, 'Integ', { testCases: [ + stack +] }); diff --git a/source/patterns/@aws-solutions-constructs/aws-sqs-pipes-stepfunctions/test/integ.sqspstp-lambda-function-enrichment.js.snapshot/asset.33adcab38bd8c4e154734b436a40ee81920a89cd6c787ce62302c33df5e1dfcb/index.js b/source/patterns/@aws-solutions-constructs/aws-sqs-pipes-stepfunctions/test/integ.sqspstp-lambda-function-enrichment.js.snapshot/asset.33adcab38bd8c4e154734b436a40ee81920a89cd6c787ce62302c33df5e1dfcb/index.js new file mode 100644 index 000000000..34d92af16 --- /dev/null +++ b/source/patterns/@aws-solutions-constructs/aws-sqs-pipes-stepfunctions/test/integ.sqspstp-lambda-function-enrichment.js.snapshot/asset.33adcab38bd8c4e154734b436a40ee81920a89cd6c787ce62302c33df5e1dfcb/index.js @@ -0,0 +1,9 @@ +exports.handler = async (event) => { + console.log(event); + const response = event.map((x) =>{ + const body = JSON.parse(x.body); + body.newAttrib = "content"; + return body; + }); + return response; +} \ No newline at end of file diff --git a/source/patterns/@aws-solutions-constructs/aws-sqs-pipes-stepfunctions/test/integ.sqspstp-lambda-function-enrichment.js.snapshot/cdk.out b/source/patterns/@aws-solutions-constructs/aws-sqs-pipes-stepfunctions/test/integ.sqspstp-lambda-function-enrichment.js.snapshot/cdk.out new file mode 100644 index 000000000..c6e612584 --- /dev/null +++ b/source/patterns/@aws-solutions-constructs/aws-sqs-pipes-stepfunctions/test/integ.sqspstp-lambda-function-enrichment.js.snapshot/cdk.out @@ -0,0 +1 @@ +{"version":"38.0.1"} \ No newline at end of file diff --git a/source/patterns/@aws-solutions-constructs/aws-sqs-pipes-stepfunctions/test/integ.sqspstp-lambda-function-enrichment.js.snapshot/integ.json b/source/patterns/@aws-solutions-constructs/aws-sqs-pipes-stepfunctions/test/integ.sqspstp-lambda-function-enrichment.js.snapshot/integ.json new file mode 100644 index 000000000..ec57a54b0 --- /dev/null +++ b/source/patterns/@aws-solutions-constructs/aws-sqs-pipes-stepfunctions/test/integ.sqspstp-lambda-function-enrichment.js.snapshot/integ.json @@ -0,0 +1,12 @@ +{ + "version": "38.0.1", + "testCases": { + "sqspstp-lambda-function-enrichment/Integ/DefaultTest": { + "stacks": [ + "sqspstp-lambda-function-enrichment" + ], + "assertionStack": "sqspstp-lambda-function-enrichment/Integ/DefaultTest/DeployAssert", + "assertionStackName": "sqspstplambdafunctionenrichmentIntegDefaultTestDeployAssert1F2A8125" + } + } +} \ No newline at end of file diff --git a/source/patterns/@aws-solutions-constructs/aws-sqs-pipes-stepfunctions/test/integ.sqspstp-lambda-function-enrichment.js.snapshot/manifest.json b/source/patterns/@aws-solutions-constructs/aws-sqs-pipes-stepfunctions/test/integ.sqspstp-lambda-function-enrichment.js.snapshot/manifest.json new file mode 100644 index 000000000..0469c4df6 --- /dev/null +++ b/source/patterns/@aws-solutions-constructs/aws-sqs-pipes-stepfunctions/test/integ.sqspstp-lambda-function-enrichment.js.snapshot/manifest.json @@ -0,0 +1,223 @@ +{ + "version": "38.0.1", + "artifacts": { + "sqspstplambdafunctionenrichmentIntegDefaultTestDeployAssert1F2A8125.assets": { + "type": "cdk:asset-manifest", + "properties": { + "file": "sqspstplambdafunctionenrichmentIntegDefaultTestDeployAssert1F2A8125.assets.json", + "requiresBootstrapStackVersion": 6, + "bootstrapStackVersionSsmParameter": "/cdk-bootstrap/hnb659fds/version" + } + }, + "sqspstplambdafunctionenrichmentIntegDefaultTestDeployAssert1F2A8125": { + "type": "aws:cloudformation:stack", + "environment": "aws://unknown-account/unknown-region", + "properties": { + "templateFile": "sqspstplambdafunctionenrichmentIntegDefaultTestDeployAssert1F2A8125.template.json", + "terminationProtection": false, + "validateOnSynth": false, + "notificationArns": [], + "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": [ + "sqspstplambdafunctionenrichmentIntegDefaultTestDeployAssert1F2A8125.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": [ + "sqspstplambdafunctionenrichmentIntegDefaultTestDeployAssert1F2A8125.assets" + ], + "metadata": { + "/sqspstp-lambda-function-enrichment/Integ/DefaultTest/DeployAssert/BootstrapVersion": [ + { + "type": "aws:cdk:logicalId", + "data": "BootstrapVersion" + } + ], + "/sqspstp-lambda-function-enrichment/Integ/DefaultTest/DeployAssert/CheckBootstrapVersion": [ + { + "type": "aws:cdk:logicalId", + "data": "CheckBootstrapVersion" + } + ] + }, + "displayName": "sqspstp-lambda-function-enrichment/Integ/DefaultTest/DeployAssert" + }, + "sqspstp-lambda-function-enrichment.assets": { + "type": "cdk:asset-manifest", + "properties": { + "file": "sqspstp-lambda-function-enrichment.assets.json", + "requiresBootstrapStackVersion": 6, + "bootstrapStackVersionSsmParameter": "/cdk-bootstrap/hnb659fds/version" + } + }, + "sqspstp-lambda-function-enrichment": { + "type": "aws:cloudformation:stack", + "environment": "aws://unknown-account/unknown-region", + "properties": { + "templateFile": "sqspstp-lambda-function-enrichment.template.json", + "terminationProtection": false, + "validateOnSynth": false, + "notificationArns": [], + "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}/306dbf92baf052489aeba6e3114641443f51d18af1130ff101b339295e2f7776.json", + "requiresBootstrapStackVersion": 6, + "bootstrapStackVersionSsmParameter": "/cdk-bootstrap/hnb659fds/version", + "additionalDependencies": [ + "sqspstp-lambda-function-enrichment.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": [ + "sqspstp-lambda-function-enrichment.assets" + ], + "metadata": { + "/sqspstp-lambda-function-enrichment/enrichment-function/ServiceRole/Resource": [ + { + "type": "aws:cdk:logicalId", + "data": "enrichmentfunctionServiceRoleF21A0515" + } + ], + "/sqspstp-lambda-function-enrichment/enrichment-function/Resource": [ + { + "type": "aws:cdk:logicalId", + "data": "enrichmentfunction84C1BE72" + } + ], + "/sqspstp-lambda-function-enrichment/lambdas3stp-test/ServiceRole/Resource": [ + { + "type": "aws:cdk:logicalId", + "data": "lambdas3stptestServiceRoleF17BB6C7" + } + ], + "/sqspstp-lambda-function-enrichment/lambdas3stp-test/Resource": [ + { + "type": "aws:cdk:logicalId", + "data": "lambdas3stptest9FBDC6CE" + } + ], + "/sqspstp-lambda-function-enrichment/test-sqs-pipes-states-construct/queue-dlq/Resource": [ + { + "type": "aws:cdk:logicalId", + "data": "testsqspipesstatesconstructqueuedlq420A82FD" + } + ], + "/sqspstp-lambda-function-enrichment/test-sqs-pipes-states-construct/queue-dlq/Policy/Resource": [ + { + "type": "aws:cdk:logicalId", + "data": "testsqspipesstatesconstructqueuedlqPolicyB1D70483" + } + ], + "/sqspstp-lambda-function-enrichment/test-sqs-pipes-states-construct/queue/Resource": [ + { + "type": "aws:cdk:logicalId", + "data": "testsqspipesstatesconstructqueueA7C76715" + } + ], + "/sqspstp-lambda-function-enrichment/test-sqs-pipes-states-construct/queue/Policy/Resource": [ + { + "type": "aws:cdk:logicalId", + "data": "testsqspipesstatesconstructqueuePolicyFD32B562" + } + ], + "/sqspstp-lambda-function-enrichment/test-sqs-pipes-states-construct/StateMachineLogGroup/Resource": [ + { + "type": "aws:cdk:logicalId", + "data": "testsqspipesstatesconstructStateMachineLogGroupADE94F1D" + } + ], + "/sqspstp-lambda-function-enrichment/test-sqs-pipes-states-construct/StateMachine/Role/Resource": [ + { + "type": "aws:cdk:logicalId", + "data": "testsqspipesstatesconstructStateMachineRoleBF97BFC0" + } + ], + "/sqspstp-lambda-function-enrichment/test-sqs-pipes-states-construct/StateMachine/Role/DefaultPolicy/Resource": [ + { + "type": "aws:cdk:logicalId", + "data": "testsqspipesstatesconstructStateMachineRoleDefaultPolicyD1BA2BF2" + } + ], + "/sqspstp-lambda-function-enrichment/test-sqs-pipes-states-construct/StateMachine/Resource": [ + { + "type": "aws:cdk:logicalId", + "data": "testsqspipesstatesconstructStateMachine29272AA9" + } + ], + "/sqspstp-lambda-function-enrichment/test-sqs-pipes-states-construct/ExecutionFailedAlarm/Resource": [ + { + "type": "aws:cdk:logicalId", + "data": "testsqspipesstatesconstructExecutionFailedAlarm1002FF55" + } + ], + "/sqspstp-lambda-function-enrichment/test-sqs-pipes-states-construct/ExecutionThrottledAlarm/Resource": [ + { + "type": "aws:cdk:logicalId", + "data": "testsqspipesstatesconstructExecutionThrottledAlarm0242B01A" + } + ], + "/sqspstp-lambda-function-enrichment/test-sqs-pipes-states-construct/ExecutionAbortedAlarm/Resource": [ + { + "type": "aws:cdk:logicalId", + "data": "testsqspipesstatesconstructExecutionAbortedAlarm14349A7B" + } + ], + "/sqspstp-lambda-function-enrichment/test-sqs-pipes-states-construct/PipeRole--test-sqs-pipes-states-construct/Resource": [ + { + "type": "aws:cdk:logicalId", + "data": "testsqspipesstatesconstructPipeRoletestsqspipesstatesconstruct2CC9A13C" + } + ], + "/sqspstp-lambda-function-enrichment/test-sqs-pipes-states-construct/enrichmentpolicytest-sqs-pipes-states-construct/Resource": [ + { + "type": "aws:cdk:logicalId", + "data": "testsqspipesstatesconstructenrichmentpolicytestsqspipesstatesconstructC752476A" + } + ], + "/sqspstp-lambda-function-enrichment/test-sqs-pipes-states-construct/LogGroup-test-sqs-pipes-states-construct/Resource": [ + { + "type": "aws:cdk:logicalId", + "data": "testsqspipesstatesconstructLogGrouptestsqspipesstatesconstructF827FE15" + } + ], + "/sqspstp-lambda-function-enrichment/test-sqs-pipes-states-construct/pipe-test-sqs-pipes-states-construct": [ + { + "type": "aws:cdk:logicalId", + "data": "testsqspipesstatesconstructpipetestsqspipesstatesconstruct71A64A15" + } + ], + "/sqspstp-lambda-function-enrichment/BootstrapVersion": [ + { + "type": "aws:cdk:logicalId", + "data": "BootstrapVersion" + } + ], + "/sqspstp-lambda-function-enrichment/CheckBootstrapVersion": [ + { + "type": "aws:cdk:logicalId", + "data": "CheckBootstrapVersion" + } + ] + }, + "displayName": "sqspstp-lambda-function-enrichment" + }, + "Tree": { + "type": "cdk:tree", + "properties": { + "file": "tree.json" + } + } + } +} \ No newline at end of file diff --git a/source/patterns/@aws-solutions-constructs/aws-sqs-pipes-stepfunctions/test/integ.sqspstp-lambda-function-enrichment.js.snapshot/sqspstp-lambda-function-enrichment.assets.json b/source/patterns/@aws-solutions-constructs/aws-sqs-pipes-stepfunctions/test/integ.sqspstp-lambda-function-enrichment.js.snapshot/sqspstp-lambda-function-enrichment.assets.json new file mode 100644 index 000000000..655b0fb9c --- /dev/null +++ b/source/patterns/@aws-solutions-constructs/aws-sqs-pipes-stepfunctions/test/integ.sqspstp-lambda-function-enrichment.js.snapshot/sqspstp-lambda-function-enrichment.assets.json @@ -0,0 +1,32 @@ +{ + "version": "38.0.1", + "files": { + "33adcab38bd8c4e154734b436a40ee81920a89cd6c787ce62302c33df5e1dfcb": { + "source": { + "path": "asset.33adcab38bd8c4e154734b436a40ee81920a89cd6c787ce62302c33df5e1dfcb", + "packaging": "zip" + }, + "destinations": { + "current_account-current_region": { + "bucketName": "cdk-hnb659fds-assets-${AWS::AccountId}-${AWS::Region}", + "objectKey": "33adcab38bd8c4e154734b436a40ee81920a89cd6c787ce62302c33df5e1dfcb.zip", + "assumeRoleArn": "arn:${AWS::Partition}:iam::${AWS::AccountId}:role/cdk-hnb659fds-file-publishing-role-${AWS::AccountId}-${AWS::Region}" + } + } + }, + "306dbf92baf052489aeba6e3114641443f51d18af1130ff101b339295e2f7776": { + "source": { + "path": "sqspstp-lambda-function-enrichment.template.json", + "packaging": "file" + }, + "destinations": { + "current_account-current_region": { + "bucketName": "cdk-hnb659fds-assets-${AWS::AccountId}-${AWS::Region}", + "objectKey": "306dbf92baf052489aeba6e3114641443f51d18af1130ff101b339295e2f7776.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-sqs-pipes-stepfunctions/test/integ.sqspstp-lambda-function-enrichment.js.snapshot/sqspstp-lambda-function-enrichment.template.json b/source/patterns/@aws-solutions-constructs/aws-sqs-pipes-stepfunctions/test/integ.sqspstp-lambda-function-enrichment.js.snapshot/sqspstp-lambda-function-enrichment.template.json new file mode 100644 index 000000000..66eaa8321 --- /dev/null +++ b/source/patterns/@aws-solutions-constructs/aws-sqs-pipes-stepfunctions/test/integ.sqspstp-lambda-function-enrichment.js.snapshot/sqspstp-lambda-function-enrichment.template.json @@ -0,0 +1,757 @@ +{ + "Resources": { + "enrichmentfunctionServiceRoleF21A0515": { + "Type": "AWS::IAM::Role", + "Properties": { + "AssumeRolePolicyDocument": { + "Statement": [ + { + "Action": "sts:AssumeRole", + "Effect": "Allow", + "Principal": { + "Service": "lambda.amazonaws.com" + } + } + ], + "Version": "2012-10-17" + }, + "ManagedPolicyArns": [ + { + "Fn::Join": [ + "", + [ + "arn:", + { + "Ref": "AWS::Partition" + }, + ":iam::aws:policy/service-role/AWSLambdaBasicExecutionRole" + ] + ] + } + ] + } + }, + "enrichmentfunction84C1BE72": { + "Type": "AWS::Lambda::Function", + "Properties": { + "Code": { + "S3Bucket": { + "Fn::Sub": "cdk-hnb659fds-assets-${AWS::AccountId}-${AWS::Region}" + }, + "S3Key": "33adcab38bd8c4e154734b436a40ee81920a89cd6c787ce62302c33df5e1dfcb.zip" + }, + "Handler": "index.handler", + "Role": { + "Fn::GetAtt": [ + "enrichmentfunctionServiceRoleF21A0515", + "Arn" + ] + }, + "Runtime": "nodejs20.x" + }, + "DependsOn": [ + "enrichmentfunctionServiceRoleF21A0515" + ], + "Metadata": { + "cfn_nag": { + "rules_to_suppress": [ + { + "id": "W58", + "reason": "This Lambda Function is created for integration testing purposes only and is not part of an actual construct" + }, + { + "id": "W89", + "reason": "This Lambda Function is created for integration testing purposes only and is not part of an actual construct" + }, + { + "id": "W92", + "reason": "This Lambda Function is created for integration testing purposes only and is not part of an actual construct" + } + ] + } + } + }, + "lambdas3stptestServiceRoleF17BB6C7": { + "Type": "AWS::IAM::Role", + "Properties": { + "AssumeRolePolicyDocument": { + "Statement": [ + { + "Action": "sts:AssumeRole", + "Effect": "Allow", + "Principal": { + "Service": "lambda.amazonaws.com" + } + } + ], + "Version": "2012-10-17" + }, + "ManagedPolicyArns": [ + { + "Fn::Join": [ + "", + [ + "arn:", + { + "Ref": "AWS::Partition" + }, + ":iam::aws:policy/service-role/AWSLambdaBasicExecutionRole" + ] + ] + } + ] + } + }, + "lambdas3stptest9FBDC6CE": { + "Type": "AWS::Lambda::Function", + "Properties": { + "Code": { + "ZipFile": "exports.handler = async (event) => console.log(event)" + }, + "Handler": "index.handler", + "Role": { + "Fn::GetAtt": [ + "lambdas3stptestServiceRoleF17BB6C7", + "Arn" + ] + }, + "Runtime": "nodejs20.x" + }, + "DependsOn": [ + "lambdas3stptestServiceRoleF17BB6C7" + ], + "Metadata": { + "cfn_nag": { + "rules_to_suppress": [ + { + "id": "W58", + "reason": "This Lambda Function is created for integration testing purposes only and is not part of an actual construct" + }, + { + "id": "W89", + "reason": "This Lambda Function is created for integration testing purposes only and is not part of an actual construct" + }, + { + "id": "W92", + "reason": "This Lambda Function is created for integration testing purposes only and is not part of an actual construct" + } + ] + } + } + }, + "testsqspipesstatesconstructqueuedlq420A82FD": { + "Type": "AWS::SQS::Queue", + "Properties": { + "KmsMasterKeyId": "alias/aws/sqs" + }, + "UpdateReplacePolicy": "Delete", + "DeletionPolicy": "Delete" + }, + "testsqspipesstatesconstructqueuedlqPolicyB1D70483": { + "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": [ + "testsqspipesstatesconstructqueuedlq420A82FD", + "Arn" + ] + }, + "Sid": "QueueOwnerOnlyAccess" + }, + { + "Action": "SQS:*", + "Condition": { + "Bool": { + "aws:SecureTransport": "false" + } + }, + "Effect": "Deny", + "Principal": { + "AWS": "*" + }, + "Resource": { + "Fn::GetAtt": [ + "testsqspipesstatesconstructqueuedlq420A82FD", + "Arn" + ] + }, + "Sid": "HttpsOnly" + } + ], + "Version": "2012-10-17" + }, + "Queues": [ + { + "Ref": "testsqspipesstatesconstructqueuedlq420A82FD" + } + ] + } + }, + "testsqspipesstatesconstructqueueA7C76715": { + "Type": "AWS::SQS::Queue", + "Properties": { + "KmsMasterKeyId": "alias/aws/sqs", + "RedrivePolicy": { + "deadLetterTargetArn": { + "Fn::GetAtt": [ + "testsqspipesstatesconstructqueuedlq420A82FD", + "Arn" + ] + }, + "maxReceiveCount": 15 + } + }, + "UpdateReplacePolicy": "Delete", + "DeletionPolicy": "Delete" + }, + "testsqspipesstatesconstructqueuePolicyFD32B562": { + "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": [ + "testsqspipesstatesconstructqueueA7C76715", + "Arn" + ] + }, + "Sid": "QueueOwnerOnlyAccess" + }, + { + "Action": "SQS:*", + "Condition": { + "Bool": { + "aws:SecureTransport": "false" + } + }, + "Effect": "Deny", + "Principal": { + "AWS": "*" + }, + "Resource": { + "Fn::GetAtt": [ + "testsqspipesstatesconstructqueueA7C76715", + "Arn" + ] + }, + "Sid": "HttpsOnly" + } + ], + "Version": "2012-10-17" + }, + "Queues": [ + { + "Ref": "testsqspipesstatesconstructqueueA7C76715" + } + ] + } + }, + "testsqspipesstatesconstructStateMachineLogGroupADE94F1D": { + "Type": "AWS::Logs::LogGroup", + "Properties": { + "LogGroupName": { + "Fn::Join": [ + "", + [ + "/aws/vendedlogs/states/constructs/sqspstp-lambda-function-enrichmenttest-sqs-pipes-states-constructStateMachineLog-", + { + "Fn::Select": [ + 2, + { + "Fn::Split": [ + "/", + { + "Ref": "AWS::StackId" + } + ] + } + ] + } + ] + ] + } + }, + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Retain", + "Metadata": { + "cfn_nag": { + "rules_to_suppress": [ + { + "id": "W86", + "reason": "Retention period for CloudWatchLogs LogGroups are set to 'Never Expire' to preserve customer data indefinitely" + }, + { + "id": "W84", + "reason": "By default CloudWatchLogs LogGroups data is encrypted using the CloudWatch server-side encryption keys (AWS Managed Keys)" + } + ] + } + } + }, + "testsqspipesstatesconstructStateMachineRoleBF97BFC0": { + "Type": "AWS::IAM::Role", + "Properties": { + "AssumeRolePolicyDocument": { + "Statement": [ + { + "Action": "sts:AssumeRole", + "Effect": "Allow", + "Principal": { + "Service": "states.amazonaws.com" + } + } + ], + "Version": "2012-10-17" + } + } + }, + "testsqspipesstatesconstructStateMachineRoleDefaultPolicyD1BA2BF2": { + "Type": "AWS::IAM::Policy", + "Properties": { + "PolicyDocument": { + "Statement": [ + { + "Action": "lambda:InvokeFunction", + "Effect": "Allow", + "Resource": [ + { + "Fn::GetAtt": [ + "lambdas3stptest9FBDC6CE", + "Arn" + ] + }, + { + "Fn::Join": [ + "", + [ + { + "Fn::GetAtt": [ + "lambdas3stptest9FBDC6CE", + "Arn" + ] + }, + ":*" + ] + ] + } + ] + }, + { + "Action": [ + "logs:CreateLogDelivery", + "logs:DeleteLogDelivery", + "logs:DescribeLogGroups", + "logs:DescribeResourcePolicies", + "logs:GetLogDelivery", + "logs:ListLogDeliveries", + "logs:PutResourcePolicy", + "logs:UpdateLogDelivery" + ], + "Effect": "Allow", + "Resource": "*" + } + ], + "Version": "2012-10-17" + }, + "PolicyName": "testsqspipesstatesconstructStateMachineRoleDefaultPolicyD1BA2BF2", + "Roles": [ + { + "Ref": "testsqspipesstatesconstructStateMachineRoleBF97BFC0" + } + ] + }, + "Metadata": { + "cfn_nag": { + "rules_to_suppress": [ + { + "id": "W12", + "reason": "These are CDK defaults. The 'LogDelivery' actions do not support resource-level authorizations. Any logging is done by State Machine code" + } + ] + } + } + }, + "testsqspipesstatesconstructStateMachine29272AA9": { + "Type": "AWS::StepFunctions::StateMachine", + "Properties": { + "DefinitionString": { + "Fn::Join": [ + "", + [ + "{\"StartAt\":\"tasks3stp-test\",\"States\":{\"tasks3stp-test\":{\"End\":true,\"Retry\":[{\"ErrorEquals\":[\"Lambda.ClientExecutionTimeoutException\",\"Lambda.ServiceException\",\"Lambda.AWSLambdaException\",\"Lambda.SdkClientException\"],\"IntervalSeconds\":2,\"MaxAttempts\":6,\"BackoffRate\":2}],\"Type\":\"Task\",\"Resource\":\"arn:", + { + "Ref": "AWS::Partition" + }, + ":states:::lambda:invoke\",\"Parameters\":{\"FunctionName\":\"", + { + "Fn::GetAtt": [ + "lambdas3stptest9FBDC6CE", + "Arn" + ] + }, + "\",\"Payload.$\":\"$\"}}}}" + ] + ] + }, + "LoggingConfiguration": { + "Destinations": [ + { + "CloudWatchLogsLogGroup": { + "LogGroupArn": { + "Fn::GetAtt": [ + "testsqspipesstatesconstructStateMachineLogGroupADE94F1D", + "Arn" + ] + } + } + } + ], + "Level": "ERROR" + }, + "RoleArn": { + "Fn::GetAtt": [ + "testsqspipesstatesconstructStateMachineRoleBF97BFC0", + "Arn" + ] + } + }, + "DependsOn": [ + "testsqspipesstatesconstructStateMachineRoleDefaultPolicyD1BA2BF2", + "testsqspipesstatesconstructStateMachineRoleBF97BFC0" + ], + "UpdateReplacePolicy": "Delete", + "DeletionPolicy": "Delete" + }, + "testsqspipesstatesconstructExecutionFailedAlarm1002FF55": { + "Type": "AWS::CloudWatch::Alarm", + "Properties": { + "AlarmDescription": "Alarm for the number of executions that failed exceeded the threshold of 1. ", + "ComparisonOperator": "GreaterThanOrEqualToThreshold", + "Dimensions": [ + { + "Name": "StateMachineArn", + "Value": { + "Ref": "testsqspipesstatesconstructStateMachine29272AA9" + } + } + ], + "EvaluationPeriods": 1, + "MetricName": "ExecutionsFailed", + "Namespace": "AWS/States", + "Period": 300, + "Statistic": "Sum", + "Threshold": 1 + } + }, + "testsqspipesstatesconstructExecutionThrottledAlarm0242B01A": { + "Type": "AWS::CloudWatch::Alarm", + "Properties": { + "AlarmDescription": "Alarm for the number of executions that throttled exceeded the threshold of 1. ", + "ComparisonOperator": "GreaterThanOrEqualToThreshold", + "Dimensions": [ + { + "Name": "StateMachineArn", + "Value": { + "Ref": "testsqspipesstatesconstructStateMachine29272AA9" + } + } + ], + "EvaluationPeriods": 1, + "MetricName": "ExecutionThrottled", + "Namespace": "AWS/States", + "Period": 300, + "Statistic": "Sum", + "Threshold": 1 + } + }, + "testsqspipesstatesconstructExecutionAbortedAlarm14349A7B": { + "Type": "AWS::CloudWatch::Alarm", + "Properties": { + "AlarmDescription": "Alarm for the number of executions that aborted exceeded the threshold of 1. ", + "ComparisonOperator": "GreaterThanOrEqualToThreshold", + "Dimensions": [ + { + "Name": "StateMachineArn", + "Value": { + "Ref": "testsqspipesstatesconstructStateMachine29272AA9" + } + } + ], + "EvaluationPeriods": 1, + "MetricName": "ExecutionsAborted", + "Namespace": "AWS/States", + "Period": 300, + "Statistic": "Maximum", + "Threshold": 1 + } + }, + "testsqspipesstatesconstructPipeRoletestsqspipesstatesconstruct2CC9A13C": { + "Type": "AWS::IAM::Role", + "Properties": { + "AssumeRolePolicyDocument": { + "Statement": [ + { + "Action": "sts:AssumeRole", + "Effect": "Allow", + "Principal": { + "Service": "pipes.amazonaws.com" + } + } + ], + "Version": "2012-10-17" + }, + "Policies": [ + { + "PolicyDocument": { + "Statement": [ + { + "Action": [ + "sqs:DeleteMessage", + "sqs:GetQueueAttributes", + "sqs:ReceiveMessage" + ], + "Effect": "Allow", + "Resource": { + "Fn::GetAtt": [ + "testsqspipesstatesconstructqueueA7C76715", + "Arn" + ] + } + } + ], + "Version": "2012-10-17" + }, + "PolicyName": "sourcePolicy" + }, + { + "PolicyDocument": { + "Statement": [ + { + "Action": "states:StartExecution", + "Effect": "Allow", + "Resource": { + "Ref": "testsqspipesstatesconstructStateMachine29272AA9" + } + } + ], + "Version": "2012-10-17" + }, + "PolicyName": "targetPolicy" + } + ] + }, + "Metadata": { + "guard": { + "SuppressedRules": [ + "IAM_NO_INLINE_POLICY_CHECK" + ] + } + } + }, + "testsqspipesstatesconstructenrichmentpolicytestsqspipesstatesconstructC752476A": { + "Type": "AWS::IAM::Policy", + "Properties": { + "PolicyDocument": { + "Statement": [ + { + "Action": "lambda:InvokeFunction", + "Effect": "Allow", + "Resource": { + "Fn::GetAtt": [ + "enrichmentfunction84C1BE72", + "Arn" + ] + } + } + ], + "Version": "2012-10-17" + }, + "PolicyName": "testsqspipesstatesconstructenrichmentpolicytestsqspipesstatesconstructC752476A", + "Roles": [ + { + "Ref": "testsqspipesstatesconstructPipeRoletestsqspipesstatesconstruct2CC9A13C" + } + ] + } + }, + "testsqspipesstatesconstructLogGrouptestsqspipesstatesconstructF827FE15": { + "Type": "AWS::Logs::LogGroup", + "Properties": { + "LogGroupName": { + "Fn::Join": [ + "", + [ + "/aws/vendedlogs/pipes/constructs/sqspstp-lambda-function-enrichmenttest-sqs-pipes-states-constructPipesLog-", + { + "Fn::Select": [ + 2, + { + "Fn::Split": [ + "/", + { + "Ref": "AWS::StackId" + } + ] + } + ] + } + ] + ] + } + }, + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Retain", + "Metadata": { + "cfn_nag": { + "rules_to_suppress": [ + { + "id": "W86", + "reason": "Retention period for CloudWatchLogs LogGroups are set to 'Never Expire' to preserve customer data indefinitely" + }, + { + "id": "W84", + "reason": "By default CloudWatchLogs LogGroups data is encrypted using the CloudWatch server-side encryption keys (AWS Managed Keys)" + } + ] + } + } + }, + "testsqspipesstatesconstructpipetestsqspipesstatesconstruct71A64A15": { + "Type": "AWS::Pipes::Pipe", + "Properties": { + "Enrichment": { + "Fn::GetAtt": [ + "enrichmentfunction84C1BE72", + "Arn" + ] + }, + "LogConfiguration": { + "CloudwatchLogsLogDestination": { + "LogGroupArn": { + "Fn::GetAtt": [ + "testsqspipesstatesconstructLogGrouptestsqspipesstatesconstructF827FE15", + "Arn" + ] + } + }, + "Level": "TRACE" + }, + "RoleArn": { + "Fn::GetAtt": [ + "testsqspipesstatesconstructPipeRoletestsqspipesstatesconstruct2CC9A13C", + "Arn" + ] + }, + "Source": { + "Fn::GetAtt": [ + "testsqspipesstatesconstructqueueA7C76715", + "Arn" + ] + }, + "SourceParameters": {}, + "Target": { + "Ref": "testsqspipesstatesconstructStateMachine29272AA9" + }, + "TargetParameters": { + "StepFunctionStateMachineParameters": { + "InvocationType": "FIRE_AND_FORGET" + } + } + } + } + }, + "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-sqs-pipes-stepfunctions/test/integ.sqspstp-lambda-function-enrichment.js.snapshot/sqspstplambdafunctionenrichmentIntegDefaultTestDeployAssert1F2A8125.assets.json b/source/patterns/@aws-solutions-constructs/aws-sqs-pipes-stepfunctions/test/integ.sqspstp-lambda-function-enrichment.js.snapshot/sqspstplambdafunctionenrichmentIntegDefaultTestDeployAssert1F2A8125.assets.json new file mode 100644 index 000000000..5f52af412 --- /dev/null +++ b/source/patterns/@aws-solutions-constructs/aws-sqs-pipes-stepfunctions/test/integ.sqspstp-lambda-function-enrichment.js.snapshot/sqspstplambdafunctionenrichmentIntegDefaultTestDeployAssert1F2A8125.assets.json @@ -0,0 +1,19 @@ +{ + "version": "38.0.1", + "files": { + "21fbb51d7b23f6a6c262b46a9caee79d744a3ac019fd45422d988b96d44b2a22": { + "source": { + "path": "sqspstplambdafunctionenrichmentIntegDefaultTestDeployAssert1F2A8125.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-sqs-pipes-stepfunctions/test/integ.sqspstp-lambda-function-enrichment.js.snapshot/sqspstplambdafunctionenrichmentIntegDefaultTestDeployAssert1F2A8125.template.json b/source/patterns/@aws-solutions-constructs/aws-sqs-pipes-stepfunctions/test/integ.sqspstp-lambda-function-enrichment.js.snapshot/sqspstplambdafunctionenrichmentIntegDefaultTestDeployAssert1F2A8125.template.json new file mode 100644 index 000000000..ad9d0fb73 --- /dev/null +++ b/source/patterns/@aws-solutions-constructs/aws-sqs-pipes-stepfunctions/test/integ.sqspstp-lambda-function-enrichment.js.snapshot/sqspstplambdafunctionenrichmentIntegDefaultTestDeployAssert1F2A8125.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-sqs-pipes-stepfunctions/test/integ.sqspstp-lambda-function-enrichment.js.snapshot/tree.json b/source/patterns/@aws-solutions-constructs/aws-sqs-pipes-stepfunctions/test/integ.sqspstp-lambda-function-enrichment.js.snapshot/tree.json new file mode 100644 index 000000000..09798a6be --- /dev/null +++ b/source/patterns/@aws-solutions-constructs/aws-sqs-pipes-stepfunctions/test/integ.sqspstp-lambda-function-enrichment.js.snapshot/tree.json @@ -0,0 +1,1127 @@ +{ + "version": "tree-0.1", + "tree": { + "id": "App", + "path": "", + "children": { + "sqspstp-lambda-function-enrichment": { + "id": "sqspstp-lambda-function-enrichment", + "path": "sqspstp-lambda-function-enrichment", + "children": { + "enrichment-function": { + "id": "enrichment-function", + "path": "sqspstp-lambda-function-enrichment/enrichment-function", + "children": { + "ServiceRole": { + "id": "ServiceRole", + "path": "sqspstp-lambda-function-enrichment/enrichment-function/ServiceRole", + "children": { + "ImportServiceRole": { + "id": "ImportServiceRole", + "path": "sqspstp-lambda-function-enrichment/enrichment-function/ServiceRole/ImportServiceRole", + "constructInfo": { + "fqn": "aws-cdk-lib.Resource", + "version": "2.161.0" + } + }, + "Resource": { + "id": "Resource", + "path": "sqspstp-lambda-function-enrichment/enrichment-function/ServiceRole/Resource", + "attributes": { + "aws:cdk:cloudformation:type": "AWS::IAM::Role", + "aws:cdk:cloudformation:props": { + "assumeRolePolicyDocument": { + "Statement": [ + { + "Action": "sts:AssumeRole", + "Effect": "Allow", + "Principal": { + "Service": "lambda.amazonaws.com" + } + } + ], + "Version": "2012-10-17" + }, + "managedPolicyArns": [ + { + "Fn::Join": [ + "", + [ + "arn:", + { + "Ref": "AWS::Partition" + }, + ":iam::aws:policy/service-role/AWSLambdaBasicExecutionRole" + ] + ] + } + ] + } + }, + "constructInfo": { + "fqn": "aws-cdk-lib.aws_iam.CfnRole", + "version": "2.161.0" + } + } + }, + "constructInfo": { + "fqn": "aws-cdk-lib.aws_iam.Role", + "version": "2.161.0" + } + }, + "Code": { + "id": "Code", + "path": "sqspstp-lambda-function-enrichment/enrichment-function/Code", + "children": { + "Stage": { + "id": "Stage", + "path": "sqspstp-lambda-function-enrichment/enrichment-function/Code/Stage", + "constructInfo": { + "fqn": "aws-cdk-lib.AssetStaging", + "version": "2.161.0" + } + }, + "AssetBucket": { + "id": "AssetBucket", + "path": "sqspstp-lambda-function-enrichment/enrichment-function/Code/AssetBucket", + "constructInfo": { + "fqn": "aws-cdk-lib.aws_s3.BucketBase", + "version": "2.161.0" + } + } + }, + "constructInfo": { + "fqn": "aws-cdk-lib.aws_s3_assets.Asset", + "version": "2.161.0" + } + }, + "Resource": { + "id": "Resource", + "path": "sqspstp-lambda-function-enrichment/enrichment-function/Resource", + "attributes": { + "aws:cdk:cloudformation:type": "AWS::Lambda::Function", + "aws:cdk:cloudformation:props": { + "code": { + "s3Bucket": { + "Fn::Sub": "cdk-hnb659fds-assets-${AWS::AccountId}-${AWS::Region}" + }, + "s3Key": "33adcab38bd8c4e154734b436a40ee81920a89cd6c787ce62302c33df5e1dfcb.zip" + }, + "handler": "index.handler", + "role": { + "Fn::GetAtt": [ + "enrichmentfunctionServiceRoleF21A0515", + "Arn" + ] + }, + "runtime": "nodejs20.x" + } + }, + "constructInfo": { + "fqn": "aws-cdk-lib.aws_lambda.CfnFunction", + "version": "2.161.0" + } + } + }, + "constructInfo": { + "fqn": "aws-cdk-lib.aws_lambda.Function", + "version": "2.161.0" + } + }, + "lambdas3stp-test": { + "id": "lambdas3stp-test", + "path": "sqspstp-lambda-function-enrichment/lambdas3stp-test", + "children": { + "ServiceRole": { + "id": "ServiceRole", + "path": "sqspstp-lambda-function-enrichment/lambdas3stp-test/ServiceRole", + "children": { + "ImportServiceRole": { + "id": "ImportServiceRole", + "path": "sqspstp-lambda-function-enrichment/lambdas3stp-test/ServiceRole/ImportServiceRole", + "constructInfo": { + "fqn": "aws-cdk-lib.Resource", + "version": "2.161.0" + } + }, + "Resource": { + "id": "Resource", + "path": "sqspstp-lambda-function-enrichment/lambdas3stp-test/ServiceRole/Resource", + "attributes": { + "aws:cdk:cloudformation:type": "AWS::IAM::Role", + "aws:cdk:cloudformation:props": { + "assumeRolePolicyDocument": { + "Statement": [ + { + "Action": "sts:AssumeRole", + "Effect": "Allow", + "Principal": { + "Service": "lambda.amazonaws.com" + } + } + ], + "Version": "2012-10-17" + }, + "managedPolicyArns": [ + { + "Fn::Join": [ + "", + [ + "arn:", + { + "Ref": "AWS::Partition" + }, + ":iam::aws:policy/service-role/AWSLambdaBasicExecutionRole" + ] + ] + } + ] + } + }, + "constructInfo": { + "fqn": "aws-cdk-lib.aws_iam.CfnRole", + "version": "2.161.0" + } + } + }, + "constructInfo": { + "fqn": "aws-cdk-lib.aws_iam.Role", + "version": "2.161.0" + } + }, + "Resource": { + "id": "Resource", + "path": "sqspstp-lambda-function-enrichment/lambdas3stp-test/Resource", + "attributes": { + "aws:cdk:cloudformation:type": "AWS::Lambda::Function", + "aws:cdk:cloudformation:props": { + "code": { + "zipFile": "exports.handler = async (event) => console.log(event)" + }, + "handler": "index.handler", + "role": { + "Fn::GetAtt": [ + "lambdas3stptestServiceRoleF17BB6C7", + "Arn" + ] + }, + "runtime": "nodejs20.x" + } + }, + "constructInfo": { + "fqn": "aws-cdk-lib.aws_lambda.CfnFunction", + "version": "2.161.0" + } + } + }, + "constructInfo": { + "fqn": "aws-cdk-lib.aws_lambda.Function", + "version": "2.161.0" + } + }, + "tasks3stp-test": { + "id": "tasks3stp-test", + "path": "sqspstp-lambda-function-enrichment/tasks3stp-test", + "constructInfo": { + "fqn": "aws-cdk-lib.aws_stepfunctions_tasks.LambdaInvoke", + "version": "2.161.0" + } + }, + "test-sqs-pipes-states-construct": { + "id": "test-sqs-pipes-states-construct", + "path": "sqspstp-lambda-function-enrichment/test-sqs-pipes-states-construct", + "children": { + "queue-dlq": { + "id": "queue-dlq", + "path": "sqspstp-lambda-function-enrichment/test-sqs-pipes-states-construct/queue-dlq", + "children": { + "Resource": { + "id": "Resource", + "path": "sqspstp-lambda-function-enrichment/test-sqs-pipes-states-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.161.0" + } + }, + "Policy": { + "id": "Policy", + "path": "sqspstp-lambda-function-enrichment/test-sqs-pipes-states-construct/queue-dlq/Policy", + "children": { + "Resource": { + "id": "Resource", + "path": "sqspstp-lambda-function-enrichment/test-sqs-pipes-states-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": [ + "testsqspipesstatesconstructqueuedlq420A82FD", + "Arn" + ] + }, + "Sid": "QueueOwnerOnlyAccess" + }, + { + "Action": "SQS:*", + "Condition": { + "Bool": { + "aws:SecureTransport": "false" + } + }, + "Effect": "Deny", + "Principal": { + "AWS": "*" + }, + "Resource": { + "Fn::GetAtt": [ + "testsqspipesstatesconstructqueuedlq420A82FD", + "Arn" + ] + }, + "Sid": "HttpsOnly" + } + ], + "Version": "2012-10-17" + }, + "queues": [ + { + "Ref": "testsqspipesstatesconstructqueuedlq420A82FD" + } + ] + } + }, + "constructInfo": { + "fqn": "aws-cdk-lib.aws_sqs.CfnQueuePolicy", + "version": "2.161.0" + } + } + }, + "constructInfo": { + "fqn": "aws-cdk-lib.aws_sqs.QueuePolicy", + "version": "2.161.0" + } + } + }, + "constructInfo": { + "fqn": "aws-cdk-lib.aws_sqs.Queue", + "version": "2.161.0" + } + }, + "queue": { + "id": "queue", + "path": "sqspstp-lambda-function-enrichment/test-sqs-pipes-states-construct/queue", + "children": { + "Resource": { + "id": "Resource", + "path": "sqspstp-lambda-function-enrichment/test-sqs-pipes-states-construct/queue/Resource", + "attributes": { + "aws:cdk:cloudformation:type": "AWS::SQS::Queue", + "aws:cdk:cloudformation:props": { + "kmsMasterKeyId": "alias/aws/sqs", + "redrivePolicy": { + "deadLetterTargetArn": { + "Fn::GetAtt": [ + "testsqspipesstatesconstructqueuedlq420A82FD", + "Arn" + ] + }, + "maxReceiveCount": 15 + } + } + }, + "constructInfo": { + "fqn": "aws-cdk-lib.aws_sqs.CfnQueue", + "version": "2.161.0" + } + }, + "Policy": { + "id": "Policy", + "path": "sqspstp-lambda-function-enrichment/test-sqs-pipes-states-construct/queue/Policy", + "children": { + "Resource": { + "id": "Resource", + "path": "sqspstp-lambda-function-enrichment/test-sqs-pipes-states-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": [ + "testsqspipesstatesconstructqueueA7C76715", + "Arn" + ] + }, + "Sid": "QueueOwnerOnlyAccess" + }, + { + "Action": "SQS:*", + "Condition": { + "Bool": { + "aws:SecureTransport": "false" + } + }, + "Effect": "Deny", + "Principal": { + "AWS": "*" + }, + "Resource": { + "Fn::GetAtt": [ + "testsqspipesstatesconstructqueueA7C76715", + "Arn" + ] + }, + "Sid": "HttpsOnly" + } + ], + "Version": "2012-10-17" + }, + "queues": [ + { + "Ref": "testsqspipesstatesconstructqueueA7C76715" + } + ] + } + }, + "constructInfo": { + "fqn": "aws-cdk-lib.aws_sqs.CfnQueuePolicy", + "version": "2.161.0" + } + } + }, + "constructInfo": { + "fqn": "aws-cdk-lib.aws_sqs.QueuePolicy", + "version": "2.161.0" + } + } + }, + "constructInfo": { + "fqn": "aws-cdk-lib.aws_sqs.Queue", + "version": "2.161.0" + } + }, + "StateMachineLogGroup": { + "id": "StateMachineLogGroup", + "path": "sqspstp-lambda-function-enrichment/test-sqs-pipes-states-construct/StateMachineLogGroup", + "children": { + "Resource": { + "id": "Resource", + "path": "sqspstp-lambda-function-enrichment/test-sqs-pipes-states-construct/StateMachineLogGroup/Resource", + "attributes": { + "aws:cdk:cloudformation:type": "AWS::Logs::LogGroup", + "aws:cdk:cloudformation:props": { + "logGroupName": { + "Fn::Join": [ + "", + [ + "/aws/vendedlogs/states/constructs/sqspstp-lambda-function-enrichmenttest-sqs-pipes-states-constructStateMachineLog-", + { + "Fn::Select": [ + 2, + { + "Fn::Split": [ + "/", + { + "Ref": "AWS::StackId" + } + ] + } + ] + } + ] + ] + } + } + }, + "constructInfo": { + "fqn": "aws-cdk-lib.aws_logs.CfnLogGroup", + "version": "2.161.0" + } + } + }, + "constructInfo": { + "fqn": "aws-cdk-lib.aws_logs.LogGroup", + "version": "2.161.0" + } + }, + "StateMachine": { + "id": "StateMachine", + "path": "sqspstp-lambda-function-enrichment/test-sqs-pipes-states-construct/StateMachine", + "children": { + "Role": { + "id": "Role", + "path": "sqspstp-lambda-function-enrichment/test-sqs-pipes-states-construct/StateMachine/Role", + "children": { + "ImportRole": { + "id": "ImportRole", + "path": "sqspstp-lambda-function-enrichment/test-sqs-pipes-states-construct/StateMachine/Role/ImportRole", + "constructInfo": { + "fqn": "aws-cdk-lib.Resource", + "version": "2.161.0" + } + }, + "Resource": { + "id": "Resource", + "path": "sqspstp-lambda-function-enrichment/test-sqs-pipes-states-construct/StateMachine/Role/Resource", + "attributes": { + "aws:cdk:cloudformation:type": "AWS::IAM::Role", + "aws:cdk:cloudformation:props": { + "assumeRolePolicyDocument": { + "Statement": [ + { + "Action": "sts:AssumeRole", + "Effect": "Allow", + "Principal": { + "Service": "states.amazonaws.com" + } + } + ], + "Version": "2012-10-17" + } + } + }, + "constructInfo": { + "fqn": "aws-cdk-lib.aws_iam.CfnRole", + "version": "2.161.0" + } + }, + "DefaultPolicy": { + "id": "DefaultPolicy", + "path": "sqspstp-lambda-function-enrichment/test-sqs-pipes-states-construct/StateMachine/Role/DefaultPolicy", + "children": { + "Resource": { + "id": "Resource", + "path": "sqspstp-lambda-function-enrichment/test-sqs-pipes-states-construct/StateMachine/Role/DefaultPolicy/Resource", + "attributes": { + "aws:cdk:cloudformation:type": "AWS::IAM::Policy", + "aws:cdk:cloudformation:props": { + "policyDocument": { + "Statement": [ + { + "Action": "lambda:InvokeFunction", + "Effect": "Allow", + "Resource": [ + { + "Fn::GetAtt": [ + "lambdas3stptest9FBDC6CE", + "Arn" + ] + }, + { + "Fn::Join": [ + "", + [ + { + "Fn::GetAtt": [ + "lambdas3stptest9FBDC6CE", + "Arn" + ] + }, + ":*" + ] + ] + } + ] + }, + { + "Action": [ + "logs:CreateLogDelivery", + "logs:DeleteLogDelivery", + "logs:DescribeLogGroups", + "logs:DescribeResourcePolicies", + "logs:GetLogDelivery", + "logs:ListLogDeliveries", + "logs:PutResourcePolicy", + "logs:UpdateLogDelivery" + ], + "Effect": "Allow", + "Resource": "*" + } + ], + "Version": "2012-10-17" + }, + "policyName": "testsqspipesstatesconstructStateMachineRoleDefaultPolicyD1BA2BF2", + "roles": [ + { + "Ref": "testsqspipesstatesconstructStateMachineRoleBF97BFC0" + } + ] + } + }, + "constructInfo": { + "fqn": "aws-cdk-lib.aws_iam.CfnPolicy", + "version": "2.161.0" + } + } + }, + "constructInfo": { + "fqn": "aws-cdk-lib.aws_iam.Policy", + "version": "2.161.0" + } + } + }, + "constructInfo": { + "fqn": "aws-cdk-lib.aws_iam.Role", + "version": "2.161.0" + } + }, + "Resource": { + "id": "Resource", + "path": "sqspstp-lambda-function-enrichment/test-sqs-pipes-states-construct/StateMachine/Resource", + "attributes": { + "aws:cdk:cloudformation:type": "AWS::StepFunctions::StateMachine", + "aws:cdk:cloudformation:props": { + "definitionString": { + "Fn::Join": [ + "", + [ + "{\"StartAt\":\"tasks3stp-test\",\"States\":{\"tasks3stp-test\":{\"End\":true,\"Retry\":[{\"ErrorEquals\":[\"Lambda.ClientExecutionTimeoutException\",\"Lambda.ServiceException\",\"Lambda.AWSLambdaException\",\"Lambda.SdkClientException\"],\"IntervalSeconds\":2,\"MaxAttempts\":6,\"BackoffRate\":2}],\"Type\":\"Task\",\"Resource\":\"arn:", + { + "Ref": "AWS::Partition" + }, + ":states:::lambda:invoke\",\"Parameters\":{\"FunctionName\":\"", + { + "Fn::GetAtt": [ + "lambdas3stptest9FBDC6CE", + "Arn" + ] + }, + "\",\"Payload.$\":\"$\"}}}}" + ] + ] + }, + "loggingConfiguration": { + "destinations": [ + { + "cloudWatchLogsLogGroup": { + "logGroupArn": { + "Fn::GetAtt": [ + "testsqspipesstatesconstructStateMachineLogGroupADE94F1D", + "Arn" + ] + } + } + } + ], + "level": "ERROR" + }, + "roleArn": { + "Fn::GetAtt": [ + "testsqspipesstatesconstructStateMachineRoleBF97BFC0", + "Arn" + ] + } + } + }, + "constructInfo": { + "fqn": "aws-cdk-lib.aws_stepfunctions.CfnStateMachine", + "version": "2.161.0" + } + } + }, + "constructInfo": { + "fqn": "aws-cdk-lib.aws_stepfunctions.StateMachine", + "version": "2.161.0" + } + }, + "ExecutionFailedAlarm": { + "id": "ExecutionFailedAlarm", + "path": "sqspstp-lambda-function-enrichment/test-sqs-pipes-states-construct/ExecutionFailedAlarm", + "children": { + "Resource": { + "id": "Resource", + "path": "sqspstp-lambda-function-enrichment/test-sqs-pipes-states-construct/ExecutionFailedAlarm/Resource", + "attributes": { + "aws:cdk:cloudformation:type": "AWS::CloudWatch::Alarm", + "aws:cdk:cloudformation:props": { + "alarmDescription": "Alarm for the number of executions that failed exceeded the threshold of 1. ", + "comparisonOperator": "GreaterThanOrEqualToThreshold", + "dimensions": [ + { + "name": "StateMachineArn", + "value": { + "Ref": "testsqspipesstatesconstructStateMachine29272AA9" + } + } + ], + "evaluationPeriods": 1, + "metricName": "ExecutionsFailed", + "namespace": "AWS/States", + "period": 300, + "statistic": "Sum", + "threshold": 1 + } + }, + "constructInfo": { + "fqn": "aws-cdk-lib.aws_cloudwatch.CfnAlarm", + "version": "2.161.0" + } + } + }, + "constructInfo": { + "fqn": "aws-cdk-lib.aws_cloudwatch.Alarm", + "version": "2.161.0" + } + }, + "ExecutionThrottledAlarm": { + "id": "ExecutionThrottledAlarm", + "path": "sqspstp-lambda-function-enrichment/test-sqs-pipes-states-construct/ExecutionThrottledAlarm", + "children": { + "Resource": { + "id": "Resource", + "path": "sqspstp-lambda-function-enrichment/test-sqs-pipes-states-construct/ExecutionThrottledAlarm/Resource", + "attributes": { + "aws:cdk:cloudformation:type": "AWS::CloudWatch::Alarm", + "aws:cdk:cloudformation:props": { + "alarmDescription": "Alarm for the number of executions that throttled exceeded the threshold of 1. ", + "comparisonOperator": "GreaterThanOrEqualToThreshold", + "dimensions": [ + { + "name": "StateMachineArn", + "value": { + "Ref": "testsqspipesstatesconstructStateMachine29272AA9" + } + } + ], + "evaluationPeriods": 1, + "metricName": "ExecutionThrottled", + "namespace": "AWS/States", + "period": 300, + "statistic": "Sum", + "threshold": 1 + } + }, + "constructInfo": { + "fqn": "aws-cdk-lib.aws_cloudwatch.CfnAlarm", + "version": "2.161.0" + } + } + }, + "constructInfo": { + "fqn": "aws-cdk-lib.aws_cloudwatch.Alarm", + "version": "2.161.0" + } + }, + "ExecutionAbortedAlarm": { + "id": "ExecutionAbortedAlarm", + "path": "sqspstp-lambda-function-enrichment/test-sqs-pipes-states-construct/ExecutionAbortedAlarm", + "children": { + "Resource": { + "id": "Resource", + "path": "sqspstp-lambda-function-enrichment/test-sqs-pipes-states-construct/ExecutionAbortedAlarm/Resource", + "attributes": { + "aws:cdk:cloudformation:type": "AWS::CloudWatch::Alarm", + "aws:cdk:cloudformation:props": { + "alarmDescription": "Alarm for the number of executions that aborted exceeded the threshold of 1. ", + "comparisonOperator": "GreaterThanOrEqualToThreshold", + "dimensions": [ + { + "name": "StateMachineArn", + "value": { + "Ref": "testsqspipesstatesconstructStateMachine29272AA9" + } + } + ], + "evaluationPeriods": 1, + "metricName": "ExecutionsAborted", + "namespace": "AWS/States", + "period": 300, + "statistic": "Maximum", + "threshold": 1 + } + }, + "constructInfo": { + "fqn": "aws-cdk-lib.aws_cloudwatch.CfnAlarm", + "version": "2.161.0" + } + } + }, + "constructInfo": { + "fqn": "aws-cdk-lib.aws_cloudwatch.Alarm", + "version": "2.161.0" + } + }, + "PipeRole--test-sqs-pipes-states-construct": { + "id": "PipeRole--test-sqs-pipes-states-construct", + "path": "sqspstp-lambda-function-enrichment/test-sqs-pipes-states-construct/PipeRole--test-sqs-pipes-states-construct", + "children": { + "ImportPipeRole--test-sqs-pipes-states-construct": { + "id": "ImportPipeRole--test-sqs-pipes-states-construct", + "path": "sqspstp-lambda-function-enrichment/test-sqs-pipes-states-construct/PipeRole--test-sqs-pipes-states-construct/ImportPipeRole--test-sqs-pipes-states-construct", + "constructInfo": { + "fqn": "aws-cdk-lib.Resource", + "version": "2.161.0" + } + }, + "Resource": { + "id": "Resource", + "path": "sqspstp-lambda-function-enrichment/test-sqs-pipes-states-construct/PipeRole--test-sqs-pipes-states-construct/Resource", + "attributes": { + "aws:cdk:cloudformation:type": "AWS::IAM::Role", + "aws:cdk:cloudformation:props": { + "assumeRolePolicyDocument": { + "Statement": [ + { + "Action": "sts:AssumeRole", + "Effect": "Allow", + "Principal": { + "Service": "pipes.amazonaws.com" + } + } + ], + "Version": "2012-10-17" + }, + "policies": [ + { + "policyName": "sourcePolicy", + "policyDocument": { + "Statement": [ + { + "Action": [ + "sqs:DeleteMessage", + "sqs:GetQueueAttributes", + "sqs:ReceiveMessage" + ], + "Effect": "Allow", + "Resource": { + "Fn::GetAtt": [ + "testsqspipesstatesconstructqueueA7C76715", + "Arn" + ] + } + } + ], + "Version": "2012-10-17" + } + }, + { + "policyName": "targetPolicy", + "policyDocument": { + "Statement": [ + { + "Action": "states:StartExecution", + "Effect": "Allow", + "Resource": { + "Ref": "testsqspipesstatesconstructStateMachine29272AA9" + } + } + ], + "Version": "2012-10-17" + } + } + ] + } + }, + "constructInfo": { + "fqn": "aws-cdk-lib.aws_iam.CfnRole", + "version": "2.161.0" + } + } + }, + "constructInfo": { + "fqn": "aws-cdk-lib.aws_iam.Role", + "version": "2.161.0" + } + }, + "enrichmentpolicytest-sqs-pipes-states-construct": { + "id": "enrichmentpolicytest-sqs-pipes-states-construct", + "path": "sqspstp-lambda-function-enrichment/test-sqs-pipes-states-construct/enrichmentpolicytest-sqs-pipes-states-construct", + "children": { + "Resource": { + "id": "Resource", + "path": "sqspstp-lambda-function-enrichment/test-sqs-pipes-states-construct/enrichmentpolicytest-sqs-pipes-states-construct/Resource", + "attributes": { + "aws:cdk:cloudformation:type": "AWS::IAM::Policy", + "aws:cdk:cloudformation:props": { + "policyDocument": { + "Statement": [ + { + "Action": "lambda:InvokeFunction", + "Effect": "Allow", + "Resource": { + "Fn::GetAtt": [ + "enrichmentfunction84C1BE72", + "Arn" + ] + } + } + ], + "Version": "2012-10-17" + }, + "policyName": "testsqspipesstatesconstructenrichmentpolicytestsqspipesstatesconstructC752476A", + "roles": [ + { + "Ref": "testsqspipesstatesconstructPipeRoletestsqspipesstatesconstruct2CC9A13C" + } + ] + } + }, + "constructInfo": { + "fqn": "aws-cdk-lib.aws_iam.CfnPolicy", + "version": "2.161.0" + } + } + }, + "constructInfo": { + "fqn": "aws-cdk-lib.aws_iam.Policy", + "version": "2.161.0" + } + }, + "LogGroup-test-sqs-pipes-states-construct": { + "id": "LogGroup-test-sqs-pipes-states-construct", + "path": "sqspstp-lambda-function-enrichment/test-sqs-pipes-states-construct/LogGroup-test-sqs-pipes-states-construct", + "children": { + "Resource": { + "id": "Resource", + "path": "sqspstp-lambda-function-enrichment/test-sqs-pipes-states-construct/LogGroup-test-sqs-pipes-states-construct/Resource", + "attributes": { + "aws:cdk:cloudformation:type": "AWS::Logs::LogGroup", + "aws:cdk:cloudformation:props": { + "logGroupName": { + "Fn::Join": [ + "", + [ + "/aws/vendedlogs/pipes/constructs/sqspstp-lambda-function-enrichmenttest-sqs-pipes-states-constructPipesLog-", + { + "Fn::Select": [ + 2, + { + "Fn::Split": [ + "/", + { + "Ref": "AWS::StackId" + } + ] + } + ] + } + ] + ] + } + } + }, + "constructInfo": { + "fqn": "aws-cdk-lib.aws_logs.CfnLogGroup", + "version": "2.161.0" + } + } + }, + "constructInfo": { + "fqn": "aws-cdk-lib.aws_logs.LogGroup", + "version": "2.161.0" + } + }, + "pipe-test-sqs-pipes-states-construct": { + "id": "pipe-test-sqs-pipes-states-construct", + "path": "sqspstp-lambda-function-enrichment/test-sqs-pipes-states-construct/pipe-test-sqs-pipes-states-construct", + "attributes": { + "aws:cdk:cloudformation:type": "AWS::Pipes::Pipe", + "aws:cdk:cloudformation:props": { + "enrichment": { + "Fn::GetAtt": [ + "enrichmentfunction84C1BE72", + "Arn" + ] + }, + "logConfiguration": { + "cloudwatchLogsLogDestination": { + "logGroupArn": { + "Fn::GetAtt": [ + "testsqspipesstatesconstructLogGrouptestsqspipesstatesconstructF827FE15", + "Arn" + ] + } + }, + "level": "TRACE" + }, + "roleArn": { + "Fn::GetAtt": [ + "testsqspipesstatesconstructPipeRoletestsqspipesstatesconstruct2CC9A13C", + "Arn" + ] + }, + "source": { + "Fn::GetAtt": [ + "testsqspipesstatesconstructqueueA7C76715", + "Arn" + ] + }, + "sourceParameters": {}, + "target": { + "Ref": "testsqspipesstatesconstructStateMachine29272AA9" + }, + "targetParameters": { + "stepFunctionStateMachineParameters": { + "invocationType": "FIRE_AND_FORGET" + } + } + } + }, + "constructInfo": { + "fqn": "aws-cdk-lib.aws_pipes.CfnPipe", + "version": "2.161.0" + } + } + }, + "constructInfo": { + "fqn": "@aws-solutions-constructs/aws-sqs-pipes-stepfunctions.SqsToPipesToStepfunctions", + "version": "2.72.0" + } + }, + "Integ": { + "id": "Integ", + "path": "sqspstp-lambda-function-enrichment/Integ", + "children": { + "DefaultTest": { + "id": "DefaultTest", + "path": "sqspstp-lambda-function-enrichment/Integ/DefaultTest", + "children": { + "Default": { + "id": "Default", + "path": "sqspstp-lambda-function-enrichment/Integ/DefaultTest/Default", + "constructInfo": { + "fqn": "constructs.Construct", + "version": "10.4.2" + } + }, + "DeployAssert": { + "id": "DeployAssert", + "path": "sqspstp-lambda-function-enrichment/Integ/DefaultTest/DeployAssert", + "children": { + "BootstrapVersion": { + "id": "BootstrapVersion", + "path": "sqspstp-lambda-function-enrichment/Integ/DefaultTest/DeployAssert/BootstrapVersion", + "constructInfo": { + "fqn": "aws-cdk-lib.CfnParameter", + "version": "2.161.0" + } + }, + "CheckBootstrapVersion": { + "id": "CheckBootstrapVersion", + "path": "sqspstp-lambda-function-enrichment/Integ/DefaultTest/DeployAssert/CheckBootstrapVersion", + "constructInfo": { + "fqn": "aws-cdk-lib.CfnRule", + "version": "2.161.0" + } + } + }, + "constructInfo": { + "fqn": "aws-cdk-lib.Stack", + "version": "2.161.0" + } + } + }, + "constructInfo": { + "fqn": "@aws-cdk/integ-tests-alpha.IntegTestCase", + "version": "2.161.0-alpha.0" + } + } + }, + "constructInfo": { + "fqn": "@aws-cdk/integ-tests-alpha.IntegTest", + "version": "2.161.0-alpha.0" + } + }, + "BootstrapVersion": { + "id": "BootstrapVersion", + "path": "sqspstp-lambda-function-enrichment/BootstrapVersion", + "constructInfo": { + "fqn": "aws-cdk-lib.CfnParameter", + "version": "2.161.0" + } + }, + "CheckBootstrapVersion": { + "id": "CheckBootstrapVersion", + "path": "sqspstp-lambda-function-enrichment/CheckBootstrapVersion", + "constructInfo": { + "fqn": "aws-cdk-lib.CfnRule", + "version": "2.161.0" + } + } + }, + "constructInfo": { + "fqn": "aws-cdk-lib.Stack", + "version": "2.161.0" + } + }, + "Tree": { + "id": "Tree", + "path": "Tree", + "constructInfo": { + "fqn": "constructs.Construct", + "version": "10.4.2" + } + } + }, + "constructInfo": { + "fqn": "aws-cdk-lib.App", + "version": "2.161.0" + } + } +} \ No newline at end of file diff --git a/source/patterns/@aws-solutions-constructs/aws-sqs-pipes-stepfunctions/test/integ.sqspstp-lambda-function-enrichment.ts b/source/patterns/@aws-solutions-constructs/aws-sqs-pipes-stepfunctions/test/integ.sqspstp-lambda-function-enrichment.ts new file mode 100644 index 000000000..d14e81f84 --- /dev/null +++ b/source/patterns/@aws-solutions-constructs/aws-sqs-pipes-stepfunctions/test/integ.sqspstp-lambda-function-enrichment.ts @@ -0,0 +1,43 @@ +/** + * 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. + */ + +/// !cdk-integ * +import { App, Stack } from "aws-cdk-lib"; +import { SqsToPipesToStepfunctions, SqsToPipesToStepfunctionsProps } from "../lib"; +import { generateIntegStackName } from '@aws-solutions-constructs/core'; +import { IntegTest } from '@aws-cdk/integ-tests-alpha'; +import * as defaults from '@aws-solutions-constructs/core'; +import * as lambda from 'aws-cdk-lib/aws-lambda'; + +const app = new App(); +const stack = new Stack(app, generateIntegStackName(__filename)); + +const enrichmentFunction = new lambda.Function(stack, 'enrichment-function', { + runtime: defaults.COMMERCIAL_REGION_LAMBDA_NODE_RUNTIME, + handler: 'index.handler', + code: lambda.Code.fromAsset(`${__dirname}/lambda`) +}); + +const props: SqsToPipesToStepfunctionsProps = { + stateMachineProps: { + definitionBody: defaults.CreateTestStateMachineDefinitionBody(stack, 's3stp-test') + }, + enrichmentFunction, + logLevel: defaults.PipesLogLevel.TRACE +}; + +new SqsToPipesToStepfunctions(stack, 'test-sqs-pipes-states-construct', props); + +new IntegTest(stack, 'Integ', { testCases: [ + stack +] }); diff --git a/source/patterns/@aws-solutions-constructs/aws-sqs-pipes-stepfunctions/test/integ.sqspstp-logs-off.js.snapshot/cdk.out b/source/patterns/@aws-solutions-constructs/aws-sqs-pipes-stepfunctions/test/integ.sqspstp-logs-off.js.snapshot/cdk.out new file mode 100644 index 000000000..c6e612584 --- /dev/null +++ b/source/patterns/@aws-solutions-constructs/aws-sqs-pipes-stepfunctions/test/integ.sqspstp-logs-off.js.snapshot/cdk.out @@ -0,0 +1 @@ +{"version":"38.0.1"} \ No newline at end of file diff --git a/source/patterns/@aws-solutions-constructs/aws-sqs-pipes-stepfunctions/test/integ.sqspstp-logs-off.js.snapshot/integ.json b/source/patterns/@aws-solutions-constructs/aws-sqs-pipes-stepfunctions/test/integ.sqspstp-logs-off.js.snapshot/integ.json new file mode 100644 index 000000000..30487a45f --- /dev/null +++ b/source/patterns/@aws-solutions-constructs/aws-sqs-pipes-stepfunctions/test/integ.sqspstp-logs-off.js.snapshot/integ.json @@ -0,0 +1,12 @@ +{ + "version": "38.0.1", + "testCases": { + "sqspstp-logs-off/Integ/DefaultTest": { + "stacks": [ + "sqspstp-logs-off" + ], + "assertionStack": "sqspstp-logs-off/Integ/DefaultTest/DeployAssert", + "assertionStackName": "sqspstplogsoffIntegDefaultTestDeployAssert25C29ACD" + } + } +} \ No newline at end of file diff --git a/source/patterns/@aws-solutions-constructs/aws-sqs-pipes-stepfunctions/test/integ.sqspstp-logs-off.js.snapshot/manifest.json b/source/patterns/@aws-solutions-constructs/aws-sqs-pipes-stepfunctions/test/integ.sqspstp-logs-off.js.snapshot/manifest.json new file mode 100644 index 000000000..3982a409a --- /dev/null +++ b/source/patterns/@aws-solutions-constructs/aws-sqs-pipes-stepfunctions/test/integ.sqspstp-logs-off.js.snapshot/manifest.json @@ -0,0 +1,199 @@ +{ + "version": "38.0.1", + "artifacts": { + "sqspstplogsoffIntegDefaultTestDeployAssert25C29ACD.assets": { + "type": "cdk:asset-manifest", + "properties": { + "file": "sqspstplogsoffIntegDefaultTestDeployAssert25C29ACD.assets.json", + "requiresBootstrapStackVersion": 6, + "bootstrapStackVersionSsmParameter": "/cdk-bootstrap/hnb659fds/version" + } + }, + "sqspstplogsoffIntegDefaultTestDeployAssert25C29ACD": { + "type": "aws:cloudformation:stack", + "environment": "aws://unknown-account/unknown-region", + "properties": { + "templateFile": "sqspstplogsoffIntegDefaultTestDeployAssert25C29ACD.template.json", + "terminationProtection": false, + "validateOnSynth": false, + "notificationArns": [], + "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": [ + "sqspstplogsoffIntegDefaultTestDeployAssert25C29ACD.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": [ + "sqspstplogsoffIntegDefaultTestDeployAssert25C29ACD.assets" + ], + "metadata": { + "/sqspstp-logs-off/Integ/DefaultTest/DeployAssert/BootstrapVersion": [ + { + "type": "aws:cdk:logicalId", + "data": "BootstrapVersion" + } + ], + "/sqspstp-logs-off/Integ/DefaultTest/DeployAssert/CheckBootstrapVersion": [ + { + "type": "aws:cdk:logicalId", + "data": "CheckBootstrapVersion" + } + ] + }, + "displayName": "sqspstp-logs-off/Integ/DefaultTest/DeployAssert" + }, + "sqspstp-logs-off.assets": { + "type": "cdk:asset-manifest", + "properties": { + "file": "sqspstp-logs-off.assets.json", + "requiresBootstrapStackVersion": 6, + "bootstrapStackVersionSsmParameter": "/cdk-bootstrap/hnb659fds/version" + } + }, + "sqspstp-logs-off": { + "type": "aws:cloudformation:stack", + "environment": "aws://unknown-account/unknown-region", + "properties": { + "templateFile": "sqspstp-logs-off.template.json", + "terminationProtection": false, + "validateOnSynth": false, + "notificationArns": [], + "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}/89d69078e83c9ebe41b3cf105e9646d5e699dda56f3ebddf3e090119e71faab9.json", + "requiresBootstrapStackVersion": 6, + "bootstrapStackVersionSsmParameter": "/cdk-bootstrap/hnb659fds/version", + "additionalDependencies": [ + "sqspstp-logs-off.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": [ + "sqspstp-logs-off.assets" + ], + "metadata": { + "/sqspstp-logs-off/lambdas3stp-test/ServiceRole/Resource": [ + { + "type": "aws:cdk:logicalId", + "data": "lambdas3stptestServiceRoleF17BB6C7" + } + ], + "/sqspstp-logs-off/lambdas3stp-test/Resource": [ + { + "type": "aws:cdk:logicalId", + "data": "lambdas3stptest9FBDC6CE" + } + ], + "/sqspstp-logs-off/test-sqs-pipes-states-construct/queue-dlq/Resource": [ + { + "type": "aws:cdk:logicalId", + "data": "testsqspipesstatesconstructqueuedlq420A82FD" + } + ], + "/sqspstp-logs-off/test-sqs-pipes-states-construct/queue-dlq/Policy/Resource": [ + { + "type": "aws:cdk:logicalId", + "data": "testsqspipesstatesconstructqueuedlqPolicyB1D70483" + } + ], + "/sqspstp-logs-off/test-sqs-pipes-states-construct/queue/Resource": [ + { + "type": "aws:cdk:logicalId", + "data": "testsqspipesstatesconstructqueueA7C76715" + } + ], + "/sqspstp-logs-off/test-sqs-pipes-states-construct/queue/Policy/Resource": [ + { + "type": "aws:cdk:logicalId", + "data": "testsqspipesstatesconstructqueuePolicyFD32B562" + } + ], + "/sqspstp-logs-off/test-sqs-pipes-states-construct/StateMachineLogGroup/Resource": [ + { + "type": "aws:cdk:logicalId", + "data": "testsqspipesstatesconstructStateMachineLogGroupADE94F1D" + } + ], + "/sqspstp-logs-off/test-sqs-pipes-states-construct/StateMachine/Role/Resource": [ + { + "type": "aws:cdk:logicalId", + "data": "testsqspipesstatesconstructStateMachineRoleBF97BFC0" + } + ], + "/sqspstp-logs-off/test-sqs-pipes-states-construct/StateMachine/Role/DefaultPolicy/Resource": [ + { + "type": "aws:cdk:logicalId", + "data": "testsqspipesstatesconstructStateMachineRoleDefaultPolicyD1BA2BF2" + } + ], + "/sqspstp-logs-off/test-sqs-pipes-states-construct/StateMachine/Resource": [ + { + "type": "aws:cdk:logicalId", + "data": "testsqspipesstatesconstructStateMachine29272AA9" + } + ], + "/sqspstp-logs-off/test-sqs-pipes-states-construct/ExecutionFailedAlarm/Resource": [ + { + "type": "aws:cdk:logicalId", + "data": "testsqspipesstatesconstructExecutionFailedAlarm1002FF55" + } + ], + "/sqspstp-logs-off/test-sqs-pipes-states-construct/ExecutionThrottledAlarm/Resource": [ + { + "type": "aws:cdk:logicalId", + "data": "testsqspipesstatesconstructExecutionThrottledAlarm0242B01A" + } + ], + "/sqspstp-logs-off/test-sqs-pipes-states-construct/ExecutionAbortedAlarm/Resource": [ + { + "type": "aws:cdk:logicalId", + "data": "testsqspipesstatesconstructExecutionAbortedAlarm14349A7B" + } + ], + "/sqspstp-logs-off/test-sqs-pipes-states-construct/PipeRole--test-sqs-pipes-states-construct/Resource": [ + { + "type": "aws:cdk:logicalId", + "data": "testsqspipesstatesconstructPipeRoletestsqspipesstatesconstruct2CC9A13C" + } + ], + "/sqspstp-logs-off/test-sqs-pipes-states-construct/pipe-test-sqs-pipes-states-construct": [ + { + "type": "aws:cdk:logicalId", + "data": "testsqspipesstatesconstructpipetestsqspipesstatesconstruct71A64A15" + } + ], + "/sqspstp-logs-off/BootstrapVersion": [ + { + "type": "aws:cdk:logicalId", + "data": "BootstrapVersion" + } + ], + "/sqspstp-logs-off/CheckBootstrapVersion": [ + { + "type": "aws:cdk:logicalId", + "data": "CheckBootstrapVersion" + } + ] + }, + "displayName": "sqspstp-logs-off" + }, + "Tree": { + "type": "cdk:tree", + "properties": { + "file": "tree.json" + } + } + } +} \ No newline at end of file diff --git a/source/patterns/@aws-solutions-constructs/aws-sqs-pipes-stepfunctions/test/integ.sqspstp-logs-off.js.snapshot/sqspstp-logs-off.assets.json b/source/patterns/@aws-solutions-constructs/aws-sqs-pipes-stepfunctions/test/integ.sqspstp-logs-off.js.snapshot/sqspstp-logs-off.assets.json new file mode 100644 index 000000000..db15a94a5 --- /dev/null +++ b/source/patterns/@aws-solutions-constructs/aws-sqs-pipes-stepfunctions/test/integ.sqspstp-logs-off.js.snapshot/sqspstp-logs-off.assets.json @@ -0,0 +1,19 @@ +{ + "version": "38.0.1", + "files": { + "89d69078e83c9ebe41b3cf105e9646d5e699dda56f3ebddf3e090119e71faab9": { + "source": { + "path": "sqspstp-logs-off.template.json", + "packaging": "file" + }, + "destinations": { + "current_account-current_region": { + "bucketName": "cdk-hnb659fds-assets-${AWS::AccountId}-${AWS::Region}", + "objectKey": "89d69078e83c9ebe41b3cf105e9646d5e699dda56f3ebddf3e090119e71faab9.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-sqs-pipes-stepfunctions/test/integ.sqspstp-logs-off.js.snapshot/sqspstp-logs-off.template.json b/source/patterns/@aws-solutions-constructs/aws-sqs-pipes-stepfunctions/test/integ.sqspstp-logs-off.js.snapshot/sqspstp-logs-off.template.json new file mode 100644 index 000000000..25e530493 --- /dev/null +++ b/source/patterns/@aws-solutions-constructs/aws-sqs-pipes-stepfunctions/test/integ.sqspstp-logs-off.js.snapshot/sqspstp-logs-off.template.json @@ -0,0 +1,601 @@ +{ + "Resources": { + "lambdas3stptestServiceRoleF17BB6C7": { + "Type": "AWS::IAM::Role", + "Properties": { + "AssumeRolePolicyDocument": { + "Statement": [ + { + "Action": "sts:AssumeRole", + "Effect": "Allow", + "Principal": { + "Service": "lambda.amazonaws.com" + } + } + ], + "Version": "2012-10-17" + }, + "ManagedPolicyArns": [ + { + "Fn::Join": [ + "", + [ + "arn:", + { + "Ref": "AWS::Partition" + }, + ":iam::aws:policy/service-role/AWSLambdaBasicExecutionRole" + ] + ] + } + ] + } + }, + "lambdas3stptest9FBDC6CE": { + "Type": "AWS::Lambda::Function", + "Properties": { + "Code": { + "ZipFile": "exports.handler = async (event) => console.log(event)" + }, + "Handler": "index.handler", + "Role": { + "Fn::GetAtt": [ + "lambdas3stptestServiceRoleF17BB6C7", + "Arn" + ] + }, + "Runtime": "nodejs20.x" + }, + "DependsOn": [ + "lambdas3stptestServiceRoleF17BB6C7" + ], + "Metadata": { + "cfn_nag": { + "rules_to_suppress": [ + { + "id": "W58", + "reason": "This Lambda Function is created for integration testing purposes only and is not part of an actual construct" + }, + { + "id": "W89", + "reason": "This Lambda Function is created for integration testing purposes only and is not part of an actual construct" + }, + { + "id": "W92", + "reason": "This Lambda Function is created for integration testing purposes only and is not part of an actual construct" + } + ] + } + } + }, + "testsqspipesstatesconstructqueuedlq420A82FD": { + "Type": "AWS::SQS::Queue", + "Properties": { + "KmsMasterKeyId": "alias/aws/sqs" + }, + "UpdateReplacePolicy": "Delete", + "DeletionPolicy": "Delete" + }, + "testsqspipesstatesconstructqueuedlqPolicyB1D70483": { + "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": [ + "testsqspipesstatesconstructqueuedlq420A82FD", + "Arn" + ] + }, + "Sid": "QueueOwnerOnlyAccess" + }, + { + "Action": "SQS:*", + "Condition": { + "Bool": { + "aws:SecureTransport": "false" + } + }, + "Effect": "Deny", + "Principal": { + "AWS": "*" + }, + "Resource": { + "Fn::GetAtt": [ + "testsqspipesstatesconstructqueuedlq420A82FD", + "Arn" + ] + }, + "Sid": "HttpsOnly" + } + ], + "Version": "2012-10-17" + }, + "Queues": [ + { + "Ref": "testsqspipesstatesconstructqueuedlq420A82FD" + } + ] + } + }, + "testsqspipesstatesconstructqueueA7C76715": { + "Type": "AWS::SQS::Queue", + "Properties": { + "KmsMasterKeyId": "alias/aws/sqs", + "RedrivePolicy": { + "deadLetterTargetArn": { + "Fn::GetAtt": [ + "testsqspipesstatesconstructqueuedlq420A82FD", + "Arn" + ] + }, + "maxReceiveCount": 15 + } + }, + "UpdateReplacePolicy": "Delete", + "DeletionPolicy": "Delete" + }, + "testsqspipesstatesconstructqueuePolicyFD32B562": { + "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": [ + "testsqspipesstatesconstructqueueA7C76715", + "Arn" + ] + }, + "Sid": "QueueOwnerOnlyAccess" + }, + { + "Action": "SQS:*", + "Condition": { + "Bool": { + "aws:SecureTransport": "false" + } + }, + "Effect": "Deny", + "Principal": { + "AWS": "*" + }, + "Resource": { + "Fn::GetAtt": [ + "testsqspipesstatesconstructqueueA7C76715", + "Arn" + ] + }, + "Sid": "HttpsOnly" + } + ], + "Version": "2012-10-17" + }, + "Queues": [ + { + "Ref": "testsqspipesstatesconstructqueueA7C76715" + } + ] + } + }, + "testsqspipesstatesconstructStateMachineLogGroupADE94F1D": { + "Type": "AWS::Logs::LogGroup", + "Properties": { + "LogGroupName": { + "Fn::Join": [ + "", + [ + "/aws/vendedlogs/states/constructs/sqspstp-logs-offtest-sqs-pipes-states-constructStateMachineLog-", + { + "Fn::Select": [ + 2, + { + "Fn::Split": [ + "/", + { + "Ref": "AWS::StackId" + } + ] + } + ] + } + ] + ] + } + }, + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Retain", + "Metadata": { + "cfn_nag": { + "rules_to_suppress": [ + { + "id": "W86", + "reason": "Retention period for CloudWatchLogs LogGroups are set to 'Never Expire' to preserve customer data indefinitely" + }, + { + "id": "W84", + "reason": "By default CloudWatchLogs LogGroups data is encrypted using the CloudWatch server-side encryption keys (AWS Managed Keys)" + } + ] + } + } + }, + "testsqspipesstatesconstructStateMachineRoleBF97BFC0": { + "Type": "AWS::IAM::Role", + "Properties": { + "AssumeRolePolicyDocument": { + "Statement": [ + { + "Action": "sts:AssumeRole", + "Effect": "Allow", + "Principal": { + "Service": "states.amazonaws.com" + } + } + ], + "Version": "2012-10-17" + } + } + }, + "testsqspipesstatesconstructStateMachineRoleDefaultPolicyD1BA2BF2": { + "Type": "AWS::IAM::Policy", + "Properties": { + "PolicyDocument": { + "Statement": [ + { + "Action": "lambda:InvokeFunction", + "Effect": "Allow", + "Resource": [ + { + "Fn::GetAtt": [ + "lambdas3stptest9FBDC6CE", + "Arn" + ] + }, + { + "Fn::Join": [ + "", + [ + { + "Fn::GetAtt": [ + "lambdas3stptest9FBDC6CE", + "Arn" + ] + }, + ":*" + ] + ] + } + ] + }, + { + "Action": [ + "logs:CreateLogDelivery", + "logs:DeleteLogDelivery", + "logs:DescribeLogGroups", + "logs:DescribeResourcePolicies", + "logs:GetLogDelivery", + "logs:ListLogDeliveries", + "logs:PutResourcePolicy", + "logs:UpdateLogDelivery" + ], + "Effect": "Allow", + "Resource": "*" + } + ], + "Version": "2012-10-17" + }, + "PolicyName": "testsqspipesstatesconstructStateMachineRoleDefaultPolicyD1BA2BF2", + "Roles": [ + { + "Ref": "testsqspipesstatesconstructStateMachineRoleBF97BFC0" + } + ] + }, + "Metadata": { + "cfn_nag": { + "rules_to_suppress": [ + { + "id": "W12", + "reason": "These are CDK defaults. The 'LogDelivery' actions do not support resource-level authorizations. Any logging is done by State Machine code" + } + ] + } + } + }, + "testsqspipesstatesconstructStateMachine29272AA9": { + "Type": "AWS::StepFunctions::StateMachine", + "Properties": { + "DefinitionString": { + "Fn::Join": [ + "", + [ + "{\"StartAt\":\"tasks3stp-test\",\"States\":{\"tasks3stp-test\":{\"End\":true,\"Retry\":[{\"ErrorEquals\":[\"Lambda.ClientExecutionTimeoutException\",\"Lambda.ServiceException\",\"Lambda.AWSLambdaException\",\"Lambda.SdkClientException\"],\"IntervalSeconds\":2,\"MaxAttempts\":6,\"BackoffRate\":2}],\"Type\":\"Task\",\"Resource\":\"arn:", + { + "Ref": "AWS::Partition" + }, + ":states:::lambda:invoke\",\"Parameters\":{\"FunctionName\":\"", + { + "Fn::GetAtt": [ + "lambdas3stptest9FBDC6CE", + "Arn" + ] + }, + "\",\"Payload.$\":\"$\"}}}}" + ] + ] + }, + "LoggingConfiguration": { + "Destinations": [ + { + "CloudWatchLogsLogGroup": { + "LogGroupArn": { + "Fn::GetAtt": [ + "testsqspipesstatesconstructStateMachineLogGroupADE94F1D", + "Arn" + ] + } + } + } + ], + "Level": "ERROR" + }, + "RoleArn": { + "Fn::GetAtt": [ + "testsqspipesstatesconstructStateMachineRoleBF97BFC0", + "Arn" + ] + } + }, + "DependsOn": [ + "testsqspipesstatesconstructStateMachineRoleDefaultPolicyD1BA2BF2", + "testsqspipesstatesconstructStateMachineRoleBF97BFC0" + ], + "UpdateReplacePolicy": "Delete", + "DeletionPolicy": "Delete" + }, + "testsqspipesstatesconstructExecutionFailedAlarm1002FF55": { + "Type": "AWS::CloudWatch::Alarm", + "Properties": { + "AlarmDescription": "Alarm for the number of executions that failed exceeded the threshold of 1. ", + "ComparisonOperator": "GreaterThanOrEqualToThreshold", + "Dimensions": [ + { + "Name": "StateMachineArn", + "Value": { + "Ref": "testsqspipesstatesconstructStateMachine29272AA9" + } + } + ], + "EvaluationPeriods": 1, + "MetricName": "ExecutionsFailed", + "Namespace": "AWS/States", + "Period": 300, + "Statistic": "Sum", + "Threshold": 1 + } + }, + "testsqspipesstatesconstructExecutionThrottledAlarm0242B01A": { + "Type": "AWS::CloudWatch::Alarm", + "Properties": { + "AlarmDescription": "Alarm for the number of executions that throttled exceeded the threshold of 1. ", + "ComparisonOperator": "GreaterThanOrEqualToThreshold", + "Dimensions": [ + { + "Name": "StateMachineArn", + "Value": { + "Ref": "testsqspipesstatesconstructStateMachine29272AA9" + } + } + ], + "EvaluationPeriods": 1, + "MetricName": "ExecutionThrottled", + "Namespace": "AWS/States", + "Period": 300, + "Statistic": "Sum", + "Threshold": 1 + } + }, + "testsqspipesstatesconstructExecutionAbortedAlarm14349A7B": { + "Type": "AWS::CloudWatch::Alarm", + "Properties": { + "AlarmDescription": "Alarm for the number of executions that aborted exceeded the threshold of 1. ", + "ComparisonOperator": "GreaterThanOrEqualToThreshold", + "Dimensions": [ + { + "Name": "StateMachineArn", + "Value": { + "Ref": "testsqspipesstatesconstructStateMachine29272AA9" + } + } + ], + "EvaluationPeriods": 1, + "MetricName": "ExecutionsAborted", + "Namespace": "AWS/States", + "Period": 300, + "Statistic": "Maximum", + "Threshold": 1 + } + }, + "testsqspipesstatesconstructPipeRoletestsqspipesstatesconstruct2CC9A13C": { + "Type": "AWS::IAM::Role", + "Properties": { + "AssumeRolePolicyDocument": { + "Statement": [ + { + "Action": "sts:AssumeRole", + "Effect": "Allow", + "Principal": { + "Service": "pipes.amazonaws.com" + } + } + ], + "Version": "2012-10-17" + }, + "Policies": [ + { + "PolicyDocument": { + "Statement": [ + { + "Action": [ + "sqs:DeleteMessage", + "sqs:GetQueueAttributes", + "sqs:ReceiveMessage" + ], + "Effect": "Allow", + "Resource": { + "Fn::GetAtt": [ + "testsqspipesstatesconstructqueueA7C76715", + "Arn" + ] + } + } + ], + "Version": "2012-10-17" + }, + "PolicyName": "sourcePolicy" + }, + { + "PolicyDocument": { + "Statement": [ + { + "Action": "states:StartExecution", + "Effect": "Allow", + "Resource": { + "Ref": "testsqspipesstatesconstructStateMachine29272AA9" + } + } + ], + "Version": "2012-10-17" + }, + "PolicyName": "targetPolicy" + } + ] + }, + "Metadata": { + "guard": { + "SuppressedRules": [ + "IAM_NO_INLINE_POLICY_CHECK" + ] + } + } + }, + "testsqspipesstatesconstructpipetestsqspipesstatesconstruct71A64A15": { + "Type": "AWS::Pipes::Pipe", + "Properties": { + "RoleArn": { + "Fn::GetAtt": [ + "testsqspipesstatesconstructPipeRoletestsqspipesstatesconstruct2CC9A13C", + "Arn" + ] + }, + "Source": { + "Fn::GetAtt": [ + "testsqspipesstatesconstructqueueA7C76715", + "Arn" + ] + }, + "SourceParameters": {}, + "Target": { + "Ref": "testsqspipesstatesconstructStateMachine29272AA9" + }, + "TargetParameters": { + "StepFunctionStateMachineParameters": { + "InvocationType": "FIRE_AND_FORGET" + } + } + } + } + }, + "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-sqs-pipes-stepfunctions/test/integ.sqspstp-logs-off.js.snapshot/sqspstplogsoffIntegDefaultTestDeployAssert25C29ACD.assets.json b/source/patterns/@aws-solutions-constructs/aws-sqs-pipes-stepfunctions/test/integ.sqspstp-logs-off.js.snapshot/sqspstplogsoffIntegDefaultTestDeployAssert25C29ACD.assets.json new file mode 100644 index 000000000..5c2973437 --- /dev/null +++ b/source/patterns/@aws-solutions-constructs/aws-sqs-pipes-stepfunctions/test/integ.sqspstp-logs-off.js.snapshot/sqspstplogsoffIntegDefaultTestDeployAssert25C29ACD.assets.json @@ -0,0 +1,19 @@ +{ + "version": "38.0.1", + "files": { + "21fbb51d7b23f6a6c262b46a9caee79d744a3ac019fd45422d988b96d44b2a22": { + "source": { + "path": "sqspstplogsoffIntegDefaultTestDeployAssert25C29ACD.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-sqs-pipes-stepfunctions/test/integ.sqspstp-logs-off.js.snapshot/sqspstplogsoffIntegDefaultTestDeployAssert25C29ACD.template.json b/source/patterns/@aws-solutions-constructs/aws-sqs-pipes-stepfunctions/test/integ.sqspstp-logs-off.js.snapshot/sqspstplogsoffIntegDefaultTestDeployAssert25C29ACD.template.json new file mode 100644 index 000000000..ad9d0fb73 --- /dev/null +++ b/source/patterns/@aws-solutions-constructs/aws-sqs-pipes-stepfunctions/test/integ.sqspstp-logs-off.js.snapshot/sqspstplogsoffIntegDefaultTestDeployAssert25C29ACD.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-sqs-pipes-stepfunctions/test/integ.sqspstp-logs-off.js.snapshot/tree.json b/source/patterns/@aws-solutions-constructs/aws-sqs-pipes-stepfunctions/test/integ.sqspstp-logs-off.js.snapshot/tree.json new file mode 100644 index 000000000..cf89ae5c2 --- /dev/null +++ b/source/patterns/@aws-solutions-constructs/aws-sqs-pipes-stepfunctions/test/integ.sqspstp-logs-off.js.snapshot/tree.json @@ -0,0 +1,902 @@ +{ + "version": "tree-0.1", + "tree": { + "id": "App", + "path": "", + "children": { + "sqspstp-logs-off": { + "id": "sqspstp-logs-off", + "path": "sqspstp-logs-off", + "children": { + "lambdas3stp-test": { + "id": "lambdas3stp-test", + "path": "sqspstp-logs-off/lambdas3stp-test", + "children": { + "ServiceRole": { + "id": "ServiceRole", + "path": "sqspstp-logs-off/lambdas3stp-test/ServiceRole", + "children": { + "ImportServiceRole": { + "id": "ImportServiceRole", + "path": "sqspstp-logs-off/lambdas3stp-test/ServiceRole/ImportServiceRole", + "constructInfo": { + "fqn": "aws-cdk-lib.Resource", + "version": "2.161.0" + } + }, + "Resource": { + "id": "Resource", + "path": "sqspstp-logs-off/lambdas3stp-test/ServiceRole/Resource", + "attributes": { + "aws:cdk:cloudformation:type": "AWS::IAM::Role", + "aws:cdk:cloudformation:props": { + "assumeRolePolicyDocument": { + "Statement": [ + { + "Action": "sts:AssumeRole", + "Effect": "Allow", + "Principal": { + "Service": "lambda.amazonaws.com" + } + } + ], + "Version": "2012-10-17" + }, + "managedPolicyArns": [ + { + "Fn::Join": [ + "", + [ + "arn:", + { + "Ref": "AWS::Partition" + }, + ":iam::aws:policy/service-role/AWSLambdaBasicExecutionRole" + ] + ] + } + ] + } + }, + "constructInfo": { + "fqn": "aws-cdk-lib.aws_iam.CfnRole", + "version": "2.161.0" + } + } + }, + "constructInfo": { + "fqn": "aws-cdk-lib.aws_iam.Role", + "version": "2.161.0" + } + }, + "Resource": { + "id": "Resource", + "path": "sqspstp-logs-off/lambdas3stp-test/Resource", + "attributes": { + "aws:cdk:cloudformation:type": "AWS::Lambda::Function", + "aws:cdk:cloudformation:props": { + "code": { + "zipFile": "exports.handler = async (event) => console.log(event)" + }, + "handler": "index.handler", + "role": { + "Fn::GetAtt": [ + "lambdas3stptestServiceRoleF17BB6C7", + "Arn" + ] + }, + "runtime": "nodejs20.x" + } + }, + "constructInfo": { + "fqn": "aws-cdk-lib.aws_lambda.CfnFunction", + "version": "2.161.0" + } + } + }, + "constructInfo": { + "fqn": "aws-cdk-lib.aws_lambda.Function", + "version": "2.161.0" + } + }, + "tasks3stp-test": { + "id": "tasks3stp-test", + "path": "sqspstp-logs-off/tasks3stp-test", + "constructInfo": { + "fqn": "aws-cdk-lib.aws_stepfunctions_tasks.LambdaInvoke", + "version": "2.161.0" + } + }, + "test-sqs-pipes-states-construct": { + "id": "test-sqs-pipes-states-construct", + "path": "sqspstp-logs-off/test-sqs-pipes-states-construct", + "children": { + "queue-dlq": { + "id": "queue-dlq", + "path": "sqspstp-logs-off/test-sqs-pipes-states-construct/queue-dlq", + "children": { + "Resource": { + "id": "Resource", + "path": "sqspstp-logs-off/test-sqs-pipes-states-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.161.0" + } + }, + "Policy": { + "id": "Policy", + "path": "sqspstp-logs-off/test-sqs-pipes-states-construct/queue-dlq/Policy", + "children": { + "Resource": { + "id": "Resource", + "path": "sqspstp-logs-off/test-sqs-pipes-states-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": [ + "testsqspipesstatesconstructqueuedlq420A82FD", + "Arn" + ] + }, + "Sid": "QueueOwnerOnlyAccess" + }, + { + "Action": "SQS:*", + "Condition": { + "Bool": { + "aws:SecureTransport": "false" + } + }, + "Effect": "Deny", + "Principal": { + "AWS": "*" + }, + "Resource": { + "Fn::GetAtt": [ + "testsqspipesstatesconstructqueuedlq420A82FD", + "Arn" + ] + }, + "Sid": "HttpsOnly" + } + ], + "Version": "2012-10-17" + }, + "queues": [ + { + "Ref": "testsqspipesstatesconstructqueuedlq420A82FD" + } + ] + } + }, + "constructInfo": { + "fqn": "aws-cdk-lib.aws_sqs.CfnQueuePolicy", + "version": "2.161.0" + } + } + }, + "constructInfo": { + "fqn": "aws-cdk-lib.aws_sqs.QueuePolicy", + "version": "2.161.0" + } + } + }, + "constructInfo": { + "fqn": "aws-cdk-lib.aws_sqs.Queue", + "version": "2.161.0" + } + }, + "queue": { + "id": "queue", + "path": "sqspstp-logs-off/test-sqs-pipes-states-construct/queue", + "children": { + "Resource": { + "id": "Resource", + "path": "sqspstp-logs-off/test-sqs-pipes-states-construct/queue/Resource", + "attributes": { + "aws:cdk:cloudformation:type": "AWS::SQS::Queue", + "aws:cdk:cloudformation:props": { + "kmsMasterKeyId": "alias/aws/sqs", + "redrivePolicy": { + "deadLetterTargetArn": { + "Fn::GetAtt": [ + "testsqspipesstatesconstructqueuedlq420A82FD", + "Arn" + ] + }, + "maxReceiveCount": 15 + } + } + }, + "constructInfo": { + "fqn": "aws-cdk-lib.aws_sqs.CfnQueue", + "version": "2.161.0" + } + }, + "Policy": { + "id": "Policy", + "path": "sqspstp-logs-off/test-sqs-pipes-states-construct/queue/Policy", + "children": { + "Resource": { + "id": "Resource", + "path": "sqspstp-logs-off/test-sqs-pipes-states-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": [ + "testsqspipesstatesconstructqueueA7C76715", + "Arn" + ] + }, + "Sid": "QueueOwnerOnlyAccess" + }, + { + "Action": "SQS:*", + "Condition": { + "Bool": { + "aws:SecureTransport": "false" + } + }, + "Effect": "Deny", + "Principal": { + "AWS": "*" + }, + "Resource": { + "Fn::GetAtt": [ + "testsqspipesstatesconstructqueueA7C76715", + "Arn" + ] + }, + "Sid": "HttpsOnly" + } + ], + "Version": "2012-10-17" + }, + "queues": [ + { + "Ref": "testsqspipesstatesconstructqueueA7C76715" + } + ] + } + }, + "constructInfo": { + "fqn": "aws-cdk-lib.aws_sqs.CfnQueuePolicy", + "version": "2.161.0" + } + } + }, + "constructInfo": { + "fqn": "aws-cdk-lib.aws_sqs.QueuePolicy", + "version": "2.161.0" + } + } + }, + "constructInfo": { + "fqn": "aws-cdk-lib.aws_sqs.Queue", + "version": "2.161.0" + } + }, + "StateMachineLogGroup": { + "id": "StateMachineLogGroup", + "path": "sqspstp-logs-off/test-sqs-pipes-states-construct/StateMachineLogGroup", + "children": { + "Resource": { + "id": "Resource", + "path": "sqspstp-logs-off/test-sqs-pipes-states-construct/StateMachineLogGroup/Resource", + "attributes": { + "aws:cdk:cloudformation:type": "AWS::Logs::LogGroup", + "aws:cdk:cloudformation:props": { + "logGroupName": { + "Fn::Join": [ + "", + [ + "/aws/vendedlogs/states/constructs/sqspstp-logs-offtest-sqs-pipes-states-constructStateMachineLog-", + { + "Fn::Select": [ + 2, + { + "Fn::Split": [ + "/", + { + "Ref": "AWS::StackId" + } + ] + } + ] + } + ] + ] + } + } + }, + "constructInfo": { + "fqn": "aws-cdk-lib.aws_logs.CfnLogGroup", + "version": "2.161.0" + } + } + }, + "constructInfo": { + "fqn": "aws-cdk-lib.aws_logs.LogGroup", + "version": "2.161.0" + } + }, + "StateMachine": { + "id": "StateMachine", + "path": "sqspstp-logs-off/test-sqs-pipes-states-construct/StateMachine", + "children": { + "Role": { + "id": "Role", + "path": "sqspstp-logs-off/test-sqs-pipes-states-construct/StateMachine/Role", + "children": { + "ImportRole": { + "id": "ImportRole", + "path": "sqspstp-logs-off/test-sqs-pipes-states-construct/StateMachine/Role/ImportRole", + "constructInfo": { + "fqn": "aws-cdk-lib.Resource", + "version": "2.161.0" + } + }, + "Resource": { + "id": "Resource", + "path": "sqspstp-logs-off/test-sqs-pipes-states-construct/StateMachine/Role/Resource", + "attributes": { + "aws:cdk:cloudformation:type": "AWS::IAM::Role", + "aws:cdk:cloudformation:props": { + "assumeRolePolicyDocument": { + "Statement": [ + { + "Action": "sts:AssumeRole", + "Effect": "Allow", + "Principal": { + "Service": "states.amazonaws.com" + } + } + ], + "Version": "2012-10-17" + } + } + }, + "constructInfo": { + "fqn": "aws-cdk-lib.aws_iam.CfnRole", + "version": "2.161.0" + } + }, + "DefaultPolicy": { + "id": "DefaultPolicy", + "path": "sqspstp-logs-off/test-sqs-pipes-states-construct/StateMachine/Role/DefaultPolicy", + "children": { + "Resource": { + "id": "Resource", + "path": "sqspstp-logs-off/test-sqs-pipes-states-construct/StateMachine/Role/DefaultPolicy/Resource", + "attributes": { + "aws:cdk:cloudformation:type": "AWS::IAM::Policy", + "aws:cdk:cloudformation:props": { + "policyDocument": { + "Statement": [ + { + "Action": "lambda:InvokeFunction", + "Effect": "Allow", + "Resource": [ + { + "Fn::GetAtt": [ + "lambdas3stptest9FBDC6CE", + "Arn" + ] + }, + { + "Fn::Join": [ + "", + [ + { + "Fn::GetAtt": [ + "lambdas3stptest9FBDC6CE", + "Arn" + ] + }, + ":*" + ] + ] + } + ] + }, + { + "Action": [ + "logs:CreateLogDelivery", + "logs:DeleteLogDelivery", + "logs:DescribeLogGroups", + "logs:DescribeResourcePolicies", + "logs:GetLogDelivery", + "logs:ListLogDeliveries", + "logs:PutResourcePolicy", + "logs:UpdateLogDelivery" + ], + "Effect": "Allow", + "Resource": "*" + } + ], + "Version": "2012-10-17" + }, + "policyName": "testsqspipesstatesconstructStateMachineRoleDefaultPolicyD1BA2BF2", + "roles": [ + { + "Ref": "testsqspipesstatesconstructStateMachineRoleBF97BFC0" + } + ] + } + }, + "constructInfo": { + "fqn": "aws-cdk-lib.aws_iam.CfnPolicy", + "version": "2.161.0" + } + } + }, + "constructInfo": { + "fqn": "aws-cdk-lib.aws_iam.Policy", + "version": "2.161.0" + } + } + }, + "constructInfo": { + "fqn": "aws-cdk-lib.aws_iam.Role", + "version": "2.161.0" + } + }, + "Resource": { + "id": "Resource", + "path": "sqspstp-logs-off/test-sqs-pipes-states-construct/StateMachine/Resource", + "attributes": { + "aws:cdk:cloudformation:type": "AWS::StepFunctions::StateMachine", + "aws:cdk:cloudformation:props": { + "definitionString": { + "Fn::Join": [ + "", + [ + "{\"StartAt\":\"tasks3stp-test\",\"States\":{\"tasks3stp-test\":{\"End\":true,\"Retry\":[{\"ErrorEquals\":[\"Lambda.ClientExecutionTimeoutException\",\"Lambda.ServiceException\",\"Lambda.AWSLambdaException\",\"Lambda.SdkClientException\"],\"IntervalSeconds\":2,\"MaxAttempts\":6,\"BackoffRate\":2}],\"Type\":\"Task\",\"Resource\":\"arn:", + { + "Ref": "AWS::Partition" + }, + ":states:::lambda:invoke\",\"Parameters\":{\"FunctionName\":\"", + { + "Fn::GetAtt": [ + "lambdas3stptest9FBDC6CE", + "Arn" + ] + }, + "\",\"Payload.$\":\"$\"}}}}" + ] + ] + }, + "loggingConfiguration": { + "destinations": [ + { + "cloudWatchLogsLogGroup": { + "logGroupArn": { + "Fn::GetAtt": [ + "testsqspipesstatesconstructStateMachineLogGroupADE94F1D", + "Arn" + ] + } + } + } + ], + "level": "ERROR" + }, + "roleArn": { + "Fn::GetAtt": [ + "testsqspipesstatesconstructStateMachineRoleBF97BFC0", + "Arn" + ] + } + } + }, + "constructInfo": { + "fqn": "aws-cdk-lib.aws_stepfunctions.CfnStateMachine", + "version": "2.161.0" + } + } + }, + "constructInfo": { + "fqn": "aws-cdk-lib.aws_stepfunctions.StateMachine", + "version": "2.161.0" + } + }, + "ExecutionFailedAlarm": { + "id": "ExecutionFailedAlarm", + "path": "sqspstp-logs-off/test-sqs-pipes-states-construct/ExecutionFailedAlarm", + "children": { + "Resource": { + "id": "Resource", + "path": "sqspstp-logs-off/test-sqs-pipes-states-construct/ExecutionFailedAlarm/Resource", + "attributes": { + "aws:cdk:cloudformation:type": "AWS::CloudWatch::Alarm", + "aws:cdk:cloudformation:props": { + "alarmDescription": "Alarm for the number of executions that failed exceeded the threshold of 1. ", + "comparisonOperator": "GreaterThanOrEqualToThreshold", + "dimensions": [ + { + "name": "StateMachineArn", + "value": { + "Ref": "testsqspipesstatesconstructStateMachine29272AA9" + } + } + ], + "evaluationPeriods": 1, + "metricName": "ExecutionsFailed", + "namespace": "AWS/States", + "period": 300, + "statistic": "Sum", + "threshold": 1 + } + }, + "constructInfo": { + "fqn": "aws-cdk-lib.aws_cloudwatch.CfnAlarm", + "version": "2.161.0" + } + } + }, + "constructInfo": { + "fqn": "aws-cdk-lib.aws_cloudwatch.Alarm", + "version": "2.161.0" + } + }, + "ExecutionThrottledAlarm": { + "id": "ExecutionThrottledAlarm", + "path": "sqspstp-logs-off/test-sqs-pipes-states-construct/ExecutionThrottledAlarm", + "children": { + "Resource": { + "id": "Resource", + "path": "sqspstp-logs-off/test-sqs-pipes-states-construct/ExecutionThrottledAlarm/Resource", + "attributes": { + "aws:cdk:cloudformation:type": "AWS::CloudWatch::Alarm", + "aws:cdk:cloudformation:props": { + "alarmDescription": "Alarm for the number of executions that throttled exceeded the threshold of 1. ", + "comparisonOperator": "GreaterThanOrEqualToThreshold", + "dimensions": [ + { + "name": "StateMachineArn", + "value": { + "Ref": "testsqspipesstatesconstructStateMachine29272AA9" + } + } + ], + "evaluationPeriods": 1, + "metricName": "ExecutionThrottled", + "namespace": "AWS/States", + "period": 300, + "statistic": "Sum", + "threshold": 1 + } + }, + "constructInfo": { + "fqn": "aws-cdk-lib.aws_cloudwatch.CfnAlarm", + "version": "2.161.0" + } + } + }, + "constructInfo": { + "fqn": "aws-cdk-lib.aws_cloudwatch.Alarm", + "version": "2.161.0" + } + }, + "ExecutionAbortedAlarm": { + "id": "ExecutionAbortedAlarm", + "path": "sqspstp-logs-off/test-sqs-pipes-states-construct/ExecutionAbortedAlarm", + "children": { + "Resource": { + "id": "Resource", + "path": "sqspstp-logs-off/test-sqs-pipes-states-construct/ExecutionAbortedAlarm/Resource", + "attributes": { + "aws:cdk:cloudformation:type": "AWS::CloudWatch::Alarm", + "aws:cdk:cloudformation:props": { + "alarmDescription": "Alarm for the number of executions that aborted exceeded the threshold of 1. ", + "comparisonOperator": "GreaterThanOrEqualToThreshold", + "dimensions": [ + { + "name": "StateMachineArn", + "value": { + "Ref": "testsqspipesstatesconstructStateMachine29272AA9" + } + } + ], + "evaluationPeriods": 1, + "metricName": "ExecutionsAborted", + "namespace": "AWS/States", + "period": 300, + "statistic": "Maximum", + "threshold": 1 + } + }, + "constructInfo": { + "fqn": "aws-cdk-lib.aws_cloudwatch.CfnAlarm", + "version": "2.161.0" + } + } + }, + "constructInfo": { + "fqn": "aws-cdk-lib.aws_cloudwatch.Alarm", + "version": "2.161.0" + } + }, + "PipeRole--test-sqs-pipes-states-construct": { + "id": "PipeRole--test-sqs-pipes-states-construct", + "path": "sqspstp-logs-off/test-sqs-pipes-states-construct/PipeRole--test-sqs-pipes-states-construct", + "children": { + "ImportPipeRole--test-sqs-pipes-states-construct": { + "id": "ImportPipeRole--test-sqs-pipes-states-construct", + "path": "sqspstp-logs-off/test-sqs-pipes-states-construct/PipeRole--test-sqs-pipes-states-construct/ImportPipeRole--test-sqs-pipes-states-construct", + "constructInfo": { + "fqn": "aws-cdk-lib.Resource", + "version": "2.161.0" + } + }, + "Resource": { + "id": "Resource", + "path": "sqspstp-logs-off/test-sqs-pipes-states-construct/PipeRole--test-sqs-pipes-states-construct/Resource", + "attributes": { + "aws:cdk:cloudformation:type": "AWS::IAM::Role", + "aws:cdk:cloudformation:props": { + "assumeRolePolicyDocument": { + "Statement": [ + { + "Action": "sts:AssumeRole", + "Effect": "Allow", + "Principal": { + "Service": "pipes.amazonaws.com" + } + } + ], + "Version": "2012-10-17" + }, + "policies": [ + { + "policyName": "sourcePolicy", + "policyDocument": { + "Statement": [ + { + "Action": [ + "sqs:DeleteMessage", + "sqs:GetQueueAttributes", + "sqs:ReceiveMessage" + ], + "Effect": "Allow", + "Resource": { + "Fn::GetAtt": [ + "testsqspipesstatesconstructqueueA7C76715", + "Arn" + ] + } + } + ], + "Version": "2012-10-17" + } + }, + { + "policyName": "targetPolicy", + "policyDocument": { + "Statement": [ + { + "Action": "states:StartExecution", + "Effect": "Allow", + "Resource": { + "Ref": "testsqspipesstatesconstructStateMachine29272AA9" + } + } + ], + "Version": "2012-10-17" + } + } + ] + } + }, + "constructInfo": { + "fqn": "aws-cdk-lib.aws_iam.CfnRole", + "version": "2.161.0" + } + } + }, + "constructInfo": { + "fqn": "aws-cdk-lib.aws_iam.Role", + "version": "2.161.0" + } + }, + "pipe-test-sqs-pipes-states-construct": { + "id": "pipe-test-sqs-pipes-states-construct", + "path": "sqspstp-logs-off/test-sqs-pipes-states-construct/pipe-test-sqs-pipes-states-construct", + "attributes": { + "aws:cdk:cloudformation:type": "AWS::Pipes::Pipe", + "aws:cdk:cloudformation:props": { + "roleArn": { + "Fn::GetAtt": [ + "testsqspipesstatesconstructPipeRoletestsqspipesstatesconstruct2CC9A13C", + "Arn" + ] + }, + "source": { + "Fn::GetAtt": [ + "testsqspipesstatesconstructqueueA7C76715", + "Arn" + ] + }, + "sourceParameters": {}, + "target": { + "Ref": "testsqspipesstatesconstructStateMachine29272AA9" + }, + "targetParameters": { + "stepFunctionStateMachineParameters": { + "invocationType": "FIRE_AND_FORGET" + } + } + } + }, + "constructInfo": { + "fqn": "aws-cdk-lib.aws_pipes.CfnPipe", + "version": "2.161.0" + } + } + }, + "constructInfo": { + "fqn": "@aws-solutions-constructs/aws-sqs-pipes-stepfunctions.SqsToPipesToStepfunctions", + "version": "2.72.0" + } + }, + "Integ": { + "id": "Integ", + "path": "sqspstp-logs-off/Integ", + "children": { + "DefaultTest": { + "id": "DefaultTest", + "path": "sqspstp-logs-off/Integ/DefaultTest", + "children": { + "Default": { + "id": "Default", + "path": "sqspstp-logs-off/Integ/DefaultTest/Default", + "constructInfo": { + "fqn": "constructs.Construct", + "version": "10.4.2" + } + }, + "DeployAssert": { + "id": "DeployAssert", + "path": "sqspstp-logs-off/Integ/DefaultTest/DeployAssert", + "children": { + "BootstrapVersion": { + "id": "BootstrapVersion", + "path": "sqspstp-logs-off/Integ/DefaultTest/DeployAssert/BootstrapVersion", + "constructInfo": { + "fqn": "aws-cdk-lib.CfnParameter", + "version": "2.161.0" + } + }, + "CheckBootstrapVersion": { + "id": "CheckBootstrapVersion", + "path": "sqspstp-logs-off/Integ/DefaultTest/DeployAssert/CheckBootstrapVersion", + "constructInfo": { + "fqn": "aws-cdk-lib.CfnRule", + "version": "2.161.0" + } + } + }, + "constructInfo": { + "fqn": "aws-cdk-lib.Stack", + "version": "2.161.0" + } + } + }, + "constructInfo": { + "fqn": "@aws-cdk/integ-tests-alpha.IntegTestCase", + "version": "2.161.0-alpha.0" + } + } + }, + "constructInfo": { + "fqn": "@aws-cdk/integ-tests-alpha.IntegTest", + "version": "2.161.0-alpha.0" + } + }, + "BootstrapVersion": { + "id": "BootstrapVersion", + "path": "sqspstp-logs-off/BootstrapVersion", + "constructInfo": { + "fqn": "aws-cdk-lib.CfnParameter", + "version": "2.161.0" + } + }, + "CheckBootstrapVersion": { + "id": "CheckBootstrapVersion", + "path": "sqspstp-logs-off/CheckBootstrapVersion", + "constructInfo": { + "fqn": "aws-cdk-lib.CfnRule", + "version": "2.161.0" + } + } + }, + "constructInfo": { + "fqn": "aws-cdk-lib.Stack", + "version": "2.161.0" + } + }, + "Tree": { + "id": "Tree", + "path": "Tree", + "constructInfo": { + "fqn": "constructs.Construct", + "version": "10.4.2" + } + } + }, + "constructInfo": { + "fqn": "aws-cdk-lib.App", + "version": "2.161.0" + } + } +} \ No newline at end of file diff --git a/source/patterns/@aws-solutions-constructs/aws-sqs-pipes-stepfunctions/test/integ.sqspstp-logs-off.ts b/source/patterns/@aws-solutions-constructs/aws-sqs-pipes-stepfunctions/test/integ.sqspstp-logs-off.ts new file mode 100644 index 000000000..696796857 --- /dev/null +++ b/source/patterns/@aws-solutions-constructs/aws-sqs-pipes-stepfunctions/test/integ.sqspstp-logs-off.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. + */ + +/// !cdk-integ * +import { App, Stack } from "aws-cdk-lib"; +import { SqsToPipesToStepfunctions, SqsToPipesToStepfunctionsProps } from "../lib"; +import { generateIntegStackName } from '@aws-solutions-constructs/core'; +import { IntegTest } from '@aws-cdk/integ-tests-alpha'; +import * as defaults from '@aws-solutions-constructs/core'; + +const app = new App(); +const stack = new Stack(app, generateIntegStackName(__filename)); + +const props: SqsToPipesToStepfunctionsProps = { + stateMachineProps: { + definitionBody: defaults.CreateTestStateMachineDefinitionBody(stack, 's3stp-test') + }, + logLevel: defaults.PipesLogLevel.OFF +}; + +new SqsToPipesToStepfunctions(stack, 'test-sqs-pipes-states-construct', props); + +new IntegTest(stack, 'Integ', { testCases: [ + stack +] }); diff --git a/source/patterns/@aws-solutions-constructs/aws-sqs-pipes-stepfunctions/test/integ.sqspstp-no-arguments.js.snapshot/cdk.out b/source/patterns/@aws-solutions-constructs/aws-sqs-pipes-stepfunctions/test/integ.sqspstp-no-arguments.js.snapshot/cdk.out new file mode 100644 index 000000000..c6e612584 --- /dev/null +++ b/source/patterns/@aws-solutions-constructs/aws-sqs-pipes-stepfunctions/test/integ.sqspstp-no-arguments.js.snapshot/cdk.out @@ -0,0 +1 @@ +{"version":"38.0.1"} \ No newline at end of file diff --git a/source/patterns/@aws-solutions-constructs/aws-sqs-pipes-stepfunctions/test/integ.sqspstp-no-arguments.js.snapshot/integ.json b/source/patterns/@aws-solutions-constructs/aws-sqs-pipes-stepfunctions/test/integ.sqspstp-no-arguments.js.snapshot/integ.json new file mode 100644 index 000000000..3a9622c9e --- /dev/null +++ b/source/patterns/@aws-solutions-constructs/aws-sqs-pipes-stepfunctions/test/integ.sqspstp-no-arguments.js.snapshot/integ.json @@ -0,0 +1,12 @@ +{ + "version": "38.0.1", + "testCases": { + "sqspstp-no-arguments/Integ/DefaultTest": { + "stacks": [ + "sqspstp-no-arguments" + ], + "assertionStack": "sqspstp-no-arguments/Integ/DefaultTest/DeployAssert", + "assertionStackName": "sqspstpnoargumentsIntegDefaultTestDeployAssert83953622" + } + } +} \ No newline at end of file diff --git a/source/patterns/@aws-solutions-constructs/aws-sqs-pipes-stepfunctions/test/integ.sqspstp-no-arguments.js.snapshot/manifest.json b/source/patterns/@aws-solutions-constructs/aws-sqs-pipes-stepfunctions/test/integ.sqspstp-no-arguments.js.snapshot/manifest.json new file mode 100644 index 000000000..856a9a94c --- /dev/null +++ b/source/patterns/@aws-solutions-constructs/aws-sqs-pipes-stepfunctions/test/integ.sqspstp-no-arguments.js.snapshot/manifest.json @@ -0,0 +1,205 @@ +{ + "version": "38.0.1", + "artifacts": { + "sqspstpnoargumentsIntegDefaultTestDeployAssert83953622.assets": { + "type": "cdk:asset-manifest", + "properties": { + "file": "sqspstpnoargumentsIntegDefaultTestDeployAssert83953622.assets.json", + "requiresBootstrapStackVersion": 6, + "bootstrapStackVersionSsmParameter": "/cdk-bootstrap/hnb659fds/version" + } + }, + "sqspstpnoargumentsIntegDefaultTestDeployAssert83953622": { + "type": "aws:cloudformation:stack", + "environment": "aws://unknown-account/unknown-region", + "properties": { + "templateFile": "sqspstpnoargumentsIntegDefaultTestDeployAssert83953622.template.json", + "terminationProtection": false, + "validateOnSynth": false, + "notificationArns": [], + "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": [ + "sqspstpnoargumentsIntegDefaultTestDeployAssert83953622.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": [ + "sqspstpnoargumentsIntegDefaultTestDeployAssert83953622.assets" + ], + "metadata": { + "/sqspstp-no-arguments/Integ/DefaultTest/DeployAssert/BootstrapVersion": [ + { + "type": "aws:cdk:logicalId", + "data": "BootstrapVersion" + } + ], + "/sqspstp-no-arguments/Integ/DefaultTest/DeployAssert/CheckBootstrapVersion": [ + { + "type": "aws:cdk:logicalId", + "data": "CheckBootstrapVersion" + } + ] + }, + "displayName": "sqspstp-no-arguments/Integ/DefaultTest/DeployAssert" + }, + "sqspstp-no-arguments.assets": { + "type": "cdk:asset-manifest", + "properties": { + "file": "sqspstp-no-arguments.assets.json", + "requiresBootstrapStackVersion": 6, + "bootstrapStackVersionSsmParameter": "/cdk-bootstrap/hnb659fds/version" + } + }, + "sqspstp-no-arguments": { + "type": "aws:cloudformation:stack", + "environment": "aws://unknown-account/unknown-region", + "properties": { + "templateFile": "sqspstp-no-arguments.template.json", + "terminationProtection": false, + "validateOnSynth": false, + "notificationArns": [], + "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}/20815c0b1c24ed41b6c31ad1fb21b7cc5502c5f051ec5a21657d78b5bfd7efbd.json", + "requiresBootstrapStackVersion": 6, + "bootstrapStackVersionSsmParameter": "/cdk-bootstrap/hnb659fds/version", + "additionalDependencies": [ + "sqspstp-no-arguments.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": [ + "sqspstp-no-arguments.assets" + ], + "metadata": { + "/sqspstp-no-arguments/lambdas3stp-test/ServiceRole/Resource": [ + { + "type": "aws:cdk:logicalId", + "data": "lambdas3stptestServiceRoleF17BB6C7" + } + ], + "/sqspstp-no-arguments/lambdas3stp-test/Resource": [ + { + "type": "aws:cdk:logicalId", + "data": "lambdas3stptest9FBDC6CE" + } + ], + "/sqspstp-no-arguments/test-sqs-pipes-states-construct/queue-dlq/Resource": [ + { + "type": "aws:cdk:logicalId", + "data": "testsqspipesstatesconstructqueuedlq420A82FD" + } + ], + "/sqspstp-no-arguments/test-sqs-pipes-states-construct/queue-dlq/Policy/Resource": [ + { + "type": "aws:cdk:logicalId", + "data": "testsqspipesstatesconstructqueuedlqPolicyB1D70483" + } + ], + "/sqspstp-no-arguments/test-sqs-pipes-states-construct/queue/Resource": [ + { + "type": "aws:cdk:logicalId", + "data": "testsqspipesstatesconstructqueueA7C76715" + } + ], + "/sqspstp-no-arguments/test-sqs-pipes-states-construct/queue/Policy/Resource": [ + { + "type": "aws:cdk:logicalId", + "data": "testsqspipesstatesconstructqueuePolicyFD32B562" + } + ], + "/sqspstp-no-arguments/test-sqs-pipes-states-construct/StateMachineLogGroup/Resource": [ + { + "type": "aws:cdk:logicalId", + "data": "testsqspipesstatesconstructStateMachineLogGroupADE94F1D" + } + ], + "/sqspstp-no-arguments/test-sqs-pipes-states-construct/StateMachine/Role/Resource": [ + { + "type": "aws:cdk:logicalId", + "data": "testsqspipesstatesconstructStateMachineRoleBF97BFC0" + } + ], + "/sqspstp-no-arguments/test-sqs-pipes-states-construct/StateMachine/Role/DefaultPolicy/Resource": [ + { + "type": "aws:cdk:logicalId", + "data": "testsqspipesstatesconstructStateMachineRoleDefaultPolicyD1BA2BF2" + } + ], + "/sqspstp-no-arguments/test-sqs-pipes-states-construct/StateMachine/Resource": [ + { + "type": "aws:cdk:logicalId", + "data": "testsqspipesstatesconstructStateMachine29272AA9" + } + ], + "/sqspstp-no-arguments/test-sqs-pipes-states-construct/ExecutionFailedAlarm/Resource": [ + { + "type": "aws:cdk:logicalId", + "data": "testsqspipesstatesconstructExecutionFailedAlarm1002FF55" + } + ], + "/sqspstp-no-arguments/test-sqs-pipes-states-construct/ExecutionThrottledAlarm/Resource": [ + { + "type": "aws:cdk:logicalId", + "data": "testsqspipesstatesconstructExecutionThrottledAlarm0242B01A" + } + ], + "/sqspstp-no-arguments/test-sqs-pipes-states-construct/ExecutionAbortedAlarm/Resource": [ + { + "type": "aws:cdk:logicalId", + "data": "testsqspipesstatesconstructExecutionAbortedAlarm14349A7B" + } + ], + "/sqspstp-no-arguments/test-sqs-pipes-states-construct/PipeRole--test-sqs-pipes-states-construct/Resource": [ + { + "type": "aws:cdk:logicalId", + "data": "testsqspipesstatesconstructPipeRoletestsqspipesstatesconstruct2CC9A13C" + } + ], + "/sqspstp-no-arguments/test-sqs-pipes-states-construct/LogGroup-test-sqs-pipes-states-construct/Resource": [ + { + "type": "aws:cdk:logicalId", + "data": "testsqspipesstatesconstructLogGrouptestsqspipesstatesconstructF827FE15" + } + ], + "/sqspstp-no-arguments/test-sqs-pipes-states-construct/pipe-test-sqs-pipes-states-construct": [ + { + "type": "aws:cdk:logicalId", + "data": "testsqspipesstatesconstructpipetestsqspipesstatesconstruct71A64A15" + } + ], + "/sqspstp-no-arguments/BootstrapVersion": [ + { + "type": "aws:cdk:logicalId", + "data": "BootstrapVersion" + } + ], + "/sqspstp-no-arguments/CheckBootstrapVersion": [ + { + "type": "aws:cdk:logicalId", + "data": "CheckBootstrapVersion" + } + ] + }, + "displayName": "sqspstp-no-arguments" + }, + "Tree": { + "type": "cdk:tree", + "properties": { + "file": "tree.json" + } + } + } +} \ No newline at end of file diff --git a/source/patterns/@aws-solutions-constructs/aws-sqs-pipes-stepfunctions/test/integ.sqspstp-no-arguments.js.snapshot/sqspstp-no-arguments.assets.json b/source/patterns/@aws-solutions-constructs/aws-sqs-pipes-stepfunctions/test/integ.sqspstp-no-arguments.js.snapshot/sqspstp-no-arguments.assets.json new file mode 100644 index 000000000..9e5153e92 --- /dev/null +++ b/source/patterns/@aws-solutions-constructs/aws-sqs-pipes-stepfunctions/test/integ.sqspstp-no-arguments.js.snapshot/sqspstp-no-arguments.assets.json @@ -0,0 +1,19 @@ +{ + "version": "38.0.1", + "files": { + "20815c0b1c24ed41b6c31ad1fb21b7cc5502c5f051ec5a21657d78b5bfd7efbd": { + "source": { + "path": "sqspstp-no-arguments.template.json", + "packaging": "file" + }, + "destinations": { + "current_account-current_region": { + "bucketName": "cdk-hnb659fds-assets-${AWS::AccountId}-${AWS::Region}", + "objectKey": "20815c0b1c24ed41b6c31ad1fb21b7cc5502c5f051ec5a21657d78b5bfd7efbd.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-sqs-pipes-stepfunctions/test/integ.sqspstp-no-arguments.js.snapshot/sqspstp-no-arguments.template.json b/source/patterns/@aws-solutions-constructs/aws-sqs-pipes-stepfunctions/test/integ.sqspstp-no-arguments.js.snapshot/sqspstp-no-arguments.template.json new file mode 100644 index 000000000..4d703dac8 --- /dev/null +++ b/source/patterns/@aws-solutions-constructs/aws-sqs-pipes-stepfunctions/test/integ.sqspstp-no-arguments.js.snapshot/sqspstp-no-arguments.template.json @@ -0,0 +1,654 @@ +{ + "Resources": { + "lambdas3stptestServiceRoleF17BB6C7": { + "Type": "AWS::IAM::Role", + "Properties": { + "AssumeRolePolicyDocument": { + "Statement": [ + { + "Action": "sts:AssumeRole", + "Effect": "Allow", + "Principal": { + "Service": "lambda.amazonaws.com" + } + } + ], + "Version": "2012-10-17" + }, + "ManagedPolicyArns": [ + { + "Fn::Join": [ + "", + [ + "arn:", + { + "Ref": "AWS::Partition" + }, + ":iam::aws:policy/service-role/AWSLambdaBasicExecutionRole" + ] + ] + } + ] + } + }, + "lambdas3stptest9FBDC6CE": { + "Type": "AWS::Lambda::Function", + "Properties": { + "Code": { + "ZipFile": "exports.handler = async (event) => console.log(event)" + }, + "Handler": "index.handler", + "Role": { + "Fn::GetAtt": [ + "lambdas3stptestServiceRoleF17BB6C7", + "Arn" + ] + }, + "Runtime": "nodejs20.x" + }, + "DependsOn": [ + "lambdas3stptestServiceRoleF17BB6C7" + ], + "Metadata": { + "cfn_nag": { + "rules_to_suppress": [ + { + "id": "W58", + "reason": "This Lambda Function is created for integration testing purposes only and is not part of an actual construct" + }, + { + "id": "W89", + "reason": "This Lambda Function is created for integration testing purposes only and is not part of an actual construct" + }, + { + "id": "W92", + "reason": "This Lambda Function is created for integration testing purposes only and is not part of an actual construct" + } + ] + } + } + }, + "testsqspipesstatesconstructqueuedlq420A82FD": { + "Type": "AWS::SQS::Queue", + "Properties": { + "KmsMasterKeyId": "alias/aws/sqs" + }, + "UpdateReplacePolicy": "Delete", + "DeletionPolicy": "Delete" + }, + "testsqspipesstatesconstructqueuedlqPolicyB1D70483": { + "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": [ + "testsqspipesstatesconstructqueuedlq420A82FD", + "Arn" + ] + }, + "Sid": "QueueOwnerOnlyAccess" + }, + { + "Action": "SQS:*", + "Condition": { + "Bool": { + "aws:SecureTransport": "false" + } + }, + "Effect": "Deny", + "Principal": { + "AWS": "*" + }, + "Resource": { + "Fn::GetAtt": [ + "testsqspipesstatesconstructqueuedlq420A82FD", + "Arn" + ] + }, + "Sid": "HttpsOnly" + } + ], + "Version": "2012-10-17" + }, + "Queues": [ + { + "Ref": "testsqspipesstatesconstructqueuedlq420A82FD" + } + ] + } + }, + "testsqspipesstatesconstructqueueA7C76715": { + "Type": "AWS::SQS::Queue", + "Properties": { + "KmsMasterKeyId": "alias/aws/sqs", + "RedrivePolicy": { + "deadLetterTargetArn": { + "Fn::GetAtt": [ + "testsqspipesstatesconstructqueuedlq420A82FD", + "Arn" + ] + }, + "maxReceiveCount": 15 + } + }, + "UpdateReplacePolicy": "Delete", + "DeletionPolicy": "Delete" + }, + "testsqspipesstatesconstructqueuePolicyFD32B562": { + "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": [ + "testsqspipesstatesconstructqueueA7C76715", + "Arn" + ] + }, + "Sid": "QueueOwnerOnlyAccess" + }, + { + "Action": "SQS:*", + "Condition": { + "Bool": { + "aws:SecureTransport": "false" + } + }, + "Effect": "Deny", + "Principal": { + "AWS": "*" + }, + "Resource": { + "Fn::GetAtt": [ + "testsqspipesstatesconstructqueueA7C76715", + "Arn" + ] + }, + "Sid": "HttpsOnly" + } + ], + "Version": "2012-10-17" + }, + "Queues": [ + { + "Ref": "testsqspipesstatesconstructqueueA7C76715" + } + ] + } + }, + "testsqspipesstatesconstructStateMachineLogGroupADE94F1D": { + "Type": "AWS::Logs::LogGroup", + "Properties": { + "LogGroupName": { + "Fn::Join": [ + "", + [ + "/aws/vendedlogs/states/constructs/sqspstp-no-argumentstest-sqs-pipes-states-constructStateMachineLog-", + { + "Fn::Select": [ + 2, + { + "Fn::Split": [ + "/", + { + "Ref": "AWS::StackId" + } + ] + } + ] + } + ] + ] + } + }, + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Retain", + "Metadata": { + "cfn_nag": { + "rules_to_suppress": [ + { + "id": "W86", + "reason": "Retention period for CloudWatchLogs LogGroups are set to 'Never Expire' to preserve customer data indefinitely" + }, + { + "id": "W84", + "reason": "By default CloudWatchLogs LogGroups data is encrypted using the CloudWatch server-side encryption keys (AWS Managed Keys)" + } + ] + } + } + }, + "testsqspipesstatesconstructStateMachineRoleBF97BFC0": { + "Type": "AWS::IAM::Role", + "Properties": { + "AssumeRolePolicyDocument": { + "Statement": [ + { + "Action": "sts:AssumeRole", + "Effect": "Allow", + "Principal": { + "Service": "states.amazonaws.com" + } + } + ], + "Version": "2012-10-17" + } + } + }, + "testsqspipesstatesconstructStateMachineRoleDefaultPolicyD1BA2BF2": { + "Type": "AWS::IAM::Policy", + "Properties": { + "PolicyDocument": { + "Statement": [ + { + "Action": "lambda:InvokeFunction", + "Effect": "Allow", + "Resource": [ + { + "Fn::GetAtt": [ + "lambdas3stptest9FBDC6CE", + "Arn" + ] + }, + { + "Fn::Join": [ + "", + [ + { + "Fn::GetAtt": [ + "lambdas3stptest9FBDC6CE", + "Arn" + ] + }, + ":*" + ] + ] + } + ] + }, + { + "Action": [ + "logs:CreateLogDelivery", + "logs:DeleteLogDelivery", + "logs:DescribeLogGroups", + "logs:DescribeResourcePolicies", + "logs:GetLogDelivery", + "logs:ListLogDeliveries", + "logs:PutResourcePolicy", + "logs:UpdateLogDelivery" + ], + "Effect": "Allow", + "Resource": "*" + } + ], + "Version": "2012-10-17" + }, + "PolicyName": "testsqspipesstatesconstructStateMachineRoleDefaultPolicyD1BA2BF2", + "Roles": [ + { + "Ref": "testsqspipesstatesconstructStateMachineRoleBF97BFC0" + } + ] + }, + "Metadata": { + "cfn_nag": { + "rules_to_suppress": [ + { + "id": "W12", + "reason": "These are CDK defaults. The 'LogDelivery' actions do not support resource-level authorizations. Any logging is done by State Machine code" + } + ] + } + } + }, + "testsqspipesstatesconstructStateMachine29272AA9": { + "Type": "AWS::StepFunctions::StateMachine", + "Properties": { + "DefinitionString": { + "Fn::Join": [ + "", + [ + "{\"StartAt\":\"tasks3stp-test\",\"States\":{\"tasks3stp-test\":{\"End\":true,\"Retry\":[{\"ErrorEquals\":[\"Lambda.ClientExecutionTimeoutException\",\"Lambda.ServiceException\",\"Lambda.AWSLambdaException\",\"Lambda.SdkClientException\"],\"IntervalSeconds\":2,\"MaxAttempts\":6,\"BackoffRate\":2}],\"Type\":\"Task\",\"Resource\":\"arn:", + { + "Ref": "AWS::Partition" + }, + ":states:::lambda:invoke\",\"Parameters\":{\"FunctionName\":\"", + { + "Fn::GetAtt": [ + "lambdas3stptest9FBDC6CE", + "Arn" + ] + }, + "\",\"Payload.$\":\"$\"}}}}" + ] + ] + }, + "LoggingConfiguration": { + "Destinations": [ + { + "CloudWatchLogsLogGroup": { + "LogGroupArn": { + "Fn::GetAtt": [ + "testsqspipesstatesconstructStateMachineLogGroupADE94F1D", + "Arn" + ] + } + } + } + ], + "Level": "ERROR" + }, + "RoleArn": { + "Fn::GetAtt": [ + "testsqspipesstatesconstructStateMachineRoleBF97BFC0", + "Arn" + ] + } + }, + "DependsOn": [ + "testsqspipesstatesconstructStateMachineRoleDefaultPolicyD1BA2BF2", + "testsqspipesstatesconstructStateMachineRoleBF97BFC0" + ], + "UpdateReplacePolicy": "Delete", + "DeletionPolicy": "Delete" + }, + "testsqspipesstatesconstructExecutionFailedAlarm1002FF55": { + "Type": "AWS::CloudWatch::Alarm", + "Properties": { + "AlarmDescription": "Alarm for the number of executions that failed exceeded the threshold of 1. ", + "ComparisonOperator": "GreaterThanOrEqualToThreshold", + "Dimensions": [ + { + "Name": "StateMachineArn", + "Value": { + "Ref": "testsqspipesstatesconstructStateMachine29272AA9" + } + } + ], + "EvaluationPeriods": 1, + "MetricName": "ExecutionsFailed", + "Namespace": "AWS/States", + "Period": 300, + "Statistic": "Sum", + "Threshold": 1 + } + }, + "testsqspipesstatesconstructExecutionThrottledAlarm0242B01A": { + "Type": "AWS::CloudWatch::Alarm", + "Properties": { + "AlarmDescription": "Alarm for the number of executions that throttled exceeded the threshold of 1. ", + "ComparisonOperator": "GreaterThanOrEqualToThreshold", + "Dimensions": [ + { + "Name": "StateMachineArn", + "Value": { + "Ref": "testsqspipesstatesconstructStateMachine29272AA9" + } + } + ], + "EvaluationPeriods": 1, + "MetricName": "ExecutionThrottled", + "Namespace": "AWS/States", + "Period": 300, + "Statistic": "Sum", + "Threshold": 1 + } + }, + "testsqspipesstatesconstructExecutionAbortedAlarm14349A7B": { + "Type": "AWS::CloudWatch::Alarm", + "Properties": { + "AlarmDescription": "Alarm for the number of executions that aborted exceeded the threshold of 1. ", + "ComparisonOperator": "GreaterThanOrEqualToThreshold", + "Dimensions": [ + { + "Name": "StateMachineArn", + "Value": { + "Ref": "testsqspipesstatesconstructStateMachine29272AA9" + } + } + ], + "EvaluationPeriods": 1, + "MetricName": "ExecutionsAborted", + "Namespace": "AWS/States", + "Period": 300, + "Statistic": "Maximum", + "Threshold": 1 + } + }, + "testsqspipesstatesconstructPipeRoletestsqspipesstatesconstruct2CC9A13C": { + "Type": "AWS::IAM::Role", + "Properties": { + "AssumeRolePolicyDocument": { + "Statement": [ + { + "Action": "sts:AssumeRole", + "Effect": "Allow", + "Principal": { + "Service": "pipes.amazonaws.com" + } + } + ], + "Version": "2012-10-17" + }, + "Policies": [ + { + "PolicyDocument": { + "Statement": [ + { + "Action": [ + "sqs:DeleteMessage", + "sqs:GetQueueAttributes", + "sqs:ReceiveMessage" + ], + "Effect": "Allow", + "Resource": { + "Fn::GetAtt": [ + "testsqspipesstatesconstructqueueA7C76715", + "Arn" + ] + } + } + ], + "Version": "2012-10-17" + }, + "PolicyName": "sourcePolicy" + }, + { + "PolicyDocument": { + "Statement": [ + { + "Action": "states:StartExecution", + "Effect": "Allow", + "Resource": { + "Ref": "testsqspipesstatesconstructStateMachine29272AA9" + } + } + ], + "Version": "2012-10-17" + }, + "PolicyName": "targetPolicy" + } + ] + }, + "Metadata": { + "guard": { + "SuppressedRules": [ + "IAM_NO_INLINE_POLICY_CHECK" + ] + } + } + }, + "testsqspipesstatesconstructLogGrouptestsqspipesstatesconstructF827FE15": { + "Type": "AWS::Logs::LogGroup", + "Properties": { + "LogGroupName": { + "Fn::Join": [ + "", + [ + "/aws/vendedlogs/pipes/constructs/sqspstp-no-argumentstest-sqs-pipes-states-constructPipesLog-", + { + "Fn::Select": [ + 2, + { + "Fn::Split": [ + "/", + { + "Ref": "AWS::StackId" + } + ] + } + ] + } + ] + ] + } + }, + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Retain", + "Metadata": { + "cfn_nag": { + "rules_to_suppress": [ + { + "id": "W86", + "reason": "Retention period for CloudWatchLogs LogGroups are set to 'Never Expire' to preserve customer data indefinitely" + }, + { + "id": "W84", + "reason": "By default CloudWatchLogs LogGroups data is encrypted using the CloudWatch server-side encryption keys (AWS Managed Keys)" + } + ] + } + } + }, + "testsqspipesstatesconstructpipetestsqspipesstatesconstruct71A64A15": { + "Type": "AWS::Pipes::Pipe", + "Properties": { + "LogConfiguration": { + "CloudwatchLogsLogDestination": { + "LogGroupArn": { + "Fn::GetAtt": [ + "testsqspipesstatesconstructLogGrouptestsqspipesstatesconstructF827FE15", + "Arn" + ] + } + }, + "Level": "INFO" + }, + "RoleArn": { + "Fn::GetAtt": [ + "testsqspipesstatesconstructPipeRoletestsqspipesstatesconstruct2CC9A13C", + "Arn" + ] + }, + "Source": { + "Fn::GetAtt": [ + "testsqspipesstatesconstructqueueA7C76715", + "Arn" + ] + }, + "SourceParameters": {}, + "Target": { + "Ref": "testsqspipesstatesconstructStateMachine29272AA9" + }, + "TargetParameters": { + "StepFunctionStateMachineParameters": { + "InvocationType": "FIRE_AND_FORGET" + } + } + } + } + }, + "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-sqs-pipes-stepfunctions/test/integ.sqspstp-no-arguments.js.snapshot/sqspstpnoargumentsIntegDefaultTestDeployAssert83953622.assets.json b/source/patterns/@aws-solutions-constructs/aws-sqs-pipes-stepfunctions/test/integ.sqspstp-no-arguments.js.snapshot/sqspstpnoargumentsIntegDefaultTestDeployAssert83953622.assets.json new file mode 100644 index 000000000..8d519bfdb --- /dev/null +++ b/source/patterns/@aws-solutions-constructs/aws-sqs-pipes-stepfunctions/test/integ.sqspstp-no-arguments.js.snapshot/sqspstpnoargumentsIntegDefaultTestDeployAssert83953622.assets.json @@ -0,0 +1,19 @@ +{ + "version": "38.0.1", + "files": { + "21fbb51d7b23f6a6c262b46a9caee79d744a3ac019fd45422d988b96d44b2a22": { + "source": { + "path": "sqspstpnoargumentsIntegDefaultTestDeployAssert83953622.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-sqs-pipes-stepfunctions/test/integ.sqspstp-no-arguments.js.snapshot/sqspstpnoargumentsIntegDefaultTestDeployAssert83953622.template.json b/source/patterns/@aws-solutions-constructs/aws-sqs-pipes-stepfunctions/test/integ.sqspstp-no-arguments.js.snapshot/sqspstpnoargumentsIntegDefaultTestDeployAssert83953622.template.json new file mode 100644 index 000000000..ad9d0fb73 --- /dev/null +++ b/source/patterns/@aws-solutions-constructs/aws-sqs-pipes-stepfunctions/test/integ.sqspstp-no-arguments.js.snapshot/sqspstpnoargumentsIntegDefaultTestDeployAssert83953622.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-sqs-pipes-stepfunctions/test/integ.sqspstp-no-arguments.js.snapshot/tree.json b/source/patterns/@aws-solutions-constructs/aws-sqs-pipes-stepfunctions/test/integ.sqspstp-no-arguments.js.snapshot/tree.json new file mode 100644 index 000000000..b638a39cd --- /dev/null +++ b/source/patterns/@aws-solutions-constructs/aws-sqs-pipes-stepfunctions/test/integ.sqspstp-no-arguments.js.snapshot/tree.json @@ -0,0 +1,957 @@ +{ + "version": "tree-0.1", + "tree": { + "id": "App", + "path": "", + "children": { + "sqspstp-no-arguments": { + "id": "sqspstp-no-arguments", + "path": "sqspstp-no-arguments", + "children": { + "lambdas3stp-test": { + "id": "lambdas3stp-test", + "path": "sqspstp-no-arguments/lambdas3stp-test", + "children": { + "ServiceRole": { + "id": "ServiceRole", + "path": "sqspstp-no-arguments/lambdas3stp-test/ServiceRole", + "children": { + "ImportServiceRole": { + "id": "ImportServiceRole", + "path": "sqspstp-no-arguments/lambdas3stp-test/ServiceRole/ImportServiceRole", + "constructInfo": { + "fqn": "aws-cdk-lib.Resource", + "version": "2.161.0" + } + }, + "Resource": { + "id": "Resource", + "path": "sqspstp-no-arguments/lambdas3stp-test/ServiceRole/Resource", + "attributes": { + "aws:cdk:cloudformation:type": "AWS::IAM::Role", + "aws:cdk:cloudformation:props": { + "assumeRolePolicyDocument": { + "Statement": [ + { + "Action": "sts:AssumeRole", + "Effect": "Allow", + "Principal": { + "Service": "lambda.amazonaws.com" + } + } + ], + "Version": "2012-10-17" + }, + "managedPolicyArns": [ + { + "Fn::Join": [ + "", + [ + "arn:", + { + "Ref": "AWS::Partition" + }, + ":iam::aws:policy/service-role/AWSLambdaBasicExecutionRole" + ] + ] + } + ] + } + }, + "constructInfo": { + "fqn": "aws-cdk-lib.aws_iam.CfnRole", + "version": "2.161.0" + } + } + }, + "constructInfo": { + "fqn": "aws-cdk-lib.aws_iam.Role", + "version": "2.161.0" + } + }, + "Resource": { + "id": "Resource", + "path": "sqspstp-no-arguments/lambdas3stp-test/Resource", + "attributes": { + "aws:cdk:cloudformation:type": "AWS::Lambda::Function", + "aws:cdk:cloudformation:props": { + "code": { + "zipFile": "exports.handler = async (event) => console.log(event)" + }, + "handler": "index.handler", + "role": { + "Fn::GetAtt": [ + "lambdas3stptestServiceRoleF17BB6C7", + "Arn" + ] + }, + "runtime": "nodejs20.x" + } + }, + "constructInfo": { + "fqn": "aws-cdk-lib.aws_lambda.CfnFunction", + "version": "2.161.0" + } + } + }, + "constructInfo": { + "fqn": "aws-cdk-lib.aws_lambda.Function", + "version": "2.161.0" + } + }, + "tasks3stp-test": { + "id": "tasks3stp-test", + "path": "sqspstp-no-arguments/tasks3stp-test", + "constructInfo": { + "fqn": "aws-cdk-lib.aws_stepfunctions_tasks.LambdaInvoke", + "version": "2.161.0" + } + }, + "test-sqs-pipes-states-construct": { + "id": "test-sqs-pipes-states-construct", + "path": "sqspstp-no-arguments/test-sqs-pipes-states-construct", + "children": { + "queue-dlq": { + "id": "queue-dlq", + "path": "sqspstp-no-arguments/test-sqs-pipes-states-construct/queue-dlq", + "children": { + "Resource": { + "id": "Resource", + "path": "sqspstp-no-arguments/test-sqs-pipes-states-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.161.0" + } + }, + "Policy": { + "id": "Policy", + "path": "sqspstp-no-arguments/test-sqs-pipes-states-construct/queue-dlq/Policy", + "children": { + "Resource": { + "id": "Resource", + "path": "sqspstp-no-arguments/test-sqs-pipes-states-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": [ + "testsqspipesstatesconstructqueuedlq420A82FD", + "Arn" + ] + }, + "Sid": "QueueOwnerOnlyAccess" + }, + { + "Action": "SQS:*", + "Condition": { + "Bool": { + "aws:SecureTransport": "false" + } + }, + "Effect": "Deny", + "Principal": { + "AWS": "*" + }, + "Resource": { + "Fn::GetAtt": [ + "testsqspipesstatesconstructqueuedlq420A82FD", + "Arn" + ] + }, + "Sid": "HttpsOnly" + } + ], + "Version": "2012-10-17" + }, + "queues": [ + { + "Ref": "testsqspipesstatesconstructqueuedlq420A82FD" + } + ] + } + }, + "constructInfo": { + "fqn": "aws-cdk-lib.aws_sqs.CfnQueuePolicy", + "version": "2.161.0" + } + } + }, + "constructInfo": { + "fqn": "aws-cdk-lib.aws_sqs.QueuePolicy", + "version": "2.161.0" + } + } + }, + "constructInfo": { + "fqn": "aws-cdk-lib.aws_sqs.Queue", + "version": "2.161.0" + } + }, + "queue": { + "id": "queue", + "path": "sqspstp-no-arguments/test-sqs-pipes-states-construct/queue", + "children": { + "Resource": { + "id": "Resource", + "path": "sqspstp-no-arguments/test-sqs-pipes-states-construct/queue/Resource", + "attributes": { + "aws:cdk:cloudformation:type": "AWS::SQS::Queue", + "aws:cdk:cloudformation:props": { + "kmsMasterKeyId": "alias/aws/sqs", + "redrivePolicy": { + "deadLetterTargetArn": { + "Fn::GetAtt": [ + "testsqspipesstatesconstructqueuedlq420A82FD", + "Arn" + ] + }, + "maxReceiveCount": 15 + } + } + }, + "constructInfo": { + "fqn": "aws-cdk-lib.aws_sqs.CfnQueue", + "version": "2.161.0" + } + }, + "Policy": { + "id": "Policy", + "path": "sqspstp-no-arguments/test-sqs-pipes-states-construct/queue/Policy", + "children": { + "Resource": { + "id": "Resource", + "path": "sqspstp-no-arguments/test-sqs-pipes-states-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": [ + "testsqspipesstatesconstructqueueA7C76715", + "Arn" + ] + }, + "Sid": "QueueOwnerOnlyAccess" + }, + { + "Action": "SQS:*", + "Condition": { + "Bool": { + "aws:SecureTransport": "false" + } + }, + "Effect": "Deny", + "Principal": { + "AWS": "*" + }, + "Resource": { + "Fn::GetAtt": [ + "testsqspipesstatesconstructqueueA7C76715", + "Arn" + ] + }, + "Sid": "HttpsOnly" + } + ], + "Version": "2012-10-17" + }, + "queues": [ + { + "Ref": "testsqspipesstatesconstructqueueA7C76715" + } + ] + } + }, + "constructInfo": { + "fqn": "aws-cdk-lib.aws_sqs.CfnQueuePolicy", + "version": "2.161.0" + } + } + }, + "constructInfo": { + "fqn": "aws-cdk-lib.aws_sqs.QueuePolicy", + "version": "2.161.0" + } + } + }, + "constructInfo": { + "fqn": "aws-cdk-lib.aws_sqs.Queue", + "version": "2.161.0" + } + }, + "StateMachineLogGroup": { + "id": "StateMachineLogGroup", + "path": "sqspstp-no-arguments/test-sqs-pipes-states-construct/StateMachineLogGroup", + "children": { + "Resource": { + "id": "Resource", + "path": "sqspstp-no-arguments/test-sqs-pipes-states-construct/StateMachineLogGroup/Resource", + "attributes": { + "aws:cdk:cloudformation:type": "AWS::Logs::LogGroup", + "aws:cdk:cloudformation:props": { + "logGroupName": { + "Fn::Join": [ + "", + [ + "/aws/vendedlogs/states/constructs/sqspstp-no-argumentstest-sqs-pipes-states-constructStateMachineLog-", + { + "Fn::Select": [ + 2, + { + "Fn::Split": [ + "/", + { + "Ref": "AWS::StackId" + } + ] + } + ] + } + ] + ] + } + } + }, + "constructInfo": { + "fqn": "aws-cdk-lib.aws_logs.CfnLogGroup", + "version": "2.161.0" + } + } + }, + "constructInfo": { + "fqn": "aws-cdk-lib.aws_logs.LogGroup", + "version": "2.161.0" + } + }, + "StateMachine": { + "id": "StateMachine", + "path": "sqspstp-no-arguments/test-sqs-pipes-states-construct/StateMachine", + "children": { + "Role": { + "id": "Role", + "path": "sqspstp-no-arguments/test-sqs-pipes-states-construct/StateMachine/Role", + "children": { + "ImportRole": { + "id": "ImportRole", + "path": "sqspstp-no-arguments/test-sqs-pipes-states-construct/StateMachine/Role/ImportRole", + "constructInfo": { + "fqn": "aws-cdk-lib.Resource", + "version": "2.161.0" + } + }, + "Resource": { + "id": "Resource", + "path": "sqspstp-no-arguments/test-sqs-pipes-states-construct/StateMachine/Role/Resource", + "attributes": { + "aws:cdk:cloudformation:type": "AWS::IAM::Role", + "aws:cdk:cloudformation:props": { + "assumeRolePolicyDocument": { + "Statement": [ + { + "Action": "sts:AssumeRole", + "Effect": "Allow", + "Principal": { + "Service": "states.amazonaws.com" + } + } + ], + "Version": "2012-10-17" + } + } + }, + "constructInfo": { + "fqn": "aws-cdk-lib.aws_iam.CfnRole", + "version": "2.161.0" + } + }, + "DefaultPolicy": { + "id": "DefaultPolicy", + "path": "sqspstp-no-arguments/test-sqs-pipes-states-construct/StateMachine/Role/DefaultPolicy", + "children": { + "Resource": { + "id": "Resource", + "path": "sqspstp-no-arguments/test-sqs-pipes-states-construct/StateMachine/Role/DefaultPolicy/Resource", + "attributes": { + "aws:cdk:cloudformation:type": "AWS::IAM::Policy", + "aws:cdk:cloudformation:props": { + "policyDocument": { + "Statement": [ + { + "Action": "lambda:InvokeFunction", + "Effect": "Allow", + "Resource": [ + { + "Fn::GetAtt": [ + "lambdas3stptest9FBDC6CE", + "Arn" + ] + }, + { + "Fn::Join": [ + "", + [ + { + "Fn::GetAtt": [ + "lambdas3stptest9FBDC6CE", + "Arn" + ] + }, + ":*" + ] + ] + } + ] + }, + { + "Action": [ + "logs:CreateLogDelivery", + "logs:DeleteLogDelivery", + "logs:DescribeLogGroups", + "logs:DescribeResourcePolicies", + "logs:GetLogDelivery", + "logs:ListLogDeliveries", + "logs:PutResourcePolicy", + "logs:UpdateLogDelivery" + ], + "Effect": "Allow", + "Resource": "*" + } + ], + "Version": "2012-10-17" + }, + "policyName": "testsqspipesstatesconstructStateMachineRoleDefaultPolicyD1BA2BF2", + "roles": [ + { + "Ref": "testsqspipesstatesconstructStateMachineRoleBF97BFC0" + } + ] + } + }, + "constructInfo": { + "fqn": "aws-cdk-lib.aws_iam.CfnPolicy", + "version": "2.161.0" + } + } + }, + "constructInfo": { + "fqn": "aws-cdk-lib.aws_iam.Policy", + "version": "2.161.0" + } + } + }, + "constructInfo": { + "fqn": "aws-cdk-lib.aws_iam.Role", + "version": "2.161.0" + } + }, + "Resource": { + "id": "Resource", + "path": "sqspstp-no-arguments/test-sqs-pipes-states-construct/StateMachine/Resource", + "attributes": { + "aws:cdk:cloudformation:type": "AWS::StepFunctions::StateMachine", + "aws:cdk:cloudformation:props": { + "definitionString": { + "Fn::Join": [ + "", + [ + "{\"StartAt\":\"tasks3stp-test\",\"States\":{\"tasks3stp-test\":{\"End\":true,\"Retry\":[{\"ErrorEquals\":[\"Lambda.ClientExecutionTimeoutException\",\"Lambda.ServiceException\",\"Lambda.AWSLambdaException\",\"Lambda.SdkClientException\"],\"IntervalSeconds\":2,\"MaxAttempts\":6,\"BackoffRate\":2}],\"Type\":\"Task\",\"Resource\":\"arn:", + { + "Ref": "AWS::Partition" + }, + ":states:::lambda:invoke\",\"Parameters\":{\"FunctionName\":\"", + { + "Fn::GetAtt": [ + "lambdas3stptest9FBDC6CE", + "Arn" + ] + }, + "\",\"Payload.$\":\"$\"}}}}" + ] + ] + }, + "loggingConfiguration": { + "destinations": [ + { + "cloudWatchLogsLogGroup": { + "logGroupArn": { + "Fn::GetAtt": [ + "testsqspipesstatesconstructStateMachineLogGroupADE94F1D", + "Arn" + ] + } + } + } + ], + "level": "ERROR" + }, + "roleArn": { + "Fn::GetAtt": [ + "testsqspipesstatesconstructStateMachineRoleBF97BFC0", + "Arn" + ] + } + } + }, + "constructInfo": { + "fqn": "aws-cdk-lib.aws_stepfunctions.CfnStateMachine", + "version": "2.161.0" + } + } + }, + "constructInfo": { + "fqn": "aws-cdk-lib.aws_stepfunctions.StateMachine", + "version": "2.161.0" + } + }, + "ExecutionFailedAlarm": { + "id": "ExecutionFailedAlarm", + "path": "sqspstp-no-arguments/test-sqs-pipes-states-construct/ExecutionFailedAlarm", + "children": { + "Resource": { + "id": "Resource", + "path": "sqspstp-no-arguments/test-sqs-pipes-states-construct/ExecutionFailedAlarm/Resource", + "attributes": { + "aws:cdk:cloudformation:type": "AWS::CloudWatch::Alarm", + "aws:cdk:cloudformation:props": { + "alarmDescription": "Alarm for the number of executions that failed exceeded the threshold of 1. ", + "comparisonOperator": "GreaterThanOrEqualToThreshold", + "dimensions": [ + { + "name": "StateMachineArn", + "value": { + "Ref": "testsqspipesstatesconstructStateMachine29272AA9" + } + } + ], + "evaluationPeriods": 1, + "metricName": "ExecutionsFailed", + "namespace": "AWS/States", + "period": 300, + "statistic": "Sum", + "threshold": 1 + } + }, + "constructInfo": { + "fqn": "aws-cdk-lib.aws_cloudwatch.CfnAlarm", + "version": "2.161.0" + } + } + }, + "constructInfo": { + "fqn": "aws-cdk-lib.aws_cloudwatch.Alarm", + "version": "2.161.0" + } + }, + "ExecutionThrottledAlarm": { + "id": "ExecutionThrottledAlarm", + "path": "sqspstp-no-arguments/test-sqs-pipes-states-construct/ExecutionThrottledAlarm", + "children": { + "Resource": { + "id": "Resource", + "path": "sqspstp-no-arguments/test-sqs-pipes-states-construct/ExecutionThrottledAlarm/Resource", + "attributes": { + "aws:cdk:cloudformation:type": "AWS::CloudWatch::Alarm", + "aws:cdk:cloudformation:props": { + "alarmDescription": "Alarm for the number of executions that throttled exceeded the threshold of 1. ", + "comparisonOperator": "GreaterThanOrEqualToThreshold", + "dimensions": [ + { + "name": "StateMachineArn", + "value": { + "Ref": "testsqspipesstatesconstructStateMachine29272AA9" + } + } + ], + "evaluationPeriods": 1, + "metricName": "ExecutionThrottled", + "namespace": "AWS/States", + "period": 300, + "statistic": "Sum", + "threshold": 1 + } + }, + "constructInfo": { + "fqn": "aws-cdk-lib.aws_cloudwatch.CfnAlarm", + "version": "2.161.0" + } + } + }, + "constructInfo": { + "fqn": "aws-cdk-lib.aws_cloudwatch.Alarm", + "version": "2.161.0" + } + }, + "ExecutionAbortedAlarm": { + "id": "ExecutionAbortedAlarm", + "path": "sqspstp-no-arguments/test-sqs-pipes-states-construct/ExecutionAbortedAlarm", + "children": { + "Resource": { + "id": "Resource", + "path": "sqspstp-no-arguments/test-sqs-pipes-states-construct/ExecutionAbortedAlarm/Resource", + "attributes": { + "aws:cdk:cloudformation:type": "AWS::CloudWatch::Alarm", + "aws:cdk:cloudformation:props": { + "alarmDescription": "Alarm for the number of executions that aborted exceeded the threshold of 1. ", + "comparisonOperator": "GreaterThanOrEqualToThreshold", + "dimensions": [ + { + "name": "StateMachineArn", + "value": { + "Ref": "testsqspipesstatesconstructStateMachine29272AA9" + } + } + ], + "evaluationPeriods": 1, + "metricName": "ExecutionsAborted", + "namespace": "AWS/States", + "period": 300, + "statistic": "Maximum", + "threshold": 1 + } + }, + "constructInfo": { + "fqn": "aws-cdk-lib.aws_cloudwatch.CfnAlarm", + "version": "2.161.0" + } + } + }, + "constructInfo": { + "fqn": "aws-cdk-lib.aws_cloudwatch.Alarm", + "version": "2.161.0" + } + }, + "PipeRole--test-sqs-pipes-states-construct": { + "id": "PipeRole--test-sqs-pipes-states-construct", + "path": "sqspstp-no-arguments/test-sqs-pipes-states-construct/PipeRole--test-sqs-pipes-states-construct", + "children": { + "ImportPipeRole--test-sqs-pipes-states-construct": { + "id": "ImportPipeRole--test-sqs-pipes-states-construct", + "path": "sqspstp-no-arguments/test-sqs-pipes-states-construct/PipeRole--test-sqs-pipes-states-construct/ImportPipeRole--test-sqs-pipes-states-construct", + "constructInfo": { + "fqn": "aws-cdk-lib.Resource", + "version": "2.161.0" + } + }, + "Resource": { + "id": "Resource", + "path": "sqspstp-no-arguments/test-sqs-pipes-states-construct/PipeRole--test-sqs-pipes-states-construct/Resource", + "attributes": { + "aws:cdk:cloudformation:type": "AWS::IAM::Role", + "aws:cdk:cloudformation:props": { + "assumeRolePolicyDocument": { + "Statement": [ + { + "Action": "sts:AssumeRole", + "Effect": "Allow", + "Principal": { + "Service": "pipes.amazonaws.com" + } + } + ], + "Version": "2012-10-17" + }, + "policies": [ + { + "policyName": "sourcePolicy", + "policyDocument": { + "Statement": [ + { + "Action": [ + "sqs:DeleteMessage", + "sqs:GetQueueAttributes", + "sqs:ReceiveMessage" + ], + "Effect": "Allow", + "Resource": { + "Fn::GetAtt": [ + "testsqspipesstatesconstructqueueA7C76715", + "Arn" + ] + } + } + ], + "Version": "2012-10-17" + } + }, + { + "policyName": "targetPolicy", + "policyDocument": { + "Statement": [ + { + "Action": "states:StartExecution", + "Effect": "Allow", + "Resource": { + "Ref": "testsqspipesstatesconstructStateMachine29272AA9" + } + } + ], + "Version": "2012-10-17" + } + } + ] + } + }, + "constructInfo": { + "fqn": "aws-cdk-lib.aws_iam.CfnRole", + "version": "2.161.0" + } + } + }, + "constructInfo": { + "fqn": "aws-cdk-lib.aws_iam.Role", + "version": "2.161.0" + } + }, + "LogGroup-test-sqs-pipes-states-construct": { + "id": "LogGroup-test-sqs-pipes-states-construct", + "path": "sqspstp-no-arguments/test-sqs-pipes-states-construct/LogGroup-test-sqs-pipes-states-construct", + "children": { + "Resource": { + "id": "Resource", + "path": "sqspstp-no-arguments/test-sqs-pipes-states-construct/LogGroup-test-sqs-pipes-states-construct/Resource", + "attributes": { + "aws:cdk:cloudformation:type": "AWS::Logs::LogGroup", + "aws:cdk:cloudformation:props": { + "logGroupName": { + "Fn::Join": [ + "", + [ + "/aws/vendedlogs/pipes/constructs/sqspstp-no-argumentstest-sqs-pipes-states-constructPipesLog-", + { + "Fn::Select": [ + 2, + { + "Fn::Split": [ + "/", + { + "Ref": "AWS::StackId" + } + ] + } + ] + } + ] + ] + } + } + }, + "constructInfo": { + "fqn": "aws-cdk-lib.aws_logs.CfnLogGroup", + "version": "2.161.0" + } + } + }, + "constructInfo": { + "fqn": "aws-cdk-lib.aws_logs.LogGroup", + "version": "2.161.0" + } + }, + "pipe-test-sqs-pipes-states-construct": { + "id": "pipe-test-sqs-pipes-states-construct", + "path": "sqspstp-no-arguments/test-sqs-pipes-states-construct/pipe-test-sqs-pipes-states-construct", + "attributes": { + "aws:cdk:cloudformation:type": "AWS::Pipes::Pipe", + "aws:cdk:cloudformation:props": { + "logConfiguration": { + "cloudwatchLogsLogDestination": { + "logGroupArn": { + "Fn::GetAtt": [ + "testsqspipesstatesconstructLogGrouptestsqspipesstatesconstructF827FE15", + "Arn" + ] + } + }, + "level": "INFO" + }, + "roleArn": { + "Fn::GetAtt": [ + "testsqspipesstatesconstructPipeRoletestsqspipesstatesconstruct2CC9A13C", + "Arn" + ] + }, + "source": { + "Fn::GetAtt": [ + "testsqspipesstatesconstructqueueA7C76715", + "Arn" + ] + }, + "sourceParameters": {}, + "target": { + "Ref": "testsqspipesstatesconstructStateMachine29272AA9" + }, + "targetParameters": { + "stepFunctionStateMachineParameters": { + "invocationType": "FIRE_AND_FORGET" + } + } + } + }, + "constructInfo": { + "fqn": "aws-cdk-lib.aws_pipes.CfnPipe", + "version": "2.161.0" + } + } + }, + "constructInfo": { + "fqn": "@aws-solutions-constructs/aws-sqs-pipes-stepfunctions.SqsToPipesToStepfunctions", + "version": "2.72.0" + } + }, + "Integ": { + "id": "Integ", + "path": "sqspstp-no-arguments/Integ", + "children": { + "DefaultTest": { + "id": "DefaultTest", + "path": "sqspstp-no-arguments/Integ/DefaultTest", + "children": { + "Default": { + "id": "Default", + "path": "sqspstp-no-arguments/Integ/DefaultTest/Default", + "constructInfo": { + "fqn": "constructs.Construct", + "version": "10.4.2" + } + }, + "DeployAssert": { + "id": "DeployAssert", + "path": "sqspstp-no-arguments/Integ/DefaultTest/DeployAssert", + "children": { + "BootstrapVersion": { + "id": "BootstrapVersion", + "path": "sqspstp-no-arguments/Integ/DefaultTest/DeployAssert/BootstrapVersion", + "constructInfo": { + "fqn": "aws-cdk-lib.CfnParameter", + "version": "2.161.0" + } + }, + "CheckBootstrapVersion": { + "id": "CheckBootstrapVersion", + "path": "sqspstp-no-arguments/Integ/DefaultTest/DeployAssert/CheckBootstrapVersion", + "constructInfo": { + "fqn": "aws-cdk-lib.CfnRule", + "version": "2.161.0" + } + } + }, + "constructInfo": { + "fqn": "aws-cdk-lib.Stack", + "version": "2.161.0" + } + } + }, + "constructInfo": { + "fqn": "@aws-cdk/integ-tests-alpha.IntegTestCase", + "version": "2.161.0-alpha.0" + } + } + }, + "constructInfo": { + "fqn": "@aws-cdk/integ-tests-alpha.IntegTest", + "version": "2.161.0-alpha.0" + } + }, + "BootstrapVersion": { + "id": "BootstrapVersion", + "path": "sqspstp-no-arguments/BootstrapVersion", + "constructInfo": { + "fqn": "aws-cdk-lib.CfnParameter", + "version": "2.161.0" + } + }, + "CheckBootstrapVersion": { + "id": "CheckBootstrapVersion", + "path": "sqspstp-no-arguments/CheckBootstrapVersion", + "constructInfo": { + "fqn": "aws-cdk-lib.CfnRule", + "version": "2.161.0" + } + } + }, + "constructInfo": { + "fqn": "aws-cdk-lib.Stack", + "version": "2.161.0" + } + }, + "Tree": { + "id": "Tree", + "path": "Tree", + "constructInfo": { + "fqn": "constructs.Construct", + "version": "10.4.2" + } + } + }, + "constructInfo": { + "fqn": "aws-cdk-lib.App", + "version": "2.161.0" + } + } +} \ No newline at end of file diff --git a/source/patterns/@aws-solutions-constructs/aws-sqs-pipes-stepfunctions/test/integ.sqspstp-no-arguments.ts b/source/patterns/@aws-solutions-constructs/aws-sqs-pipes-stepfunctions/test/integ.sqspstp-no-arguments.ts new file mode 100644 index 000000000..21d1b660c --- /dev/null +++ b/source/patterns/@aws-solutions-constructs/aws-sqs-pipes-stepfunctions/test/integ.sqspstp-no-arguments.ts @@ -0,0 +1,34 @@ +/** + * 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. + */ + +/// !cdk-integ * +import { App, Stack } from "aws-cdk-lib"; +import { SqsToPipesToStepfunctions, SqsToPipesToStepfunctionsProps } from "../lib"; +import { generateIntegStackName } from '@aws-solutions-constructs/core'; +import { IntegTest } from '@aws-cdk/integ-tests-alpha'; +import * as defaults from '@aws-solutions-constructs/core'; + +const app = new App(); +const stack = new Stack(app, generateIntegStackName(__filename)); + +const props: SqsToPipesToStepfunctionsProps = { + stateMachineProps: { + definitionBody: defaults.CreateTestStateMachineDefinitionBody(stack, 's3stp-test') + }, +}; + +new SqsToPipesToStepfunctions(stack, 'test-sqs-pipes-states-construct', props); + +new IntegTest(stack, 'Integ', { testCases: [ + stack +] }); diff --git a/source/patterns/@aws-solutions-constructs/aws-sqs-pipes-stepfunctions/test/integ.sqspstp-set-queue-batch-size.js.snapshot/cdk.out b/source/patterns/@aws-solutions-constructs/aws-sqs-pipes-stepfunctions/test/integ.sqspstp-set-queue-batch-size.js.snapshot/cdk.out new file mode 100644 index 000000000..c6e612584 --- /dev/null +++ b/source/patterns/@aws-solutions-constructs/aws-sqs-pipes-stepfunctions/test/integ.sqspstp-set-queue-batch-size.js.snapshot/cdk.out @@ -0,0 +1 @@ +{"version":"38.0.1"} \ No newline at end of file diff --git a/source/patterns/@aws-solutions-constructs/aws-sqs-pipes-stepfunctions/test/integ.sqspstp-set-queue-batch-size.js.snapshot/integ.json b/source/patterns/@aws-solutions-constructs/aws-sqs-pipes-stepfunctions/test/integ.sqspstp-set-queue-batch-size.js.snapshot/integ.json new file mode 100644 index 000000000..64301ae53 --- /dev/null +++ b/source/patterns/@aws-solutions-constructs/aws-sqs-pipes-stepfunctions/test/integ.sqspstp-set-queue-batch-size.js.snapshot/integ.json @@ -0,0 +1,12 @@ +{ + "version": "38.0.1", + "testCases": { + "sqspstp-set-queue-batch-size/Integ/DefaultTest": { + "stacks": [ + "sqspstp-set-queue-batch-size" + ], + "assertionStack": "sqspstp-set-queue-batch-size/Integ/DefaultTest/DeployAssert", + "assertionStackName": "sqspstpsetqueuebatchsizeIntegDefaultTestDeployAssertA1752E9D" + } + } +} \ No newline at end of file diff --git a/source/patterns/@aws-solutions-constructs/aws-sqs-pipes-stepfunctions/test/integ.sqspstp-set-queue-batch-size.js.snapshot/manifest.json b/source/patterns/@aws-solutions-constructs/aws-sqs-pipes-stepfunctions/test/integ.sqspstp-set-queue-batch-size.js.snapshot/manifest.json new file mode 100644 index 000000000..97818f9c7 --- /dev/null +++ b/source/patterns/@aws-solutions-constructs/aws-sqs-pipes-stepfunctions/test/integ.sqspstp-set-queue-batch-size.js.snapshot/manifest.json @@ -0,0 +1,205 @@ +{ + "version": "38.0.1", + "artifacts": { + "sqspstpsetqueuebatchsizeIntegDefaultTestDeployAssertA1752E9D.assets": { + "type": "cdk:asset-manifest", + "properties": { + "file": "sqspstpsetqueuebatchsizeIntegDefaultTestDeployAssertA1752E9D.assets.json", + "requiresBootstrapStackVersion": 6, + "bootstrapStackVersionSsmParameter": "/cdk-bootstrap/hnb659fds/version" + } + }, + "sqspstpsetqueuebatchsizeIntegDefaultTestDeployAssertA1752E9D": { + "type": "aws:cloudformation:stack", + "environment": "aws://unknown-account/unknown-region", + "properties": { + "templateFile": "sqspstpsetqueuebatchsizeIntegDefaultTestDeployAssertA1752E9D.template.json", + "terminationProtection": false, + "validateOnSynth": false, + "notificationArns": [], + "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": [ + "sqspstpsetqueuebatchsizeIntegDefaultTestDeployAssertA1752E9D.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": [ + "sqspstpsetqueuebatchsizeIntegDefaultTestDeployAssertA1752E9D.assets" + ], + "metadata": { + "/sqspstp-set-queue-batch-size/Integ/DefaultTest/DeployAssert/BootstrapVersion": [ + { + "type": "aws:cdk:logicalId", + "data": "BootstrapVersion" + } + ], + "/sqspstp-set-queue-batch-size/Integ/DefaultTest/DeployAssert/CheckBootstrapVersion": [ + { + "type": "aws:cdk:logicalId", + "data": "CheckBootstrapVersion" + } + ] + }, + "displayName": "sqspstp-set-queue-batch-size/Integ/DefaultTest/DeployAssert" + }, + "sqspstp-set-queue-batch-size.assets": { + "type": "cdk:asset-manifest", + "properties": { + "file": "sqspstp-set-queue-batch-size.assets.json", + "requiresBootstrapStackVersion": 6, + "bootstrapStackVersionSsmParameter": "/cdk-bootstrap/hnb659fds/version" + } + }, + "sqspstp-set-queue-batch-size": { + "type": "aws:cloudformation:stack", + "environment": "aws://unknown-account/unknown-region", + "properties": { + "templateFile": "sqspstp-set-queue-batch-size.template.json", + "terminationProtection": false, + "validateOnSynth": false, + "notificationArns": [], + "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}/b608de4251b772257f786d1776e1bb2dbb6566658681631d71e5741f2e95c986.json", + "requiresBootstrapStackVersion": 6, + "bootstrapStackVersionSsmParameter": "/cdk-bootstrap/hnb659fds/version", + "additionalDependencies": [ + "sqspstp-set-queue-batch-size.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": [ + "sqspstp-set-queue-batch-size.assets" + ], + "metadata": { + "/sqspstp-set-queue-batch-size/lambdas3stp-test/ServiceRole/Resource": [ + { + "type": "aws:cdk:logicalId", + "data": "lambdas3stptestServiceRoleF17BB6C7" + } + ], + "/sqspstp-set-queue-batch-size/lambdas3stp-test/Resource": [ + { + "type": "aws:cdk:logicalId", + "data": "lambdas3stptest9FBDC6CE" + } + ], + "/sqspstp-set-queue-batch-size/test-sqs-pipes-states-construct/queue-dlq/Resource": [ + { + "type": "aws:cdk:logicalId", + "data": "testsqspipesstatesconstructqueuedlq420A82FD" + } + ], + "/sqspstp-set-queue-batch-size/test-sqs-pipes-states-construct/queue-dlq/Policy/Resource": [ + { + "type": "aws:cdk:logicalId", + "data": "testsqspipesstatesconstructqueuedlqPolicyB1D70483" + } + ], + "/sqspstp-set-queue-batch-size/test-sqs-pipes-states-construct/queue/Resource": [ + { + "type": "aws:cdk:logicalId", + "data": "testsqspipesstatesconstructqueueA7C76715" + } + ], + "/sqspstp-set-queue-batch-size/test-sqs-pipes-states-construct/queue/Policy/Resource": [ + { + "type": "aws:cdk:logicalId", + "data": "testsqspipesstatesconstructqueuePolicyFD32B562" + } + ], + "/sqspstp-set-queue-batch-size/test-sqs-pipes-states-construct/StateMachineLogGroup/Resource": [ + { + "type": "aws:cdk:logicalId", + "data": "testsqspipesstatesconstructStateMachineLogGroupADE94F1D" + } + ], + "/sqspstp-set-queue-batch-size/test-sqs-pipes-states-construct/StateMachine/Role/Resource": [ + { + "type": "aws:cdk:logicalId", + "data": "testsqspipesstatesconstructStateMachineRoleBF97BFC0" + } + ], + "/sqspstp-set-queue-batch-size/test-sqs-pipes-states-construct/StateMachine/Role/DefaultPolicy/Resource": [ + { + "type": "aws:cdk:logicalId", + "data": "testsqspipesstatesconstructStateMachineRoleDefaultPolicyD1BA2BF2" + } + ], + "/sqspstp-set-queue-batch-size/test-sqs-pipes-states-construct/StateMachine/Resource": [ + { + "type": "aws:cdk:logicalId", + "data": "testsqspipesstatesconstructStateMachine29272AA9" + } + ], + "/sqspstp-set-queue-batch-size/test-sqs-pipes-states-construct/ExecutionFailedAlarm/Resource": [ + { + "type": "aws:cdk:logicalId", + "data": "testsqspipesstatesconstructExecutionFailedAlarm1002FF55" + } + ], + "/sqspstp-set-queue-batch-size/test-sqs-pipes-states-construct/ExecutionThrottledAlarm/Resource": [ + { + "type": "aws:cdk:logicalId", + "data": "testsqspipesstatesconstructExecutionThrottledAlarm0242B01A" + } + ], + "/sqspstp-set-queue-batch-size/test-sqs-pipes-states-construct/ExecutionAbortedAlarm/Resource": [ + { + "type": "aws:cdk:logicalId", + "data": "testsqspipesstatesconstructExecutionAbortedAlarm14349A7B" + } + ], + "/sqspstp-set-queue-batch-size/test-sqs-pipes-states-construct/PipeRole--test-sqs-pipes-states-construct/Resource": [ + { + "type": "aws:cdk:logicalId", + "data": "testsqspipesstatesconstructPipeRoletestsqspipesstatesconstruct2CC9A13C" + } + ], + "/sqspstp-set-queue-batch-size/test-sqs-pipes-states-construct/LogGroup-test-sqs-pipes-states-construct/Resource": [ + { + "type": "aws:cdk:logicalId", + "data": "testsqspipesstatesconstructLogGrouptestsqspipesstatesconstructF827FE15" + } + ], + "/sqspstp-set-queue-batch-size/test-sqs-pipes-states-construct/pipe-test-sqs-pipes-states-construct": [ + { + "type": "aws:cdk:logicalId", + "data": "testsqspipesstatesconstructpipetestsqspipesstatesconstruct71A64A15" + } + ], + "/sqspstp-set-queue-batch-size/BootstrapVersion": [ + { + "type": "aws:cdk:logicalId", + "data": "BootstrapVersion" + } + ], + "/sqspstp-set-queue-batch-size/CheckBootstrapVersion": [ + { + "type": "aws:cdk:logicalId", + "data": "CheckBootstrapVersion" + } + ] + }, + "displayName": "sqspstp-set-queue-batch-size" + }, + "Tree": { + "type": "cdk:tree", + "properties": { + "file": "tree.json" + } + } + } +} \ No newline at end of file diff --git a/source/patterns/@aws-solutions-constructs/aws-sqs-pipes-stepfunctions/test/integ.sqspstp-set-queue-batch-size.js.snapshot/sqspstp-set-queue-batch-size.assets.json b/source/patterns/@aws-solutions-constructs/aws-sqs-pipes-stepfunctions/test/integ.sqspstp-set-queue-batch-size.js.snapshot/sqspstp-set-queue-batch-size.assets.json new file mode 100644 index 000000000..8518f2211 --- /dev/null +++ b/source/patterns/@aws-solutions-constructs/aws-sqs-pipes-stepfunctions/test/integ.sqspstp-set-queue-batch-size.js.snapshot/sqspstp-set-queue-batch-size.assets.json @@ -0,0 +1,19 @@ +{ + "version": "38.0.1", + "files": { + "b608de4251b772257f786d1776e1bb2dbb6566658681631d71e5741f2e95c986": { + "source": { + "path": "sqspstp-set-queue-batch-size.template.json", + "packaging": "file" + }, + "destinations": { + "current_account-current_region": { + "bucketName": "cdk-hnb659fds-assets-${AWS::AccountId}-${AWS::Region}", + "objectKey": "b608de4251b772257f786d1776e1bb2dbb6566658681631d71e5741f2e95c986.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-sqs-pipes-stepfunctions/test/integ.sqspstp-set-queue-batch-size.js.snapshot/sqspstp-set-queue-batch-size.template.json b/source/patterns/@aws-solutions-constructs/aws-sqs-pipes-stepfunctions/test/integ.sqspstp-set-queue-batch-size.js.snapshot/sqspstp-set-queue-batch-size.template.json new file mode 100644 index 000000000..d3a6340f7 --- /dev/null +++ b/source/patterns/@aws-solutions-constructs/aws-sqs-pipes-stepfunctions/test/integ.sqspstp-set-queue-batch-size.js.snapshot/sqspstp-set-queue-batch-size.template.json @@ -0,0 +1,658 @@ +{ + "Resources": { + "lambdas3stptestServiceRoleF17BB6C7": { + "Type": "AWS::IAM::Role", + "Properties": { + "AssumeRolePolicyDocument": { + "Statement": [ + { + "Action": "sts:AssumeRole", + "Effect": "Allow", + "Principal": { + "Service": "lambda.amazonaws.com" + } + } + ], + "Version": "2012-10-17" + }, + "ManagedPolicyArns": [ + { + "Fn::Join": [ + "", + [ + "arn:", + { + "Ref": "AWS::Partition" + }, + ":iam::aws:policy/service-role/AWSLambdaBasicExecutionRole" + ] + ] + } + ] + } + }, + "lambdas3stptest9FBDC6CE": { + "Type": "AWS::Lambda::Function", + "Properties": { + "Code": { + "ZipFile": "exports.handler = async (event) => console.log(event)" + }, + "Handler": "index.handler", + "Role": { + "Fn::GetAtt": [ + "lambdas3stptestServiceRoleF17BB6C7", + "Arn" + ] + }, + "Runtime": "nodejs20.x" + }, + "DependsOn": [ + "lambdas3stptestServiceRoleF17BB6C7" + ], + "Metadata": { + "cfn_nag": { + "rules_to_suppress": [ + { + "id": "W58", + "reason": "This Lambda Function is created for integration testing purposes only and is not part of an actual construct" + }, + { + "id": "W89", + "reason": "This Lambda Function is created for integration testing purposes only and is not part of an actual construct" + }, + { + "id": "W92", + "reason": "This Lambda Function is created for integration testing purposes only and is not part of an actual construct" + } + ] + } + } + }, + "testsqspipesstatesconstructqueuedlq420A82FD": { + "Type": "AWS::SQS::Queue", + "Properties": { + "KmsMasterKeyId": "alias/aws/sqs" + }, + "UpdateReplacePolicy": "Delete", + "DeletionPolicy": "Delete" + }, + "testsqspipesstatesconstructqueuedlqPolicyB1D70483": { + "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": [ + "testsqspipesstatesconstructqueuedlq420A82FD", + "Arn" + ] + }, + "Sid": "QueueOwnerOnlyAccess" + }, + { + "Action": "SQS:*", + "Condition": { + "Bool": { + "aws:SecureTransport": "false" + } + }, + "Effect": "Deny", + "Principal": { + "AWS": "*" + }, + "Resource": { + "Fn::GetAtt": [ + "testsqspipesstatesconstructqueuedlq420A82FD", + "Arn" + ] + }, + "Sid": "HttpsOnly" + } + ], + "Version": "2012-10-17" + }, + "Queues": [ + { + "Ref": "testsqspipesstatesconstructqueuedlq420A82FD" + } + ] + } + }, + "testsqspipesstatesconstructqueueA7C76715": { + "Type": "AWS::SQS::Queue", + "Properties": { + "KmsMasterKeyId": "alias/aws/sqs", + "RedrivePolicy": { + "deadLetterTargetArn": { + "Fn::GetAtt": [ + "testsqspipesstatesconstructqueuedlq420A82FD", + "Arn" + ] + }, + "maxReceiveCount": 15 + } + }, + "UpdateReplacePolicy": "Delete", + "DeletionPolicy": "Delete" + }, + "testsqspipesstatesconstructqueuePolicyFD32B562": { + "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": [ + "testsqspipesstatesconstructqueueA7C76715", + "Arn" + ] + }, + "Sid": "QueueOwnerOnlyAccess" + }, + { + "Action": "SQS:*", + "Condition": { + "Bool": { + "aws:SecureTransport": "false" + } + }, + "Effect": "Deny", + "Principal": { + "AWS": "*" + }, + "Resource": { + "Fn::GetAtt": [ + "testsqspipesstatesconstructqueueA7C76715", + "Arn" + ] + }, + "Sid": "HttpsOnly" + } + ], + "Version": "2012-10-17" + }, + "Queues": [ + { + "Ref": "testsqspipesstatesconstructqueueA7C76715" + } + ] + } + }, + "testsqspipesstatesconstructStateMachineLogGroupADE94F1D": { + "Type": "AWS::Logs::LogGroup", + "Properties": { + "LogGroupName": { + "Fn::Join": [ + "", + [ + "/aws/vendedlogs/states/constructs/sqspstp-set-queue-batch-sizetest-sqs-pipes-states-constructStateMachineLog-", + { + "Fn::Select": [ + 2, + { + "Fn::Split": [ + "/", + { + "Ref": "AWS::StackId" + } + ] + } + ] + } + ] + ] + } + }, + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Retain", + "Metadata": { + "cfn_nag": { + "rules_to_suppress": [ + { + "id": "W86", + "reason": "Retention period for CloudWatchLogs LogGroups are set to 'Never Expire' to preserve customer data indefinitely" + }, + { + "id": "W84", + "reason": "By default CloudWatchLogs LogGroups data is encrypted using the CloudWatch server-side encryption keys (AWS Managed Keys)" + } + ] + } + } + }, + "testsqspipesstatesconstructStateMachineRoleBF97BFC0": { + "Type": "AWS::IAM::Role", + "Properties": { + "AssumeRolePolicyDocument": { + "Statement": [ + { + "Action": "sts:AssumeRole", + "Effect": "Allow", + "Principal": { + "Service": "states.amazonaws.com" + } + } + ], + "Version": "2012-10-17" + } + } + }, + "testsqspipesstatesconstructStateMachineRoleDefaultPolicyD1BA2BF2": { + "Type": "AWS::IAM::Policy", + "Properties": { + "PolicyDocument": { + "Statement": [ + { + "Action": "lambda:InvokeFunction", + "Effect": "Allow", + "Resource": [ + { + "Fn::GetAtt": [ + "lambdas3stptest9FBDC6CE", + "Arn" + ] + }, + { + "Fn::Join": [ + "", + [ + { + "Fn::GetAtt": [ + "lambdas3stptest9FBDC6CE", + "Arn" + ] + }, + ":*" + ] + ] + } + ] + }, + { + "Action": [ + "logs:CreateLogDelivery", + "logs:DeleteLogDelivery", + "logs:DescribeLogGroups", + "logs:DescribeResourcePolicies", + "logs:GetLogDelivery", + "logs:ListLogDeliveries", + "logs:PutResourcePolicy", + "logs:UpdateLogDelivery" + ], + "Effect": "Allow", + "Resource": "*" + } + ], + "Version": "2012-10-17" + }, + "PolicyName": "testsqspipesstatesconstructStateMachineRoleDefaultPolicyD1BA2BF2", + "Roles": [ + { + "Ref": "testsqspipesstatesconstructStateMachineRoleBF97BFC0" + } + ] + }, + "Metadata": { + "cfn_nag": { + "rules_to_suppress": [ + { + "id": "W12", + "reason": "These are CDK defaults. The 'LogDelivery' actions do not support resource-level authorizations. Any logging is done by State Machine code" + } + ] + } + } + }, + "testsqspipesstatesconstructStateMachine29272AA9": { + "Type": "AWS::StepFunctions::StateMachine", + "Properties": { + "DefinitionString": { + "Fn::Join": [ + "", + [ + "{\"StartAt\":\"tasks3stp-test\",\"States\":{\"tasks3stp-test\":{\"End\":true,\"Retry\":[{\"ErrorEquals\":[\"Lambda.ClientExecutionTimeoutException\",\"Lambda.ServiceException\",\"Lambda.AWSLambdaException\",\"Lambda.SdkClientException\"],\"IntervalSeconds\":2,\"MaxAttempts\":6,\"BackoffRate\":2}],\"Type\":\"Task\",\"Resource\":\"arn:", + { + "Ref": "AWS::Partition" + }, + ":states:::lambda:invoke\",\"Parameters\":{\"FunctionName\":\"", + { + "Fn::GetAtt": [ + "lambdas3stptest9FBDC6CE", + "Arn" + ] + }, + "\",\"Payload.$\":\"$\"}}}}" + ] + ] + }, + "LoggingConfiguration": { + "Destinations": [ + { + "CloudWatchLogsLogGroup": { + "LogGroupArn": { + "Fn::GetAtt": [ + "testsqspipesstatesconstructStateMachineLogGroupADE94F1D", + "Arn" + ] + } + } + } + ], + "Level": "ERROR" + }, + "RoleArn": { + "Fn::GetAtt": [ + "testsqspipesstatesconstructStateMachineRoleBF97BFC0", + "Arn" + ] + } + }, + "DependsOn": [ + "testsqspipesstatesconstructStateMachineRoleDefaultPolicyD1BA2BF2", + "testsqspipesstatesconstructStateMachineRoleBF97BFC0" + ], + "UpdateReplacePolicy": "Delete", + "DeletionPolicy": "Delete" + }, + "testsqspipesstatesconstructExecutionFailedAlarm1002FF55": { + "Type": "AWS::CloudWatch::Alarm", + "Properties": { + "AlarmDescription": "Alarm for the number of executions that failed exceeded the threshold of 1. ", + "ComparisonOperator": "GreaterThanOrEqualToThreshold", + "Dimensions": [ + { + "Name": "StateMachineArn", + "Value": { + "Ref": "testsqspipesstatesconstructStateMachine29272AA9" + } + } + ], + "EvaluationPeriods": 1, + "MetricName": "ExecutionsFailed", + "Namespace": "AWS/States", + "Period": 300, + "Statistic": "Sum", + "Threshold": 1 + } + }, + "testsqspipesstatesconstructExecutionThrottledAlarm0242B01A": { + "Type": "AWS::CloudWatch::Alarm", + "Properties": { + "AlarmDescription": "Alarm for the number of executions that throttled exceeded the threshold of 1. ", + "ComparisonOperator": "GreaterThanOrEqualToThreshold", + "Dimensions": [ + { + "Name": "StateMachineArn", + "Value": { + "Ref": "testsqspipesstatesconstructStateMachine29272AA9" + } + } + ], + "EvaluationPeriods": 1, + "MetricName": "ExecutionThrottled", + "Namespace": "AWS/States", + "Period": 300, + "Statistic": "Sum", + "Threshold": 1 + } + }, + "testsqspipesstatesconstructExecutionAbortedAlarm14349A7B": { + "Type": "AWS::CloudWatch::Alarm", + "Properties": { + "AlarmDescription": "Alarm for the number of executions that aborted exceeded the threshold of 1. ", + "ComparisonOperator": "GreaterThanOrEqualToThreshold", + "Dimensions": [ + { + "Name": "StateMachineArn", + "Value": { + "Ref": "testsqspipesstatesconstructStateMachine29272AA9" + } + } + ], + "EvaluationPeriods": 1, + "MetricName": "ExecutionsAborted", + "Namespace": "AWS/States", + "Period": 300, + "Statistic": "Maximum", + "Threshold": 1 + } + }, + "testsqspipesstatesconstructPipeRoletestsqspipesstatesconstruct2CC9A13C": { + "Type": "AWS::IAM::Role", + "Properties": { + "AssumeRolePolicyDocument": { + "Statement": [ + { + "Action": "sts:AssumeRole", + "Effect": "Allow", + "Principal": { + "Service": "pipes.amazonaws.com" + } + } + ], + "Version": "2012-10-17" + }, + "Policies": [ + { + "PolicyDocument": { + "Statement": [ + { + "Action": [ + "sqs:DeleteMessage", + "sqs:GetQueueAttributes", + "sqs:ReceiveMessage" + ], + "Effect": "Allow", + "Resource": { + "Fn::GetAtt": [ + "testsqspipesstatesconstructqueueA7C76715", + "Arn" + ] + } + } + ], + "Version": "2012-10-17" + }, + "PolicyName": "sourcePolicy" + }, + { + "PolicyDocument": { + "Statement": [ + { + "Action": "states:StartExecution", + "Effect": "Allow", + "Resource": { + "Ref": "testsqspipesstatesconstructStateMachine29272AA9" + } + } + ], + "Version": "2012-10-17" + }, + "PolicyName": "targetPolicy" + } + ] + }, + "Metadata": { + "guard": { + "SuppressedRules": [ + "IAM_NO_INLINE_POLICY_CHECK" + ] + } + } + }, + "testsqspipesstatesconstructLogGrouptestsqspipesstatesconstructF827FE15": { + "Type": "AWS::Logs::LogGroup", + "Properties": { + "LogGroupName": { + "Fn::Join": [ + "", + [ + "/aws/vendedlogs/pipes/constructs/sqspstp-set-queue-batch-sizetest-sqs-pipes-states-constructPipesLog-", + { + "Fn::Select": [ + 2, + { + "Fn::Split": [ + "/", + { + "Ref": "AWS::StackId" + } + ] + } + ] + } + ] + ] + } + }, + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Retain", + "Metadata": { + "cfn_nag": { + "rules_to_suppress": [ + { + "id": "W86", + "reason": "Retention period for CloudWatchLogs LogGroups are set to 'Never Expire' to preserve customer data indefinitely" + }, + { + "id": "W84", + "reason": "By default CloudWatchLogs LogGroups data is encrypted using the CloudWatch server-side encryption keys (AWS Managed Keys)" + } + ] + } + } + }, + "testsqspipesstatesconstructpipetestsqspipesstatesconstruct71A64A15": { + "Type": "AWS::Pipes::Pipe", + "Properties": { + "LogConfiguration": { + "CloudwatchLogsLogDestination": { + "LogGroupArn": { + "Fn::GetAtt": [ + "testsqspipesstatesconstructLogGrouptestsqspipesstatesconstructF827FE15", + "Arn" + ] + } + }, + "Level": "INFO" + }, + "RoleArn": { + "Fn::GetAtt": [ + "testsqspipesstatesconstructPipeRoletestsqspipesstatesconstruct2CC9A13C", + "Arn" + ] + }, + "Source": { + "Fn::GetAtt": [ + "testsqspipesstatesconstructqueueA7C76715", + "Arn" + ] + }, + "SourceParameters": { + "SqsQueueParameters": { + "BatchSize": 3 + } + }, + "Target": { + "Ref": "testsqspipesstatesconstructStateMachine29272AA9" + }, + "TargetParameters": { + "StepFunctionStateMachineParameters": { + "InvocationType": "FIRE_AND_FORGET" + } + } + } + } + }, + "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-sqs-pipes-stepfunctions/test/integ.sqspstp-set-queue-batch-size.js.snapshot/sqspstpsetqueuebatchsizeIntegDefaultTestDeployAssertA1752E9D.assets.json b/source/patterns/@aws-solutions-constructs/aws-sqs-pipes-stepfunctions/test/integ.sqspstp-set-queue-batch-size.js.snapshot/sqspstpsetqueuebatchsizeIntegDefaultTestDeployAssertA1752E9D.assets.json new file mode 100644 index 000000000..2323278a0 --- /dev/null +++ b/source/patterns/@aws-solutions-constructs/aws-sqs-pipes-stepfunctions/test/integ.sqspstp-set-queue-batch-size.js.snapshot/sqspstpsetqueuebatchsizeIntegDefaultTestDeployAssertA1752E9D.assets.json @@ -0,0 +1,19 @@ +{ + "version": "38.0.1", + "files": { + "21fbb51d7b23f6a6c262b46a9caee79d744a3ac019fd45422d988b96d44b2a22": { + "source": { + "path": "sqspstpsetqueuebatchsizeIntegDefaultTestDeployAssertA1752E9D.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-sqs-pipes-stepfunctions/test/integ.sqspstp-set-queue-batch-size.js.snapshot/sqspstpsetqueuebatchsizeIntegDefaultTestDeployAssertA1752E9D.template.json b/source/patterns/@aws-solutions-constructs/aws-sqs-pipes-stepfunctions/test/integ.sqspstp-set-queue-batch-size.js.snapshot/sqspstpsetqueuebatchsizeIntegDefaultTestDeployAssertA1752E9D.template.json new file mode 100644 index 000000000..ad9d0fb73 --- /dev/null +++ b/source/patterns/@aws-solutions-constructs/aws-sqs-pipes-stepfunctions/test/integ.sqspstp-set-queue-batch-size.js.snapshot/sqspstpsetqueuebatchsizeIntegDefaultTestDeployAssertA1752E9D.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-sqs-pipes-stepfunctions/test/integ.sqspstp-set-queue-batch-size.js.snapshot/tree.json b/source/patterns/@aws-solutions-constructs/aws-sqs-pipes-stepfunctions/test/integ.sqspstp-set-queue-batch-size.js.snapshot/tree.json new file mode 100644 index 000000000..a51ff4640 --- /dev/null +++ b/source/patterns/@aws-solutions-constructs/aws-sqs-pipes-stepfunctions/test/integ.sqspstp-set-queue-batch-size.js.snapshot/tree.json @@ -0,0 +1,961 @@ +{ + "version": "tree-0.1", + "tree": { + "id": "App", + "path": "", + "children": { + "sqspstp-set-queue-batch-size": { + "id": "sqspstp-set-queue-batch-size", + "path": "sqspstp-set-queue-batch-size", + "children": { + "lambdas3stp-test": { + "id": "lambdas3stp-test", + "path": "sqspstp-set-queue-batch-size/lambdas3stp-test", + "children": { + "ServiceRole": { + "id": "ServiceRole", + "path": "sqspstp-set-queue-batch-size/lambdas3stp-test/ServiceRole", + "children": { + "ImportServiceRole": { + "id": "ImportServiceRole", + "path": "sqspstp-set-queue-batch-size/lambdas3stp-test/ServiceRole/ImportServiceRole", + "constructInfo": { + "fqn": "aws-cdk-lib.Resource", + "version": "2.161.0" + } + }, + "Resource": { + "id": "Resource", + "path": "sqspstp-set-queue-batch-size/lambdas3stp-test/ServiceRole/Resource", + "attributes": { + "aws:cdk:cloudformation:type": "AWS::IAM::Role", + "aws:cdk:cloudformation:props": { + "assumeRolePolicyDocument": { + "Statement": [ + { + "Action": "sts:AssumeRole", + "Effect": "Allow", + "Principal": { + "Service": "lambda.amazonaws.com" + } + } + ], + "Version": "2012-10-17" + }, + "managedPolicyArns": [ + { + "Fn::Join": [ + "", + [ + "arn:", + { + "Ref": "AWS::Partition" + }, + ":iam::aws:policy/service-role/AWSLambdaBasicExecutionRole" + ] + ] + } + ] + } + }, + "constructInfo": { + "fqn": "aws-cdk-lib.aws_iam.CfnRole", + "version": "2.161.0" + } + } + }, + "constructInfo": { + "fqn": "aws-cdk-lib.aws_iam.Role", + "version": "2.161.0" + } + }, + "Resource": { + "id": "Resource", + "path": "sqspstp-set-queue-batch-size/lambdas3stp-test/Resource", + "attributes": { + "aws:cdk:cloudformation:type": "AWS::Lambda::Function", + "aws:cdk:cloudformation:props": { + "code": { + "zipFile": "exports.handler = async (event) => console.log(event)" + }, + "handler": "index.handler", + "role": { + "Fn::GetAtt": [ + "lambdas3stptestServiceRoleF17BB6C7", + "Arn" + ] + }, + "runtime": "nodejs20.x" + } + }, + "constructInfo": { + "fqn": "aws-cdk-lib.aws_lambda.CfnFunction", + "version": "2.161.0" + } + } + }, + "constructInfo": { + "fqn": "aws-cdk-lib.aws_lambda.Function", + "version": "2.161.0" + } + }, + "tasks3stp-test": { + "id": "tasks3stp-test", + "path": "sqspstp-set-queue-batch-size/tasks3stp-test", + "constructInfo": { + "fqn": "aws-cdk-lib.aws_stepfunctions_tasks.LambdaInvoke", + "version": "2.161.0" + } + }, + "test-sqs-pipes-states-construct": { + "id": "test-sqs-pipes-states-construct", + "path": "sqspstp-set-queue-batch-size/test-sqs-pipes-states-construct", + "children": { + "queue-dlq": { + "id": "queue-dlq", + "path": "sqspstp-set-queue-batch-size/test-sqs-pipes-states-construct/queue-dlq", + "children": { + "Resource": { + "id": "Resource", + "path": "sqspstp-set-queue-batch-size/test-sqs-pipes-states-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.161.0" + } + }, + "Policy": { + "id": "Policy", + "path": "sqspstp-set-queue-batch-size/test-sqs-pipes-states-construct/queue-dlq/Policy", + "children": { + "Resource": { + "id": "Resource", + "path": "sqspstp-set-queue-batch-size/test-sqs-pipes-states-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": [ + "testsqspipesstatesconstructqueuedlq420A82FD", + "Arn" + ] + }, + "Sid": "QueueOwnerOnlyAccess" + }, + { + "Action": "SQS:*", + "Condition": { + "Bool": { + "aws:SecureTransport": "false" + } + }, + "Effect": "Deny", + "Principal": { + "AWS": "*" + }, + "Resource": { + "Fn::GetAtt": [ + "testsqspipesstatesconstructqueuedlq420A82FD", + "Arn" + ] + }, + "Sid": "HttpsOnly" + } + ], + "Version": "2012-10-17" + }, + "queues": [ + { + "Ref": "testsqspipesstatesconstructqueuedlq420A82FD" + } + ] + } + }, + "constructInfo": { + "fqn": "aws-cdk-lib.aws_sqs.CfnQueuePolicy", + "version": "2.161.0" + } + } + }, + "constructInfo": { + "fqn": "aws-cdk-lib.aws_sqs.QueuePolicy", + "version": "2.161.0" + } + } + }, + "constructInfo": { + "fqn": "aws-cdk-lib.aws_sqs.Queue", + "version": "2.161.0" + } + }, + "queue": { + "id": "queue", + "path": "sqspstp-set-queue-batch-size/test-sqs-pipes-states-construct/queue", + "children": { + "Resource": { + "id": "Resource", + "path": "sqspstp-set-queue-batch-size/test-sqs-pipes-states-construct/queue/Resource", + "attributes": { + "aws:cdk:cloudformation:type": "AWS::SQS::Queue", + "aws:cdk:cloudformation:props": { + "kmsMasterKeyId": "alias/aws/sqs", + "redrivePolicy": { + "deadLetterTargetArn": { + "Fn::GetAtt": [ + "testsqspipesstatesconstructqueuedlq420A82FD", + "Arn" + ] + }, + "maxReceiveCount": 15 + } + } + }, + "constructInfo": { + "fqn": "aws-cdk-lib.aws_sqs.CfnQueue", + "version": "2.161.0" + } + }, + "Policy": { + "id": "Policy", + "path": "sqspstp-set-queue-batch-size/test-sqs-pipes-states-construct/queue/Policy", + "children": { + "Resource": { + "id": "Resource", + "path": "sqspstp-set-queue-batch-size/test-sqs-pipes-states-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": [ + "testsqspipesstatesconstructqueueA7C76715", + "Arn" + ] + }, + "Sid": "QueueOwnerOnlyAccess" + }, + { + "Action": "SQS:*", + "Condition": { + "Bool": { + "aws:SecureTransport": "false" + } + }, + "Effect": "Deny", + "Principal": { + "AWS": "*" + }, + "Resource": { + "Fn::GetAtt": [ + "testsqspipesstatesconstructqueueA7C76715", + "Arn" + ] + }, + "Sid": "HttpsOnly" + } + ], + "Version": "2012-10-17" + }, + "queues": [ + { + "Ref": "testsqspipesstatesconstructqueueA7C76715" + } + ] + } + }, + "constructInfo": { + "fqn": "aws-cdk-lib.aws_sqs.CfnQueuePolicy", + "version": "2.161.0" + } + } + }, + "constructInfo": { + "fqn": "aws-cdk-lib.aws_sqs.QueuePolicy", + "version": "2.161.0" + } + } + }, + "constructInfo": { + "fqn": "aws-cdk-lib.aws_sqs.Queue", + "version": "2.161.0" + } + }, + "StateMachineLogGroup": { + "id": "StateMachineLogGroup", + "path": "sqspstp-set-queue-batch-size/test-sqs-pipes-states-construct/StateMachineLogGroup", + "children": { + "Resource": { + "id": "Resource", + "path": "sqspstp-set-queue-batch-size/test-sqs-pipes-states-construct/StateMachineLogGroup/Resource", + "attributes": { + "aws:cdk:cloudformation:type": "AWS::Logs::LogGroup", + "aws:cdk:cloudformation:props": { + "logGroupName": { + "Fn::Join": [ + "", + [ + "/aws/vendedlogs/states/constructs/sqspstp-set-queue-batch-sizetest-sqs-pipes-states-constructStateMachineLog-", + { + "Fn::Select": [ + 2, + { + "Fn::Split": [ + "/", + { + "Ref": "AWS::StackId" + } + ] + } + ] + } + ] + ] + } + } + }, + "constructInfo": { + "fqn": "aws-cdk-lib.aws_logs.CfnLogGroup", + "version": "2.161.0" + } + } + }, + "constructInfo": { + "fqn": "aws-cdk-lib.aws_logs.LogGroup", + "version": "2.161.0" + } + }, + "StateMachine": { + "id": "StateMachine", + "path": "sqspstp-set-queue-batch-size/test-sqs-pipes-states-construct/StateMachine", + "children": { + "Role": { + "id": "Role", + "path": "sqspstp-set-queue-batch-size/test-sqs-pipes-states-construct/StateMachine/Role", + "children": { + "ImportRole": { + "id": "ImportRole", + "path": "sqspstp-set-queue-batch-size/test-sqs-pipes-states-construct/StateMachine/Role/ImportRole", + "constructInfo": { + "fqn": "aws-cdk-lib.Resource", + "version": "2.161.0" + } + }, + "Resource": { + "id": "Resource", + "path": "sqspstp-set-queue-batch-size/test-sqs-pipes-states-construct/StateMachine/Role/Resource", + "attributes": { + "aws:cdk:cloudformation:type": "AWS::IAM::Role", + "aws:cdk:cloudformation:props": { + "assumeRolePolicyDocument": { + "Statement": [ + { + "Action": "sts:AssumeRole", + "Effect": "Allow", + "Principal": { + "Service": "states.amazonaws.com" + } + } + ], + "Version": "2012-10-17" + } + } + }, + "constructInfo": { + "fqn": "aws-cdk-lib.aws_iam.CfnRole", + "version": "2.161.0" + } + }, + "DefaultPolicy": { + "id": "DefaultPolicy", + "path": "sqspstp-set-queue-batch-size/test-sqs-pipes-states-construct/StateMachine/Role/DefaultPolicy", + "children": { + "Resource": { + "id": "Resource", + "path": "sqspstp-set-queue-batch-size/test-sqs-pipes-states-construct/StateMachine/Role/DefaultPolicy/Resource", + "attributes": { + "aws:cdk:cloudformation:type": "AWS::IAM::Policy", + "aws:cdk:cloudformation:props": { + "policyDocument": { + "Statement": [ + { + "Action": "lambda:InvokeFunction", + "Effect": "Allow", + "Resource": [ + { + "Fn::GetAtt": [ + "lambdas3stptest9FBDC6CE", + "Arn" + ] + }, + { + "Fn::Join": [ + "", + [ + { + "Fn::GetAtt": [ + "lambdas3stptest9FBDC6CE", + "Arn" + ] + }, + ":*" + ] + ] + } + ] + }, + { + "Action": [ + "logs:CreateLogDelivery", + "logs:DeleteLogDelivery", + "logs:DescribeLogGroups", + "logs:DescribeResourcePolicies", + "logs:GetLogDelivery", + "logs:ListLogDeliveries", + "logs:PutResourcePolicy", + "logs:UpdateLogDelivery" + ], + "Effect": "Allow", + "Resource": "*" + } + ], + "Version": "2012-10-17" + }, + "policyName": "testsqspipesstatesconstructStateMachineRoleDefaultPolicyD1BA2BF2", + "roles": [ + { + "Ref": "testsqspipesstatesconstructStateMachineRoleBF97BFC0" + } + ] + } + }, + "constructInfo": { + "fqn": "aws-cdk-lib.aws_iam.CfnPolicy", + "version": "2.161.0" + } + } + }, + "constructInfo": { + "fqn": "aws-cdk-lib.aws_iam.Policy", + "version": "2.161.0" + } + } + }, + "constructInfo": { + "fqn": "aws-cdk-lib.aws_iam.Role", + "version": "2.161.0" + } + }, + "Resource": { + "id": "Resource", + "path": "sqspstp-set-queue-batch-size/test-sqs-pipes-states-construct/StateMachine/Resource", + "attributes": { + "aws:cdk:cloudformation:type": "AWS::StepFunctions::StateMachine", + "aws:cdk:cloudformation:props": { + "definitionString": { + "Fn::Join": [ + "", + [ + "{\"StartAt\":\"tasks3stp-test\",\"States\":{\"tasks3stp-test\":{\"End\":true,\"Retry\":[{\"ErrorEquals\":[\"Lambda.ClientExecutionTimeoutException\",\"Lambda.ServiceException\",\"Lambda.AWSLambdaException\",\"Lambda.SdkClientException\"],\"IntervalSeconds\":2,\"MaxAttempts\":6,\"BackoffRate\":2}],\"Type\":\"Task\",\"Resource\":\"arn:", + { + "Ref": "AWS::Partition" + }, + ":states:::lambda:invoke\",\"Parameters\":{\"FunctionName\":\"", + { + "Fn::GetAtt": [ + "lambdas3stptest9FBDC6CE", + "Arn" + ] + }, + "\",\"Payload.$\":\"$\"}}}}" + ] + ] + }, + "loggingConfiguration": { + "destinations": [ + { + "cloudWatchLogsLogGroup": { + "logGroupArn": { + "Fn::GetAtt": [ + "testsqspipesstatesconstructStateMachineLogGroupADE94F1D", + "Arn" + ] + } + } + } + ], + "level": "ERROR" + }, + "roleArn": { + "Fn::GetAtt": [ + "testsqspipesstatesconstructStateMachineRoleBF97BFC0", + "Arn" + ] + } + } + }, + "constructInfo": { + "fqn": "aws-cdk-lib.aws_stepfunctions.CfnStateMachine", + "version": "2.161.0" + } + } + }, + "constructInfo": { + "fqn": "aws-cdk-lib.aws_stepfunctions.StateMachine", + "version": "2.161.0" + } + }, + "ExecutionFailedAlarm": { + "id": "ExecutionFailedAlarm", + "path": "sqspstp-set-queue-batch-size/test-sqs-pipes-states-construct/ExecutionFailedAlarm", + "children": { + "Resource": { + "id": "Resource", + "path": "sqspstp-set-queue-batch-size/test-sqs-pipes-states-construct/ExecutionFailedAlarm/Resource", + "attributes": { + "aws:cdk:cloudformation:type": "AWS::CloudWatch::Alarm", + "aws:cdk:cloudformation:props": { + "alarmDescription": "Alarm for the number of executions that failed exceeded the threshold of 1. ", + "comparisonOperator": "GreaterThanOrEqualToThreshold", + "dimensions": [ + { + "name": "StateMachineArn", + "value": { + "Ref": "testsqspipesstatesconstructStateMachine29272AA9" + } + } + ], + "evaluationPeriods": 1, + "metricName": "ExecutionsFailed", + "namespace": "AWS/States", + "period": 300, + "statistic": "Sum", + "threshold": 1 + } + }, + "constructInfo": { + "fqn": "aws-cdk-lib.aws_cloudwatch.CfnAlarm", + "version": "2.161.0" + } + } + }, + "constructInfo": { + "fqn": "aws-cdk-lib.aws_cloudwatch.Alarm", + "version": "2.161.0" + } + }, + "ExecutionThrottledAlarm": { + "id": "ExecutionThrottledAlarm", + "path": "sqspstp-set-queue-batch-size/test-sqs-pipes-states-construct/ExecutionThrottledAlarm", + "children": { + "Resource": { + "id": "Resource", + "path": "sqspstp-set-queue-batch-size/test-sqs-pipes-states-construct/ExecutionThrottledAlarm/Resource", + "attributes": { + "aws:cdk:cloudformation:type": "AWS::CloudWatch::Alarm", + "aws:cdk:cloudformation:props": { + "alarmDescription": "Alarm for the number of executions that throttled exceeded the threshold of 1. ", + "comparisonOperator": "GreaterThanOrEqualToThreshold", + "dimensions": [ + { + "name": "StateMachineArn", + "value": { + "Ref": "testsqspipesstatesconstructStateMachine29272AA9" + } + } + ], + "evaluationPeriods": 1, + "metricName": "ExecutionThrottled", + "namespace": "AWS/States", + "period": 300, + "statistic": "Sum", + "threshold": 1 + } + }, + "constructInfo": { + "fqn": "aws-cdk-lib.aws_cloudwatch.CfnAlarm", + "version": "2.161.0" + } + } + }, + "constructInfo": { + "fqn": "aws-cdk-lib.aws_cloudwatch.Alarm", + "version": "2.161.0" + } + }, + "ExecutionAbortedAlarm": { + "id": "ExecutionAbortedAlarm", + "path": "sqspstp-set-queue-batch-size/test-sqs-pipes-states-construct/ExecutionAbortedAlarm", + "children": { + "Resource": { + "id": "Resource", + "path": "sqspstp-set-queue-batch-size/test-sqs-pipes-states-construct/ExecutionAbortedAlarm/Resource", + "attributes": { + "aws:cdk:cloudformation:type": "AWS::CloudWatch::Alarm", + "aws:cdk:cloudformation:props": { + "alarmDescription": "Alarm for the number of executions that aborted exceeded the threshold of 1. ", + "comparisonOperator": "GreaterThanOrEqualToThreshold", + "dimensions": [ + { + "name": "StateMachineArn", + "value": { + "Ref": "testsqspipesstatesconstructStateMachine29272AA9" + } + } + ], + "evaluationPeriods": 1, + "metricName": "ExecutionsAborted", + "namespace": "AWS/States", + "period": 300, + "statistic": "Maximum", + "threshold": 1 + } + }, + "constructInfo": { + "fqn": "aws-cdk-lib.aws_cloudwatch.CfnAlarm", + "version": "2.161.0" + } + } + }, + "constructInfo": { + "fqn": "aws-cdk-lib.aws_cloudwatch.Alarm", + "version": "2.161.0" + } + }, + "PipeRole--test-sqs-pipes-states-construct": { + "id": "PipeRole--test-sqs-pipes-states-construct", + "path": "sqspstp-set-queue-batch-size/test-sqs-pipes-states-construct/PipeRole--test-sqs-pipes-states-construct", + "children": { + "ImportPipeRole--test-sqs-pipes-states-construct": { + "id": "ImportPipeRole--test-sqs-pipes-states-construct", + "path": "sqspstp-set-queue-batch-size/test-sqs-pipes-states-construct/PipeRole--test-sqs-pipes-states-construct/ImportPipeRole--test-sqs-pipes-states-construct", + "constructInfo": { + "fqn": "aws-cdk-lib.Resource", + "version": "2.161.0" + } + }, + "Resource": { + "id": "Resource", + "path": "sqspstp-set-queue-batch-size/test-sqs-pipes-states-construct/PipeRole--test-sqs-pipes-states-construct/Resource", + "attributes": { + "aws:cdk:cloudformation:type": "AWS::IAM::Role", + "aws:cdk:cloudformation:props": { + "assumeRolePolicyDocument": { + "Statement": [ + { + "Action": "sts:AssumeRole", + "Effect": "Allow", + "Principal": { + "Service": "pipes.amazonaws.com" + } + } + ], + "Version": "2012-10-17" + }, + "policies": [ + { + "policyName": "sourcePolicy", + "policyDocument": { + "Statement": [ + { + "Action": [ + "sqs:DeleteMessage", + "sqs:GetQueueAttributes", + "sqs:ReceiveMessage" + ], + "Effect": "Allow", + "Resource": { + "Fn::GetAtt": [ + "testsqspipesstatesconstructqueueA7C76715", + "Arn" + ] + } + } + ], + "Version": "2012-10-17" + } + }, + { + "policyName": "targetPolicy", + "policyDocument": { + "Statement": [ + { + "Action": "states:StartExecution", + "Effect": "Allow", + "Resource": { + "Ref": "testsqspipesstatesconstructStateMachine29272AA9" + } + } + ], + "Version": "2012-10-17" + } + } + ] + } + }, + "constructInfo": { + "fqn": "aws-cdk-lib.aws_iam.CfnRole", + "version": "2.161.0" + } + } + }, + "constructInfo": { + "fqn": "aws-cdk-lib.aws_iam.Role", + "version": "2.161.0" + } + }, + "LogGroup-test-sqs-pipes-states-construct": { + "id": "LogGroup-test-sqs-pipes-states-construct", + "path": "sqspstp-set-queue-batch-size/test-sqs-pipes-states-construct/LogGroup-test-sqs-pipes-states-construct", + "children": { + "Resource": { + "id": "Resource", + "path": "sqspstp-set-queue-batch-size/test-sqs-pipes-states-construct/LogGroup-test-sqs-pipes-states-construct/Resource", + "attributes": { + "aws:cdk:cloudformation:type": "AWS::Logs::LogGroup", + "aws:cdk:cloudformation:props": { + "logGroupName": { + "Fn::Join": [ + "", + [ + "/aws/vendedlogs/pipes/constructs/sqspstp-set-queue-batch-sizetest-sqs-pipes-states-constructPipesLog-", + { + "Fn::Select": [ + 2, + { + "Fn::Split": [ + "/", + { + "Ref": "AWS::StackId" + } + ] + } + ] + } + ] + ] + } + } + }, + "constructInfo": { + "fqn": "aws-cdk-lib.aws_logs.CfnLogGroup", + "version": "2.161.0" + } + } + }, + "constructInfo": { + "fqn": "aws-cdk-lib.aws_logs.LogGroup", + "version": "2.161.0" + } + }, + "pipe-test-sqs-pipes-states-construct": { + "id": "pipe-test-sqs-pipes-states-construct", + "path": "sqspstp-set-queue-batch-size/test-sqs-pipes-states-construct/pipe-test-sqs-pipes-states-construct", + "attributes": { + "aws:cdk:cloudformation:type": "AWS::Pipes::Pipe", + "aws:cdk:cloudformation:props": { + "logConfiguration": { + "cloudwatchLogsLogDestination": { + "logGroupArn": { + "Fn::GetAtt": [ + "testsqspipesstatesconstructLogGrouptestsqspipesstatesconstructF827FE15", + "Arn" + ] + } + }, + "level": "INFO" + }, + "roleArn": { + "Fn::GetAtt": [ + "testsqspipesstatesconstructPipeRoletestsqspipesstatesconstruct2CC9A13C", + "Arn" + ] + }, + "source": { + "Fn::GetAtt": [ + "testsqspipesstatesconstructqueueA7C76715", + "Arn" + ] + }, + "sourceParameters": { + "sqsQueueParameters": { + "batchSize": 3 + } + }, + "target": { + "Ref": "testsqspipesstatesconstructStateMachine29272AA9" + }, + "targetParameters": { + "stepFunctionStateMachineParameters": { + "invocationType": "FIRE_AND_FORGET" + } + } + } + }, + "constructInfo": { + "fqn": "aws-cdk-lib.aws_pipes.CfnPipe", + "version": "2.161.0" + } + } + }, + "constructInfo": { + "fqn": "@aws-solutions-constructs/aws-sqs-pipes-stepfunctions.SqsToPipesToStepfunctions", + "version": "2.72.0" + } + }, + "Integ": { + "id": "Integ", + "path": "sqspstp-set-queue-batch-size/Integ", + "children": { + "DefaultTest": { + "id": "DefaultTest", + "path": "sqspstp-set-queue-batch-size/Integ/DefaultTest", + "children": { + "Default": { + "id": "Default", + "path": "sqspstp-set-queue-batch-size/Integ/DefaultTest/Default", + "constructInfo": { + "fqn": "constructs.Construct", + "version": "10.4.2" + } + }, + "DeployAssert": { + "id": "DeployAssert", + "path": "sqspstp-set-queue-batch-size/Integ/DefaultTest/DeployAssert", + "children": { + "BootstrapVersion": { + "id": "BootstrapVersion", + "path": "sqspstp-set-queue-batch-size/Integ/DefaultTest/DeployAssert/BootstrapVersion", + "constructInfo": { + "fqn": "aws-cdk-lib.CfnParameter", + "version": "2.161.0" + } + }, + "CheckBootstrapVersion": { + "id": "CheckBootstrapVersion", + "path": "sqspstp-set-queue-batch-size/Integ/DefaultTest/DeployAssert/CheckBootstrapVersion", + "constructInfo": { + "fqn": "aws-cdk-lib.CfnRule", + "version": "2.161.0" + } + } + }, + "constructInfo": { + "fqn": "aws-cdk-lib.Stack", + "version": "2.161.0" + } + } + }, + "constructInfo": { + "fqn": "@aws-cdk/integ-tests-alpha.IntegTestCase", + "version": "2.161.0-alpha.0" + } + } + }, + "constructInfo": { + "fqn": "@aws-cdk/integ-tests-alpha.IntegTest", + "version": "2.161.0-alpha.0" + } + }, + "BootstrapVersion": { + "id": "BootstrapVersion", + "path": "sqspstp-set-queue-batch-size/BootstrapVersion", + "constructInfo": { + "fqn": "aws-cdk-lib.CfnParameter", + "version": "2.161.0" + } + }, + "CheckBootstrapVersion": { + "id": "CheckBootstrapVersion", + "path": "sqspstp-set-queue-batch-size/CheckBootstrapVersion", + "constructInfo": { + "fqn": "aws-cdk-lib.CfnRule", + "version": "2.161.0" + } + } + }, + "constructInfo": { + "fqn": "aws-cdk-lib.Stack", + "version": "2.161.0" + } + }, + "Tree": { + "id": "Tree", + "path": "Tree", + "constructInfo": { + "fqn": "constructs.Construct", + "version": "10.4.2" + } + } + }, + "constructInfo": { + "fqn": "aws-cdk-lib.App", + "version": "2.161.0" + } + } +} \ No newline at end of file diff --git a/source/patterns/@aws-solutions-constructs/aws-sqs-pipes-stepfunctions/test/integ.sqspstp-set-queue-batch-size.ts b/source/patterns/@aws-solutions-constructs/aws-sqs-pipes-stepfunctions/test/integ.sqspstp-set-queue-batch-size.ts new file mode 100644 index 000000000..b2a95f294 --- /dev/null +++ b/source/patterns/@aws-solutions-constructs/aws-sqs-pipes-stepfunctions/test/integ.sqspstp-set-queue-batch-size.ts @@ -0,0 +1,41 @@ +/** + * 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. + */ + +/// !cdk-integ * +import { App, Stack } from "aws-cdk-lib"; +import { SqsToPipesToStepfunctions, SqsToPipesToStepfunctionsProps } from "../lib"; +import { generateIntegStackName } from '@aws-solutions-constructs/core'; +import { IntegTest } from '@aws-cdk/integ-tests-alpha'; +import * as defaults from '@aws-solutions-constructs/core'; + +const app = new App(); +const stack = new Stack(app, generateIntegStackName(__filename)); + +const props: SqsToPipesToStepfunctionsProps = { + stateMachineProps: { + definitionBody: defaults.CreateTestStateMachineDefinitionBody(stack, 's3stp-test') + }, + pipeProps: { + sourceParameters: { + sqsQueueParameters: { + batchSize: 3, + }, + } + } +}; + +new SqsToPipesToStepfunctions(stack, 'test-sqs-pipes-states-construct', props); + +new IntegTest(stack, 'Integ', { testCases: [ + stack +] }); diff --git a/source/patterns/@aws-solutions-constructs/aws-sqs-pipes-stepfunctions/test/integ.sqspstp-state-machine-enrichment.js.snapshot/cdk.out b/source/patterns/@aws-solutions-constructs/aws-sqs-pipes-stepfunctions/test/integ.sqspstp-state-machine-enrichment.js.snapshot/cdk.out new file mode 100644 index 000000000..c6e612584 --- /dev/null +++ b/source/patterns/@aws-solutions-constructs/aws-sqs-pipes-stepfunctions/test/integ.sqspstp-state-machine-enrichment.js.snapshot/cdk.out @@ -0,0 +1 @@ +{"version":"38.0.1"} \ No newline at end of file diff --git a/source/patterns/@aws-solutions-constructs/aws-sqs-pipes-stepfunctions/test/integ.sqspstp-state-machine-enrichment.js.snapshot/integ.json b/source/patterns/@aws-solutions-constructs/aws-sqs-pipes-stepfunctions/test/integ.sqspstp-state-machine-enrichment.js.snapshot/integ.json new file mode 100644 index 000000000..3f3c9170a --- /dev/null +++ b/source/patterns/@aws-solutions-constructs/aws-sqs-pipes-stepfunctions/test/integ.sqspstp-state-machine-enrichment.js.snapshot/integ.json @@ -0,0 +1,12 @@ +{ + "version": "38.0.1", + "testCases": { + "sqspstp-state-machine-enrichment/Integ/DefaultTest": { + "stacks": [ + "sqspstp-state-machine-enrichment" + ], + "assertionStack": "sqspstp-state-machine-enrichment/Integ/DefaultTest/DeployAssert", + "assertionStackName": "sqspstpstatemachineenrichmentIntegDefaultTestDeployAssert47A5DE6D" + } + } +} \ No newline at end of file diff --git a/source/patterns/@aws-solutions-constructs/aws-sqs-pipes-stepfunctions/test/integ.sqspstp-state-machine-enrichment.js.snapshot/manifest.json b/source/patterns/@aws-solutions-constructs/aws-sqs-pipes-stepfunctions/test/integ.sqspstp-state-machine-enrichment.js.snapshot/manifest.json new file mode 100644 index 000000000..34dc7693f --- /dev/null +++ b/source/patterns/@aws-solutions-constructs/aws-sqs-pipes-stepfunctions/test/integ.sqspstp-state-machine-enrichment.js.snapshot/manifest.json @@ -0,0 +1,241 @@ +{ + "version": "38.0.1", + "artifacts": { + "sqspstpstatemachineenrichmentIntegDefaultTestDeployAssert47A5DE6D.assets": { + "type": "cdk:asset-manifest", + "properties": { + "file": "sqspstpstatemachineenrichmentIntegDefaultTestDeployAssert47A5DE6D.assets.json", + "requiresBootstrapStackVersion": 6, + "bootstrapStackVersionSsmParameter": "/cdk-bootstrap/hnb659fds/version" + } + }, + "sqspstpstatemachineenrichmentIntegDefaultTestDeployAssert47A5DE6D": { + "type": "aws:cloudformation:stack", + "environment": "aws://unknown-account/unknown-region", + "properties": { + "templateFile": "sqspstpstatemachineenrichmentIntegDefaultTestDeployAssert47A5DE6D.template.json", + "terminationProtection": false, + "validateOnSynth": false, + "notificationArns": [], + "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": [ + "sqspstpstatemachineenrichmentIntegDefaultTestDeployAssert47A5DE6D.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": [ + "sqspstpstatemachineenrichmentIntegDefaultTestDeployAssert47A5DE6D.assets" + ], + "metadata": { + "/sqspstp-state-machine-enrichment/Integ/DefaultTest/DeployAssert/BootstrapVersion": [ + { + "type": "aws:cdk:logicalId", + "data": "BootstrapVersion" + } + ], + "/sqspstp-state-machine-enrichment/Integ/DefaultTest/DeployAssert/CheckBootstrapVersion": [ + { + "type": "aws:cdk:logicalId", + "data": "CheckBootstrapVersion" + } + ] + }, + "displayName": "sqspstp-state-machine-enrichment/Integ/DefaultTest/DeployAssert" + }, + "sqspstp-state-machine-enrichment.assets": { + "type": "cdk:asset-manifest", + "properties": { + "file": "sqspstp-state-machine-enrichment.assets.json", + "requiresBootstrapStackVersion": 6, + "bootstrapStackVersionSsmParameter": "/cdk-bootstrap/hnb659fds/version" + } + }, + "sqspstp-state-machine-enrichment": { + "type": "aws:cloudformation:stack", + "environment": "aws://unknown-account/unknown-region", + "properties": { + "templateFile": "sqspstp-state-machine-enrichment.template.json", + "terminationProtection": false, + "validateOnSynth": false, + "notificationArns": [], + "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}/37e120129bdd6a92826312af8144843d8677b653caa62941beadbab36762289e.json", + "requiresBootstrapStackVersion": 6, + "bootstrapStackVersionSsmParameter": "/cdk-bootstrap/hnb659fds/version", + "additionalDependencies": [ + "sqspstp-state-machine-enrichment.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": [ + "sqspstp-state-machine-enrichment.assets" + ], + "metadata": { + "/sqspstp-state-machine-enrichment/lambdatemp/ServiceRole/Resource": [ + { + "type": "aws:cdk:logicalId", + "data": "lambdatempServiceRoleA1A0368B" + } + ], + "/sqspstp-state-machine-enrichment/lambdatemp/Resource": [ + { + "type": "aws:cdk:logicalId", + "data": "lambdatemp1CD2462E" + } + ], + "/sqspstp-state-machine-enrichment/temp/Role/Resource": [ + { + "type": "aws:cdk:logicalId", + "data": "tempRole0DF4072C" + } + ], + "/sqspstp-state-machine-enrichment/temp/Role/DefaultPolicy/Resource": [ + { + "type": "aws:cdk:logicalId", + "data": "tempRoleDefaultPolicy6B471CA6" + } + ], + "/sqspstp-state-machine-enrichment/temp/Resource": [ + { + "type": "aws:cdk:logicalId", + "data": "temp3A4F7567" + } + ], + "/sqspstp-state-machine-enrichment/lambdas3stp-test/ServiceRole/Resource": [ + { + "type": "aws:cdk:logicalId", + "data": "lambdas3stptestServiceRoleF17BB6C7" + } + ], + "/sqspstp-state-machine-enrichment/lambdas3stp-test/Resource": [ + { + "type": "aws:cdk:logicalId", + "data": "lambdas3stptest9FBDC6CE" + } + ], + "/sqspstp-state-machine-enrichment/test-sqs-pipes-states-construct/queue-dlq/Resource": [ + { + "type": "aws:cdk:logicalId", + "data": "testsqspipesstatesconstructqueuedlq420A82FD" + } + ], + "/sqspstp-state-machine-enrichment/test-sqs-pipes-states-construct/queue-dlq/Policy/Resource": [ + { + "type": "aws:cdk:logicalId", + "data": "testsqspipesstatesconstructqueuedlqPolicyB1D70483" + } + ], + "/sqspstp-state-machine-enrichment/test-sqs-pipes-states-construct/queue/Resource": [ + { + "type": "aws:cdk:logicalId", + "data": "testsqspipesstatesconstructqueueA7C76715" + } + ], + "/sqspstp-state-machine-enrichment/test-sqs-pipes-states-construct/queue/Policy/Resource": [ + { + "type": "aws:cdk:logicalId", + "data": "testsqspipesstatesconstructqueuePolicyFD32B562" + } + ], + "/sqspstp-state-machine-enrichment/test-sqs-pipes-states-construct/StateMachineLogGroup/Resource": [ + { + "type": "aws:cdk:logicalId", + "data": "testsqspipesstatesconstructStateMachineLogGroupADE94F1D" + } + ], + "/sqspstp-state-machine-enrichment/test-sqs-pipes-states-construct/StateMachine/Role/Resource": [ + { + "type": "aws:cdk:logicalId", + "data": "testsqspipesstatesconstructStateMachineRoleBF97BFC0" + } + ], + "/sqspstp-state-machine-enrichment/test-sqs-pipes-states-construct/StateMachine/Role/DefaultPolicy/Resource": [ + { + "type": "aws:cdk:logicalId", + "data": "testsqspipesstatesconstructStateMachineRoleDefaultPolicyD1BA2BF2" + } + ], + "/sqspstp-state-machine-enrichment/test-sqs-pipes-states-construct/StateMachine/Resource": [ + { + "type": "aws:cdk:logicalId", + "data": "testsqspipesstatesconstructStateMachine29272AA9" + } + ], + "/sqspstp-state-machine-enrichment/test-sqs-pipes-states-construct/ExecutionFailedAlarm/Resource": [ + { + "type": "aws:cdk:logicalId", + "data": "testsqspipesstatesconstructExecutionFailedAlarm1002FF55" + } + ], + "/sqspstp-state-machine-enrichment/test-sqs-pipes-states-construct/ExecutionThrottledAlarm/Resource": [ + { + "type": "aws:cdk:logicalId", + "data": "testsqspipesstatesconstructExecutionThrottledAlarm0242B01A" + } + ], + "/sqspstp-state-machine-enrichment/test-sqs-pipes-states-construct/ExecutionAbortedAlarm/Resource": [ + { + "type": "aws:cdk:logicalId", + "data": "testsqspipesstatesconstructExecutionAbortedAlarm14349A7B" + } + ], + "/sqspstp-state-machine-enrichment/test-sqs-pipes-states-construct/PipeRole--test-sqs-pipes-states-construct/Resource": [ + { + "type": "aws:cdk:logicalId", + "data": "testsqspipesstatesconstructPipeRoletestsqspipesstatesconstruct2CC9A13C" + } + ], + "/sqspstp-state-machine-enrichment/test-sqs-pipes-states-construct/enrichmentpolicytest-sqs-pipes-states-construct/Resource": [ + { + "type": "aws:cdk:logicalId", + "data": "testsqspipesstatesconstructenrichmentpolicytestsqspipesstatesconstructC752476A" + } + ], + "/sqspstp-state-machine-enrichment/test-sqs-pipes-states-construct/LogGroup-test-sqs-pipes-states-construct/Resource": [ + { + "type": "aws:cdk:logicalId", + "data": "testsqspipesstatesconstructLogGrouptestsqspipesstatesconstructF827FE15" + } + ], + "/sqspstp-state-machine-enrichment/test-sqs-pipes-states-construct/pipe-test-sqs-pipes-states-construct": [ + { + "type": "aws:cdk:logicalId", + "data": "testsqspipesstatesconstructpipetestsqspipesstatesconstruct71A64A15" + } + ], + "/sqspstp-state-machine-enrichment/BootstrapVersion": [ + { + "type": "aws:cdk:logicalId", + "data": "BootstrapVersion" + } + ], + "/sqspstp-state-machine-enrichment/CheckBootstrapVersion": [ + { + "type": "aws:cdk:logicalId", + "data": "CheckBootstrapVersion" + } + ] + }, + "displayName": "sqspstp-state-machine-enrichment" + }, + "Tree": { + "type": "cdk:tree", + "properties": { + "file": "tree.json" + } + } + } +} \ No newline at end of file diff --git a/source/patterns/@aws-solutions-constructs/aws-sqs-pipes-stepfunctions/test/integ.sqspstp-state-machine-enrichment.js.snapshot/sqspstp-state-machine-enrichment.assets.json b/source/patterns/@aws-solutions-constructs/aws-sqs-pipes-stepfunctions/test/integ.sqspstp-state-machine-enrichment.js.snapshot/sqspstp-state-machine-enrichment.assets.json new file mode 100644 index 000000000..0a92e2752 --- /dev/null +++ b/source/patterns/@aws-solutions-constructs/aws-sqs-pipes-stepfunctions/test/integ.sqspstp-state-machine-enrichment.js.snapshot/sqspstp-state-machine-enrichment.assets.json @@ -0,0 +1,19 @@ +{ + "version": "38.0.1", + "files": { + "37e120129bdd6a92826312af8144843d8677b653caa62941beadbab36762289e": { + "source": { + "path": "sqspstp-state-machine-enrichment.template.json", + "packaging": "file" + }, + "destinations": { + "current_account-current_region": { + "bucketName": "cdk-hnb659fds-assets-${AWS::AccountId}-${AWS::Region}", + "objectKey": "37e120129bdd6a92826312af8144843d8677b653caa62941beadbab36762289e.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-sqs-pipes-stepfunctions/test/integ.sqspstp-state-machine-enrichment.js.snapshot/sqspstp-state-machine-enrichment.template.json b/source/patterns/@aws-solutions-constructs/aws-sqs-pipes-stepfunctions/test/integ.sqspstp-state-machine-enrichment.js.snapshot/sqspstp-state-machine-enrichment.template.json new file mode 100644 index 000000000..d06a5aaed --- /dev/null +++ b/source/patterns/@aws-solutions-constructs/aws-sqs-pipes-stepfunctions/test/integ.sqspstp-state-machine-enrichment.js.snapshot/sqspstp-state-machine-enrichment.template.json @@ -0,0 +1,868 @@ +{ + "Resources": { + "lambdatempServiceRoleA1A0368B": { + "Type": "AWS::IAM::Role", + "Properties": { + "AssumeRolePolicyDocument": { + "Statement": [ + { + "Action": "sts:AssumeRole", + "Effect": "Allow", + "Principal": { + "Service": "lambda.amazonaws.com" + } + } + ], + "Version": "2012-10-17" + }, + "ManagedPolicyArns": [ + { + "Fn::Join": [ + "", + [ + "arn:", + { + "Ref": "AWS::Partition" + }, + ":iam::aws:policy/service-role/AWSLambdaBasicExecutionRole" + ] + ] + } + ] + } + }, + "lambdatemp1CD2462E": { + "Type": "AWS::Lambda::Function", + "Properties": { + "Code": { + "ZipFile": "exports.handler = async (event) => console.log(event)" + }, + "Handler": "index.handler", + "Role": { + "Fn::GetAtt": [ + "lambdatempServiceRoleA1A0368B", + "Arn" + ] + }, + "Runtime": "nodejs20.x" + }, + "DependsOn": [ + "lambdatempServiceRoleA1A0368B" + ], + "Metadata": { + "cfn_nag": { + "rules_to_suppress": [ + { + "id": "W58", + "reason": "This Lambda Function is created for integration testing purposes only and is not part of an actual construct" + }, + { + "id": "W89", + "reason": "This Lambda Function is created for integration testing purposes only and is not part of an actual construct" + }, + { + "id": "W92", + "reason": "This Lambda Function is created for integration testing purposes only and is not part of an actual construct" + }, + { + "id": "W58", + "reason": "This Lambda Function is created for integration testing purposes only and is not part of an actual construct" + }, + { + "id": "W89", + "reason": "This Lambda Function is created for integration testing purposes only and is not part of an actual construct" + }, + { + "id": "W92", + "reason": "This Lambda Function is created for integration testing purposes only and is not part of an actual construct" + } + ] + } + } + }, + "tempRole0DF4072C": { + "Type": "AWS::IAM::Role", + "Properties": { + "AssumeRolePolicyDocument": { + "Statement": [ + { + "Action": "sts:AssumeRole", + "Effect": "Allow", + "Principal": { + "Service": "states.amazonaws.com" + } + } + ], + "Version": "2012-10-17" + } + } + }, + "tempRoleDefaultPolicy6B471CA6": { + "Type": "AWS::IAM::Policy", + "Properties": { + "PolicyDocument": { + "Statement": [ + { + "Action": "lambda:InvokeFunction", + "Effect": "Allow", + "Resource": [ + { + "Fn::GetAtt": [ + "lambdatemp1CD2462E", + "Arn" + ] + }, + { + "Fn::Join": [ + "", + [ + { + "Fn::GetAtt": [ + "lambdatemp1CD2462E", + "Arn" + ] + }, + ":*" + ] + ] + } + ] + } + ], + "Version": "2012-10-17" + }, + "PolicyName": "tempRoleDefaultPolicy6B471CA6", + "Roles": [ + { + "Ref": "tempRole0DF4072C" + } + ] + } + }, + "temp3A4F7567": { + "Type": "AWS::StepFunctions::StateMachine", + "Properties": { + "DefinitionString": { + "Fn::Join": [ + "", + [ + "{\"StartAt\":\"tasktemp\",\"States\":{\"tasktemp\":{\"End\":true,\"Retry\":[{\"ErrorEquals\":[\"Lambda.ClientExecutionTimeoutException\",\"Lambda.ServiceException\",\"Lambda.AWSLambdaException\",\"Lambda.SdkClientException\"],\"IntervalSeconds\":2,\"MaxAttempts\":6,\"BackoffRate\":2}],\"Type\":\"Task\",\"Resource\":\"arn:", + { + "Ref": "AWS::Partition" + }, + ":states:::lambda:invoke\",\"Parameters\":{\"FunctionName\":\"", + { + "Fn::GetAtt": [ + "lambdatemp1CD2462E", + "Arn" + ] + }, + "\",\"Payload.$\":\"$\"}}}}" + ] + ] + }, + "RoleArn": { + "Fn::GetAtt": [ + "tempRole0DF4072C", + "Arn" + ] + }, + "StateMachineType": "EXPRESS" + }, + "DependsOn": [ + "tempRoleDefaultPolicy6B471CA6", + "tempRole0DF4072C" + ], + "UpdateReplacePolicy": "Delete", + "DeletionPolicy": "Delete" + }, + "lambdas3stptestServiceRoleF17BB6C7": { + "Type": "AWS::IAM::Role", + "Properties": { + "AssumeRolePolicyDocument": { + "Statement": [ + { + "Action": "sts:AssumeRole", + "Effect": "Allow", + "Principal": { + "Service": "lambda.amazonaws.com" + } + } + ], + "Version": "2012-10-17" + }, + "ManagedPolicyArns": [ + { + "Fn::Join": [ + "", + [ + "arn:", + { + "Ref": "AWS::Partition" + }, + ":iam::aws:policy/service-role/AWSLambdaBasicExecutionRole" + ] + ] + } + ] + } + }, + "lambdas3stptest9FBDC6CE": { + "Type": "AWS::Lambda::Function", + "Properties": { + "Code": { + "ZipFile": "exports.handler = async (event) => console.log(event)" + }, + "Handler": "index.handler", + "Role": { + "Fn::GetAtt": [ + "lambdas3stptestServiceRoleF17BB6C7", + "Arn" + ] + }, + "Runtime": "nodejs20.x" + }, + "DependsOn": [ + "lambdas3stptestServiceRoleF17BB6C7" + ], + "Metadata": { + "cfn_nag": { + "rules_to_suppress": [ + { + "id": "W58", + "reason": "This Lambda Function is created for integration testing purposes only and is not part of an actual construct" + }, + { + "id": "W89", + "reason": "This Lambda Function is created for integration testing purposes only and is not part of an actual construct" + }, + { + "id": "W92", + "reason": "This Lambda Function is created for integration testing purposes only and is not part of an actual construct" + }, + { + "id": "W58", + "reason": "This Lambda Function is created for integration testing purposes only and is not part of an actual construct" + }, + { + "id": "W89", + "reason": "This Lambda Function is created for integration testing purposes only and is not part of an actual construct" + }, + { + "id": "W92", + "reason": "This Lambda Function is created for integration testing purposes only and is not part of an actual construct" + } + ] + } + } + }, + "testsqspipesstatesconstructqueuedlq420A82FD": { + "Type": "AWS::SQS::Queue", + "Properties": { + "KmsMasterKeyId": "alias/aws/sqs" + }, + "UpdateReplacePolicy": "Delete", + "DeletionPolicy": "Delete" + }, + "testsqspipesstatesconstructqueuedlqPolicyB1D70483": { + "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": [ + "testsqspipesstatesconstructqueuedlq420A82FD", + "Arn" + ] + }, + "Sid": "QueueOwnerOnlyAccess" + }, + { + "Action": "SQS:*", + "Condition": { + "Bool": { + "aws:SecureTransport": "false" + } + }, + "Effect": "Deny", + "Principal": { + "AWS": "*" + }, + "Resource": { + "Fn::GetAtt": [ + "testsqspipesstatesconstructqueuedlq420A82FD", + "Arn" + ] + }, + "Sid": "HttpsOnly" + } + ], + "Version": "2012-10-17" + }, + "Queues": [ + { + "Ref": "testsqspipesstatesconstructqueuedlq420A82FD" + } + ] + } + }, + "testsqspipesstatesconstructqueueA7C76715": { + "Type": "AWS::SQS::Queue", + "Properties": { + "KmsMasterKeyId": "alias/aws/sqs", + "RedrivePolicy": { + "deadLetterTargetArn": { + "Fn::GetAtt": [ + "testsqspipesstatesconstructqueuedlq420A82FD", + "Arn" + ] + }, + "maxReceiveCount": 15 + } + }, + "UpdateReplacePolicy": "Delete", + "DeletionPolicy": "Delete" + }, + "testsqspipesstatesconstructqueuePolicyFD32B562": { + "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": [ + "testsqspipesstatesconstructqueueA7C76715", + "Arn" + ] + }, + "Sid": "QueueOwnerOnlyAccess" + }, + { + "Action": "SQS:*", + "Condition": { + "Bool": { + "aws:SecureTransport": "false" + } + }, + "Effect": "Deny", + "Principal": { + "AWS": "*" + }, + "Resource": { + "Fn::GetAtt": [ + "testsqspipesstatesconstructqueueA7C76715", + "Arn" + ] + }, + "Sid": "HttpsOnly" + } + ], + "Version": "2012-10-17" + }, + "Queues": [ + { + "Ref": "testsqspipesstatesconstructqueueA7C76715" + } + ] + } + }, + "testsqspipesstatesconstructStateMachineLogGroupADE94F1D": { + "Type": "AWS::Logs::LogGroup", + "Properties": { + "LogGroupName": { + "Fn::Join": [ + "", + [ + "/aws/vendedlogs/states/constructs/sqspstp-state-machine-enrichmenttest-sqs-pipes-states-constructStateMachineLog-", + { + "Fn::Select": [ + 2, + { + "Fn::Split": [ + "/", + { + "Ref": "AWS::StackId" + } + ] + } + ] + } + ] + ] + } + }, + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Retain", + "Metadata": { + "cfn_nag": { + "rules_to_suppress": [ + { + "id": "W86", + "reason": "Retention period for CloudWatchLogs LogGroups are set to 'Never Expire' to preserve customer data indefinitely" + }, + { + "id": "W84", + "reason": "By default CloudWatchLogs LogGroups data is encrypted using the CloudWatch server-side encryption keys (AWS Managed Keys)" + } + ] + } + } + }, + "testsqspipesstatesconstructStateMachineRoleBF97BFC0": { + "Type": "AWS::IAM::Role", + "Properties": { + "AssumeRolePolicyDocument": { + "Statement": [ + { + "Action": "sts:AssumeRole", + "Effect": "Allow", + "Principal": { + "Service": "states.amazonaws.com" + } + } + ], + "Version": "2012-10-17" + } + } + }, + "testsqspipesstatesconstructStateMachineRoleDefaultPolicyD1BA2BF2": { + "Type": "AWS::IAM::Policy", + "Properties": { + "PolicyDocument": { + "Statement": [ + { + "Action": "lambda:InvokeFunction", + "Effect": "Allow", + "Resource": [ + { + "Fn::GetAtt": [ + "lambdas3stptest9FBDC6CE", + "Arn" + ] + }, + { + "Fn::Join": [ + "", + [ + { + "Fn::GetAtt": [ + "lambdas3stptest9FBDC6CE", + "Arn" + ] + }, + ":*" + ] + ] + } + ] + }, + { + "Action": [ + "logs:CreateLogDelivery", + "logs:DeleteLogDelivery", + "logs:DescribeLogGroups", + "logs:DescribeResourcePolicies", + "logs:GetLogDelivery", + "logs:ListLogDeliveries", + "logs:PutResourcePolicy", + "logs:UpdateLogDelivery" + ], + "Effect": "Allow", + "Resource": "*" + } + ], + "Version": "2012-10-17" + }, + "PolicyName": "testsqspipesstatesconstructStateMachineRoleDefaultPolicyD1BA2BF2", + "Roles": [ + { + "Ref": "testsqspipesstatesconstructStateMachineRoleBF97BFC0" + } + ] + }, + "Metadata": { + "cfn_nag": { + "rules_to_suppress": [ + { + "id": "W12", + "reason": "These are CDK defaults. The 'LogDelivery' actions do not support resource-level authorizations. Any logging is done by State Machine code" + } + ] + } + } + }, + "testsqspipesstatesconstructStateMachine29272AA9": { + "Type": "AWS::StepFunctions::StateMachine", + "Properties": { + "DefinitionString": { + "Fn::Join": [ + "", + [ + "{\"StartAt\":\"tasks3stp-test\",\"States\":{\"tasks3stp-test\":{\"End\":true,\"Retry\":[{\"ErrorEquals\":[\"Lambda.ClientExecutionTimeoutException\",\"Lambda.ServiceException\",\"Lambda.AWSLambdaException\",\"Lambda.SdkClientException\"],\"IntervalSeconds\":2,\"MaxAttempts\":6,\"BackoffRate\":2}],\"Type\":\"Task\",\"Resource\":\"arn:", + { + "Ref": "AWS::Partition" + }, + ":states:::lambda:invoke\",\"Parameters\":{\"FunctionName\":\"", + { + "Fn::GetAtt": [ + "lambdas3stptest9FBDC6CE", + "Arn" + ] + }, + "\",\"Payload.$\":\"$\"}}}}" + ] + ] + }, + "LoggingConfiguration": { + "Destinations": [ + { + "CloudWatchLogsLogGroup": { + "LogGroupArn": { + "Fn::GetAtt": [ + "testsqspipesstatesconstructStateMachineLogGroupADE94F1D", + "Arn" + ] + } + } + } + ], + "Level": "ERROR" + }, + "RoleArn": { + "Fn::GetAtt": [ + "testsqspipesstatesconstructStateMachineRoleBF97BFC0", + "Arn" + ] + } + }, + "DependsOn": [ + "testsqspipesstatesconstructStateMachineRoleDefaultPolicyD1BA2BF2", + "testsqspipesstatesconstructStateMachineRoleBF97BFC0" + ], + "UpdateReplacePolicy": "Delete", + "DeletionPolicy": "Delete" + }, + "testsqspipesstatesconstructExecutionFailedAlarm1002FF55": { + "Type": "AWS::CloudWatch::Alarm", + "Properties": { + "AlarmDescription": "Alarm for the number of executions that failed exceeded the threshold of 1. ", + "ComparisonOperator": "GreaterThanOrEqualToThreshold", + "Dimensions": [ + { + "Name": "StateMachineArn", + "Value": { + "Ref": "testsqspipesstatesconstructStateMachine29272AA9" + } + } + ], + "EvaluationPeriods": 1, + "MetricName": "ExecutionsFailed", + "Namespace": "AWS/States", + "Period": 300, + "Statistic": "Sum", + "Threshold": 1 + } + }, + "testsqspipesstatesconstructExecutionThrottledAlarm0242B01A": { + "Type": "AWS::CloudWatch::Alarm", + "Properties": { + "AlarmDescription": "Alarm for the number of executions that throttled exceeded the threshold of 1. ", + "ComparisonOperator": "GreaterThanOrEqualToThreshold", + "Dimensions": [ + { + "Name": "StateMachineArn", + "Value": { + "Ref": "testsqspipesstatesconstructStateMachine29272AA9" + } + } + ], + "EvaluationPeriods": 1, + "MetricName": "ExecutionThrottled", + "Namespace": "AWS/States", + "Period": 300, + "Statistic": "Sum", + "Threshold": 1 + } + }, + "testsqspipesstatesconstructExecutionAbortedAlarm14349A7B": { + "Type": "AWS::CloudWatch::Alarm", + "Properties": { + "AlarmDescription": "Alarm for the number of executions that aborted exceeded the threshold of 1. ", + "ComparisonOperator": "GreaterThanOrEqualToThreshold", + "Dimensions": [ + { + "Name": "StateMachineArn", + "Value": { + "Ref": "testsqspipesstatesconstructStateMachine29272AA9" + } + } + ], + "EvaluationPeriods": 1, + "MetricName": "ExecutionsAborted", + "Namespace": "AWS/States", + "Period": 300, + "Statistic": "Maximum", + "Threshold": 1 + } + }, + "testsqspipesstatesconstructPipeRoletestsqspipesstatesconstruct2CC9A13C": { + "Type": "AWS::IAM::Role", + "Properties": { + "AssumeRolePolicyDocument": { + "Statement": [ + { + "Action": "sts:AssumeRole", + "Effect": "Allow", + "Principal": { + "Service": "pipes.amazonaws.com" + } + } + ], + "Version": "2012-10-17" + }, + "Policies": [ + { + "PolicyDocument": { + "Statement": [ + { + "Action": [ + "sqs:DeleteMessage", + "sqs:GetQueueAttributes", + "sqs:ReceiveMessage" + ], + "Effect": "Allow", + "Resource": { + "Fn::GetAtt": [ + "testsqspipesstatesconstructqueueA7C76715", + "Arn" + ] + } + } + ], + "Version": "2012-10-17" + }, + "PolicyName": "sourcePolicy" + }, + { + "PolicyDocument": { + "Statement": [ + { + "Action": "states:StartExecution", + "Effect": "Allow", + "Resource": { + "Ref": "testsqspipesstatesconstructStateMachine29272AA9" + } + } + ], + "Version": "2012-10-17" + }, + "PolicyName": "targetPolicy" + } + ] + }, + "Metadata": { + "guard": { + "SuppressedRules": [ + "IAM_NO_INLINE_POLICY_CHECK" + ] + } + } + }, + "testsqspipesstatesconstructenrichmentpolicytestsqspipesstatesconstructC752476A": { + "Type": "AWS::IAM::Policy", + "Properties": { + "PolicyDocument": { + "Statement": [ + { + "Action": "states:StartSyncExecution", + "Effect": "Allow", + "Resource": { + "Ref": "temp3A4F7567" + } + } + ], + "Version": "2012-10-17" + }, + "PolicyName": "testsqspipesstatesconstructenrichmentpolicytestsqspipesstatesconstructC752476A", + "Roles": [ + { + "Ref": "testsqspipesstatesconstructPipeRoletestsqspipesstatesconstruct2CC9A13C" + } + ] + } + }, + "testsqspipesstatesconstructLogGrouptestsqspipesstatesconstructF827FE15": { + "Type": "AWS::Logs::LogGroup", + "Properties": { + "LogGroupName": { + "Fn::Join": [ + "", + [ + "/aws/vendedlogs/pipes/constructs/sqspstp-state-machine-enrichmenttest-sqs-pipes-states-constructPipesLog-", + { + "Fn::Select": [ + 2, + { + "Fn::Split": [ + "/", + { + "Ref": "AWS::StackId" + } + ] + } + ] + } + ] + ] + } + }, + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Retain", + "Metadata": { + "cfn_nag": { + "rules_to_suppress": [ + { + "id": "W86", + "reason": "Retention period for CloudWatchLogs LogGroups are set to 'Never Expire' to preserve customer data indefinitely" + }, + { + "id": "W84", + "reason": "By default CloudWatchLogs LogGroups data is encrypted using the CloudWatch server-side encryption keys (AWS Managed Keys)" + } + ] + } + } + }, + "testsqspipesstatesconstructpipetestsqspipesstatesconstruct71A64A15": { + "Type": "AWS::Pipes::Pipe", + "Properties": { + "Enrichment": { + "Ref": "temp3A4F7567" + }, + "LogConfiguration": { + "CloudwatchLogsLogDestination": { + "LogGroupArn": { + "Fn::GetAtt": [ + "testsqspipesstatesconstructLogGrouptestsqspipesstatesconstructF827FE15", + "Arn" + ] + } + }, + "Level": "TRACE" + }, + "RoleArn": { + "Fn::GetAtt": [ + "testsqspipesstatesconstructPipeRoletestsqspipesstatesconstruct2CC9A13C", + "Arn" + ] + }, + "Source": { + "Fn::GetAtt": [ + "testsqspipesstatesconstructqueueA7C76715", + "Arn" + ] + }, + "SourceParameters": {}, + "Target": { + "Ref": "testsqspipesstatesconstructStateMachine29272AA9" + }, + "TargetParameters": { + "StepFunctionStateMachineParameters": { + "InvocationType": "FIRE_AND_FORGET" + } + } + } + } + }, + "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-sqs-pipes-stepfunctions/test/integ.sqspstp-state-machine-enrichment.js.snapshot/sqspstpstatemachineenrichmentIntegDefaultTestDeployAssert47A5DE6D.assets.json b/source/patterns/@aws-solutions-constructs/aws-sqs-pipes-stepfunctions/test/integ.sqspstp-state-machine-enrichment.js.snapshot/sqspstpstatemachineenrichmentIntegDefaultTestDeployAssert47A5DE6D.assets.json new file mode 100644 index 000000000..3a89d33e3 --- /dev/null +++ b/source/patterns/@aws-solutions-constructs/aws-sqs-pipes-stepfunctions/test/integ.sqspstp-state-machine-enrichment.js.snapshot/sqspstpstatemachineenrichmentIntegDefaultTestDeployAssert47A5DE6D.assets.json @@ -0,0 +1,19 @@ +{ + "version": "38.0.1", + "files": { + "21fbb51d7b23f6a6c262b46a9caee79d744a3ac019fd45422d988b96d44b2a22": { + "source": { + "path": "sqspstpstatemachineenrichmentIntegDefaultTestDeployAssert47A5DE6D.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-sqs-pipes-stepfunctions/test/integ.sqspstp-state-machine-enrichment.js.snapshot/sqspstpstatemachineenrichmentIntegDefaultTestDeployAssert47A5DE6D.template.json b/source/patterns/@aws-solutions-constructs/aws-sqs-pipes-stepfunctions/test/integ.sqspstp-state-machine-enrichment.js.snapshot/sqspstpstatemachineenrichmentIntegDefaultTestDeployAssert47A5DE6D.template.json new file mode 100644 index 000000000..ad9d0fb73 --- /dev/null +++ b/source/patterns/@aws-solutions-constructs/aws-sqs-pipes-stepfunctions/test/integ.sqspstp-state-machine-enrichment.js.snapshot/sqspstpstatemachineenrichmentIntegDefaultTestDeployAssert47A5DE6D.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-sqs-pipes-stepfunctions/test/integ.sqspstp-state-machine-enrichment.js.snapshot/tree.json b/source/patterns/@aws-solutions-constructs/aws-sqs-pipes-stepfunctions/test/integ.sqspstp-state-machine-enrichment.js.snapshot/tree.json new file mode 100644 index 000000000..22513ac63 --- /dev/null +++ b/source/patterns/@aws-solutions-constructs/aws-sqs-pipes-stepfunctions/test/integ.sqspstp-state-machine-enrichment.js.snapshot/tree.json @@ -0,0 +1,1252 @@ +{ + "version": "tree-0.1", + "tree": { + "id": "App", + "path": "", + "children": { + "sqspstp-state-machine-enrichment": { + "id": "sqspstp-state-machine-enrichment", + "path": "sqspstp-state-machine-enrichment", + "children": { + "lambdatemp": { + "id": "lambdatemp", + "path": "sqspstp-state-machine-enrichment/lambdatemp", + "children": { + "ServiceRole": { + "id": "ServiceRole", + "path": "sqspstp-state-machine-enrichment/lambdatemp/ServiceRole", + "children": { + "ImportServiceRole": { + "id": "ImportServiceRole", + "path": "sqspstp-state-machine-enrichment/lambdatemp/ServiceRole/ImportServiceRole", + "constructInfo": { + "fqn": "aws-cdk-lib.Resource", + "version": "2.161.0" + } + }, + "Resource": { + "id": "Resource", + "path": "sqspstp-state-machine-enrichment/lambdatemp/ServiceRole/Resource", + "attributes": { + "aws:cdk:cloudformation:type": "AWS::IAM::Role", + "aws:cdk:cloudformation:props": { + "assumeRolePolicyDocument": { + "Statement": [ + { + "Action": "sts:AssumeRole", + "Effect": "Allow", + "Principal": { + "Service": "lambda.amazonaws.com" + } + } + ], + "Version": "2012-10-17" + }, + "managedPolicyArns": [ + { + "Fn::Join": [ + "", + [ + "arn:", + { + "Ref": "AWS::Partition" + }, + ":iam::aws:policy/service-role/AWSLambdaBasicExecutionRole" + ] + ] + } + ] + } + }, + "constructInfo": { + "fqn": "aws-cdk-lib.aws_iam.CfnRole", + "version": "2.161.0" + } + } + }, + "constructInfo": { + "fqn": "aws-cdk-lib.aws_iam.Role", + "version": "2.161.0" + } + }, + "Resource": { + "id": "Resource", + "path": "sqspstp-state-machine-enrichment/lambdatemp/Resource", + "attributes": { + "aws:cdk:cloudformation:type": "AWS::Lambda::Function", + "aws:cdk:cloudformation:props": { + "code": { + "zipFile": "exports.handler = async (event) => console.log(event)" + }, + "handler": "index.handler", + "role": { + "Fn::GetAtt": [ + "lambdatempServiceRoleA1A0368B", + "Arn" + ] + }, + "runtime": "nodejs20.x" + } + }, + "constructInfo": { + "fqn": "aws-cdk-lib.aws_lambda.CfnFunction", + "version": "2.161.0" + } + } + }, + "constructInfo": { + "fqn": "aws-cdk-lib.aws_lambda.Function", + "version": "2.161.0" + } + }, + "tasktemp": { + "id": "tasktemp", + "path": "sqspstp-state-machine-enrichment/tasktemp", + "constructInfo": { + "fqn": "aws-cdk-lib.aws_stepfunctions_tasks.LambdaInvoke", + "version": "2.161.0" + } + }, + "temp": { + "id": "temp", + "path": "sqspstp-state-machine-enrichment/temp", + "children": { + "Role": { + "id": "Role", + "path": "sqspstp-state-machine-enrichment/temp/Role", + "children": { + "ImportRole": { + "id": "ImportRole", + "path": "sqspstp-state-machine-enrichment/temp/Role/ImportRole", + "constructInfo": { + "fqn": "aws-cdk-lib.Resource", + "version": "2.161.0" + } + }, + "Resource": { + "id": "Resource", + "path": "sqspstp-state-machine-enrichment/temp/Role/Resource", + "attributes": { + "aws:cdk:cloudformation:type": "AWS::IAM::Role", + "aws:cdk:cloudformation:props": { + "assumeRolePolicyDocument": { + "Statement": [ + { + "Action": "sts:AssumeRole", + "Effect": "Allow", + "Principal": { + "Service": "states.amazonaws.com" + } + } + ], + "Version": "2012-10-17" + } + } + }, + "constructInfo": { + "fqn": "aws-cdk-lib.aws_iam.CfnRole", + "version": "2.161.0" + } + }, + "DefaultPolicy": { + "id": "DefaultPolicy", + "path": "sqspstp-state-machine-enrichment/temp/Role/DefaultPolicy", + "children": { + "Resource": { + "id": "Resource", + "path": "sqspstp-state-machine-enrichment/temp/Role/DefaultPolicy/Resource", + "attributes": { + "aws:cdk:cloudformation:type": "AWS::IAM::Policy", + "aws:cdk:cloudformation:props": { + "policyDocument": { + "Statement": [ + { + "Action": "lambda:InvokeFunction", + "Effect": "Allow", + "Resource": [ + { + "Fn::GetAtt": [ + "lambdatemp1CD2462E", + "Arn" + ] + }, + { + "Fn::Join": [ + "", + [ + { + "Fn::GetAtt": [ + "lambdatemp1CD2462E", + "Arn" + ] + }, + ":*" + ] + ] + } + ] + } + ], + "Version": "2012-10-17" + }, + "policyName": "tempRoleDefaultPolicy6B471CA6", + "roles": [ + { + "Ref": "tempRole0DF4072C" + } + ] + } + }, + "constructInfo": { + "fqn": "aws-cdk-lib.aws_iam.CfnPolicy", + "version": "2.161.0" + } + } + }, + "constructInfo": { + "fqn": "aws-cdk-lib.aws_iam.Policy", + "version": "2.161.0" + } + } + }, + "constructInfo": { + "fqn": "aws-cdk-lib.aws_iam.Role", + "version": "2.161.0" + } + }, + "Resource": { + "id": "Resource", + "path": "sqspstp-state-machine-enrichment/temp/Resource", + "attributes": { + "aws:cdk:cloudformation:type": "AWS::StepFunctions::StateMachine", + "aws:cdk:cloudformation:props": { + "definitionString": { + "Fn::Join": [ + "", + [ + "{\"StartAt\":\"tasktemp\",\"States\":{\"tasktemp\":{\"End\":true,\"Retry\":[{\"ErrorEquals\":[\"Lambda.ClientExecutionTimeoutException\",\"Lambda.ServiceException\",\"Lambda.AWSLambdaException\",\"Lambda.SdkClientException\"],\"IntervalSeconds\":2,\"MaxAttempts\":6,\"BackoffRate\":2}],\"Type\":\"Task\",\"Resource\":\"arn:", + { + "Ref": "AWS::Partition" + }, + ":states:::lambda:invoke\",\"Parameters\":{\"FunctionName\":\"", + { + "Fn::GetAtt": [ + "lambdatemp1CD2462E", + "Arn" + ] + }, + "\",\"Payload.$\":\"$\"}}}}" + ] + ] + }, + "roleArn": { + "Fn::GetAtt": [ + "tempRole0DF4072C", + "Arn" + ] + }, + "stateMachineType": "EXPRESS" + } + }, + "constructInfo": { + "fqn": "aws-cdk-lib.aws_stepfunctions.CfnStateMachine", + "version": "2.161.0" + } + } + }, + "constructInfo": { + "fqn": "aws-cdk-lib.aws_stepfunctions.StateMachine", + "version": "2.161.0" + } + }, + "lambdas3stp-test": { + "id": "lambdas3stp-test", + "path": "sqspstp-state-machine-enrichment/lambdas3stp-test", + "children": { + "ServiceRole": { + "id": "ServiceRole", + "path": "sqspstp-state-machine-enrichment/lambdas3stp-test/ServiceRole", + "children": { + "ImportServiceRole": { + "id": "ImportServiceRole", + "path": "sqspstp-state-machine-enrichment/lambdas3stp-test/ServiceRole/ImportServiceRole", + "constructInfo": { + "fqn": "aws-cdk-lib.Resource", + "version": "2.161.0" + } + }, + "Resource": { + "id": "Resource", + "path": "sqspstp-state-machine-enrichment/lambdas3stp-test/ServiceRole/Resource", + "attributes": { + "aws:cdk:cloudformation:type": "AWS::IAM::Role", + "aws:cdk:cloudformation:props": { + "assumeRolePolicyDocument": { + "Statement": [ + { + "Action": "sts:AssumeRole", + "Effect": "Allow", + "Principal": { + "Service": "lambda.amazonaws.com" + } + } + ], + "Version": "2012-10-17" + }, + "managedPolicyArns": [ + { + "Fn::Join": [ + "", + [ + "arn:", + { + "Ref": "AWS::Partition" + }, + ":iam::aws:policy/service-role/AWSLambdaBasicExecutionRole" + ] + ] + } + ] + } + }, + "constructInfo": { + "fqn": "aws-cdk-lib.aws_iam.CfnRole", + "version": "2.161.0" + } + } + }, + "constructInfo": { + "fqn": "aws-cdk-lib.aws_iam.Role", + "version": "2.161.0" + } + }, + "Resource": { + "id": "Resource", + "path": "sqspstp-state-machine-enrichment/lambdas3stp-test/Resource", + "attributes": { + "aws:cdk:cloudformation:type": "AWS::Lambda::Function", + "aws:cdk:cloudformation:props": { + "code": { + "zipFile": "exports.handler = async (event) => console.log(event)" + }, + "handler": "index.handler", + "role": { + "Fn::GetAtt": [ + "lambdas3stptestServiceRoleF17BB6C7", + "Arn" + ] + }, + "runtime": "nodejs20.x" + } + }, + "constructInfo": { + "fqn": "aws-cdk-lib.aws_lambda.CfnFunction", + "version": "2.161.0" + } + } + }, + "constructInfo": { + "fqn": "aws-cdk-lib.aws_lambda.Function", + "version": "2.161.0" + } + }, + "tasks3stp-test": { + "id": "tasks3stp-test", + "path": "sqspstp-state-machine-enrichment/tasks3stp-test", + "constructInfo": { + "fqn": "aws-cdk-lib.aws_stepfunctions_tasks.LambdaInvoke", + "version": "2.161.0" + } + }, + "test-sqs-pipes-states-construct": { + "id": "test-sqs-pipes-states-construct", + "path": "sqspstp-state-machine-enrichment/test-sqs-pipes-states-construct", + "children": { + "queue-dlq": { + "id": "queue-dlq", + "path": "sqspstp-state-machine-enrichment/test-sqs-pipes-states-construct/queue-dlq", + "children": { + "Resource": { + "id": "Resource", + "path": "sqspstp-state-machine-enrichment/test-sqs-pipes-states-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.161.0" + } + }, + "Policy": { + "id": "Policy", + "path": "sqspstp-state-machine-enrichment/test-sqs-pipes-states-construct/queue-dlq/Policy", + "children": { + "Resource": { + "id": "Resource", + "path": "sqspstp-state-machine-enrichment/test-sqs-pipes-states-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": [ + "testsqspipesstatesconstructqueuedlq420A82FD", + "Arn" + ] + }, + "Sid": "QueueOwnerOnlyAccess" + }, + { + "Action": "SQS:*", + "Condition": { + "Bool": { + "aws:SecureTransport": "false" + } + }, + "Effect": "Deny", + "Principal": { + "AWS": "*" + }, + "Resource": { + "Fn::GetAtt": [ + "testsqspipesstatesconstructqueuedlq420A82FD", + "Arn" + ] + }, + "Sid": "HttpsOnly" + } + ], + "Version": "2012-10-17" + }, + "queues": [ + { + "Ref": "testsqspipesstatesconstructqueuedlq420A82FD" + } + ] + } + }, + "constructInfo": { + "fqn": "aws-cdk-lib.aws_sqs.CfnQueuePolicy", + "version": "2.161.0" + } + } + }, + "constructInfo": { + "fqn": "aws-cdk-lib.aws_sqs.QueuePolicy", + "version": "2.161.0" + } + } + }, + "constructInfo": { + "fqn": "aws-cdk-lib.aws_sqs.Queue", + "version": "2.161.0" + } + }, + "queue": { + "id": "queue", + "path": "sqspstp-state-machine-enrichment/test-sqs-pipes-states-construct/queue", + "children": { + "Resource": { + "id": "Resource", + "path": "sqspstp-state-machine-enrichment/test-sqs-pipes-states-construct/queue/Resource", + "attributes": { + "aws:cdk:cloudformation:type": "AWS::SQS::Queue", + "aws:cdk:cloudformation:props": { + "kmsMasterKeyId": "alias/aws/sqs", + "redrivePolicy": { + "deadLetterTargetArn": { + "Fn::GetAtt": [ + "testsqspipesstatesconstructqueuedlq420A82FD", + "Arn" + ] + }, + "maxReceiveCount": 15 + } + } + }, + "constructInfo": { + "fqn": "aws-cdk-lib.aws_sqs.CfnQueue", + "version": "2.161.0" + } + }, + "Policy": { + "id": "Policy", + "path": "sqspstp-state-machine-enrichment/test-sqs-pipes-states-construct/queue/Policy", + "children": { + "Resource": { + "id": "Resource", + "path": "sqspstp-state-machine-enrichment/test-sqs-pipes-states-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": [ + "testsqspipesstatesconstructqueueA7C76715", + "Arn" + ] + }, + "Sid": "QueueOwnerOnlyAccess" + }, + { + "Action": "SQS:*", + "Condition": { + "Bool": { + "aws:SecureTransport": "false" + } + }, + "Effect": "Deny", + "Principal": { + "AWS": "*" + }, + "Resource": { + "Fn::GetAtt": [ + "testsqspipesstatesconstructqueueA7C76715", + "Arn" + ] + }, + "Sid": "HttpsOnly" + } + ], + "Version": "2012-10-17" + }, + "queues": [ + { + "Ref": "testsqspipesstatesconstructqueueA7C76715" + } + ] + } + }, + "constructInfo": { + "fqn": "aws-cdk-lib.aws_sqs.CfnQueuePolicy", + "version": "2.161.0" + } + } + }, + "constructInfo": { + "fqn": "aws-cdk-lib.aws_sqs.QueuePolicy", + "version": "2.161.0" + } + } + }, + "constructInfo": { + "fqn": "aws-cdk-lib.aws_sqs.Queue", + "version": "2.161.0" + } + }, + "StateMachineLogGroup": { + "id": "StateMachineLogGroup", + "path": "sqspstp-state-machine-enrichment/test-sqs-pipes-states-construct/StateMachineLogGroup", + "children": { + "Resource": { + "id": "Resource", + "path": "sqspstp-state-machine-enrichment/test-sqs-pipes-states-construct/StateMachineLogGroup/Resource", + "attributes": { + "aws:cdk:cloudformation:type": "AWS::Logs::LogGroup", + "aws:cdk:cloudformation:props": { + "logGroupName": { + "Fn::Join": [ + "", + [ + "/aws/vendedlogs/states/constructs/sqspstp-state-machine-enrichmenttest-sqs-pipes-states-constructStateMachineLog-", + { + "Fn::Select": [ + 2, + { + "Fn::Split": [ + "/", + { + "Ref": "AWS::StackId" + } + ] + } + ] + } + ] + ] + } + } + }, + "constructInfo": { + "fqn": "aws-cdk-lib.aws_logs.CfnLogGroup", + "version": "2.161.0" + } + } + }, + "constructInfo": { + "fqn": "aws-cdk-lib.aws_logs.LogGroup", + "version": "2.161.0" + } + }, + "StateMachine": { + "id": "StateMachine", + "path": "sqspstp-state-machine-enrichment/test-sqs-pipes-states-construct/StateMachine", + "children": { + "Role": { + "id": "Role", + "path": "sqspstp-state-machine-enrichment/test-sqs-pipes-states-construct/StateMachine/Role", + "children": { + "ImportRole": { + "id": "ImportRole", + "path": "sqspstp-state-machine-enrichment/test-sqs-pipes-states-construct/StateMachine/Role/ImportRole", + "constructInfo": { + "fqn": "aws-cdk-lib.Resource", + "version": "2.161.0" + } + }, + "Resource": { + "id": "Resource", + "path": "sqspstp-state-machine-enrichment/test-sqs-pipes-states-construct/StateMachine/Role/Resource", + "attributes": { + "aws:cdk:cloudformation:type": "AWS::IAM::Role", + "aws:cdk:cloudformation:props": { + "assumeRolePolicyDocument": { + "Statement": [ + { + "Action": "sts:AssumeRole", + "Effect": "Allow", + "Principal": { + "Service": "states.amazonaws.com" + } + } + ], + "Version": "2012-10-17" + } + } + }, + "constructInfo": { + "fqn": "aws-cdk-lib.aws_iam.CfnRole", + "version": "2.161.0" + } + }, + "DefaultPolicy": { + "id": "DefaultPolicy", + "path": "sqspstp-state-machine-enrichment/test-sqs-pipes-states-construct/StateMachine/Role/DefaultPolicy", + "children": { + "Resource": { + "id": "Resource", + "path": "sqspstp-state-machine-enrichment/test-sqs-pipes-states-construct/StateMachine/Role/DefaultPolicy/Resource", + "attributes": { + "aws:cdk:cloudformation:type": "AWS::IAM::Policy", + "aws:cdk:cloudformation:props": { + "policyDocument": { + "Statement": [ + { + "Action": "lambda:InvokeFunction", + "Effect": "Allow", + "Resource": [ + { + "Fn::GetAtt": [ + "lambdas3stptest9FBDC6CE", + "Arn" + ] + }, + { + "Fn::Join": [ + "", + [ + { + "Fn::GetAtt": [ + "lambdas3stptest9FBDC6CE", + "Arn" + ] + }, + ":*" + ] + ] + } + ] + }, + { + "Action": [ + "logs:CreateLogDelivery", + "logs:DeleteLogDelivery", + "logs:DescribeLogGroups", + "logs:DescribeResourcePolicies", + "logs:GetLogDelivery", + "logs:ListLogDeliveries", + "logs:PutResourcePolicy", + "logs:UpdateLogDelivery" + ], + "Effect": "Allow", + "Resource": "*" + } + ], + "Version": "2012-10-17" + }, + "policyName": "testsqspipesstatesconstructStateMachineRoleDefaultPolicyD1BA2BF2", + "roles": [ + { + "Ref": "testsqspipesstatesconstructStateMachineRoleBF97BFC0" + } + ] + } + }, + "constructInfo": { + "fqn": "aws-cdk-lib.aws_iam.CfnPolicy", + "version": "2.161.0" + } + } + }, + "constructInfo": { + "fqn": "aws-cdk-lib.aws_iam.Policy", + "version": "2.161.0" + } + } + }, + "constructInfo": { + "fqn": "aws-cdk-lib.aws_iam.Role", + "version": "2.161.0" + } + }, + "Resource": { + "id": "Resource", + "path": "sqspstp-state-machine-enrichment/test-sqs-pipes-states-construct/StateMachine/Resource", + "attributes": { + "aws:cdk:cloudformation:type": "AWS::StepFunctions::StateMachine", + "aws:cdk:cloudformation:props": { + "definitionString": { + "Fn::Join": [ + "", + [ + "{\"StartAt\":\"tasks3stp-test\",\"States\":{\"tasks3stp-test\":{\"End\":true,\"Retry\":[{\"ErrorEquals\":[\"Lambda.ClientExecutionTimeoutException\",\"Lambda.ServiceException\",\"Lambda.AWSLambdaException\",\"Lambda.SdkClientException\"],\"IntervalSeconds\":2,\"MaxAttempts\":6,\"BackoffRate\":2}],\"Type\":\"Task\",\"Resource\":\"arn:", + { + "Ref": "AWS::Partition" + }, + ":states:::lambda:invoke\",\"Parameters\":{\"FunctionName\":\"", + { + "Fn::GetAtt": [ + "lambdas3stptest9FBDC6CE", + "Arn" + ] + }, + "\",\"Payload.$\":\"$\"}}}}" + ] + ] + }, + "loggingConfiguration": { + "destinations": [ + { + "cloudWatchLogsLogGroup": { + "logGroupArn": { + "Fn::GetAtt": [ + "testsqspipesstatesconstructStateMachineLogGroupADE94F1D", + "Arn" + ] + } + } + } + ], + "level": "ERROR" + }, + "roleArn": { + "Fn::GetAtt": [ + "testsqspipesstatesconstructStateMachineRoleBF97BFC0", + "Arn" + ] + } + } + }, + "constructInfo": { + "fqn": "aws-cdk-lib.aws_stepfunctions.CfnStateMachine", + "version": "2.161.0" + } + } + }, + "constructInfo": { + "fqn": "aws-cdk-lib.aws_stepfunctions.StateMachine", + "version": "2.161.0" + } + }, + "ExecutionFailedAlarm": { + "id": "ExecutionFailedAlarm", + "path": "sqspstp-state-machine-enrichment/test-sqs-pipes-states-construct/ExecutionFailedAlarm", + "children": { + "Resource": { + "id": "Resource", + "path": "sqspstp-state-machine-enrichment/test-sqs-pipes-states-construct/ExecutionFailedAlarm/Resource", + "attributes": { + "aws:cdk:cloudformation:type": "AWS::CloudWatch::Alarm", + "aws:cdk:cloudformation:props": { + "alarmDescription": "Alarm for the number of executions that failed exceeded the threshold of 1. ", + "comparisonOperator": "GreaterThanOrEqualToThreshold", + "dimensions": [ + { + "name": "StateMachineArn", + "value": { + "Ref": "testsqspipesstatesconstructStateMachine29272AA9" + } + } + ], + "evaluationPeriods": 1, + "metricName": "ExecutionsFailed", + "namespace": "AWS/States", + "period": 300, + "statistic": "Sum", + "threshold": 1 + } + }, + "constructInfo": { + "fqn": "aws-cdk-lib.aws_cloudwatch.CfnAlarm", + "version": "2.161.0" + } + } + }, + "constructInfo": { + "fqn": "aws-cdk-lib.aws_cloudwatch.Alarm", + "version": "2.161.0" + } + }, + "ExecutionThrottledAlarm": { + "id": "ExecutionThrottledAlarm", + "path": "sqspstp-state-machine-enrichment/test-sqs-pipes-states-construct/ExecutionThrottledAlarm", + "children": { + "Resource": { + "id": "Resource", + "path": "sqspstp-state-machine-enrichment/test-sqs-pipes-states-construct/ExecutionThrottledAlarm/Resource", + "attributes": { + "aws:cdk:cloudformation:type": "AWS::CloudWatch::Alarm", + "aws:cdk:cloudformation:props": { + "alarmDescription": "Alarm for the number of executions that throttled exceeded the threshold of 1. ", + "comparisonOperator": "GreaterThanOrEqualToThreshold", + "dimensions": [ + { + "name": "StateMachineArn", + "value": { + "Ref": "testsqspipesstatesconstructStateMachine29272AA9" + } + } + ], + "evaluationPeriods": 1, + "metricName": "ExecutionThrottled", + "namespace": "AWS/States", + "period": 300, + "statistic": "Sum", + "threshold": 1 + } + }, + "constructInfo": { + "fqn": "aws-cdk-lib.aws_cloudwatch.CfnAlarm", + "version": "2.161.0" + } + } + }, + "constructInfo": { + "fqn": "aws-cdk-lib.aws_cloudwatch.Alarm", + "version": "2.161.0" + } + }, + "ExecutionAbortedAlarm": { + "id": "ExecutionAbortedAlarm", + "path": "sqspstp-state-machine-enrichment/test-sqs-pipes-states-construct/ExecutionAbortedAlarm", + "children": { + "Resource": { + "id": "Resource", + "path": "sqspstp-state-machine-enrichment/test-sqs-pipes-states-construct/ExecutionAbortedAlarm/Resource", + "attributes": { + "aws:cdk:cloudformation:type": "AWS::CloudWatch::Alarm", + "aws:cdk:cloudformation:props": { + "alarmDescription": "Alarm for the number of executions that aborted exceeded the threshold of 1. ", + "comparisonOperator": "GreaterThanOrEqualToThreshold", + "dimensions": [ + { + "name": "StateMachineArn", + "value": { + "Ref": "testsqspipesstatesconstructStateMachine29272AA9" + } + } + ], + "evaluationPeriods": 1, + "metricName": "ExecutionsAborted", + "namespace": "AWS/States", + "period": 300, + "statistic": "Maximum", + "threshold": 1 + } + }, + "constructInfo": { + "fqn": "aws-cdk-lib.aws_cloudwatch.CfnAlarm", + "version": "2.161.0" + } + } + }, + "constructInfo": { + "fqn": "aws-cdk-lib.aws_cloudwatch.Alarm", + "version": "2.161.0" + } + }, + "PipeRole--test-sqs-pipes-states-construct": { + "id": "PipeRole--test-sqs-pipes-states-construct", + "path": "sqspstp-state-machine-enrichment/test-sqs-pipes-states-construct/PipeRole--test-sqs-pipes-states-construct", + "children": { + "ImportPipeRole--test-sqs-pipes-states-construct": { + "id": "ImportPipeRole--test-sqs-pipes-states-construct", + "path": "sqspstp-state-machine-enrichment/test-sqs-pipes-states-construct/PipeRole--test-sqs-pipes-states-construct/ImportPipeRole--test-sqs-pipes-states-construct", + "constructInfo": { + "fqn": "aws-cdk-lib.Resource", + "version": "2.161.0" + } + }, + "Resource": { + "id": "Resource", + "path": "sqspstp-state-machine-enrichment/test-sqs-pipes-states-construct/PipeRole--test-sqs-pipes-states-construct/Resource", + "attributes": { + "aws:cdk:cloudformation:type": "AWS::IAM::Role", + "aws:cdk:cloudformation:props": { + "assumeRolePolicyDocument": { + "Statement": [ + { + "Action": "sts:AssumeRole", + "Effect": "Allow", + "Principal": { + "Service": "pipes.amazonaws.com" + } + } + ], + "Version": "2012-10-17" + }, + "policies": [ + { + "policyName": "sourcePolicy", + "policyDocument": { + "Statement": [ + { + "Action": [ + "sqs:DeleteMessage", + "sqs:GetQueueAttributes", + "sqs:ReceiveMessage" + ], + "Effect": "Allow", + "Resource": { + "Fn::GetAtt": [ + "testsqspipesstatesconstructqueueA7C76715", + "Arn" + ] + } + } + ], + "Version": "2012-10-17" + } + }, + { + "policyName": "targetPolicy", + "policyDocument": { + "Statement": [ + { + "Action": "states:StartExecution", + "Effect": "Allow", + "Resource": { + "Ref": "testsqspipesstatesconstructStateMachine29272AA9" + } + } + ], + "Version": "2012-10-17" + } + } + ] + } + }, + "constructInfo": { + "fqn": "aws-cdk-lib.aws_iam.CfnRole", + "version": "2.161.0" + } + } + }, + "constructInfo": { + "fqn": "aws-cdk-lib.aws_iam.Role", + "version": "2.161.0" + } + }, + "enrichmentpolicytest-sqs-pipes-states-construct": { + "id": "enrichmentpolicytest-sqs-pipes-states-construct", + "path": "sqspstp-state-machine-enrichment/test-sqs-pipes-states-construct/enrichmentpolicytest-sqs-pipes-states-construct", + "children": { + "Resource": { + "id": "Resource", + "path": "sqspstp-state-machine-enrichment/test-sqs-pipes-states-construct/enrichmentpolicytest-sqs-pipes-states-construct/Resource", + "attributes": { + "aws:cdk:cloudformation:type": "AWS::IAM::Policy", + "aws:cdk:cloudformation:props": { + "policyDocument": { + "Statement": [ + { + "Action": "states:StartSyncExecution", + "Effect": "Allow", + "Resource": { + "Ref": "temp3A4F7567" + } + } + ], + "Version": "2012-10-17" + }, + "policyName": "testsqspipesstatesconstructenrichmentpolicytestsqspipesstatesconstructC752476A", + "roles": [ + { + "Ref": "testsqspipesstatesconstructPipeRoletestsqspipesstatesconstruct2CC9A13C" + } + ] + } + }, + "constructInfo": { + "fqn": "aws-cdk-lib.aws_iam.CfnPolicy", + "version": "2.161.0" + } + } + }, + "constructInfo": { + "fqn": "aws-cdk-lib.aws_iam.Policy", + "version": "2.161.0" + } + }, + "LogGroup-test-sqs-pipes-states-construct": { + "id": "LogGroup-test-sqs-pipes-states-construct", + "path": "sqspstp-state-machine-enrichment/test-sqs-pipes-states-construct/LogGroup-test-sqs-pipes-states-construct", + "children": { + "Resource": { + "id": "Resource", + "path": "sqspstp-state-machine-enrichment/test-sqs-pipes-states-construct/LogGroup-test-sqs-pipes-states-construct/Resource", + "attributes": { + "aws:cdk:cloudformation:type": "AWS::Logs::LogGroup", + "aws:cdk:cloudformation:props": { + "logGroupName": { + "Fn::Join": [ + "", + [ + "/aws/vendedlogs/pipes/constructs/sqspstp-state-machine-enrichmenttest-sqs-pipes-states-constructPipesLog-", + { + "Fn::Select": [ + 2, + { + "Fn::Split": [ + "/", + { + "Ref": "AWS::StackId" + } + ] + } + ] + } + ] + ] + } + } + }, + "constructInfo": { + "fqn": "aws-cdk-lib.aws_logs.CfnLogGroup", + "version": "2.161.0" + } + } + }, + "constructInfo": { + "fqn": "aws-cdk-lib.aws_logs.LogGroup", + "version": "2.161.0" + } + }, + "pipe-test-sqs-pipes-states-construct": { + "id": "pipe-test-sqs-pipes-states-construct", + "path": "sqspstp-state-machine-enrichment/test-sqs-pipes-states-construct/pipe-test-sqs-pipes-states-construct", + "attributes": { + "aws:cdk:cloudformation:type": "AWS::Pipes::Pipe", + "aws:cdk:cloudformation:props": { + "enrichment": { + "Ref": "temp3A4F7567" + }, + "logConfiguration": { + "cloudwatchLogsLogDestination": { + "logGroupArn": { + "Fn::GetAtt": [ + "testsqspipesstatesconstructLogGrouptestsqspipesstatesconstructF827FE15", + "Arn" + ] + } + }, + "level": "TRACE" + }, + "roleArn": { + "Fn::GetAtt": [ + "testsqspipesstatesconstructPipeRoletestsqspipesstatesconstruct2CC9A13C", + "Arn" + ] + }, + "source": { + "Fn::GetAtt": [ + "testsqspipesstatesconstructqueueA7C76715", + "Arn" + ] + }, + "sourceParameters": {}, + "target": { + "Ref": "testsqspipesstatesconstructStateMachine29272AA9" + }, + "targetParameters": { + "stepFunctionStateMachineParameters": { + "invocationType": "FIRE_AND_FORGET" + } + } + } + }, + "constructInfo": { + "fqn": "aws-cdk-lib.aws_pipes.CfnPipe", + "version": "2.161.0" + } + } + }, + "constructInfo": { + "fqn": "@aws-solutions-constructs/aws-sqs-pipes-stepfunctions.SqsToPipesToStepfunctions", + "version": "2.72.0" + } + }, + "Integ": { + "id": "Integ", + "path": "sqspstp-state-machine-enrichment/Integ", + "children": { + "DefaultTest": { + "id": "DefaultTest", + "path": "sqspstp-state-machine-enrichment/Integ/DefaultTest", + "children": { + "Default": { + "id": "Default", + "path": "sqspstp-state-machine-enrichment/Integ/DefaultTest/Default", + "constructInfo": { + "fqn": "constructs.Construct", + "version": "10.4.2" + } + }, + "DeployAssert": { + "id": "DeployAssert", + "path": "sqspstp-state-machine-enrichment/Integ/DefaultTest/DeployAssert", + "children": { + "BootstrapVersion": { + "id": "BootstrapVersion", + "path": "sqspstp-state-machine-enrichment/Integ/DefaultTest/DeployAssert/BootstrapVersion", + "constructInfo": { + "fqn": "aws-cdk-lib.CfnParameter", + "version": "2.161.0" + } + }, + "CheckBootstrapVersion": { + "id": "CheckBootstrapVersion", + "path": "sqspstp-state-machine-enrichment/Integ/DefaultTest/DeployAssert/CheckBootstrapVersion", + "constructInfo": { + "fqn": "aws-cdk-lib.CfnRule", + "version": "2.161.0" + } + } + }, + "constructInfo": { + "fqn": "aws-cdk-lib.Stack", + "version": "2.161.0" + } + } + }, + "constructInfo": { + "fqn": "@aws-cdk/integ-tests-alpha.IntegTestCase", + "version": "2.161.0-alpha.0" + } + } + }, + "constructInfo": { + "fqn": "@aws-cdk/integ-tests-alpha.IntegTest", + "version": "2.161.0-alpha.0" + } + }, + "BootstrapVersion": { + "id": "BootstrapVersion", + "path": "sqspstp-state-machine-enrichment/BootstrapVersion", + "constructInfo": { + "fqn": "aws-cdk-lib.CfnParameter", + "version": "2.161.0" + } + }, + "CheckBootstrapVersion": { + "id": "CheckBootstrapVersion", + "path": "sqspstp-state-machine-enrichment/CheckBootstrapVersion", + "constructInfo": { + "fqn": "aws-cdk-lib.CfnRule", + "version": "2.161.0" + } + } + }, + "constructInfo": { + "fqn": "aws-cdk-lib.Stack", + "version": "2.161.0" + } + }, + "Tree": { + "id": "Tree", + "path": "Tree", + "constructInfo": { + "fqn": "constructs.Construct", + "version": "10.4.2" + } + } + }, + "constructInfo": { + "fqn": "aws-cdk-lib.App", + "version": "2.161.0" + } + } +} \ No newline at end of file diff --git a/source/patterns/@aws-solutions-constructs/aws-sqs-pipes-stepfunctions/test/integ.sqspstp-state-machine-enrichment.ts b/source/patterns/@aws-solutions-constructs/aws-sqs-pipes-stepfunctions/test/integ.sqspstp-state-machine-enrichment.ts new file mode 100644 index 000000000..0b86a3df0 --- /dev/null +++ b/source/patterns/@aws-solutions-constructs/aws-sqs-pipes-stepfunctions/test/integ.sqspstp-state-machine-enrichment.ts @@ -0,0 +1,40 @@ +/** + * 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. + */ + +/// !cdk-integ * +import { App, Stack } from "aws-cdk-lib"; +import { SqsToPipesToStepfunctions, SqsToPipesToStepfunctionsProps } from "../lib"; +import { generateIntegStackName } from '@aws-solutions-constructs/core'; +import { IntegTest } from '@aws-cdk/integ-tests-alpha'; +import * as defaults from '@aws-solutions-constructs/core'; +import * as sfn from 'aws-cdk-lib/aws-stepfunctions'; + +const app = new App(); +const stack = new Stack(app, generateIntegStackName(__filename)); +const enrichmentStateMachine = new sfn.StateMachine(stack, 'temp', { + stateMachineType: sfn.StateMachineType.EXPRESS, + definitionBody: defaults.CreateTestStateMachineDefinitionBody(stack, 'temp') +}); +const props: SqsToPipesToStepfunctionsProps = { + stateMachineProps: { + definitionBody: defaults.CreateTestStateMachineDefinitionBody(stack, 's3stp-test') + }, + enrichmentStateMachine, + logLevel: defaults.PipesLogLevel.TRACE +}; + +new SqsToPipesToStepfunctions(stack, 'test-sqs-pipes-states-construct', props); + +new IntegTest(stack, 'Integ', { testCases: [ + stack +] }); diff --git a/source/patterns/@aws-solutions-constructs/aws-sqs-pipes-stepfunctions/test/lambda/index.js b/source/patterns/@aws-solutions-constructs/aws-sqs-pipes-stepfunctions/test/lambda/index.js new file mode 100644 index 000000000..34d92af16 --- /dev/null +++ b/source/patterns/@aws-solutions-constructs/aws-sqs-pipes-stepfunctions/test/lambda/index.js @@ -0,0 +1,9 @@ +exports.handler = async (event) => { + console.log(event); + const response = event.map((x) =>{ + const body = JSON.parse(x.body); + body.newAttrib = "content"; + return body; + }); + return response; +} \ No newline at end of file diff --git a/source/patterns/@aws-solutions-constructs/aws-sqs-pipes-stepfunctions/test/sqs-pipes-stepfunctions.test.ts b/source/patterns/@aws-solutions-constructs/aws-sqs-pipes-stepfunctions/test/sqs-pipes-stepfunctions.test.ts new file mode 100644 index 000000000..9cbde4ec2 --- /dev/null +++ b/source/patterns/@aws-solutions-constructs/aws-sqs-pipes-stepfunctions/test/sqs-pipes-stepfunctions.test.ts @@ -0,0 +1,425 @@ +/** + * 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 { Stack } from "aws-cdk-lib"; +import { SqsToPipesToStepfunctions, SqsToPipesToStepfunctionsProps } from "../lib"; +import { Match, Template } from 'aws-cdk-lib/assertions'; +import * as sqs from 'aws-cdk-lib/aws-sqs'; +import * as defaults from '@aws-solutions-constructs/core'; +import * as lambda from 'aws-cdk-lib/aws-lambda'; +import { RetentionDays } from "aws-cdk-lib/aws-logs"; + +test('Test default behaviors', () => { + // Initial Setup + const stack = new Stack(); + const props: SqsToPipesToStepfunctionsProps = { + stateMachineProps: { + definitionBody: defaults.CreateTestStateMachineDefinitionBody(stack, 'pipes-test') + } + }; + const construct = new SqsToPipesToStepfunctions(stack, 'test-sqs-pipes-states', props); + const template = Template.fromStack(stack); + + expect(construct.pipe).toBeDefined(); + expect(construct.pipeRole).toBeDefined(); + + template.hasResourceProperties('AWS::IAM::Role', { + AssumeRolePolicyDocument: { + Statement: [ + { + Action: "sts:AssumeRole", + Effect: "Allow", + Principal: { + Service: "pipes.amazonaws.com" + } + } + ], + Version: "2012-10-17" + }, + Policies: [ + { + PolicyDocument: { + Statement: [ + { + Action: [ + "sqs:ReceiveMessage", + "sqs:DeleteMessage", + "sqs:GetQueueAttributes" + ], + Effect: "Allow", + Resource: { + "Fn::GetAtt": [ + Match.stringLikeRegexp(`testsqspipesstatesqueue.*`), + "Arn" + ] + } + } + ], + Version: "2012-10-17" + }, + PolicyName: "sourcePolicy" + }, + { + PolicyDocument: { + Statement: [ + { + Action: "states:StartExecution", + Effect: "Allow", + Resource: { + Ref: Match.stringLikeRegexp(`testsqspipesstatesStateMachine.*`) + } + } + ], + Version: "2012-10-17" + }, + PolicyName: "targetPolicy" + } + ] + }); + template.hasResourceProperties('AWS::Pipes::Pipe', { + Source: { + "Fn::GetAtt": [ + Match.stringLikeRegexp(`testsqspipesstatesqueue.*`), + "Arn" + ] + }, + Target: { + Ref: Match.stringLikeRegexp(`testsqspipesstatesStateMachine.*`), + }, + }); + + template.hasResourceProperties('AWS::Pipes::Pipe', { + LogConfiguration: { + CloudwatchLogsLogDestination: { + LogGroupArn: { + "Fn::GetAtt": [ + Match.stringLikeRegexp(`testsqspipesstatesLogGrouptestsqspipesstates.*`), + "Arn" + ] + } + }, + Level: "INFO" + } + }); + template.hasResourceProperties('AWS::Logs::LogGroup', { + LogGroupName: { + "Fn::Join": [ + "", + [ + Match.stringLikeRegexp('\/aws\/vendedlogs\/pipes\/constructs'), + { + "Fn::Select": [ + 2, + Match.anyValue() + ] + } + ] + ] + }, + }); + +}); + +test('Test queue and state machine aspects of construct', () => { + // Initial Setup + const stack = new Stack(); + const props: SqsToPipesToStepfunctionsProps = { + stateMachineProps: { + definitionBody: defaults.CreateTestStateMachineDefinitionBody(stack, 'lamstp-test') + } + }; + const construct = new SqsToPipesToStepfunctions(stack, 'test-sqs-pipes-states', props); + const template = Template.fromStack(stack); + + expect(construct.sqsQueue).toBeDefined(); + expect(construct.deadLetterQueue).toBeDefined(); + template.resourceCountIs("AWS::SQS::Queue", 2); + template.hasResourceProperties('AWS::SQS::Queue', { + KmsMasterKeyId: "alias/aws/sqs" + }); + + const stateMachine = construct.stateMachine; + expect(stateMachine).toBeDefined(); + const cwAlarm = construct.cloudwatchAlarms; + expect(cwAlarm).toBeDefined(); + expect(construct.stateMachineLogGroup).toBeDefined(); +}); + +test('Test existing queue', () => { + const stack = new Stack(); + const existingQueue = new sqs.Queue(stack, 'existing-queue', {}); + + const props: SqsToPipesToStepfunctionsProps = { + stateMachineProps: { + definitionBody: defaults.CreateTestStateMachineDefinitionBody(stack, 'lamstp-test') + }, + existingQueueObj: existingQueue, + }; + const construct = new SqsToPipesToStepfunctions(stack, 'test-sqs-pipes-states', props); + expect(construct.sqsQueue.queueArn).toEqual(existingQueue.queueArn); +}); + +test('Test filter', () => { + // Stack + const stack = new Stack(); + const testFilterPattern = `{ + "body": { + "state": ["open"] + } + }`; + const props: SqsToPipesToStepfunctionsProps = { + stateMachineProps: { + definitionBody: defaults.CreateTestStateMachineDefinitionBody(stack, 'lamstp-test') + }, + pipeProps: { + sourceParameters: { + filterCriteria: { + filters: [{ pattern: testFilterPattern }], + }, + } + } + }; + new SqsToPipesToStepfunctions(stack, 'test-sqs-pipes-states', props); + const template = Template.fromStack(stack); + template.hasResourceProperties('AWS::Pipes::Pipe', { + SourceParameters: { + FilterCriteria: { + Filters: [ + { + Pattern: testFilterPattern + } + ] + } + } + }); + +}); + +test('Test target parameters?', () => { + const testMessageGroupId = "test-id"; + // Stack + const stack = new Stack(); + const props: SqsToPipesToStepfunctionsProps = { + stateMachineProps: { + definitionBody: defaults.CreateTestStateMachineDefinitionBody(stack, 'lamstp-test') + }, + pipeProps: { + // We realize that this would not launch because the target is not + // a queue, but it tests the functionality + targetParameters: { + sqsQueueParameters: { + messageGroupId: testMessageGroupId, + } + } + } + }; + new SqsToPipesToStepfunctions(stack, 'test-sqs-pipes-states', props); + const template = Template.fromStack(stack); + + template.hasResourceProperties('AWS::Pipes::Pipe', { + TargetParameters: { + SqsQueueParameters: { + MessageGroupId: testMessageGroupId, + } + } + }); +}); + +test('test state machine enrichment', () => { + const stack = new Stack(); + const enrichmentStateMachine = defaults.CreateTestStateMachine(stack, 'enrichment-state-machine'); + const props: SqsToPipesToStepfunctionsProps = { + enrichmentStateMachine, + stateMachineProps: { + definitionBody: defaults.CreateTestStateMachineDefinitionBody(stack, 'pipes-test') + } + }; + const construct = new SqsToPipesToStepfunctions(stack, 'test', props); + + expect(construct.pipe).toBeDefined(); + expect(construct.pipeRole).toBeDefined(); + + const template = Template.fromStack(stack); + + // Look for additional enrichment permision + template.hasResourceProperties('AWS::IAM::Policy', { + PolicyDocument: { + Statement: [ + { + Action: "states:StartSyncExecution", + Effect: "Allow", + Resource: { + Ref: Match.stringLikeRegexp('enrichmentstatemachine.*'), + } + } + ], + Version: "2012-10-17" + }, + PolicyName: Match.stringLikeRegexp(`testenrichmentpolicytest.*`), + Roles: [ + { + Ref: Match.stringLikeRegexp(`testPipeRoletest.*`) + } + ] + }); + template.hasResourceProperties('AWS::Pipes::Pipe', { + Enrichment: { + Ref: Match.stringLikeRegexp("enrichmentstatemachine.*") + }, + }); +}); + +test('Test lambda function enrichment', () => { + const stack = new Stack(); + const enrichmentFunction = new lambda.Function(stack, 'enrichment-function', { + runtime: lambda.Runtime.NODEJS_20_X, + handler: 'index.handler', + code: lambda.Code.fromInline(`exports.handler = async (event) => {return;}`) + }); + + const props: SqsToPipesToStepfunctionsProps = { + stateMachineProps: { + definitionBody: defaults.CreateTestStateMachineDefinitionBody(stack, 'pipes-test') + }, + enrichmentFunction + }; + const construct = new SqsToPipesToStepfunctions(stack, 'enrichment-function-test', props); + const template = Template.fromStack(stack); + + expect(construct.pipe).toBeDefined(); + expect(construct.pipeRole).toBeDefined(); + + template.hasResourceProperties('AWS::IAM::Policy', { + PolicyDocument: { + Statement: [ + { + Action: "lambda:InvokeFunction", + Effect: "Allow", + Resource: { + "Fn::GetAtt": [ + Match.stringLikeRegexp('enrichmentfunction.*'), + "Arn" + ] + } + } + ], + Version: "2012-10-17" + }, + PolicyName: Match.stringLikeRegexp(`enrichmentfunctiontestenrichmentpolicyenrichmentfunctiontest.*`), + Roles: [ + { + Ref: Match.stringLikeRegexp(`enrichmentfunctiontestPipeRoleenrichmentfunctiontest.*`) + } + ] + }); + template.hasResourceProperties('AWS::Pipes::Pipe', { + Enrichment: { + "Fn::GetAtt": [ + Match.stringLikeRegexp("enrichmentfunction.*"), + "Arn" + ] + }, + }); +}); + +test('Test custom log level', () => { + const stack = new Stack(); + const props: SqsToPipesToStepfunctionsProps = { + stateMachineProps: { + definitionBody: defaults.CreateTestStateMachineDefinitionBody(stack, 'pipes-test') + }, + logLevel: defaults.PipesLogLevel.TRACE + }; + const construct = new SqsToPipesToStepfunctions(stack, 'test-sqs-pipes-states', props); + const template = Template.fromStack(stack); + + expect(construct.pipe).toBeDefined(); + expect(construct.pipeRole).toBeDefined(); + + template.hasResourceProperties('AWS::Pipes::Pipe', { + LogConfiguration: { + Level: "TRACE", + } + }); +}); + +test('Test log level OFF', () => { + const stack = new Stack(); + const props: SqsToPipesToStepfunctionsProps = { + stateMachineProps: { + definitionBody: defaults.CreateTestStateMachineDefinitionBody(stack, 'pipes-test') + }, + logLevel: defaults.PipesLogLevel.OFF + }; + const construct = new SqsToPipesToStepfunctions(stack, 'test-sqs-pipes-states', props); + const template = Template.fromStack(stack); + + expect(construct.pipe).toBeDefined(); + expect(construct.pipeRole).toBeDefined(); + + // Should be no LogConfiguration + template.resourcePropertiesCountIs('AWS::Pipes::Pipe', { LogConfiguration: {}}, 0); + + // One log group for the state machine, none for the pipe + template.resourceCountIs('AWS::Logs::LogGroup', 1); +}); + +test('Test custom pipe log props', () => { + const testRetention = RetentionDays.FOUR_MONTHS; + const stack = new Stack(); + const props: SqsToPipesToStepfunctionsProps = { + stateMachineProps: { + definitionBody: defaults.CreateTestStateMachineDefinitionBody(stack, 'pipes-test') + }, + pipeLogProps: { + retention: testRetention + } + }; + const construct = new SqsToPipesToStepfunctions(stack, 'test-sqs-pipes-states', props); + const template = Template.fromStack(stack); + + expect(construct.pipe).toBeDefined(); + expect(construct.pipeRole).toBeDefined(); + template.hasResourceProperties('AWS::Logs::LogGroup', { + RetentionInDays: 120, + }); +}); + +test('Test setting source parameters like batchSize', () => { + const testBatchSize = 123; + const stack = new Stack(); + const props: SqsToPipesToStepfunctionsProps = { + stateMachineProps: { + definitionBody: defaults.CreateTestStateMachineDefinitionBody(stack, 'pipes-test') + }, + pipeProps: { + sourceParameters: { + sqsQueueParameters: { + batchSize: testBatchSize, + }, + } + } + }; + const construct = new SqsToPipesToStepfunctions(stack, 'test-sqs-pipes-states', props); + const template = Template.fromStack(stack); + + expect(construct.pipe).toBeDefined(); + expect(construct.pipeRole).toBeDefined(); + template.hasResourceProperties('AWS::Pipes::Pipe', { + SourceParameters: { + SqsQueueParameters: { + BatchSize: testBatchSize, + } + } + }); +}); diff --git a/source/patterns/@aws-solutions-constructs/core/index.ts b/source/patterns/@aws-solutions-constructs/core/index.ts index 91c64d30e..de29701ad 100644 --- a/source/patterns/@aws-solutions-constructs/core/index.ts +++ b/source/patterns/@aws-solutions-constructs/core/index.ts @@ -75,3 +75,5 @@ export * from './lib/opensearch-helper'; export * from './lib/kendra-helper'; export * from './lib/websocket-api-defaults'; export * from './lib/websocket-api-helper'; +export * from './lib/pipes-defaults'; +export * from './lib/pipes-helper'; diff --git a/source/patterns/@aws-solutions-constructs/core/lib/apigateway-defaults.ts b/source/patterns/@aws-solutions-constructs/core/lib/apigateway-defaults.ts index 0cd63b322..392aea98e 100644 --- a/source/patterns/@aws-solutions-constructs/core/lib/apigateway-defaults.ts +++ b/source/patterns/@aws-solutions-constructs/core/lib/apigateway-defaults.ts @@ -21,7 +21,7 @@ import { IntegrationResponse } from 'aws-cdk-lib/aws-apigateway'; import * as lambda from 'aws-cdk-lib/aws-lambda'; import { LogGroup } from 'aws-cdk-lib/aws-logs'; import { Construct } from 'constructs'; -import { generatePhysicalName } from './utils'; +import { generatePhysicalRestApiName } from './utils'; /** * Private function to configure an api.RestApiProps @@ -124,7 +124,7 @@ export function DefaultSpecRestApiProps(scope: Construct, logGroup: LogGroup): a dataTraceEnabled: false, tracingEnabled: true }, - restApiName: generatePhysicalName("", [ scope.node.id ], 255), + restApiName: generatePhysicalRestApiName("", [ scope.node.id ]), }; } diff --git a/source/patterns/@aws-solutions-constructs/core/lib/cloudfront-distribution-helper.ts b/source/patterns/@aws-solutions-constructs/core/lib/cloudfront-distribution-helper.ts index 4a0f9e178..53a7b0336 100644 --- a/source/patterns/@aws-solutions-constructs/core/lib/cloudfront-distribution-helper.ts +++ b/source/patterns/@aws-solutions-constructs/core/lib/cloudfront-distribution-helper.ts @@ -26,7 +26,7 @@ import { DefaultCloudFrontWebDistributionForApiGatewayProps, DefaultCloudFrontDistributionForMediaStoreProps } from './cloudfront-distribution-defaults'; -import { addCfnSuppressRules, consolidateProps, generatePhysicalName } from './utils'; +import { addCfnSuppressRules, consolidateProps, generatePhysicalOacName } from './utils'; import { createCloudFrontLoggingBucket } from './s3-bucket-helper'; import { DefaultS3Props } from './s3-bucket-defaults'; import { S3OacOrigin } from './s3-oac-origin'; @@ -145,7 +145,7 @@ export function createCloudFrontDistributionForS3( if (!props.sourceBucket.isWebsite) { originAccessControl = new cloudfront.CfnOriginAccessControl(scope, 'CloudFrontOac', { originAccessControlConfig: { - name: generatePhysicalName('aws-cloudfront-s3-', [id], 64), + name: generatePhysicalOacName('aws-cloudfront-s3-', [id]), originAccessControlOriginType: 's3', signingBehavior: 'always', signingProtocol: 'sigv4', diff --git a/source/patterns/@aws-solutions-constructs/core/lib/kendra-defaults.ts b/source/patterns/@aws-solutions-constructs/core/lib/kendra-defaults.ts index 9901947bc..62088c5c4 100644 --- a/source/patterns/@aws-solutions-constructs/core/lib/kendra-defaults.ts +++ b/source/patterns/@aws-solutions-constructs/core/lib/kendra-defaults.ts @@ -12,14 +12,14 @@ */ import * as kendra from 'aws-cdk-lib/aws-kendra'; -import { generatePhysicalName } from "./utils"; +import { generatePhysicalKendraIndexName } from "./utils"; /** * @internal This is an internal core function and should not be called directly by Solutions Constructs clients. */ export function DefaultKendraIndexProps(id: string, roleArn?: string): kendra.CfnIndexProps { return { - name: generatePhysicalName("", ["KendraIndex", id], 1000), + name: generatePhysicalKendraIndexName("", ["KendraIndex", id]), roleArn, edition: 'DEVELOPER_EDITION', } as kendra.CfnIndexProps; diff --git a/source/patterns/@aws-solutions-constructs/core/lib/kendra-helper.ts b/source/patterns/@aws-solutions-constructs/core/lib/kendra-helper.ts index 3606975ef..4edd5f590 100644 --- a/source/patterns/@aws-solutions-constructs/core/lib/kendra-helper.ts +++ b/source/patterns/@aws-solutions-constructs/core/lib/kendra-helper.ts @@ -18,7 +18,7 @@ import * as kendra from 'aws-cdk-lib/aws-kendra'; import * as iam from 'aws-cdk-lib/aws-iam'; -import { addCfnGuardSuppressRules, addCfnSuppressRules, consolidateProps, generatePhysicalName, overrideProps } from "./utils"; +import { addCfnGuardSuppressRules, addCfnSuppressRules, consolidateProps, generatePhysicalKendraIndexName, overrideProps } from "./utils"; import { Aws } from 'aws-cdk-lib'; // Note: To ensure CDKv2 compatibility, keep the import statement for Construct separate @@ -126,7 +126,7 @@ function CreateS3DataSource(scope: Construct, // Put bucket name in default props let defaultProps: kendra.CfnDataSourceProps = { indexId: targetIndex.ref, - name: generatePhysicalName('', ['s3-datasource', id], 1000), + name: generatePhysicalKendraIndexName('', ['s3-datasource', id]), type: 'S3' }; diff --git a/source/patterns/@aws-solutions-constructs/core/lib/pipes-defaults.ts b/source/patterns/@aws-solutions-constructs/core/lib/pipes-defaults.ts new file mode 100644 index 000000000..bb920e31d --- /dev/null +++ b/source/patterns/@aws-solutions-constructs/core/lib/pipes-defaults.ts @@ -0,0 +1,31 @@ +/** + * 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 * as pipes from 'aws-cdk-lib/aws-pipes'; + +export function defaultPipesProps(): any { + return {}; +} + +export function defaultSqsSourceProps(): any { + return { + }; +} + +export function defaultStateMachineTargetProps(): any { + return { + stepFunctionStateMachineParameters: { + invocationType: 'FIRE_AND_FORGET' + } + }; +} diff --git a/source/patterns/@aws-solutions-constructs/core/lib/pipes-helper.ts b/source/patterns/@aws-solutions-constructs/core/lib/pipes-helper.ts new file mode 100644 index 000000000..ec95b5cf8 --- /dev/null +++ b/source/patterns/@aws-solutions-constructs/core/lib/pipes-helper.ts @@ -0,0 +1,257 @@ +/** + * 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 * as pipes from 'aws-cdk-lib/aws-pipes'; +import * as sqs from 'aws-cdk-lib/aws-sqs'; +import * as iam from 'aws-cdk-lib/aws-iam'; +import * as logs from 'aws-cdk-lib/aws-logs'; +import * as lambda from 'aws-cdk-lib/aws-lambda'; +import * as sfn from 'aws-cdk-lib/aws-stepfunctions'; +import * as defaults from ".."; +import * as cdk from 'aws-cdk-lib'; +import { Construct } from 'constructs'; + +export enum PipesLogLevel { + OFF = "OFF", + TRACE = "TRACE", + INFO = "INFO", + ERROR = "ERROR", +} + +export interface CreateSourceResponse { + readonly sourceParameters: pipes.CfnPipe.PipeSourceParametersProperty, + readonly sourceArn: string, + readonly sourcePolicy: iam.PolicyDocument +} + +export interface BuildPipesProps { + readonly source: CreateSourceResponse, + readonly target: CreateTargetResponse, + readonly enrichmentFunction?: lambda.Function, + readonly enrichmentStateMachine?: sfn.StateMachine, + readonly clientProps?: any | pipes.CfnPipeProps + readonly logLevel?: PipesLogLevel, + readonly pipeLogProps?: logs.LogGroupProps +} + +export interface BuildPipesResponse { + readonly pipe: pipes.CfnPipe, + readonly pipeRole: iam.Role +} + +export function BuildPipe(scope: Construct, id: string, props: BuildPipesProps): BuildPipesResponse { + CheckBuildPipeProps(props); + + const pipeRole = new iam.Role(scope, `PipeRole--${id}`, { + assumedBy: new iam.ServicePrincipal('pipes.amazonaws.com'), + inlinePolicies: { + sourcePolicy: props.source.sourcePolicy, + targetPolicy: props.target.targetPolicy, + }, + }); + + // At this point we have the minimum values for CfnPipeProps - let's + // create it and fold in any additional values as we go along + let constructProps: pipes.CfnPipeProps = { + roleArn: pipeRole.roleArn, + source: props.source.sourceArn, + target: props.target.targetArn, + sourceParameters: props.source.sourceParameters, + targetParameters: props.target.targetParameters, + }; + + // Do we have any enrichment functionality? + if (props.enrichmentFunction) { + const enrichmentSettings = createLambdaEnrichment(scope, id, props.enrichmentFunction); + pipeRole.attachInlinePolicy(enrichmentSettings.pipeRolePolicy); + constructProps = defaults.consolidateProps(constructProps, { enrichment: enrichmentSettings.enrichmentArn }); + } else if (props.enrichmentStateMachine) { + const enrichmentSettings = createStateMachineEnrichment(scope, id, props.enrichmentStateMachine); + pipeRole.attachInlinePolicy(enrichmentSettings.pipeRolePolicy); + constructProps = defaults.consolidateProps(constructProps, { enrichment: enrichmentSettings.enrichmentArn }); + } + + // Are we responsible to create the logging mechanism? + if (!props.clientProps?.logConfiguration) { + + const logLevel = defaults.CheckStringWithDefault(props.logLevel, PipesLogLevel.INFO); + if (logLevel !== PipesLogLevel.OFF) { + + const defaultLogGroupProps = { + logGroupName: createPipesLogGroupName(scope, id), + }; + const consolidatedLogGroupProps = defaults.consolidateProps(defaultLogGroupProps, props.pipeLogProps); + const newLogGroup = defaults.buildLogGroup(scope, `LogGroup-${id}`, consolidatedLogGroupProps); + const logConfiguration = { + cloudwatchLogsLogDestination: { + logGroupArn: newLogGroup.logGroupArn + }, + level: logLevel + }; + + constructProps = defaults.consolidateProps(constructProps, { + logConfiguration, + }); + } + } + + const consolidateProps = defaults.consolidateProps(defaults.defaultPipesProps(), props.clientProps, constructProps); + + const newPipe = new pipes.CfnPipe(scope, `pipe-${id}`, consolidateProps); + + return { + pipe: newPipe, + pipeRole + }; +} + +interface CreateEnrichmentResponse { + readonly enrichmentArn: string, + readonly pipeRolePolicy: iam.Policy +} + +function createLambdaEnrichment(scope: Construct, id: string, lambdaFunction: lambda.Function): CreateEnrichmentResponse { + return { + enrichmentArn: lambdaFunction.functionArn, + pipeRolePolicy: new iam.Policy(scope, `enrichmentpolicy${id}`, { + statements: [ + new iam.PolicyStatement({ + resources: [lambdaFunction.functionArn], + actions: ['lambda:InvokeFunction'], + effect: iam.Effect.ALLOW, + }) + ] + }) + }; +} + +function createStateMachineEnrichment(scope: Construct, id: string, stateMachine: sfn.StateMachine): CreateEnrichmentResponse { + return { + enrichmentArn: stateMachine.stateMachineArn, + pipeRolePolicy: new iam.Policy(scope, `enrichmentpolicy${id}`, { + statements: [ + new iam.PolicyStatement({ + resources: [stateMachine.stateMachineArn], + actions: ['states:StartSyncExecution'], + effect: iam.Effect.ALLOW, + }) + ] + }) + }; +} + +function createPipesLogGroupName(scope: Construct, id: string): string { + const logGroupPrefix = '/aws/vendedlogs/pipes/constructs/'; + const nameParts: string[] = [ + cdk.Stack.of(scope).stackName, + id, + 'PipesLog' + ]; + return defaults.generatePhysicalLogGroupName(logGroupPrefix, nameParts); +} + +// ========================== +// Source and Target code - as new sources and targets are required, implement them +// here and test the new functions. + +export function CreateSqsSource(queue: sqs.IQueue, clientProps?: pipes.CfnPipe.PipeSourceParametersProperty | cdk.IResolvable): CreateSourceResponse { + const sourceParameters: pipes.CfnPipe.PipeSourceParametersProperty = defaults.consolidateProps(defaults.defaultSqsSourceProps(), clientProps); + return { + sourceParameters, + sourceArn: queue.queueArn, + sourcePolicy: new iam.PolicyDocument({ + statements: [ + new iam.PolicyStatement({ + resources: [queue.queueArn!], + actions: [ + "sqs:ReceiveMessage", + "sqs:DeleteMessage", + "sqs:GetQueueAttributes", + ], + effect: iam.Effect.ALLOW, + }) + ] + }) + }; +} + +export interface CreateTargetResponse { + readonly targetParameters: pipes.CfnPipe.PipeTargetParametersProperty, + readonly targetArn: string, + readonly targetPolicy: iam.PolicyDocument +} + +export function CreateStateMachineTarget(stateMachine: sfn.IStateMachine, + clientProps?: pipes.CfnPipe.PipeTargetParametersProperty | cdk.IResolvable): CreateTargetResponse { + + const targetParameters: pipes.CfnPipe.PipeTargetParametersProperty = + defaults.consolidateProps(defaults.defaultStateMachineTargetProps(), clientProps); + return { + targetParameters, + targetArn: stateMachine.stateMachineArn, + targetPolicy: new iam.PolicyDocument({ + statements: [ + new iam.PolicyStatement({ + resources: [stateMachine.stateMachineArn], + actions: ['states:StartExecution'], + effect: iam.Effect.ALLOW, + }), + ], + }) + }; +} + +// This is called by BuildPipe to validate arguments sent to BuildPipe +function CheckBuildPipeProps(props: BuildPipesProps) { + if (props.enrichmentFunction && props.enrichmentStateMachine) { + throw new Error("ERROR - Only one of enrichmentFunction or enrichmentStateMachine can be provided"); + } + + if (props.clientProps && (props.clientProps.source || props.clientProps.target || props.clientProps.roleArn || props.clientProps.enrichment)) { + throw new Error("ERROR - BuildPipeProps cannot specify source, target, roleArn, or enrichment"); + } + + if (props.logLevel && props.clientProps?.logConfiguration) { + throw new Error('ERROR - BuildPipeProps cannot specify logLevel and logConfiguration'); + } + if (props.pipeLogProps && props.clientProps?.logConfiguration) { + throw new Error('ERROR - BuildPipeProps cannot specify pipeLogProps and logConfiguration'); + } + if (props.pipeLogProps && (props.logLevel === PipesLogLevel.OFF)) { + throw new Error('ERROR - BuildPipeProps cannot specify pipeLogProps and log level OFF'); + } +} + +export interface PipesProps { + readonly pipesProps?: pipes.CfnPipeProps +} + +// This is called by constructs to validate inputs to the construct +export function CheckPipesProps(propsObject: PipesProps | any) { + let errorMessages = ''; + let errorFound = false; + + if (propsObject.pipesProps?.source) { + errorMessages += 'Do not set source in pipesProps. It is set by the construct.\n'; + errorFound = true; + } + + if (propsObject.pipesProps?.target) { + errorMessages += 'Do not set target in pipesProps. It is set by the construct.\n'; + errorFound = true; + } + + if (errorFound) { + throw new Error(errorMessages); + } +} diff --git a/source/patterns/@aws-solutions-constructs/core/lib/step-function-helper.ts b/source/patterns/@aws-solutions-constructs/core/lib/step-function-helper.ts index fdbd51100..9d2854e4b 100644 --- a/source/patterns/@aws-solutions-constructs/core/lib/step-function-helper.ts +++ b/source/patterns/@aws-solutions-constructs/core/lib/step-function-helper.ts @@ -21,7 +21,7 @@ import * as logs from 'aws-cdk-lib/aws-logs'; import * as cdk from 'aws-cdk-lib'; import * as smDefaults from './step-function-defaults'; import * as sfn from 'aws-cdk-lib/aws-stepfunctions'; -import { overrideProps, addCfnSuppressRules, generatePhysicalName } from './utils'; +import { overrideProps, addCfnSuppressRules, generatePhysicalLogGroupName } from './utils'; import * as iam from 'aws-cdk-lib/aws-iam'; import * as cloudwatch from 'aws-cdk-lib/aws-cloudwatch'; import { buildLogGroup } from './cloudwatch-log-group-helper'; @@ -75,17 +75,15 @@ export function buildStateMachine(scope: Construct, id: string | undefined, prop consolidatedLogGroupProps = {}; } - const maxLogGroupNameLength = 255; if (!consolidatedLogGroupProps?.logGroupName) { const logGroupPrefix = '/aws/vendedlogs/states/constructs/'; - const maxGeneratedNameLength = maxLogGroupNameLength - logGroupPrefix.length; const nameParts: string[] = [ cdk.Stack.of(scope).stackName, // Name of the stack id ?? scope.node.id, // Use the ID from client if provided, otherwise use the construct ID 'StateMachineLog' // Literal string for log group name portion ]; - const logGroupName = generatePhysicalName(logGroupPrefix, nameParts, maxGeneratedNameLength); + const logGroupName = generatePhysicalLogGroupName(logGroupPrefix, nameParts); consolidatedLogGroupProps = overrideProps(consolidatedLogGroupProps, { logGroupName }); } diff --git a/source/patterns/@aws-solutions-constructs/core/lib/utils.ts b/source/patterns/@aws-solutions-constructs/core/lib/utils.ts index 78212cdad..3311f4982 100644 --- a/source/patterns/@aws-solutions-constructs/core/lib/utils.ts +++ b/source/patterns/@aws-solutions-constructs/core/lib/utils.ts @@ -138,6 +138,34 @@ export function generateResourceName( return finalName.toLowerCase(); } +export function generatePhysicalLogGroupName( + prefix: string, + parts: string[] +): string { + return generatePhysicalName(prefix, parts, 255 - prefix.length); +} + +export function generatePhysicalRestApiName( + prefix: string, + parts: string[] +): string { + return generatePhysicalName(prefix, parts, 255); +} + +export function generatePhysicalOacName( + prefix: string, + parts: string[] +): string { + return generatePhysicalName(prefix, parts, 64); +} + +export function generatePhysicalKendraIndexName( + prefix: string, + parts: string[] +): string { + return generatePhysicalName(prefix, parts, 1000); +} + /** * @internal This is an internal core function and should not be called directly by Solutions Constructs clients. * @@ -317,4 +345,12 @@ export function CheckBooleanWithDefault(value: boolean | undefined, defaultValue } else { return value; } +} + +export function CheckStringWithDefault(value: string | undefined, defaultValue: string): string { + if (value === undefined) { + return defaultValue; + } else { + return value; + } } \ No newline at end of file diff --git a/source/patterns/@aws-solutions-constructs/core/test/pipes-helper.test.ts b/source/patterns/@aws-solutions-constructs/core/test/pipes-helper.test.ts new file mode 100644 index 000000000..82122c621 --- /dev/null +++ b/source/patterns/@aws-solutions-constructs/core/test/pipes-helper.test.ts @@ -0,0 +1,811 @@ +/** + * 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 { buildQueue } from "../lib/sqs-helper"; +import { buildStateMachine } from "../lib/step-function-helper"; +import { Stack } from "aws-cdk-lib"; +import * as defaults from '../'; +import * as pipes from 'aws-cdk-lib/aws-pipes'; +import * as lambda from 'aws-cdk-lib/aws-lambda'; +import * as sfn from 'aws-cdk-lib/aws-stepfunctions'; +import * as s3 from 'aws-cdk-lib/aws-s3'; +import { Match, Template } from "aws-cdk-lib/assertions"; +import { RetentionDays } from "aws-cdk-lib/aws-logs"; + +// ================================= +// Test sources and targets generation +// ================================= + +test('Create a default SQS Source', () => { + // Stack + const stack = new Stack(); + + const buildQueueResponse = buildQueue(stack, 'test-queue', {}); + const sqsSource = defaults.CreateSqsSource(buildQueueResponse.queue); + + expect(sqsSource.sourceArn).toEqual(buildQueueResponse.queue.queueArn); + expect(Object.keys(sqsSource.sourceParameters).length).toEqual(0); + // best we can do here, confirm values when we instantiate the actual pipe + expect(sqsSource.sourcePolicy.statementCount).toEqual(1); + Template.fromStack(stack); +}); + +test('Create an SQS Source with overrides', () => { + // Stack + const stack = new Stack(); + + const buildQueueResponse = buildQueue(stack, 'test-queue', {}); + const sqsSource = defaults.CreateSqsSource(buildQueueResponse.queue, { + sqsQueueParameters: { + batchSize: 123, + }, + }); + + expect(sqsSource.sourceArn).toEqual(buildQueueResponse.queue.queueArn); + // Because sqsQueueParameters type include 'IResolvable |', we need to extract the property this way + const batchSizeProp = + (sqsSource.sourceParameters.sqsQueueParameters as pipes.CfnPipe.PipeSourceSqsQueueParametersProperty)!.batchSize; + expect(batchSizeProp).toEqual(123); + // best we can do here, confirm values when we instantiate the actual pipe + expect(sqsSource.sourcePolicy.statementCount).toEqual(1); +}); + +test('Create a default Step Functions Target', () => { + + // Stack + const stack = new Stack(); + + const buildStateMachineResponse = buildStateMachine(stack, 'test-state-machine', { + stateMachineProps: { + definitionBody: defaults.CreateTestStateMachineDefinitionBody(stack, 'stub-state-machine') + } + }); + const stateMachineTarget = defaults.CreateStateMachineTarget(buildStateMachineResponse.stateMachine); + + expect(stateMachineTarget.targetArn).toEqual(buildStateMachineResponse.stateMachine.stateMachineArn); + expect(stateMachineTarget.targetParameters.stepFunctionStateMachineParameters).toBeDefined(); + const invocationType: string | undefined = + (stateMachineTarget.targetParameters.stepFunctionStateMachineParameters as pipes.CfnPipe.PipeTargetStateMachineParametersProperty).invocationType; + expect(invocationType).toEqual('FIRE_AND_FORGET'); + expect(Object.keys(stateMachineTarget.targetParameters).length).toEqual(1); + // best we can do here, confirm values when we instantiate the actual pipe + expect(stateMachineTarget.targetPolicy.statementCount).toEqual(1); + Template.fromStack(stack); + +}); + +test('Create a Step Functions Target with overrides', () => { + + // Stack + const stack = new Stack(); + + const buildStateMachineResponse = buildStateMachine(stack, 'test-state-machine', { + stateMachineProps: { + definitionBody: defaults.CreateTestStateMachineDefinitionBody(stack, 'stub-state-machine') + } + }); + const stateMachineTarget = defaults.CreateStateMachineTarget(buildStateMachineResponse.stateMachine, { + stepFunctionStateMachineParameters: { + invocationType: 'REQUEST_RESPONSE' + } + }); + + expect(stateMachineTarget.targetArn).toEqual(buildStateMachineResponse.stateMachine.stateMachineArn); + expect(stateMachineTarget.targetParameters.stepFunctionStateMachineParameters).toBeDefined(); + const invocationType: string | undefined = + (stateMachineTarget.targetParameters.stepFunctionStateMachineParameters as pipes.CfnPipe.PipeTargetStateMachineParametersProperty).invocationType; + expect(invocationType).toEqual('REQUEST_RESPONSE'); + expect(Object.keys(stateMachineTarget.targetParameters).length).toEqual(1); + // best we can do here, confirm values when we instantiate the actual pipe + expect(stateMachineTarget.targetPolicy.statementCount).toEqual(1); +}); + +// ================================= +// Test pipe creation +// ================================= + +test('Create a default pipe', () => { + const prerequisiteId = 'alldefault'; + const pipeId = 'defaultpipe'; + + // Stack + const stack = new Stack(); + const prerequisites = CreatePrerequisites(stack, prerequisiteId); + + const pipeResponse = defaults.BuildPipe(stack, pipeId, { + source: prerequisites.source, + target: prerequisites.target, + clientProps: {} + }); + + CheckPipeResponseProperties(pipeResponse, prerequisites); + + const template = Template.fromStack(stack); + template.resourceCountIs('AWS::Pipes::Pipe', 1); + CheckPipeResource(template, pipeId, prerequisiteId); + CheckPipeRole(template, prerequisiteId); + CheckLogGroup(template); +}); + +test('Create a pipe with overrides', () => { + const prerequisiteId = 'overridestest'; + const pipeId = 'overridespipe'; + // Stack + const stack = new Stack(); + const prerequisites = CreatePrerequisites(stack, prerequisiteId); + + const testDescription = 'test-description'; + const pipeResponse = defaults.BuildPipe(stack, pipeId, { + source: prerequisites.source, + target: prerequisites.target, + clientProps: { + description: testDescription + } + }); + CheckPipeResponseProperties(pipeResponse, prerequisites); + + const template = Template.fromStack(stack); + CheckPipeResource(template, pipeId, prerequisiteId); + CheckPipeRole(template, prerequisiteId); + CheckLogGroup(template); + + // The description is unique to this test, so check it here + template.hasResourceProperties('AWS::Pipes::Pipe', { + Description: testDescription + }); + +}); + +test('Create a pipe with a filter', () => { + const prerequisiteId = 'filtertest'; + const pipeId = 'filterpipe'; + + // Stack + const stack = new Stack(); + const prerequisites = CreatePrerequisites(stack, prerequisiteId); + + const testFilterPattern = `{ + "body": { + "state": ["open"] + } + }`; + + const pipeResponse = defaults.BuildPipe(stack, pipeId, { + source: prerequisites.source, + target: prerequisites.target, + clientProps: { + sourceParameters: { + filterCriteria: { + filters: [{ pattern: testFilterPattern }], + }, + } + }, + }); + CheckPipeResponseProperties(pipeResponse, prerequisites); + + const template = Template.fromStack(stack); + CheckPipeResource(template, pipeId, prerequisiteId); + CheckPipeRole(template, prerequisiteId); + CheckLogGroup(template); + + // SourceParameters is unique to this test, so check it here + template.hasResourceProperties('AWS::Pipes::Pipe', { + SourceParameters: { + FilterCriteria: { + Filters: [ + { + Pattern: testFilterPattern + } + ] + } + } + }); +}); + +test('Create a pipe with Lambda function enrichment', () => { + const prerequisiteId = 'lambdaenrichtest'; + const pipeId = 'lambdaenrichpipe'; + + // Stack + const stack = new Stack(); + const prerequisites = CreatePrerequisites(stack, prerequisiteId); + + const enrichmentFunction = new lambda.Function(stack, 'enrichment-function', { + code: lambda.Code.fromAsset(`${__dirname}/lambda-test`), + handler: "index.handler", + runtime: lambda.Runtime.NODEJS_20_X, + }); + + const pipeResponse = defaults.BuildPipe(stack, pipeId, { + source: prerequisites.source, + target: prerequisites.target, + enrichmentFunction + }); + CheckPipeResponseProperties(pipeResponse, prerequisites); + + const template = Template.fromStack(stack); + template.resourceCountIs('AWS::Pipes::Pipe', 1); + CheckPipeResource(template, pipeId, prerequisiteId); + CheckLogGroup(template); + + // Enrichment is unique to this test so check it here + template.hasResourceProperties('AWS::Pipes::Pipe', { + Enrichment: { + "Fn::GetAtt": [ + Match.stringLikeRegexp('enrichmentfunction.*'), + "Arn" + ] + }, + }); + // This checks for everything but enrichment + CheckPipeRole(template, prerequisiteId); + // This checks for enrichment permissions + template.hasResourceProperties('AWS::IAM::Policy', { + PolicyDocument: { + Statement: [ + { + Action: "lambda:InvokeFunction", + Effect: "Allow", + Resource: { + "Fn::GetAtt": [ + Match.stringLikeRegexp('enrichmentfunction.*'), + "Arn" + ] + } + } + ], + Version: "2012-10-17" + }, + PolicyName: Match.stringLikeRegexp(`enrichmentpolicy${pipeId}.*`), + Roles: [ + { + Ref: Match.stringLikeRegexp(`PipeRole${pipeId}.*`) + } + ] + }); +}); + +test('Create a pipe with state machine enrichment', () => { + const prerequisiteId = 'smenrichtest'; + const pipeId = 'smenrichpipe'; + + // Stack + const stack = new Stack(); + const prerequisites = CreatePrerequisites(stack, prerequisiteId); + + const enrichmentStateMachine = defaults.CreateTestStateMachine(stack, 'state-machine-enrichment'); + + const pipeResponse = defaults.BuildPipe(stack, pipeId, { + source: prerequisites.source, + target: prerequisites.target, + enrichmentStateMachine + }); + CheckPipeResponseProperties(pipeResponse, prerequisites); + + const template = Template.fromStack(stack); + template.resourceCountIs('AWS::Pipes::Pipe', 1); + CheckPipeResource(template, pipeId, prerequisiteId); + CheckPipeRole(template, prerequisiteId); + CheckLogGroup(template); + + // Look for additional enrichment permision + template.hasResourceProperties('AWS::IAM::Policy', { + PolicyDocument: { + Statement: [ + { + // This won't run if we actually launched it as the enrichmentStateMachine is not EXPRESS + Action: "states:StartSyncExecution", + Effect: "Allow", + Resource: { + Ref: Match.stringLikeRegexp('statemachineenrichment.*'), + } + } + ], + Version: "2012-10-17" + }, + PolicyName: Match.stringLikeRegexp(`enrichmentpolicy${pipeId}.*`), + Roles: [ + { + Ref: Match.stringLikeRegexp(`PipeRole${pipeId}.*`) + } + ] + }); + template.hasResourceProperties('AWS::Pipes::Pipe', { + Enrichment: { + Ref: Match.stringLikeRegexp("statemachineenrichment.*") + }, + }); +}); + +test('Provide replacement LogConfiguration', () => { + const prerequisiteId = 'logconfigtest'; + const pipeId = 'logconfigpipe'; + + // Stack + const stack = new Stack(); + const prerequisites = CreatePrerequisites(stack, prerequisiteId); + + const customLogConfiguration: pipes.CfnPipe.PipeLogConfigurationProperty = { + s3LogDestination: { + bucketName: new s3.Bucket(stack, 'test').bucketName, + }, + level: defaults.PipesLogLevel.ERROR + }; + const pipeResponse = defaults.BuildPipe(stack, pipeId, { + source: prerequisites.source, + target: prerequisites.target, + clientProps: { + logConfiguration: customLogConfiguration + } + }); + CheckPipeResponseProperties(pipeResponse, prerequisites); + + const template = Template.fromStack(stack); + CheckPipeSourceAndTarget(template, prerequisiteId); + + template.hasResourceProperties('AWS::Pipes::Pipe', { + LogConfiguration: { + Level: "ERROR", + S3LogDestination: { + BucketName: { + Ref: Match.stringLikeRegexp("test.*") + } + } + } + }); + + template.resourceCountIs('AWS::Pipes::Pipe', 1); + CheckPipeRole(template, prerequisiteId); +}); + +test('Override the default log level', () => { + const prerequisiteId = 'loglevelttest'; + const pipeId = 'loglevelpipe'; + + // Stack + const stack = new Stack(); + const prerequisites = CreatePrerequisites(stack, prerequisiteId); + + const pipeResponse = defaults.BuildPipe(stack, pipeId, { + source: prerequisites.source, + target: prerequisites.target, + logLevel: defaults.PipesLogLevel.ERROR + }); + CheckPipeResponseProperties(pipeResponse, prerequisites); + + const template = Template.fromStack(stack); + template.resourceCountIs('AWS::Pipes::Pipe', 1); + CheckPipeResource(template, pipeId, prerequisiteId); + CheckPipeRole(template, prerequisiteId); + CheckLogGroup(template); + + // Level is unique to this test + template.hasResourceProperties('AWS::Pipes::Pipe', { + LogConfiguration: { + Level: defaults.PipesLogLevel.ERROR, + } + }); +}); + +test('Test no logging', () => { + const prerequisiteId = 'nologs'; + const pipeId = 'testpipe'; + + // Stack + const stack = new Stack(); + const prerequisites = CreatePrerequisites(stack, prerequisiteId); + + const pipeResponse = defaults.BuildPipe(stack, pipeId, { + source: prerequisites.source, + target: prerequisites.target, + logLevel: defaults.PipesLogLevel.OFF + }); + CheckPipeResponseProperties(pipeResponse, prerequisites); + + const template = Template.fromStack(stack); + template.resourceCountIs('AWS::Pipes::Pipe', 1); + CheckPipeSourceAndTarget(template, prerequisiteId); + CheckPipeRole(template, prerequisiteId); + + // One log group for the state machine, none for the pipe + template.resourceCountIs('AWS::Logs::LogGroup', 1); +}); + +test('Override a subset of SQS source paramters', () => { + const prerequisiteId = 'srcparamtest'; + const pipeId = 'srcparampipe'; + const testBatchSize = 7; + + // Stack + const stack = new Stack(); + const prerequisites = CreatePrerequisites(stack, prerequisiteId); + + const pipeResponse = defaults.BuildPipe(stack, pipeId, { + source: prerequisites.source, + target: prerequisites.target, + clientProps: { + sourceParameters: { + sqsQueueParameters: { + batchSize: testBatchSize, + } + } + } + }); + + CheckPipeResponseProperties(pipeResponse, prerequisites); + + const template = Template.fromStack(stack); + template.resourceCountIs('AWS::Pipes::Pipe', 1); + CheckPipeResource(template, pipeId, prerequisiteId); + CheckPipeRole(template, prerequisiteId); + CheckLogGroup(template); + + template.resourceCountIs('AWS::Pipes::Pipe', 1); + template.hasResourceProperties('AWS::Pipes::Pipe', { + SourceParameters: { + SqsQueueParameters: { + BatchSize: testBatchSize + } + }, + }); +}); + +test('Provide pipeLogProps', () => { + const prerequisiteId = 'pipelogpropstest'; + const pipeId = 'pipelogpropspipe'; + // While this is an enum we need to use, in the template + // it is converted to days, in this case 120 + const testRetention = RetentionDays.FOUR_MONTHS; + + // Stack + const stack = new Stack(); + const prerequisites = CreatePrerequisites(stack, prerequisiteId); + + const pipeResponse = defaults.BuildPipe(stack, pipeId, { + source: prerequisites.source, + target: prerequisites.target, + pipeLogProps: { + retention: testRetention + } + }); + + CheckPipeResponseProperties(pipeResponse, prerequisites); + + const template = Template.fromStack(stack); + template.resourceCountIs('AWS::Pipes::Pipe', 1); + CheckPipeResource(template, pipeId, prerequisiteId); + CheckPipeRole(template, prerequisiteId); + CheckLogGroup(template); + CheckPipeLogConfiguration(template, pipeId); + + // Look for additional property we passed in pipeLogProps + template.hasResourceProperties('AWS::Logs::LogGroup', { + RetentionInDays: 120, + }); +}); + +test('Check for error when providing source in CfnProps', () => { + // Stack + const stack = new Stack(); + const prerequisites = CreatePrerequisites(stack, 'log-level-test'); + + const app = () => { + defaults.BuildPipe(stack, 'test-pipe', { + source: prerequisites.source, + target: prerequisites.target, + clientProps: { + source: prerequisites.source.sourceArn + } + }); + }; + // Assertion + expect(app).toThrowError('ERROR - BuildPipeProps cannot specify source, target, roleArn, or enrichment'); +}); + +test('Check for error when providing target in CfnProps', () => { + // Stack + const stack = new Stack(); + const prerequisites = CreatePrerequisites(stack, 'log-level-test'); + + const app = () => { + defaults.BuildPipe(stack, 'test-pipe', { + source: prerequisites.source, + target: prerequisites.target, + clientProps: { + target: prerequisites.target.targetArn, + } + }); + }; + // Assertion + expect(app).toThrowError('ERROR - BuildPipeProps cannot specify source, target, roleArn, or enrichment'); +}); + +test('Check for error when providing a roleArn', () => { + // Stack + const stack = new Stack(); + const prerequisites = CreatePrerequisites(stack, 'log-level-test'); + + const app = () => { + defaults.BuildPipe(stack, 'test-pipe', { + source: prerequisites.source, + target: prerequisites.target, + clientProps: { + roleArn: "some-arn", + } + }); + }; + // Assertion + expect(app).toThrowError('ERROR - BuildPipeProps cannot specify source, target, roleArn, or enrichment'); +}); + +test('Check for error when providing enrichment', () => { + // Stack + const stack = new Stack(); + const prerequisites = CreatePrerequisites(stack, 'log-level-test'); + + const app = () => { + defaults.BuildPipe(stack, 'test-pipe', { + source: prerequisites.source, + target: prerequisites.target, + clientProps: { + enrichment: "functionArn", + } + }); + }; + // Assertion + expect(app).toThrowError('ERROR - BuildPipeProps cannot specify source, target, roleArn, or enrichment'); +}); + +test('Check for error when log level and log configuration are both provided', () => { + // Stack + const stack = new Stack(); + const prerequisites = CreatePrerequisites(stack, 'log-level-test'); + + const app = () => { + defaults.BuildPipe(stack, 'test-pipe', { + source: prerequisites.source, + target: prerequisites.target, + logLevel: defaults.PipesLogLevel.ERROR, + clientProps: { + logConfiguration: { some: "object" }, + } + }); + }; + // Assertion + expect(app).toThrowError('ERROR - BuildPipeProps cannot specify logLevel and logConfiguration'); +}); + +test('Check for error when pipeLogProps and log configuration are both provided', () => { + // Stack + const stack = new Stack(); + const prerequisites = CreatePrerequisites(stack, 'log-level-test'); + + const app = () => { + defaults.BuildPipe(stack, 'test-pipe', { + source: prerequisites.source, + target: prerequisites.target, + pipeLogProps: { logGroupName: "anyvalue" }, + clientProps: { + logConfiguration: { some: "object" }, + } + }); + }; + // Assertion + expect(app).toThrowError('ERROR - BuildPipeProps cannot specify pipeLogProps and logConfiguration'); +}); + +test('Check for error when enrichmentFunction and enrichmentStateMachine are both provided', () => { + // Stack + const stack = new Stack(); + const prerequisites = CreatePrerequisites(stack, 'log-level-test'); + + const app = () => { + defaults.BuildPipe(stack, 'test-pipe', { + source: prerequisites.source, + target: prerequisites.target, + enrichmentFunction: { place: "holder" } as unknown as lambda.Function, + enrichmentStateMachine: { place: "holder" } as unknown as sfn.StateMachine + }); + }; + // Assertion + expect(app).toThrowError('ERROR - Only one of enrichmentFunction or enrichmentStateMachine can be provided'); +}); + +test('Check for error when pipeLogProps and log level is set to OFF', () => { + // Stack + const stack = new Stack(); + const prerequisites = CreatePrerequisites(stack, 'log-level-test'); + + const app = () => { + defaults.BuildPipe(stack, 'test-pipe', { + source: prerequisites.source, + target: prerequisites.target, + logLevel: defaults.PipesLogLevel.OFF, + pipeLogProps: { logGroupName: "anyvalue" }, + }); + }; + // Assertion + expect(app).toThrowError('ERROR - BuildPipeProps cannot specify pipeLogProps and log level OFF'); +}); + +test('Test all of CheckPipesProps', () => { + const app = () => { + defaults.CheckPipesProps({ + pipesProps: { source: "value" }, + }); + }; + // Assertion + expect(app).toThrowError('Do not set source in pipesProps. It is set by the construct.\n'); + + const appTwo = () => { + defaults.CheckPipesProps({ + pipesProps: { target: "value" }, + }); + }; + // Assertion + expect(appTwo).toThrowError('Do not set target in pipesProps. It is set by the construct.\n'); + +}); + +// ============================== +// Shared setup function +// ============================== + +interface Prerequisites { + source: defaults.CreateSourceResponse, + target: defaults.CreateTargetResponse, +} + +function CreatePrerequisites(scope: Stack, id: string): Prerequisites { + const buildQueueResponse = buildQueue(scope, `${id}-source-queue`, {}); + const sqsSource = defaults.CreateSqsSource(buildQueueResponse.queue); + + const buildStateMachineResponse = buildStateMachine(scope, `${id}-target-state-machine`, { + stateMachineProps: { + definitionBody: defaults.CreateTestStateMachineDefinitionBody(scope, `${id}-steps`) + } + }); + const stateMachineTarget = defaults.CreateStateMachineTarget(buildStateMachineResponse.stateMachine, { + stepFunctionStateMachineParameters: { + invocationType: 'REQUEST_RESPONSE' + } + }); + return { + source: sqsSource, + target: stateMachineTarget + }; +} + +// ============================== +// Shared functions that check default settings +// ============================== + +function CheckPipeResponseProperties(pipeResponse: defaults.BuildPipesResponse, prerequisites: Prerequisites) { + expect(pipeResponse.pipe).toBeDefined(); + expect(pipeResponse.pipe.source).toEqual(prerequisites.source.sourceArn); + expect(pipeResponse.pipe.target).toEqual(prerequisites.target.targetArn); + expect(pipeResponse.pipeRole).toBeDefined(); + expect(pipeResponse.pipeRole.node).toBeDefined(); +} + +function CheckPipeResource(template: Template, + pipeId: string, + prerequisiteId: string +) { + CheckPipeSourceAndTarget(template, prerequisiteId); + CheckPipeLogConfiguration(template, pipeId); +} + +function CheckPipeSourceAndTarget(template: Template, prerequisiteId: string) { + template.hasResourceProperties('AWS::Pipes::Pipe', { + Source: { + "Fn::GetAtt": [ + Match.stringLikeRegexp(`${prerequisiteId}sourcequeue.*`), + "Arn" + ] + }, + Target: { + Ref: Match.stringLikeRegexp(`StateMachine${prerequisiteId}targetstatemachine.*`), + }, + }); +} + +function CheckPipeLogConfiguration(template: Template, pipeId: string) { + template.hasResourceProperties('AWS::Pipes::Pipe', { + LogConfiguration: { + CloudwatchLogsLogDestination: { + LogGroupArn: { + "Fn::GetAtt": [ + Match.stringLikeRegexp(`LogGroup${pipeId}.*`), + "Arn" + ] + } + } + } + }); +} + +function CheckPipeRole(template: Template, prerequisiteId: string) { + template.hasResourceProperties('AWS::IAM::Role', { + AssumeRolePolicyDocument: { + Statement: [ + { + Action: "sts:AssumeRole", + Effect: "Allow", + Principal: { + Service: "pipes.amazonaws.com" + } + } + ], + Version: "2012-10-17" + }, + Policies: [ + { + PolicyDocument: { + Statement: [ + { + Action: [ + "sqs:ReceiveMessage", + "sqs:DeleteMessage", + "sqs:GetQueueAttributes" + ], + Effect: "Allow", + Resource: { + "Fn::GetAtt": [ + Match.stringLikeRegexp(`${prerequisiteId}sourcequeue.*`), + "Arn" + ] + } + } + ], + Version: "2012-10-17" + }, + PolicyName: "sourcePolicy" + }, + { + PolicyDocument: { + Statement: [ + { + Action: "states:StartExecution", + Effect: "Allow", + Resource: { + Ref: Match.stringLikeRegexp(`StateMachine${prerequisiteId}targetstatemachine.*`) + } + } + ], + Version: "2012-10-17" + }, + PolicyName: "targetPolicy" + } + ] + }); +} + +function CheckLogGroup(template: Template) { + template.hasResourceProperties('AWS::Logs::LogGroup', { + LogGroupName: { + "Fn::Join": [ + "", + [ + Match.stringLikeRegexp('\/aws\/vendedlogs\/pipes\/constructs'), + { + "Fn::Select": [ + 2, + Match.anyValue() + ] + } + ] + ] + }, + }); +} \ No newline at end of file diff --git a/source/patterns/@aws-solutions-constructs/core/test/test-helper.ts b/source/patterns/@aws-solutions-constructs/core/test/test-helper.ts index cc4f0f6e8..1ffbb1900 100644 --- a/source/patterns/@aws-solutions-constructs/core/test/test-helper.ts +++ b/source/patterns/@aws-solutions-constructs/core/test/test-helper.ts @@ -115,7 +115,12 @@ export function getFakeCertificate(scope: Construct, id: string): acm.ICertifica ); } -// Creates a bucket used for testing - minimal properties, destroyed after test +export function CreateTestStateMachine(scope: Construct, id: string): sfn.StateMachine { + return new sfn.StateMachine(scope, id, { + definitionBody: defaults.CreateTestStateMachineDefinitionBody(scope, id) + }); +} + export function CreateTestStateMachineDefinitionBody(scope: Construct, id: string): sfn.DefinitionBody { const smStep = new lambda.Function(scope, `lambda${id}`, { diff --git a/source/patterns/@aws-solutions-constructs/core/test/utils.test.ts b/source/patterns/@aws-solutions-constructs/core/test/utils.test.ts index 9d3df1502..2931e1512 100644 --- a/source/patterns/@aws-solutions-constructs/core/test/utils.test.ts +++ b/source/patterns/@aws-solutions-constructs/core/test/utils.test.ts @@ -329,6 +329,19 @@ test('CheckBooleanWithDefault', () => { expect(response).toBe(false); }); +test('CheckStringWithDefault', () => { + let response; + const value = 'testValue'; + const defaultValue = 'default'; + + response = defaults.CheckStringWithDefault(undefined, defaultValue); + expect(response).toBe(defaultValue); + + response = defaults.CheckStringWithDefault(value, defaultValue); + expect(response).toBe(value); + +}); + test('test addCfnGuardSuppressRules', () => { const stack = new Stack(); From 86b997017d600d6ee56c34ae418473350c6237f7 Mon Sep 17 00:00:00 2001 From: AWS Solutions Constructs Automation Date: Mon, 21 Oct 2024 16:46:38 +0000 Subject: [PATCH 2/3] chore(release): 2.73.0 --- CHANGELOG.md | 7 +++++++ source/lerna.json | 2 +- 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index bfe6fd059..1cb2e6907 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,6 +2,13 @@ All notable changes to this project will be documented in this file. See [standard-version](https://github.com/conventional-changelog/standard-version) for commit guidelines. +## [2.73.0](https://github.com/awslabs/aws-solutions-constructs/compare/v2.72.0...v2.73.0) (2024-10-21) + + +### Features + +* **aws-sqs-pipes-stepfunctions:** new construct ([#1220](https://github.com/awslabs/aws-solutions-constructs/issues/1220)) ([c508279](https://github.com/awslabs/aws-solutions-constructs/commit/c508279b6f69a1126e8b58bf6bfc13d246ea2a9e)) + ## [2.72.0](https://github.com/awslabs/aws-solutions-constructs/compare/v2.71.0...v2.72.0) (2024-10-06) Build on CDK v2.161.0 diff --git a/source/lerna.json b/source/lerna.json index b9499e273..796014f02 100644 --- a/source/lerna.json +++ b/source/lerna.json @@ -5,5 +5,5 @@ "patterns/@aws-solutions-constructs/*" ], "rejectCycles": "true", - "version": "2.72.0" + "version": "2.73.0" } From fe10873d0b5d0a85711d90d3e9c9790c1326cc0f Mon Sep 17 00:00:00 2001 From: biffgaut Date: Mon, 21 Oct 2024 12:50:41 -0400 Subject: [PATCH 3/3] chore(changelog): Updated CHANGELOG.md --- CHANGELOG.md | 1 + 1 file changed, 1 insertion(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 1cb2e6907..b845e6965 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -4,6 +4,7 @@ All notable changes to this project will be documented in this file. See [standa ## [2.73.0](https://github.com/awslabs/aws-solutions-constructs/compare/v2.72.0...v2.73.0) (2024-10-21) +Build on CDK v2.161.0 ### Features