diff --git a/CHANGELOG.md b/CHANGELOG.md index 0c2bf59ff..14da2da4f 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.68.0](https://github.com/awslabs/aws-solutions-constructs/compare/v2.67.1...v2.68.0) (2024-08-28) + +Built on CDK v2.154.1 + +### Bug Fixes +* **version:** unpin constructs from specific cdk version ([#1187](https://github.com/awslabs/aws-solutions-constructs/pull/1187)) + ## [2.67.1](https://github.com/awslabs/aws-solutions-constructs/compare/v2.67.0...v2.67.1) (2024-08-27) Built on CDK v2.151.0 diff --git a/deployment/v2/align-version.js b/deployment/v2/align-version.js index 2c5d51b8e..11409d34e 100755 --- a/deployment/v2/align-version.js +++ b/deployment/v2/align-version.js @@ -10,7 +10,7 @@ const nullVersionMarker = process.argv[2]; const targetSolutionsConstructsVersion = process.argv[3]; // these versions need to be sourced from a config file -const awsCdkLibVersion = '2.151.0'; +const awsCdkLibVersion = '2.154.1'; for (const file of process.argv.splice(4)) { const pkg = JSON.parse(fs.readFileSync(file).toString()); diff --git a/source/lerna.json b/source/lerna.json index 244a45f93..b9f133276 100644 --- a/source/lerna.json +++ b/source/lerna.json @@ -6,5 +6,5 @@ "./patterns/@aws-solutions-constructs/*" ], "rejectCycles": "true", - "version": "2.67.1" + "version": "2.68.0" } diff --git a/source/patterns/@aws-solutions-constructs/aws-alb-fargate/package.json b/source/patterns/@aws-solutions-constructs/aws-alb-fargate/package.json index aa9dcbb57..99828e24a 100644 --- a/source/patterns/@aws-solutions-constructs/aws-alb-fargate/package.json +++ b/source/patterns/@aws-solutions-constructs/aws-alb-fargate/package.json @@ -81,7 +81,7 @@ "peerDependencies": { "@aws-solutions-constructs/core": "0.0.0", "constructs": "^10.0.0", - "aws-cdk-lib": "0.0.0" + "aws-cdk-lib": "^0.0.0" }, "keywords": [ "aws", diff --git a/source/patterns/@aws-solutions-constructs/aws-alb-lambda/package.json b/source/patterns/@aws-solutions-constructs/aws-alb-lambda/package.json index 8e5b535f6..654cf689b 100644 --- a/source/patterns/@aws-solutions-constructs/aws-alb-lambda/package.json +++ b/source/patterns/@aws-solutions-constructs/aws-alb-lambda/package.json @@ -81,7 +81,7 @@ "peerDependencies": { "@aws-solutions-constructs/core": "0.0.0", "constructs": "^10.0.0", - "aws-cdk-lib": "0.0.0" + "aws-cdk-lib": "^0.0.0" }, "keywords": [ "aws", diff --git a/source/patterns/@aws-solutions-constructs/aws-apigateway-dynamodb/package.json b/source/patterns/@aws-solutions-constructs/aws-apigateway-dynamodb/package.json index cc322ef34..d7b413b0c 100644 --- a/source/patterns/@aws-solutions-constructs/aws-apigateway-dynamodb/package.json +++ b/source/patterns/@aws-solutions-constructs/aws-apigateway-dynamodb/package.json @@ -80,7 +80,7 @@ "peerDependencies": { "@aws-solutions-constructs/core": "0.0.0", "constructs": "^10.0.0", - "aws-cdk-lib": "0.0.0" + "aws-cdk-lib": "^0.0.0" }, "keywords": [ "aws", diff --git a/source/patterns/@aws-solutions-constructs/aws-apigateway-iot/package.json b/source/patterns/@aws-solutions-constructs/aws-apigateway-iot/package.json index 0c145a892..fc8438db6 100755 --- a/source/patterns/@aws-solutions-constructs/aws-apigateway-iot/package.json +++ b/source/patterns/@aws-solutions-constructs/aws-apigateway-iot/package.json @@ -80,7 +80,7 @@ "peerDependencies": { "@aws-solutions-constructs/core": "0.0.0", "constructs": "^10.0.0", - "aws-cdk-lib": "0.0.0" + "aws-cdk-lib": "^0.0.0" }, "keywords": [ "aws", diff --git a/source/patterns/@aws-solutions-constructs/aws-apigateway-kinesisstreams/package.json b/source/patterns/@aws-solutions-constructs/aws-apigateway-kinesisstreams/package.json index c859a986b..e167c04fe 100644 --- a/source/patterns/@aws-solutions-constructs/aws-apigateway-kinesisstreams/package.json +++ b/source/patterns/@aws-solutions-constructs/aws-apigateway-kinesisstreams/package.json @@ -80,7 +80,7 @@ "peerDependencies": { "@aws-solutions-constructs/core": "0.0.0", "constructs": "^10.0.0", - "aws-cdk-lib": "0.0.0" + "aws-cdk-lib": "^0.0.0" }, "keywords": [ "aws", diff --git a/source/patterns/@aws-solutions-constructs/aws-apigateway-lambda/package.json b/source/patterns/@aws-solutions-constructs/aws-apigateway-lambda/package.json index b0653e1e6..720508506 100644 --- a/source/patterns/@aws-solutions-constructs/aws-apigateway-lambda/package.json +++ b/source/patterns/@aws-solutions-constructs/aws-apigateway-lambda/package.json @@ -80,7 +80,7 @@ "peerDependencies": { "@aws-solutions-constructs/core": "0.0.0", "constructs": "^10.0.0", - "aws-cdk-lib": "0.0.0" + "aws-cdk-lib": "^0.0.0" }, "keywords": [ "aws", diff --git a/source/patterns/@aws-solutions-constructs/aws-apigateway-sagemakerendpoint/package.json b/source/patterns/@aws-solutions-constructs/aws-apigateway-sagemakerendpoint/package.json index 82b19903f..df18f0f5f 100644 --- a/source/patterns/@aws-solutions-constructs/aws-apigateway-sagemakerendpoint/package.json +++ b/source/patterns/@aws-solutions-constructs/aws-apigateway-sagemakerendpoint/package.json @@ -80,7 +80,7 @@ "peerDependencies": { "@aws-solutions-constructs/core": "0.0.0", "constructs": "^10.0.0", - "aws-cdk-lib": "0.0.0" + "aws-cdk-lib": "^0.0.0" }, "keywords": [ "aws", diff --git a/source/patterns/@aws-solutions-constructs/aws-apigateway-sqs/package.json b/source/patterns/@aws-solutions-constructs/aws-apigateway-sqs/package.json index f16333884..1f3e396ee 100644 --- a/source/patterns/@aws-solutions-constructs/aws-apigateway-sqs/package.json +++ b/source/patterns/@aws-solutions-constructs/aws-apigateway-sqs/package.json @@ -80,7 +80,7 @@ "peerDependencies": { "@aws-solutions-constructs/core": "0.0.0", "constructs": "^10.0.0", - "aws-cdk-lib": "0.0.0" + "aws-cdk-lib": "^0.0.0" }, "keywords": [ "aws", diff --git a/source/patterns/@aws-solutions-constructs/aws-apigatewayv2websocket-sqs/package.json b/source/patterns/@aws-solutions-constructs/aws-apigatewayv2websocket-sqs/package.json index 62c09e6df..0658ec6ea 100644 --- a/source/patterns/@aws-solutions-constructs/aws-apigatewayv2websocket-sqs/package.json +++ b/source/patterns/@aws-solutions-constructs/aws-apigatewayv2websocket-sqs/package.json @@ -80,7 +80,7 @@ "peerDependencies": { "@aws-solutions-constructs/core": "0.0.0", "constructs": "^10.0.0", - "aws-cdk-lib": "0.0.0" + "aws-cdk-lib": "^0.0.0" }, "keywords": [ "aws", diff --git a/source/patterns/@aws-solutions-constructs/aws-cloudfront-apigateway-lambda/package.json b/source/patterns/@aws-solutions-constructs/aws-cloudfront-apigateway-lambda/package.json index 33a9898b1..1858a92d4 100644 --- a/source/patterns/@aws-solutions-constructs/aws-cloudfront-apigateway-lambda/package.json +++ b/source/patterns/@aws-solutions-constructs/aws-cloudfront-apigateway-lambda/package.json @@ -82,7 +82,7 @@ "@aws-solutions-constructs/core": "0.0.0", "@aws-solutions-constructs/aws-cloudfront-apigateway": "0.0.0", "constructs": "^10.0.0", - "aws-cdk-lib": "0.0.0" + "aws-cdk-lib": "^0.0.0" }, "keywords": [ "aws", diff --git a/source/patterns/@aws-solutions-constructs/aws-cloudfront-apigateway/package.json b/source/patterns/@aws-solutions-constructs/aws-cloudfront-apigateway/package.json index 2a06e466a..1c1ae2216 100644 --- a/source/patterns/@aws-solutions-constructs/aws-cloudfront-apigateway/package.json +++ b/source/patterns/@aws-solutions-constructs/aws-cloudfront-apigateway/package.json @@ -80,7 +80,7 @@ "peerDependencies": { "@aws-solutions-constructs/core": "0.0.0", "constructs": "^10.0.0", - "aws-cdk-lib": "0.0.0" + "aws-cdk-lib": "^0.0.0" }, "keywords": [ "aws", diff --git a/source/patterns/@aws-solutions-constructs/aws-cloudfront-mediastore/package.json b/source/patterns/@aws-solutions-constructs/aws-cloudfront-mediastore/package.json index 35abda727..902b2d10c 100644 --- a/source/patterns/@aws-solutions-constructs/aws-cloudfront-mediastore/package.json +++ b/source/patterns/@aws-solutions-constructs/aws-cloudfront-mediastore/package.json @@ -80,7 +80,7 @@ "peerDependencies": { "@aws-solutions-constructs/core": "0.0.0", "constructs": "^10.0.0", - "aws-cdk-lib": "0.0.0" + "aws-cdk-lib": "^0.0.0" }, "keywords": [ "aws", diff --git a/source/patterns/@aws-solutions-constructs/aws-cloudfront-s3/package.json b/source/patterns/@aws-solutions-constructs/aws-cloudfront-s3/package.json index d70987b96..b91ce1925 100644 --- a/source/patterns/@aws-solutions-constructs/aws-cloudfront-s3/package.json +++ b/source/patterns/@aws-solutions-constructs/aws-cloudfront-s3/package.json @@ -82,7 +82,7 @@ "@aws-solutions-constructs/core": "0.0.0", "@aws-solutions-constructs/resources": "0.0.0", "constructs": "^10.0.0", - "aws-cdk-lib": "0.0.0" + "aws-cdk-lib": "^0.0.0" }, "keywords": [ "aws", diff --git a/source/patterns/@aws-solutions-constructs/aws-cognito-apigateway-lambda/package.json b/source/patterns/@aws-solutions-constructs/aws-cognito-apigateway-lambda/package.json index 0ca758235..dc6cade48 100644 --- a/source/patterns/@aws-solutions-constructs/aws-cognito-apigateway-lambda/package.json +++ b/source/patterns/@aws-solutions-constructs/aws-cognito-apigateway-lambda/package.json @@ -80,7 +80,7 @@ "peerDependencies": { "@aws-solutions-constructs/core": "0.0.0", "constructs": "^10.0.0", - "aws-cdk-lib": "0.0.0" + "aws-cdk-lib": "^0.0.0" }, "keywords": [ "aws", diff --git a/source/patterns/@aws-solutions-constructs/aws-constructs-factories/package.json b/source/patterns/@aws-solutions-constructs/aws-constructs-factories/package.json index c98fe6b47..ab26b4ad5 100644 --- a/source/patterns/@aws-solutions-constructs/aws-constructs-factories/package.json +++ b/source/patterns/@aws-solutions-constructs/aws-constructs-factories/package.json @@ -79,7 +79,7 @@ }, "peerDependencies": { "@aws-solutions-constructs/core": "0.0.0", - "aws-cdk-lib": "0.0.0", + "aws-cdk-lib": "^0.0.0", "constructs": "^10.0.0" }, "keywords": [ diff --git a/source/patterns/@aws-solutions-constructs/aws-dynamodbstreams-lambda-elasticsearch-kibana/package.json b/source/patterns/@aws-solutions-constructs/aws-dynamodbstreams-lambda-elasticsearch-kibana/package.json index a8b2b4020..2465aa1ca 100644 --- a/source/patterns/@aws-solutions-constructs/aws-dynamodbstreams-lambda-elasticsearch-kibana/package.json +++ b/source/patterns/@aws-solutions-constructs/aws-dynamodbstreams-lambda-elasticsearch-kibana/package.json @@ -84,7 +84,7 @@ "@aws-solutions-constructs/aws-dynamodbstreams-lambda": "0.0.0", "@aws-solutions-constructs/aws-lambda-elasticsearch-kibana": "0.0.0", "constructs": "^10.0.0", - "aws-cdk-lib": "0.0.0" + "aws-cdk-lib": "^0.0.0" }, "keywords": [ "aws", diff --git a/source/patterns/@aws-solutions-constructs/aws-dynamodbstreams-lambda/package.json b/source/patterns/@aws-solutions-constructs/aws-dynamodbstreams-lambda/package.json index 76f5c95cb..41c682dd3 100644 --- a/source/patterns/@aws-solutions-constructs/aws-dynamodbstreams-lambda/package.json +++ b/source/patterns/@aws-solutions-constructs/aws-dynamodbstreams-lambda/package.json @@ -80,7 +80,7 @@ "peerDependencies": { "@aws-solutions-constructs/core": "0.0.0", "constructs": "^10.0.0", - "aws-cdk-lib": "0.0.0" + "aws-cdk-lib": "^0.0.0" }, "keywords": [ "aws", diff --git a/source/patterns/@aws-solutions-constructs/aws-eventbridge-kinesisfirehose-s3/package.json b/source/patterns/@aws-solutions-constructs/aws-eventbridge-kinesisfirehose-s3/package.json index 38ea44ecf..0025e9918 100644 --- a/source/patterns/@aws-solutions-constructs/aws-eventbridge-kinesisfirehose-s3/package.json +++ b/source/patterns/@aws-solutions-constructs/aws-eventbridge-kinesisfirehose-s3/package.json @@ -82,7 +82,7 @@ "@aws-solutions-constructs/core": "0.0.0", "@aws-solutions-constructs/aws-kinesisfirehose-s3": "0.0.0", "constructs": "^10.0.0", - "aws-cdk-lib": "0.0.0" + "aws-cdk-lib": "^0.0.0" }, "keywords": [ "aws", diff --git a/source/patterns/@aws-solutions-constructs/aws-eventbridge-kinesisstreams/package.json b/source/patterns/@aws-solutions-constructs/aws-eventbridge-kinesisstreams/package.json index 15f4c8e29..f2db824f3 100644 --- a/source/patterns/@aws-solutions-constructs/aws-eventbridge-kinesisstreams/package.json +++ b/source/patterns/@aws-solutions-constructs/aws-eventbridge-kinesisstreams/package.json @@ -80,7 +80,7 @@ "peerDependencies": { "@aws-solutions-constructs/core": "0.0.0", "constructs": "^10.0.0", - "aws-cdk-lib": "0.0.0" + "aws-cdk-lib": "^0.0.0" }, "keywords": [ "aws", diff --git a/source/patterns/@aws-solutions-constructs/aws-eventbridge-lambda/package.json b/source/patterns/@aws-solutions-constructs/aws-eventbridge-lambda/package.json index f15d69b16..cb2fc6191 100644 --- a/source/patterns/@aws-solutions-constructs/aws-eventbridge-lambda/package.json +++ b/source/patterns/@aws-solutions-constructs/aws-eventbridge-lambda/package.json @@ -80,7 +80,7 @@ "peerDependencies": { "@aws-solutions-constructs/core": "0.0.0", "constructs": "^10.0.0", - "aws-cdk-lib": "0.0.0" + "aws-cdk-lib": "^0.0.0" }, "keywords": [ "aws", diff --git a/source/patterns/@aws-solutions-constructs/aws-eventbridge-sns/package.json b/source/patterns/@aws-solutions-constructs/aws-eventbridge-sns/package.json index 89046cf6c..4c2932dda 100644 --- a/source/patterns/@aws-solutions-constructs/aws-eventbridge-sns/package.json +++ b/source/patterns/@aws-solutions-constructs/aws-eventbridge-sns/package.json @@ -80,7 +80,7 @@ "peerDependencies": { "@aws-solutions-constructs/core": "0.0.0", "constructs": "^10.0.0", - "aws-cdk-lib": "0.0.0" + "aws-cdk-lib": "^0.0.0" }, "keywords": [ "aws", diff --git a/source/patterns/@aws-solutions-constructs/aws-eventbridge-sqs/package.json b/source/patterns/@aws-solutions-constructs/aws-eventbridge-sqs/package.json index a34600016..d97c47073 100644 --- a/source/patterns/@aws-solutions-constructs/aws-eventbridge-sqs/package.json +++ b/source/patterns/@aws-solutions-constructs/aws-eventbridge-sqs/package.json @@ -80,7 +80,7 @@ "peerDependencies": { "@aws-solutions-constructs/core": "0.0.0", "constructs": "^10.0.0", - "aws-cdk-lib": "0.0.0" + "aws-cdk-lib": "^0.0.0" }, "keywords": [ "aws", diff --git a/source/patterns/@aws-solutions-constructs/aws-eventbridge-stepfunctions/package.json b/source/patterns/@aws-solutions-constructs/aws-eventbridge-stepfunctions/package.json index b8ec29f47..bfef146ab 100644 --- a/source/patterns/@aws-solutions-constructs/aws-eventbridge-stepfunctions/package.json +++ b/source/patterns/@aws-solutions-constructs/aws-eventbridge-stepfunctions/package.json @@ -80,7 +80,7 @@ "peerDependencies": { "@aws-solutions-constructs/core": "0.0.0", "constructs": "^10.0.0", - "aws-cdk-lib": "0.0.0" + "aws-cdk-lib": "^0.0.0" }, "keywords": [ "aws", diff --git a/source/patterns/@aws-solutions-constructs/aws-fargate-dynamodb/package.json b/source/patterns/@aws-solutions-constructs/aws-fargate-dynamodb/package.json index 24fcf11ca..b72a6f471 100644 --- a/source/patterns/@aws-solutions-constructs/aws-fargate-dynamodb/package.json +++ b/source/patterns/@aws-solutions-constructs/aws-fargate-dynamodb/package.json @@ -81,7 +81,7 @@ "peerDependencies": { "@aws-solutions-constructs/core": "0.0.0", "constructs": "^10.0.0", - "aws-cdk-lib": "0.0.0" + "aws-cdk-lib": "^0.0.0" }, "keywords": [ "aws", diff --git a/source/patterns/@aws-solutions-constructs/aws-fargate-eventbridge/package.json b/source/patterns/@aws-solutions-constructs/aws-fargate-eventbridge/package.json index 27f0cd903..c0c09fb1a 100644 --- a/source/patterns/@aws-solutions-constructs/aws-fargate-eventbridge/package.json +++ b/source/patterns/@aws-solutions-constructs/aws-fargate-eventbridge/package.json @@ -81,7 +81,7 @@ "peerDependencies": { "@aws-solutions-constructs/core": "0.0.0", "constructs": "^10.0.0", - "aws-cdk-lib": "0.0.0" + "aws-cdk-lib": "^0.0.0" }, "keywords": [ "aws", diff --git a/source/patterns/@aws-solutions-constructs/aws-fargate-kinesisfirehose/package.json b/source/patterns/@aws-solutions-constructs/aws-fargate-kinesisfirehose/package.json index 3dd145feb..c19b294ef 100644 --- a/source/patterns/@aws-solutions-constructs/aws-fargate-kinesisfirehose/package.json +++ b/source/patterns/@aws-solutions-constructs/aws-fargate-kinesisfirehose/package.json @@ -81,7 +81,7 @@ }, "peerDependencies": { "@aws-solutions-constructs/core": "0.0.0", - "aws-cdk-lib": "0.0.0", + "aws-cdk-lib": "^0.0.0", "constructs": "^10.0.0" }, "keywords": [ diff --git a/source/patterns/@aws-solutions-constructs/aws-fargate-kinesisstreams/package.json b/source/patterns/@aws-solutions-constructs/aws-fargate-kinesisstreams/package.json index c682ca384..9ab67c548 100644 --- a/source/patterns/@aws-solutions-constructs/aws-fargate-kinesisstreams/package.json +++ b/source/patterns/@aws-solutions-constructs/aws-fargate-kinesisstreams/package.json @@ -81,7 +81,7 @@ "peerDependencies": { "@aws-solutions-constructs/core": "0.0.0", "constructs": "^10.0.0", - "aws-cdk-lib": "0.0.0" + "aws-cdk-lib": "^0.0.0" }, "keywords": [ "aws", diff --git a/source/patterns/@aws-solutions-constructs/aws-fargate-opensearch/package.json b/source/patterns/@aws-solutions-constructs/aws-fargate-opensearch/package.json index 3358bc3dd..aba97c7de 100644 --- a/source/patterns/@aws-solutions-constructs/aws-fargate-opensearch/package.json +++ b/source/patterns/@aws-solutions-constructs/aws-fargate-opensearch/package.json @@ -81,7 +81,7 @@ "peerDependencies": { "@aws-solutions-constructs/core": "0.0.0", "constructs": "^10.0.0", - "aws-cdk-lib": "0.0.0" + "aws-cdk-lib": "^0.0.0" }, "keywords": [ "aws", diff --git a/source/patterns/@aws-solutions-constructs/aws-fargate-s3/package.json b/source/patterns/@aws-solutions-constructs/aws-fargate-s3/package.json index cca740318..36e5b63a6 100644 --- a/source/patterns/@aws-solutions-constructs/aws-fargate-s3/package.json +++ b/source/patterns/@aws-solutions-constructs/aws-fargate-s3/package.json @@ -81,7 +81,7 @@ "peerDependencies": { "@aws-solutions-constructs/core": "0.0.0", "constructs": "^10.0.0", - "aws-cdk-lib": "0.0.0" + "aws-cdk-lib": "^0.0.0" }, "keywords": [ "aws", diff --git a/source/patterns/@aws-solutions-constructs/aws-fargate-secretsmanager/package.json b/source/patterns/@aws-solutions-constructs/aws-fargate-secretsmanager/package.json index 2fb253938..f29ff6624 100644 --- a/source/patterns/@aws-solutions-constructs/aws-fargate-secretsmanager/package.json +++ b/source/patterns/@aws-solutions-constructs/aws-fargate-secretsmanager/package.json @@ -81,7 +81,7 @@ "peerDependencies": { "@aws-solutions-constructs/core": "0.0.0", "constructs": "^10.0.0", - "aws-cdk-lib": "0.0.0" + "aws-cdk-lib": "^0.0.0" }, "keywords": [ "aws", diff --git a/source/patterns/@aws-solutions-constructs/aws-fargate-sns/package.json b/source/patterns/@aws-solutions-constructs/aws-fargate-sns/package.json index 6080d2e07..ce7cc6709 100644 --- a/source/patterns/@aws-solutions-constructs/aws-fargate-sns/package.json +++ b/source/patterns/@aws-solutions-constructs/aws-fargate-sns/package.json @@ -81,7 +81,7 @@ "peerDependencies": { "@aws-solutions-constructs/core": "0.0.0", "constructs": "^10.0.0", - "aws-cdk-lib": "0.0.0" + "aws-cdk-lib": "^0.0.0" }, "keywords": [ "aws", diff --git a/source/patterns/@aws-solutions-constructs/aws-fargate-sqs/package.json b/source/patterns/@aws-solutions-constructs/aws-fargate-sqs/package.json index 5c09f4cd5..1f4339b6e 100644 --- a/source/patterns/@aws-solutions-constructs/aws-fargate-sqs/package.json +++ b/source/patterns/@aws-solutions-constructs/aws-fargate-sqs/package.json @@ -81,7 +81,7 @@ "peerDependencies": { "@aws-solutions-constructs/core": "0.0.0", "constructs": "^10.0.0", - "aws-cdk-lib": "0.0.0" + "aws-cdk-lib": "^0.0.0" }, "keywords": [ "aws", diff --git a/source/patterns/@aws-solutions-constructs/aws-fargate-ssmstringparameter/package.json b/source/patterns/@aws-solutions-constructs/aws-fargate-ssmstringparameter/package.json index 9a74bf445..479916930 100644 --- a/source/patterns/@aws-solutions-constructs/aws-fargate-ssmstringparameter/package.json +++ b/source/patterns/@aws-solutions-constructs/aws-fargate-ssmstringparameter/package.json @@ -81,7 +81,7 @@ "peerDependencies": { "@aws-solutions-constructs/core": "0.0.0", "constructs": "^10.0.0", - "aws-cdk-lib": "0.0.0" + "aws-cdk-lib": "^0.0.0" }, "keywords": [ "aws", diff --git a/source/patterns/@aws-solutions-constructs/aws-fargate-stepfunctions/package.json b/source/patterns/@aws-solutions-constructs/aws-fargate-stepfunctions/package.json index 6441bea12..f973ca845 100644 --- a/source/patterns/@aws-solutions-constructs/aws-fargate-stepfunctions/package.json +++ b/source/patterns/@aws-solutions-constructs/aws-fargate-stepfunctions/package.json @@ -81,7 +81,7 @@ "peerDependencies": { "@aws-solutions-constructs/core": "0.0.0", "constructs": "^10.0.0", - "aws-cdk-lib": "0.0.0" + "aws-cdk-lib": "^0.0.0" }, "keywords": [ "aws", diff --git a/source/patterns/@aws-solutions-constructs/aws-iot-kinesisfirehose-s3/package.json b/source/patterns/@aws-solutions-constructs/aws-iot-kinesisfirehose-s3/package.json index f3b8dac94..8c7ee7995 100644 --- a/source/patterns/@aws-solutions-constructs/aws-iot-kinesisfirehose-s3/package.json +++ b/source/patterns/@aws-solutions-constructs/aws-iot-kinesisfirehose-s3/package.json @@ -82,7 +82,7 @@ "@aws-solutions-constructs/core": "0.0.0", "@aws-solutions-constructs/aws-kinesisfirehose-s3": "0.0.0", "constructs": "^10.0.0", - "aws-cdk-lib": "0.0.0" + "aws-cdk-lib": "^0.0.0" }, "keywords": [ "aws", diff --git a/source/patterns/@aws-solutions-constructs/aws-iot-kinesisstreams/package.json b/source/patterns/@aws-solutions-constructs/aws-iot-kinesisstreams/package.json index c337fe775..c23617851 100644 --- a/source/patterns/@aws-solutions-constructs/aws-iot-kinesisstreams/package.json +++ b/source/patterns/@aws-solutions-constructs/aws-iot-kinesisstreams/package.json @@ -80,7 +80,7 @@ "peerDependencies": { "@aws-solutions-constructs/core": "0.0.0", "constructs": "^10.0.0", - "aws-cdk-lib": "0.0.0" + "aws-cdk-lib": "^0.0.0" }, "keywords": [ "aws", diff --git a/source/patterns/@aws-solutions-constructs/aws-iot-lambda-dynamodb/package.json b/source/patterns/@aws-solutions-constructs/aws-iot-lambda-dynamodb/package.json index 409c052bc..ed11978f1 100644 --- a/source/patterns/@aws-solutions-constructs/aws-iot-lambda-dynamodb/package.json +++ b/source/patterns/@aws-solutions-constructs/aws-iot-lambda-dynamodb/package.json @@ -84,7 +84,7 @@ "@aws-solutions-constructs/aws-iot-lambda": "0.0.0", "@aws-solutions-constructs/aws-lambda-dynamodb": "0.0.0", "constructs": "^10.0.0", - "aws-cdk-lib": "0.0.0" + "aws-cdk-lib": "^0.0.0" }, "keywords": [ "aws", diff --git a/source/patterns/@aws-solutions-constructs/aws-iot-lambda/package.json b/source/patterns/@aws-solutions-constructs/aws-iot-lambda/package.json index bb11f1038..7ee06471e 100644 --- a/source/patterns/@aws-solutions-constructs/aws-iot-lambda/package.json +++ b/source/patterns/@aws-solutions-constructs/aws-iot-lambda/package.json @@ -80,7 +80,7 @@ "peerDependencies": { "@aws-solutions-constructs/core": "0.0.0", "constructs": "^10.0.0", - "aws-cdk-lib": "0.0.0" + "aws-cdk-lib": "^0.0.0" }, "keywords": [ "aws", diff --git a/source/patterns/@aws-solutions-constructs/aws-iot-s3/package.json b/source/patterns/@aws-solutions-constructs/aws-iot-s3/package.json index bf2c6fde9..ccd311345 100644 --- a/source/patterns/@aws-solutions-constructs/aws-iot-s3/package.json +++ b/source/patterns/@aws-solutions-constructs/aws-iot-s3/package.json @@ -80,6 +80,6 @@ "peerDependencies": { "@aws-solutions-constructs/core": "0.0.0", "constructs": "^10.0.0", - "aws-cdk-lib": "0.0.0" + "aws-cdk-lib": "^0.0.0" } } \ No newline at end of file diff --git a/source/patterns/@aws-solutions-constructs/aws-iot-sqs/package.json b/source/patterns/@aws-solutions-constructs/aws-iot-sqs/package.json index 8bf49b5b0..9b35af18d 100644 --- a/source/patterns/@aws-solutions-constructs/aws-iot-sqs/package.json +++ b/source/patterns/@aws-solutions-constructs/aws-iot-sqs/package.json @@ -80,6 +80,6 @@ "peerDependencies": { "@aws-solutions-constructs/core": "0.0.0", "constructs": "^10.0.0", - "aws-cdk-lib": "0.0.0" + "aws-cdk-lib": "^0.0.0" } } \ No newline at end of file diff --git a/source/patterns/@aws-solutions-constructs/aws-kinesisfirehose-s3/package.json b/source/patterns/@aws-solutions-constructs/aws-kinesisfirehose-s3/package.json index 5310d7e19..74bab896b 100644 --- a/source/patterns/@aws-solutions-constructs/aws-kinesisfirehose-s3/package.json +++ b/source/patterns/@aws-solutions-constructs/aws-kinesisfirehose-s3/package.json @@ -80,7 +80,7 @@ "peerDependencies": { "@aws-solutions-constructs/core": "0.0.0", "constructs": "^10.0.0", - "aws-cdk-lib": "0.0.0" + "aws-cdk-lib": "^0.0.0" }, "keywords": [ "aws", diff --git a/source/patterns/@aws-solutions-constructs/aws-kinesisstreams-gluejob/package.json b/source/patterns/@aws-solutions-constructs/aws-kinesisstreams-gluejob/package.json index c6ffb335c..6d82a3111 100644 --- a/source/patterns/@aws-solutions-constructs/aws-kinesisstreams-gluejob/package.json +++ b/source/patterns/@aws-solutions-constructs/aws-kinesisstreams-gluejob/package.json @@ -80,7 +80,7 @@ "peerDependencies": { "@aws-solutions-constructs/core": "0.0.0", "constructs": "^10.0.0", - "aws-cdk-lib": "0.0.0" + "aws-cdk-lib": "^0.0.0" }, "keywords": [ "aws", diff --git a/source/patterns/@aws-solutions-constructs/aws-kinesisstreams-kinesisfirehose-s3/package.json b/source/patterns/@aws-solutions-constructs/aws-kinesisstreams-kinesisfirehose-s3/package.json index be8299a56..ead487efd 100644 --- a/source/patterns/@aws-solutions-constructs/aws-kinesisstreams-kinesisfirehose-s3/package.json +++ b/source/patterns/@aws-solutions-constructs/aws-kinesisstreams-kinesisfirehose-s3/package.json @@ -82,7 +82,7 @@ "peerDependencies": { "@aws-solutions-constructs/core": "0.0.0", "constructs": "^10.0.0", - "aws-cdk-lib": "0.0.0", + "aws-cdk-lib": "^0.0.0", "@aws-solutions-constructs/aws-kinesisfirehose-s3": "0.0.0", "@aws-solutions-constructs/aws-kinesisstreams-lambda": "0.0.0" }, diff --git a/source/patterns/@aws-solutions-constructs/aws-kinesisstreams-lambda/package.json b/source/patterns/@aws-solutions-constructs/aws-kinesisstreams-lambda/package.json index b6bb97eaa..35ba5aea8 100644 --- a/source/patterns/@aws-solutions-constructs/aws-kinesisstreams-lambda/package.json +++ b/source/patterns/@aws-solutions-constructs/aws-kinesisstreams-lambda/package.json @@ -80,7 +80,7 @@ "peerDependencies": { "@aws-solutions-constructs/core": "0.0.0", "constructs": "^10.0.0", - "aws-cdk-lib": "0.0.0" + "aws-cdk-lib": "^0.0.0" }, "keywords": [ "aws", diff --git a/source/patterns/@aws-solutions-constructs/aws-lambda-dynamodb/package.json b/source/patterns/@aws-solutions-constructs/aws-lambda-dynamodb/package.json index 36a9ea1c3..a47428dba 100644 --- a/source/patterns/@aws-solutions-constructs/aws-lambda-dynamodb/package.json +++ b/source/patterns/@aws-solutions-constructs/aws-lambda-dynamodb/package.json @@ -80,7 +80,7 @@ "peerDependencies": { "@aws-solutions-constructs/core": "0.0.0", "constructs": "^10.0.0", - "aws-cdk-lib": "0.0.0" + "aws-cdk-lib": "^0.0.0" }, "keywords": [ "aws", diff --git a/source/patterns/@aws-solutions-constructs/aws-lambda-elasticachememcached/package.json b/source/patterns/@aws-solutions-constructs/aws-lambda-elasticachememcached/package.json index 5e85dc020..470fca0ba 100644 --- a/source/patterns/@aws-solutions-constructs/aws-lambda-elasticachememcached/package.json +++ b/source/patterns/@aws-solutions-constructs/aws-lambda-elasticachememcached/package.json @@ -80,7 +80,7 @@ "peerDependencies": { "@aws-solutions-constructs/core": "0.0.0", "constructs": "^10.0.0", - "aws-cdk-lib": "0.0.0" + "aws-cdk-lib": "^0.0.0" }, "keywords": [ "aws", diff --git a/source/patterns/@aws-solutions-constructs/aws-lambda-elasticsearch-kibana/package.json b/source/patterns/@aws-solutions-constructs/aws-lambda-elasticsearch-kibana/package.json index ee69c4f27..c4b79ec22 100644 --- a/source/patterns/@aws-solutions-constructs/aws-lambda-elasticsearch-kibana/package.json +++ b/source/patterns/@aws-solutions-constructs/aws-lambda-elasticsearch-kibana/package.json @@ -80,7 +80,7 @@ "peerDependencies": { "@aws-solutions-constructs/core": "0.0.0", "constructs": "^10.0.0", - "aws-cdk-lib": "0.0.0" + "aws-cdk-lib": "^0.0.0" }, "keywords": [ "aws", diff --git a/source/patterns/@aws-solutions-constructs/aws-lambda-eventbridge/package.json b/source/patterns/@aws-solutions-constructs/aws-lambda-eventbridge/package.json index 738864a64..032dc1fc9 100755 --- a/source/patterns/@aws-solutions-constructs/aws-lambda-eventbridge/package.json +++ b/source/patterns/@aws-solutions-constructs/aws-lambda-eventbridge/package.json @@ -80,7 +80,7 @@ "peerDependencies": { "@aws-solutions-constructs/core": "0.0.0", "constructs": "^10.0.0", - "aws-cdk-lib": "0.0.0" + "aws-cdk-lib": "^0.0.0" }, "keywords": [ "aws", diff --git a/source/patterns/@aws-solutions-constructs/aws-lambda-kendra/package.json b/source/patterns/@aws-solutions-constructs/aws-lambda-kendra/package.json index c7ca6148e..a34ee0035 100644 --- a/source/patterns/@aws-solutions-constructs/aws-lambda-kendra/package.json +++ b/source/patterns/@aws-solutions-constructs/aws-lambda-kendra/package.json @@ -76,7 +76,7 @@ }, "peerDependencies": { "@aws-solutions-constructs/core": "0.0.0", - "aws-cdk-lib": "0.0.0", + "aws-cdk-lib": "^0.0.0", "constructs": "^10.0.0" }, "keywords": [ diff --git a/source/patterns/@aws-solutions-constructs/aws-lambda-kinesisfirehose/package.json b/source/patterns/@aws-solutions-constructs/aws-lambda-kinesisfirehose/package.json index faeb16b56..75cbe4347 100644 --- a/source/patterns/@aws-solutions-constructs/aws-lambda-kinesisfirehose/package.json +++ b/source/patterns/@aws-solutions-constructs/aws-lambda-kinesisfirehose/package.json @@ -81,7 +81,7 @@ "peerDependencies": { "@aws-solutions-constructs/core": "0.0.0", "constructs": "^10.0.0", - "aws-cdk-lib": "0.0.0" + "aws-cdk-lib": "^0.0.0" }, "keywords": [ "aws", diff --git a/source/patterns/@aws-solutions-constructs/aws-lambda-kinesisstreams/package.json b/source/patterns/@aws-solutions-constructs/aws-lambda-kinesisstreams/package.json index ada2ca545..18a0af34c 100644 --- a/source/patterns/@aws-solutions-constructs/aws-lambda-kinesisstreams/package.json +++ b/source/patterns/@aws-solutions-constructs/aws-lambda-kinesisstreams/package.json @@ -80,7 +80,7 @@ "peerDependencies": { "@aws-solutions-constructs/core": "0.0.0", "constructs": "^10.0.0", - "aws-cdk-lib": "0.0.0" + "aws-cdk-lib": "^0.0.0" }, "keywords": [ "aws", diff --git a/source/patterns/@aws-solutions-constructs/aws-lambda-opensearch/package.json b/source/patterns/@aws-solutions-constructs/aws-lambda-opensearch/package.json index 78f06ccfb..4465cb5f9 100644 --- a/source/patterns/@aws-solutions-constructs/aws-lambda-opensearch/package.json +++ b/source/patterns/@aws-solutions-constructs/aws-lambda-opensearch/package.json @@ -80,7 +80,7 @@ "peerDependencies": { "@aws-solutions-constructs/core": "0.0.0", "constructs": "^10.0.0", - "aws-cdk-lib": "0.0.0" + "aws-cdk-lib": "^0.0.0" }, "keywords": [ "aws", diff --git a/source/patterns/@aws-solutions-constructs/aws-lambda-s3/package.json b/source/patterns/@aws-solutions-constructs/aws-lambda-s3/package.json index 15553aff5..58c1d92bd 100644 --- a/source/patterns/@aws-solutions-constructs/aws-lambda-s3/package.json +++ b/source/patterns/@aws-solutions-constructs/aws-lambda-s3/package.json @@ -80,7 +80,7 @@ "peerDependencies": { "@aws-solutions-constructs/core": "0.0.0", "constructs": "^10.0.0", - "aws-cdk-lib": "0.0.0" + "aws-cdk-lib": "^0.0.0" }, "keywords": [ "aws", diff --git a/source/patterns/@aws-solutions-constructs/aws-lambda-sagemakerendpoint/package.json b/source/patterns/@aws-solutions-constructs/aws-lambda-sagemakerendpoint/package.json index 47099ed17..366dde6ae 100644 --- a/source/patterns/@aws-solutions-constructs/aws-lambda-sagemakerendpoint/package.json +++ b/source/patterns/@aws-solutions-constructs/aws-lambda-sagemakerendpoint/package.json @@ -80,7 +80,7 @@ "peerDependencies": { "@aws-solutions-constructs/core": "0.0.0", "constructs": "^10.0.0", - "aws-cdk-lib": "0.0.0" + "aws-cdk-lib": "^0.0.0" }, "keywords": [ "aws", diff --git a/source/patterns/@aws-solutions-constructs/aws-lambda-secretsmanager/package.json b/source/patterns/@aws-solutions-constructs/aws-lambda-secretsmanager/package.json index 9b78b8225..d3aedfb48 100755 --- a/source/patterns/@aws-solutions-constructs/aws-lambda-secretsmanager/package.json +++ b/source/patterns/@aws-solutions-constructs/aws-lambda-secretsmanager/package.json @@ -71,7 +71,7 @@ "peerDependencies": { "@aws-solutions-constructs/core": "0.0.0", "constructs": "^10.0.0", - "aws-cdk-lib": "0.0.0" + "aws-cdk-lib": "^0.0.0" }, "keywords": [ "aws", diff --git a/source/patterns/@aws-solutions-constructs/aws-lambda-sns/package.json b/source/patterns/@aws-solutions-constructs/aws-lambda-sns/package.json index 2370a5393..657349d42 100644 --- a/source/patterns/@aws-solutions-constructs/aws-lambda-sns/package.json +++ b/source/patterns/@aws-solutions-constructs/aws-lambda-sns/package.json @@ -80,7 +80,7 @@ "peerDependencies": { "@aws-solutions-constructs/core": "0.0.0", "constructs": "^10.0.0", - "aws-cdk-lib": "0.0.0" + "aws-cdk-lib": "^0.0.0" }, "keywords": [ "aws", diff --git a/source/patterns/@aws-solutions-constructs/aws-lambda-sqs-lambda/package.json b/source/patterns/@aws-solutions-constructs/aws-lambda-sqs-lambda/package.json index ba7391a00..b687ec3ee 100755 --- a/source/patterns/@aws-solutions-constructs/aws-lambda-sqs-lambda/package.json +++ b/source/patterns/@aws-solutions-constructs/aws-lambda-sqs-lambda/package.json @@ -84,7 +84,7 @@ "@aws-solutions-constructs/aws-lambda-sqs": "0.0.0", "@aws-solutions-constructs/aws-sqs-lambda": "0.0.0", "constructs": "^10.0.0", - "aws-cdk-lib": "0.0.0" + "aws-cdk-lib": "^0.0.0" }, "keywords": [ "aws", diff --git a/source/patterns/@aws-solutions-constructs/aws-lambda-sqs/package.json b/source/patterns/@aws-solutions-constructs/aws-lambda-sqs/package.json index 6668366a4..f6b206f82 100755 --- a/source/patterns/@aws-solutions-constructs/aws-lambda-sqs/package.json +++ b/source/patterns/@aws-solutions-constructs/aws-lambda-sqs/package.json @@ -80,7 +80,7 @@ "peerDependencies": { "@aws-solutions-constructs/core": "0.0.0", "constructs": "^10.0.0", - "aws-cdk-lib": "0.0.0" + "aws-cdk-lib": "^0.0.0" }, "keywords": [ "aws", diff --git a/source/patterns/@aws-solutions-constructs/aws-lambda-ssmstringparameter/package.json b/source/patterns/@aws-solutions-constructs/aws-lambda-ssmstringparameter/package.json index 609108484..43ed15e8b 100755 --- a/source/patterns/@aws-solutions-constructs/aws-lambda-ssmstringparameter/package.json +++ b/source/patterns/@aws-solutions-constructs/aws-lambda-ssmstringparameter/package.json @@ -71,7 +71,7 @@ "peerDependencies": { "@aws-solutions-constructs/core": "0.0.0", "constructs": "^10.0.0", - "aws-cdk-lib": "0.0.0" + "aws-cdk-lib": "^0.0.0" }, "keywords": [ "aws", diff --git a/source/patterns/@aws-solutions-constructs/aws-lambda-stepfunctions/package.json b/source/patterns/@aws-solutions-constructs/aws-lambda-stepfunctions/package.json index 55c602df6..9fc5b67d9 100644 --- a/source/patterns/@aws-solutions-constructs/aws-lambda-stepfunctions/package.json +++ b/source/patterns/@aws-solutions-constructs/aws-lambda-stepfunctions/package.json @@ -81,6 +81,6 @@ "peerDependencies": { "@aws-solutions-constructs/core": "0.0.0", "constructs": "^10.0.0", - "aws-cdk-lib": "0.0.0" + "aws-cdk-lib": "^0.0.0" } } \ No newline at end of file diff --git a/source/patterns/@aws-solutions-constructs/aws-openapigateway-lambda/package.json b/source/patterns/@aws-solutions-constructs/aws-openapigateway-lambda/package.json index b9cbd8405..76c5d0014 100644 --- a/source/patterns/@aws-solutions-constructs/aws-openapigateway-lambda/package.json +++ b/source/patterns/@aws-solutions-constructs/aws-openapigateway-lambda/package.json @@ -84,7 +84,7 @@ "@aws-solutions-constructs/core": "0.0.0", "@aws-solutions-constructs/resources": "0.0.0", "constructs": "^10.0.0", - "aws-cdk-lib": "0.0.0" + "aws-cdk-lib": "^0.0.0" }, "keywords": [ "aws", diff --git a/source/patterns/@aws-solutions-constructs/aws-route53-alb/package.json b/source/patterns/@aws-solutions-constructs/aws-route53-alb/package.json index b8f6f6b2c..30cb028e5 100644 --- a/source/patterns/@aws-solutions-constructs/aws-route53-alb/package.json +++ b/source/patterns/@aws-solutions-constructs/aws-route53-alb/package.json @@ -81,7 +81,7 @@ "peerDependencies": { "@aws-solutions-constructs/core": "0.0.0", "constructs": "^10.0.0", - "aws-cdk-lib": "0.0.0" + "aws-cdk-lib": "^0.0.0" }, "keywords": [ "aws", diff --git a/source/patterns/@aws-solutions-constructs/aws-route53-apigateway/package.json b/source/patterns/@aws-solutions-constructs/aws-route53-apigateway/package.json index 644c89fb1..4381fe603 100755 --- a/source/patterns/@aws-solutions-constructs/aws-route53-apigateway/package.json +++ b/source/patterns/@aws-solutions-constructs/aws-route53-apigateway/package.json @@ -81,7 +81,7 @@ "peerDependencies": { "@aws-solutions-constructs/core": "0.0.0", "constructs": "^10.0.0", - "aws-cdk-lib": "0.0.0" + "aws-cdk-lib": "^0.0.0" }, "keywords": [ "aws", diff --git a/source/patterns/@aws-solutions-constructs/aws-s3-lambda/package.json b/source/patterns/@aws-solutions-constructs/aws-s3-lambda/package.json index c7747c68f..e6b6a8e39 100644 --- a/source/patterns/@aws-solutions-constructs/aws-s3-lambda/package.json +++ b/source/patterns/@aws-solutions-constructs/aws-s3-lambda/package.json @@ -80,7 +80,7 @@ "peerDependencies": { "@aws-solutions-constructs/core": "0.0.0", "constructs": "^10.0.0", - "aws-cdk-lib": "0.0.0" + "aws-cdk-lib": "^0.0.0" }, "keywords": [ "aws", diff --git a/source/patterns/@aws-solutions-constructs/aws-s3-lambda/test/integ.s3lam-existing-s3-bucket.js.snapshot/cdk.out b/source/patterns/@aws-solutions-constructs/aws-s3-lambda/test/integ.s3lam-existing-s3-bucket.js.snapshot/cdk.out index 1f0068d32..0d15a78da 100644 --- a/source/patterns/@aws-solutions-constructs/aws-s3-lambda/test/integ.s3lam-existing-s3-bucket.js.snapshot/cdk.out +++ b/source/patterns/@aws-solutions-constructs/aws-s3-lambda/test/integ.s3lam-existing-s3-bucket.js.snapshot/cdk.out @@ -1 +1 @@ -{"version":"36.0.0"} \ No newline at end of file +{"version":"36.0.18"} \ No newline at end of file diff --git a/source/patterns/@aws-solutions-constructs/aws-s3-lambda/test/integ.s3lam-existing-s3-bucket.js.snapshot/integ.json b/source/patterns/@aws-solutions-constructs/aws-s3-lambda/test/integ.s3lam-existing-s3-bucket.js.snapshot/integ.json index f5017fe64..e511f4bbb 100644 --- a/source/patterns/@aws-solutions-constructs/aws-s3-lambda/test/integ.s3lam-existing-s3-bucket.js.snapshot/integ.json +++ b/source/patterns/@aws-solutions-constructs/aws-s3-lambda/test/integ.s3lam-existing-s3-bucket.js.snapshot/integ.json @@ -1,5 +1,5 @@ { - "version": "36.0.0", + "version": "36.0.18", "testCases": { "s3lam-existing-s3-bucket/Integ/DefaultTest": { "stacks": [ diff --git a/source/patterns/@aws-solutions-constructs/aws-s3-lambda/test/integ.s3lam-existing-s3-bucket.js.snapshot/manifest.json b/source/patterns/@aws-solutions-constructs/aws-s3-lambda/test/integ.s3lam-existing-s3-bucket.js.snapshot/manifest.json index 5f59a0135..583415f78 100644 --- a/source/patterns/@aws-solutions-constructs/aws-s3-lambda/test/integ.s3lam-existing-s3-bucket.js.snapshot/manifest.json +++ b/source/patterns/@aws-solutions-constructs/aws-s3-lambda/test/integ.s3lam-existing-s3-bucket.js.snapshot/manifest.json @@ -1,5 +1,5 @@ { - "version": "36.0.0", + "version": "36.0.5", "artifacts": { "s3lamexistings3bucketIntegDefaultTestDeployAssert7738D7BA.assets": { "type": "cdk:asset-manifest", @@ -66,7 +66,7 @@ "validateOnSynth": false, "assumeRoleArn": "arn:${AWS::Partition}:iam::${AWS::AccountId}:role/cdk-hnb659fds-deploy-role-${AWS::AccountId}-${AWS::Region}", "cloudFormationExecutionRoleArn": "arn:${AWS::Partition}:iam::${AWS::AccountId}:role/cdk-hnb659fds-cfn-exec-role-${AWS::AccountId}-${AWS::Region}", - "stackTemplateAssetObjectUrl": "s3://cdk-hnb659fds-assets-${AWS::AccountId}-${AWS::Region}/39d66b466aa780ad5b8c2ea2f72529181acb16c4144530db8336d2bd540dc9a0.json", + "stackTemplateAssetObjectUrl": "s3://cdk-hnb659fds-assets-${AWS::AccountId}-${AWS::Region}/b1c9809625e97eb91957892b468c8d62285613da64b2e793b50991d0724fbc10.json", "requiresBootstrapStackVersion": 6, "bootstrapStackVersionSsmParameter": "/cdk-bootstrap/hnb659fds/version", "additionalDependencies": [ @@ -106,6 +106,12 @@ "data": "LatestNodeRuntimeMap" } ], + "/s3lam-existing-s3-bucket/Custom::S3AutoDeleteObjectsCustomResourceProvider": [ + { + "type": "aws:cdk:is-custom-resource-handler-customResourceProvider", + "data": true + } + ], "/s3lam-existing-s3-bucket/Custom::S3AutoDeleteObjectsCustomResourceProvider/Role": [ { "type": "aws:cdk:logicalId", diff --git a/source/patterns/@aws-solutions-constructs/aws-s3-lambda/test/integ.s3lam-existing-s3-bucket.js.snapshot/s3lam-existing-s3-bucket.assets.json b/source/patterns/@aws-solutions-constructs/aws-s3-lambda/test/integ.s3lam-existing-s3-bucket.js.snapshot/s3lam-existing-s3-bucket.assets.json index 7e199aa32..c7993b3e9 100644 --- a/source/patterns/@aws-solutions-constructs/aws-s3-lambda/test/integ.s3lam-existing-s3-bucket.js.snapshot/s3lam-existing-s3-bucket.assets.json +++ b/source/patterns/@aws-solutions-constructs/aws-s3-lambda/test/integ.s3lam-existing-s3-bucket.js.snapshot/s3lam-existing-s3-bucket.assets.json @@ -1,5 +1,5 @@ { - "version": "36.0.0", + "version": "36.0.18", "files": { "faa95a81ae7d7373f3e1f242268f904eb748d8d0fdd306e8a6fe515a1905a7d6": { "source": { @@ -27,7 +27,7 @@ } } }, - "39d66b466aa780ad5b8c2ea2f72529181acb16c4144530db8336d2bd540dc9a0": { + "b1c9809625e97eb91957892b468c8d62285613da64b2e793b50991d0724fbc10": { "source": { "path": "s3lam-existing-s3-bucket.template.json", "packaging": "file" @@ -35,7 +35,7 @@ "destinations": { "current_account-current_region": { "bucketName": "cdk-hnb659fds-assets-${AWS::AccountId}-${AWS::Region}", - "objectKey": "39d66b466aa780ad5b8c2ea2f72529181acb16c4144530db8336d2bd540dc9a0.json", + "objectKey": "b1c9809625e97eb91957892b468c8d62285613da64b2e793b50991d0724fbc10.json", "assumeRoleArn": "arn:${AWS::Partition}:iam::${AWS::AccountId}:role/cdk-hnb659fds-file-publishing-role-${AWS::AccountId}-${AWS::Region}" } } diff --git a/source/patterns/@aws-solutions-constructs/aws-s3-lambda/test/integ.s3lam-existing-s3-bucket.js.snapshot/s3lam-existing-s3-bucket.template.json b/source/patterns/@aws-solutions-constructs/aws-s3-lambda/test/integ.s3lam-existing-s3-bucket.js.snapshot/s3lam-existing-s3-bucket.template.json index 1813c9dc9..f05dce7b8 100644 --- a/source/patterns/@aws-solutions-constructs/aws-s3-lambda/test/integ.s3lam-existing-s3-bucket.js.snapshot/s3lam-existing-s3-bucket.template.json +++ b/source/patterns/@aws-solutions-constructs/aws-s3-lambda/test/integ.s3lam-existing-s3-bucket.js.snapshot/s3lam-existing-s3-bucket.template.json @@ -422,7 +422,8 @@ } ] }, - "Managed": true + "Managed": true, + "SkipDestinationValidation": false }, "DependsOn": [ "scrapBucketAllowBucketNotificationsTos3lamexistings3buckettests3lambdaLambdaFunctionCA1AFC4CBBE7A87C", @@ -663,7 +664,7 @@ "Properties": { "Description": "AWS CloudFormation handler for \"Custom::S3BucketNotifications\" resources (@aws-cdk/aws-s3)", "Code": { - "ZipFile": "import boto3 # type: ignore\nimport json\nimport logging\nimport urllib.request\n\ns3 = boto3.client(\"s3\")\n\nEVENTBRIDGE_CONFIGURATION = 'EventBridgeConfiguration'\nCONFIGURATION_TYPES = [\"TopicConfigurations\", \"QueueConfigurations\", \"LambdaFunctionConfigurations\"]\n\ndef handler(event: dict, context):\n response_status = \"SUCCESS\"\n error_message = \"\"\n try:\n props = event[\"ResourceProperties\"]\n notification_configuration = props[\"NotificationConfiguration\"]\n managed = props.get('Managed', 'true').lower() == 'true'\n stack_id = event['StackId']\n old = event.get(\"OldResourceProperties\", {}).get(\"NotificationConfiguration\", {})\n if managed:\n config = handle_managed(event[\"RequestType\"], notification_configuration)\n else:\n config = handle_unmanaged(props[\"BucketName\"], stack_id, event[\"RequestType\"], notification_configuration, old)\n s3.put_bucket_notification_configuration(Bucket=props[\"BucketName\"], NotificationConfiguration=config)\n except Exception as e:\n logging.exception(\"Failed to put bucket notification configuration\")\n response_status = \"FAILED\"\n error_message = f\"Error: {str(e)}. \"\n finally:\n submit_response(event, context, response_status, error_message)\n\ndef handle_managed(request_type, notification_configuration):\n if request_type == 'Delete':\n return {}\n return notification_configuration\n\ndef handle_unmanaged(bucket, stack_id, request_type, notification_configuration, old):\n def get_id(n):\n n['Id'] = ''\n strToHash=json.dumps(n, sort_keys=True).replace('\"Name\": \"prefix\"', '\"Name\": \"Prefix\"').replace('\"Name\": \"suffix\"', '\"Name\": \"Suffix\"')\n return f\"{stack_id}-{hash(strToHash)}\"\n def with_id(n):\n n['Id'] = get_id(n)\n return n\n\n external_notifications = {}\n existing_notifications = s3.get_bucket_notification_configuration(Bucket=bucket)\n for t in CONFIGURATION_TYPES:\n if request_type == 'Update':\n old_incoming_ids = [get_id(n) for n in old.get(t, [])]\n external_notifications[t] = [n for n in existing_notifications.get(t, []) if not get_id(n) in old_incoming_ids] \n elif request_type == 'Delete':\n external_notifications[t] = [n for n in existing_notifications.get(t, []) if not n['Id'].startswith(f\"{stack_id}-\")]\n elif request_type == 'Create':\n external_notifications[t] = [n for n in existing_notifications.get(t, [])]\n if EVENTBRIDGE_CONFIGURATION in existing_notifications:\n external_notifications[EVENTBRIDGE_CONFIGURATION] = existing_notifications[EVENTBRIDGE_CONFIGURATION]\n\n if request_type == 'Delete':\n return external_notifications\n\n notifications = {}\n for t in CONFIGURATION_TYPES:\n external = external_notifications.get(t, [])\n incoming = [with_id(n) for n in notification_configuration.get(t, [])]\n notifications[t] = external + incoming\n\n if EVENTBRIDGE_CONFIGURATION in notification_configuration:\n notifications[EVENTBRIDGE_CONFIGURATION] = notification_configuration[EVENTBRIDGE_CONFIGURATION]\n elif EVENTBRIDGE_CONFIGURATION in external_notifications:\n notifications[EVENTBRIDGE_CONFIGURATION] = external_notifications[EVENTBRIDGE_CONFIGURATION]\n\n return notifications\n\ndef submit_response(event: dict, context, response_status: str, error_message: str):\n response_body = json.dumps(\n {\n \"Status\": response_status,\n \"Reason\": f\"{error_message}See the details in CloudWatch Log Stream: {context.log_stream_name}\",\n \"PhysicalResourceId\": event.get(\"PhysicalResourceId\") or event[\"LogicalResourceId\"],\n \"StackId\": event[\"StackId\"],\n \"RequestId\": event[\"RequestId\"],\n \"LogicalResourceId\": event[\"LogicalResourceId\"],\n \"NoEcho\": False,\n }\n ).encode(\"utf-8\")\n headers = {\"content-type\": \"\", \"content-length\": str(len(response_body))}\n try:\n req = urllib.request.Request(url=event[\"ResponseURL\"], headers=headers, data=response_body, method=\"PUT\")\n with urllib.request.urlopen(req) as response:\n print(response.read().decode(\"utf-8\"))\n print(\"Status code: \" + response.reason)\n except Exception as e:\n print(\"send(..) failed executing request.urlopen(..): \" + str(e))" + "ZipFile": "import boto3 # type: ignore\nimport json\nimport logging\nimport urllib.request\n\ns3 = boto3.client(\"s3\")\n\nEVENTBRIDGE_CONFIGURATION = 'EventBridgeConfiguration'\nCONFIGURATION_TYPES = [\"TopicConfigurations\", \"QueueConfigurations\", \"LambdaFunctionConfigurations\"]\n\ndef handler(event: dict, context):\n response_status = \"SUCCESS\"\n error_message = \"\"\n try:\n props = event[\"ResourceProperties\"]\n notification_configuration = props[\"NotificationConfiguration\"]\n managed = props.get('Managed', 'true').lower() == 'true'\n skipDestinationValidation = props.get('SkipDestinationValidation', 'false').lower() == 'true'\n stack_id = event['StackId']\n old = event.get(\"OldResourceProperties\", {}).get(\"NotificationConfiguration\", {})\n if managed:\n config = handle_managed(event[\"RequestType\"], notification_configuration)\n else:\n config = handle_unmanaged(props[\"BucketName\"], stack_id, event[\"RequestType\"], notification_configuration, old)\n s3.put_bucket_notification_configuration(Bucket=props[\"BucketName\"], NotificationConfiguration=config, SkipDestinationValidation=skipDestinationValidation)\n except Exception as e:\n logging.exception(\"Failed to put bucket notification configuration\")\n response_status = \"FAILED\"\n error_message = f\"Error: {str(e)}. \"\n finally:\n submit_response(event, context, response_status, error_message)\n\ndef handle_managed(request_type, notification_configuration):\n if request_type == 'Delete':\n return {}\n return notification_configuration\n\ndef handle_unmanaged(bucket, stack_id, request_type, notification_configuration, old):\n def get_id(n):\n n['Id'] = ''\n strToHash=json.dumps(n, sort_keys=True).replace('\"Name\": \"prefix\"', '\"Name\": \"Prefix\"').replace('\"Name\": \"suffix\"', '\"Name\": \"Suffix\"')\n return f\"{stack_id}-{hash(strToHash)}\"\n def with_id(n):\n n['Id'] = get_id(n)\n return n\n\n external_notifications = {}\n existing_notifications = s3.get_bucket_notification_configuration(Bucket=bucket)\n for t in CONFIGURATION_TYPES:\n if request_type == 'Update':\n old_incoming_ids = [get_id(n) for n in old.get(t, [])]\n external_notifications[t] = [n for n in existing_notifications.get(t, []) if not get_id(n) in old_incoming_ids] \n elif request_type == 'Delete':\n external_notifications[t] = [n for n in existing_notifications.get(t, []) if not n['Id'].startswith(f\"{stack_id}-\")]\n elif request_type == 'Create':\n external_notifications[t] = [n for n in existing_notifications.get(t, [])]\n if EVENTBRIDGE_CONFIGURATION in existing_notifications:\n external_notifications[EVENTBRIDGE_CONFIGURATION] = existing_notifications[EVENTBRIDGE_CONFIGURATION]\n\n if request_type == 'Delete':\n return external_notifications\n\n notifications = {}\n for t in CONFIGURATION_TYPES:\n external = external_notifications.get(t, [])\n incoming = [with_id(n) for n in notification_configuration.get(t, [])]\n notifications[t] = external + incoming\n\n if EVENTBRIDGE_CONFIGURATION in notification_configuration:\n notifications[EVENTBRIDGE_CONFIGURATION] = notification_configuration[EVENTBRIDGE_CONFIGURATION]\n elif EVENTBRIDGE_CONFIGURATION in external_notifications:\n notifications[EVENTBRIDGE_CONFIGURATION] = external_notifications[EVENTBRIDGE_CONFIGURATION]\n\n return notifications\n\ndef submit_response(event: dict, context, response_status: str, error_message: str):\n response_body = json.dumps(\n {\n \"Status\": response_status,\n \"Reason\": f\"{error_message}See the details in CloudWatch Log Stream: {context.log_stream_name}\",\n \"PhysicalResourceId\": event.get(\"PhysicalResourceId\") or event[\"LogicalResourceId\"],\n \"StackId\": event[\"StackId\"],\n \"RequestId\": event[\"RequestId\"],\n \"LogicalResourceId\": event[\"LogicalResourceId\"],\n \"NoEcho\": False,\n }\n ).encode(\"utf-8\")\n headers = {\"content-type\": \"\", \"content-length\": str(len(response_body))}\n try:\n req = urllib.request.Request(url=event[\"ResponseURL\"], headers=headers, data=response_body, method=\"PUT\")\n with urllib.request.urlopen(req) as response:\n print(response.read().decode(\"utf-8\"))\n print(\"Status code: \" + response.reason)\n except Exception as e:\n print(\"send(..) failed executing request.urlopen(..): \" + str(e))" }, "Handler": "index.handler", "Role": { diff --git a/source/patterns/@aws-solutions-constructs/aws-s3-lambda/test/integ.s3lam-existing-s3-bucket.js.snapshot/s3lamexistings3bucketIntegDefaultTestDeployAssert7738D7BA.assets.json b/source/patterns/@aws-solutions-constructs/aws-s3-lambda/test/integ.s3lam-existing-s3-bucket.js.snapshot/s3lamexistings3bucketIntegDefaultTestDeployAssert7738D7BA.assets.json index 7b3cc7cdd..3f2bdd12d 100644 --- a/source/patterns/@aws-solutions-constructs/aws-s3-lambda/test/integ.s3lam-existing-s3-bucket.js.snapshot/s3lamexistings3bucketIntegDefaultTestDeployAssert7738D7BA.assets.json +++ b/source/patterns/@aws-solutions-constructs/aws-s3-lambda/test/integ.s3lam-existing-s3-bucket.js.snapshot/s3lamexistings3bucketIntegDefaultTestDeployAssert7738D7BA.assets.json @@ -1,5 +1,5 @@ { - "version": "36.0.0", + "version": "36.0.18", "files": { "21fbb51d7b23f6a6c262b46a9caee79d744a3ac019fd45422d988b96d44b2a22": { "source": { diff --git a/source/patterns/@aws-solutions-constructs/aws-s3-lambda/test/integ.s3lam-existing-s3-bucket.js.snapshot/tree.json b/source/patterns/@aws-solutions-constructs/aws-s3-lambda/test/integ.s3lam-existing-s3-bucket.js.snapshot/tree.json index da7558fd8..4621fb266 100644 --- a/source/patterns/@aws-solutions-constructs/aws-s3-lambda/test/integ.s3lam-existing-s3-bucket.js.snapshot/tree.json +++ b/source/patterns/@aws-solutions-constructs/aws-s3-lambda/test/integ.s3lam-existing-s3-bucket.js.snapshot/tree.json @@ -40,7 +40,7 @@ }, "constructInfo": { "fqn": "aws-cdk-lib.aws_s3.CfnBucket", - "version": "2.150.0" + "version": "2.154.1" } }, "Policy": { @@ -174,13 +174,13 @@ }, "constructInfo": { "fqn": "aws-cdk-lib.aws_s3.CfnBucketPolicy", - "version": "2.150.0" + "version": "2.154.1" } } }, "constructInfo": { "fqn": "aws-cdk-lib.aws_s3.BucketPolicy", - "version": "2.150.0" + "version": "2.154.1" } }, "AutoDeleteObjectsCustomResource": { @@ -192,19 +192,19 @@ "path": "s3lam-existing-s3-bucket/scrapBucketLog/AutoDeleteObjectsCustomResource/Default", "constructInfo": { "fqn": "aws-cdk-lib.CfnResource", - "version": "2.150.0" + "version": "2.154.1" } } }, "constructInfo": { "fqn": "aws-cdk-lib.CustomResource", - "version": "2.150.0" + "version": "2.154.1" } } }, "constructInfo": { "fqn": "aws-cdk-lib.aws_s3.Bucket", - "version": "2.150.0" + "version": "2.154.1" } }, "LatestNodeRuntimeMap": { @@ -212,7 +212,7 @@ "path": "s3lam-existing-s3-bucket/LatestNodeRuntimeMap", "constructInfo": { "fqn": "aws-cdk-lib.CfnMapping", - "version": "2.150.0" + "version": "2.154.1" } }, "Custom::S3AutoDeleteObjectsCustomResourceProvider": { @@ -224,7 +224,7 @@ "path": "s3lam-existing-s3-bucket/Custom::S3AutoDeleteObjectsCustomResourceProvider/Staging", "constructInfo": { "fqn": "aws-cdk-lib.AssetStaging", - "version": "2.150.0" + "version": "2.154.1" } }, "Role": { @@ -232,7 +232,7 @@ "path": "s3lam-existing-s3-bucket/Custom::S3AutoDeleteObjectsCustomResourceProvider/Role", "constructInfo": { "fqn": "aws-cdk-lib.CfnResource", - "version": "2.150.0" + "version": "2.154.1" } }, "Handler": { @@ -240,13 +240,13 @@ "path": "s3lam-existing-s3-bucket/Custom::S3AutoDeleteObjectsCustomResourceProvider/Handler", "constructInfo": { "fqn": "aws-cdk-lib.CfnResource", - "version": "2.150.0" + "version": "2.154.1" } } }, "constructInfo": { "fqn": "aws-cdk-lib.CustomResourceProviderBase", - "version": "2.150.0" + "version": "2.154.1" } }, "scrapBucket": { @@ -286,7 +286,7 @@ }, "constructInfo": { "fqn": "aws-cdk-lib.aws_s3.CfnBucket", - "version": "2.150.0" + "version": "2.154.1" } }, "Policy": { @@ -384,13 +384,13 @@ }, "constructInfo": { "fqn": "aws-cdk-lib.aws_s3.CfnBucketPolicy", - "version": "2.150.0" + "version": "2.154.1" } } }, "constructInfo": { "fqn": "aws-cdk-lib.aws_s3.BucketPolicy", - "version": "2.150.0" + "version": "2.154.1" } }, "AutoDeleteObjectsCustomResource": { @@ -402,13 +402,13 @@ "path": "s3lam-existing-s3-bucket/scrapBucket/AutoDeleteObjectsCustomResource/Default", "constructInfo": { "fqn": "aws-cdk-lib.CfnResource", - "version": "2.150.0" + "version": "2.154.1" } } }, "constructInfo": { "fqn": "aws-cdk-lib.CustomResource", - "version": "2.150.0" + "version": "2.154.1" } }, "Notifications": { @@ -420,7 +420,7 @@ "path": "s3lam-existing-s3-bucket/scrapBucket/Notifications/Resource", "constructInfo": { "fqn": "aws-cdk-lib.CfnResource", - "version": "2.150.0" + "version": "2.154.1" } } }, @@ -456,13 +456,13 @@ }, "constructInfo": { "fqn": "aws-cdk-lib.aws_lambda.CfnPermission", - "version": "2.150.0" + "version": "2.154.1" } } }, "constructInfo": { "fqn": "aws-cdk-lib.aws_s3.Bucket", - "version": "2.150.0" + "version": "2.154.1" } }, "test-s3-lambda": { @@ -478,7 +478,7 @@ "path": "s3lam-existing-s3-bucket/test-s3-lambda/LambdaFunctionServiceRole/ImportLambdaFunctionServiceRole", "constructInfo": { "fqn": "aws-cdk-lib.Resource", - "version": "2.150.0" + "version": "2.154.1" } }, "Resource": { @@ -541,7 +541,7 @@ }, "constructInfo": { "fqn": "aws-cdk-lib.aws_iam.CfnRole", - "version": "2.150.0" + "version": "2.154.1" } }, "DefaultPolicy": { @@ -577,19 +577,19 @@ }, "constructInfo": { "fqn": "aws-cdk-lib.aws_iam.CfnPolicy", - "version": "2.150.0" + "version": "2.154.1" } } }, "constructInfo": { "fqn": "aws-cdk-lib.aws_iam.Policy", - "version": "2.150.0" + "version": "2.154.1" } } }, "constructInfo": { "fqn": "aws-cdk-lib.aws_iam.Role", - "version": "2.150.0" + "version": "2.154.1" } }, "LambdaFunction": { @@ -605,7 +605,7 @@ "path": "s3lam-existing-s3-bucket/test-s3-lambda/LambdaFunction/Code/Stage", "constructInfo": { "fqn": "aws-cdk-lib.AssetStaging", - "version": "2.150.0" + "version": "2.154.1" } }, "AssetBucket": { @@ -613,13 +613,13 @@ "path": "s3lam-existing-s3-bucket/test-s3-lambda/LambdaFunction/Code/AssetBucket", "constructInfo": { "fqn": "aws-cdk-lib.aws_s3.BucketBase", - "version": "2.150.0" + "version": "2.154.1" } } }, "constructInfo": { "fqn": "aws-cdk-lib.aws_s3_assets.Asset", - "version": "2.150.0" + "version": "2.154.1" } }, "Resource": { @@ -654,19 +654,19 @@ }, "constructInfo": { "fqn": "aws-cdk-lib.aws_lambda.CfnFunction", - "version": "2.150.0" + "version": "2.154.1" } } }, "constructInfo": { "fqn": "aws-cdk-lib.aws_lambda.Function", - "version": "2.150.0" + "version": "2.154.1" } } }, "constructInfo": { "fqn": "@aws-solutions-constructs/aws-s3-lambda.S3ToLambda", - "version": "2.63.0" + "version": "2.67.1" } }, "BucketNotificationsHandler050a0587b7544547bf325f094a3db834": { @@ -682,7 +682,7 @@ "path": "s3lam-existing-s3-bucket/BucketNotificationsHandler050a0587b7544547bf325f094a3db834/Role/ImportRole", "constructInfo": { "fqn": "aws-cdk-lib.Resource", - "version": "2.150.0" + "version": "2.154.1" } }, "Resource": { @@ -721,7 +721,7 @@ }, "constructInfo": { "fqn": "aws-cdk-lib.aws_iam.CfnRole", - "version": "2.150.0" + "version": "2.154.1" } }, "DefaultPolicy": { @@ -754,19 +754,19 @@ }, "constructInfo": { "fqn": "aws-cdk-lib.aws_iam.CfnPolicy", - "version": "2.150.0" + "version": "2.154.1" } } }, "constructInfo": { "fqn": "aws-cdk-lib.aws_iam.Policy", - "version": "2.150.0" + "version": "2.154.1" } } }, "constructInfo": { "fqn": "aws-cdk-lib.aws_iam.Role", - "version": "2.150.0" + "version": "2.154.1" } }, "Resource": { @@ -774,7 +774,7 @@ "path": "s3lam-existing-s3-bucket/BucketNotificationsHandler050a0587b7544547bf325f094a3db834/Resource", "constructInfo": { "fqn": "aws-cdk-lib.CfnResource", - "version": "2.150.0" + "version": "2.154.1" } } }, @@ -808,7 +808,7 @@ "path": "s3lam-existing-s3-bucket/Integ/DefaultTest/DeployAssert/BootstrapVersion", "constructInfo": { "fqn": "aws-cdk-lib.CfnParameter", - "version": "2.150.0" + "version": "2.154.1" } }, "CheckBootstrapVersion": { @@ -816,25 +816,25 @@ "path": "s3lam-existing-s3-bucket/Integ/DefaultTest/DeployAssert/CheckBootstrapVersion", "constructInfo": { "fqn": "aws-cdk-lib.CfnRule", - "version": "2.150.0" + "version": "2.154.1" } } }, "constructInfo": { "fqn": "aws-cdk-lib.Stack", - "version": "2.150.0" + "version": "2.154.1" } } }, "constructInfo": { "fqn": "@aws-cdk/integ-tests-alpha.IntegTestCase", - "version": "2.150.0-alpha.0" + "version": "2.154.1-alpha.0" } } }, "constructInfo": { "fqn": "@aws-cdk/integ-tests-alpha.IntegTest", - "version": "2.150.0-alpha.0" + "version": "2.154.1-alpha.0" } }, "BootstrapVersion": { @@ -842,7 +842,7 @@ "path": "s3lam-existing-s3-bucket/BootstrapVersion", "constructInfo": { "fqn": "aws-cdk-lib.CfnParameter", - "version": "2.150.0" + "version": "2.154.1" } }, "CheckBootstrapVersion": { @@ -850,13 +850,13 @@ "path": "s3lam-existing-s3-bucket/CheckBootstrapVersion", "constructInfo": { "fqn": "aws-cdk-lib.CfnRule", - "version": "2.150.0" + "version": "2.154.1" } } }, "constructInfo": { "fqn": "aws-cdk-lib.Stack", - "version": "2.150.0" + "version": "2.154.1" } }, "Tree": { @@ -870,7 +870,7 @@ }, "constructInfo": { "fqn": "aws-cdk-lib.App", - "version": "2.150.0" + "version": "2.154.1" } } } \ No newline at end of file diff --git a/source/patterns/@aws-solutions-constructs/aws-s3-lambda/test/integ.s3lam-no-arguments.js.snapshot/cdk.out b/source/patterns/@aws-solutions-constructs/aws-s3-lambda/test/integ.s3lam-no-arguments.js.snapshot/cdk.out index 1f0068d32..0d15a78da 100644 --- a/source/patterns/@aws-solutions-constructs/aws-s3-lambda/test/integ.s3lam-no-arguments.js.snapshot/cdk.out +++ b/source/patterns/@aws-solutions-constructs/aws-s3-lambda/test/integ.s3lam-no-arguments.js.snapshot/cdk.out @@ -1 +1 @@ -{"version":"36.0.0"} \ No newline at end of file +{"version":"36.0.18"} \ No newline at end of file diff --git a/source/patterns/@aws-solutions-constructs/aws-s3-lambda/test/integ.s3lam-no-arguments.js.snapshot/integ.json b/source/patterns/@aws-solutions-constructs/aws-s3-lambda/test/integ.s3lam-no-arguments.js.snapshot/integ.json index d4d057ced..fbea9b4fb 100644 --- a/source/patterns/@aws-solutions-constructs/aws-s3-lambda/test/integ.s3lam-no-arguments.js.snapshot/integ.json +++ b/source/patterns/@aws-solutions-constructs/aws-s3-lambda/test/integ.s3lam-no-arguments.js.snapshot/integ.json @@ -1,5 +1,5 @@ { - "version": "36.0.0", + "version": "36.0.18", "testCases": { "s3lam-no-arguments/Integ/DefaultTest": { "stacks": [ diff --git a/source/patterns/@aws-solutions-constructs/aws-s3-lambda/test/integ.s3lam-no-arguments.js.snapshot/manifest.json b/source/patterns/@aws-solutions-constructs/aws-s3-lambda/test/integ.s3lam-no-arguments.js.snapshot/manifest.json index 4cc924657..e7ae73589 100644 --- a/source/patterns/@aws-solutions-constructs/aws-s3-lambda/test/integ.s3lam-no-arguments.js.snapshot/manifest.json +++ b/source/patterns/@aws-solutions-constructs/aws-s3-lambda/test/integ.s3lam-no-arguments.js.snapshot/manifest.json @@ -1,5 +1,5 @@ { - "version": "36.0.0", + "version": "36.0.5", "artifacts": { "s3lamnoargumentsIntegDefaultTestDeployAssert35992089.assets": { "type": "cdk:asset-manifest", @@ -66,7 +66,7 @@ "validateOnSynth": false, "assumeRoleArn": "arn:${AWS::Partition}:iam::${AWS::AccountId}:role/cdk-hnb659fds-deploy-role-${AWS::AccountId}-${AWS::Region}", "cloudFormationExecutionRoleArn": "arn:${AWS::Partition}:iam::${AWS::AccountId}:role/cdk-hnb659fds-cfn-exec-role-${AWS::AccountId}-${AWS::Region}", - "stackTemplateAssetObjectUrl": "s3://cdk-hnb659fds-assets-${AWS::AccountId}-${AWS::Region}/8e304e6afe821183257e0e4d9666ad6846a7f18dac14710f906bda5458c59ca3.json", + "stackTemplateAssetObjectUrl": "s3://cdk-hnb659fds-assets-${AWS::AccountId}-${AWS::Region}/90bdcd24f3061e9c3c899d59c1acd15eeef4aacc3e632dbbc0bd627f8b773027.json", "requiresBootstrapStackVersion": 6, "bootstrapStackVersionSsmParameter": "/cdk-bootstrap/hnb659fds/version", "additionalDependencies": [ @@ -148,6 +148,12 @@ "data": "LatestNodeRuntimeMap" } ], + "/s3lam-no-arguments/Custom::S3AutoDeleteObjectsCustomResourceProvider": [ + { + "type": "aws:cdk:is-custom-resource-handler-customResourceProvider", + "data": true + } + ], "/s3lam-no-arguments/Custom::S3AutoDeleteObjectsCustomResourceProvider/Role": [ { "type": "aws:cdk:logicalId", diff --git a/source/patterns/@aws-solutions-constructs/aws-s3-lambda/test/integ.s3lam-no-arguments.js.snapshot/s3lam-no-arguments.assets.json b/source/patterns/@aws-solutions-constructs/aws-s3-lambda/test/integ.s3lam-no-arguments.js.snapshot/s3lam-no-arguments.assets.json index f3d155489..74d1b3f40 100644 --- a/source/patterns/@aws-solutions-constructs/aws-s3-lambda/test/integ.s3lam-no-arguments.js.snapshot/s3lam-no-arguments.assets.json +++ b/source/patterns/@aws-solutions-constructs/aws-s3-lambda/test/integ.s3lam-no-arguments.js.snapshot/s3lam-no-arguments.assets.json @@ -1,5 +1,5 @@ { - "version": "36.0.0", + "version": "36.0.18", "files": { "0c3255e93ffe7a906c7422e9f0e9cc4c7fd86ee996ee3bb302e2f134b38463c8": { "source": { @@ -27,7 +27,7 @@ } } }, - "8e304e6afe821183257e0e4d9666ad6846a7f18dac14710f906bda5458c59ca3": { + "90bdcd24f3061e9c3c899d59c1acd15eeef4aacc3e632dbbc0bd627f8b773027": { "source": { "path": "s3lam-no-arguments.template.json", "packaging": "file" @@ -35,7 +35,7 @@ "destinations": { "current_account-current_region": { "bucketName": "cdk-hnb659fds-assets-${AWS::AccountId}-${AWS::Region}", - "objectKey": "8e304e6afe821183257e0e4d9666ad6846a7f18dac14710f906bda5458c59ca3.json", + "objectKey": "90bdcd24f3061e9c3c899d59c1acd15eeef4aacc3e632dbbc0bd627f8b773027.json", "assumeRoleArn": "arn:${AWS::Partition}:iam::${AWS::AccountId}:role/cdk-hnb659fds-file-publishing-role-${AWS::AccountId}-${AWS::Region}" } } diff --git a/source/patterns/@aws-solutions-constructs/aws-s3-lambda/test/integ.s3lam-no-arguments.js.snapshot/s3lam-no-arguments.template.json b/source/patterns/@aws-solutions-constructs/aws-s3-lambda/test/integ.s3lam-no-arguments.js.snapshot/s3lam-no-arguments.template.json index 89933e0cb..5cf7e9661 100644 --- a/source/patterns/@aws-solutions-constructs/aws-s3-lambda/test/integ.s3lam-no-arguments.js.snapshot/s3lam-no-arguments.template.json +++ b/source/patterns/@aws-solutions-constructs/aws-s3-lambda/test/integ.s3lam-no-arguments.js.snapshot/s3lam-no-arguments.template.json @@ -56,7 +56,9 @@ }, "Metadata": { "guard": { - "SuppressedRules": ["IAM_NO_INLINE_POLICY_CHECK"] + "SuppressedRules": [ + "IAM_NO_INLINE_POLICY_CHECK" + ] } } }, @@ -452,7 +454,8 @@ } ] }, - "Managed": true + "Managed": true, + "SkipDestinationValidation": false }, "DependsOn": [ "tests3lambdaS3BucketAllowBucketNotificationsTos3lamnoargumentstests3lambdaLambdaFunction7F4DB5A1D2077883", @@ -632,7 +635,7 @@ "Properties": { "Description": "AWS CloudFormation handler for \"Custom::S3BucketNotifications\" resources (@aws-cdk/aws-s3)", "Code": { - "ZipFile": "import boto3 # type: ignore\nimport json\nimport logging\nimport urllib.request\n\ns3 = boto3.client(\"s3\")\n\nEVENTBRIDGE_CONFIGURATION = 'EventBridgeConfiguration'\nCONFIGURATION_TYPES = [\"TopicConfigurations\", \"QueueConfigurations\", \"LambdaFunctionConfigurations\"]\n\ndef handler(event: dict, context):\n response_status = \"SUCCESS\"\n error_message = \"\"\n try:\n props = event[\"ResourceProperties\"]\n notification_configuration = props[\"NotificationConfiguration\"]\n managed = props.get('Managed', 'true').lower() == 'true'\n stack_id = event['StackId']\n old = event.get(\"OldResourceProperties\", {}).get(\"NotificationConfiguration\", {})\n if managed:\n config = handle_managed(event[\"RequestType\"], notification_configuration)\n else:\n config = handle_unmanaged(props[\"BucketName\"], stack_id, event[\"RequestType\"], notification_configuration, old)\n s3.put_bucket_notification_configuration(Bucket=props[\"BucketName\"], NotificationConfiguration=config)\n except Exception as e:\n logging.exception(\"Failed to put bucket notification configuration\")\n response_status = \"FAILED\"\n error_message = f\"Error: {str(e)}. \"\n finally:\n submit_response(event, context, response_status, error_message)\n\ndef handle_managed(request_type, notification_configuration):\n if request_type == 'Delete':\n return {}\n return notification_configuration\n\ndef handle_unmanaged(bucket, stack_id, request_type, notification_configuration, old):\n def get_id(n):\n n['Id'] = ''\n strToHash=json.dumps(n, sort_keys=True).replace('\"Name\": \"prefix\"', '\"Name\": \"Prefix\"').replace('\"Name\": \"suffix\"', '\"Name\": \"Suffix\"')\n return f\"{stack_id}-{hash(strToHash)}\"\n def with_id(n):\n n['Id'] = get_id(n)\n return n\n\n external_notifications = {}\n existing_notifications = s3.get_bucket_notification_configuration(Bucket=bucket)\n for t in CONFIGURATION_TYPES:\n if request_type == 'Update':\n old_incoming_ids = [get_id(n) for n in old.get(t, [])]\n external_notifications[t] = [n for n in existing_notifications.get(t, []) if not get_id(n) in old_incoming_ids] \n elif request_type == 'Delete':\n external_notifications[t] = [n for n in existing_notifications.get(t, []) if not n['Id'].startswith(f\"{stack_id}-\")]\n elif request_type == 'Create':\n external_notifications[t] = [n for n in existing_notifications.get(t, [])]\n if EVENTBRIDGE_CONFIGURATION in existing_notifications:\n external_notifications[EVENTBRIDGE_CONFIGURATION] = existing_notifications[EVENTBRIDGE_CONFIGURATION]\n\n if request_type == 'Delete':\n return external_notifications\n\n notifications = {}\n for t in CONFIGURATION_TYPES:\n external = external_notifications.get(t, [])\n incoming = [with_id(n) for n in notification_configuration.get(t, [])]\n notifications[t] = external + incoming\n\n if EVENTBRIDGE_CONFIGURATION in notification_configuration:\n notifications[EVENTBRIDGE_CONFIGURATION] = notification_configuration[EVENTBRIDGE_CONFIGURATION]\n elif EVENTBRIDGE_CONFIGURATION in external_notifications:\n notifications[EVENTBRIDGE_CONFIGURATION] = external_notifications[EVENTBRIDGE_CONFIGURATION]\n\n return notifications\n\ndef submit_response(event: dict, context, response_status: str, error_message: str):\n response_body = json.dumps(\n {\n \"Status\": response_status,\n \"Reason\": f\"{error_message}See the details in CloudWatch Log Stream: {context.log_stream_name}\",\n \"PhysicalResourceId\": event.get(\"PhysicalResourceId\") or event[\"LogicalResourceId\"],\n \"StackId\": event[\"StackId\"],\n \"RequestId\": event[\"RequestId\"],\n \"LogicalResourceId\": event[\"LogicalResourceId\"],\n \"NoEcho\": False,\n }\n ).encode(\"utf-8\")\n headers = {\"content-type\": \"\", \"content-length\": str(len(response_body))}\n try:\n req = urllib.request.Request(url=event[\"ResponseURL\"], headers=headers, data=response_body, method=\"PUT\")\n with urllib.request.urlopen(req) as response:\n print(response.read().decode(\"utf-8\"))\n print(\"Status code: \" + response.reason)\n except Exception as e:\n print(\"send(..) failed executing request.urlopen(..): \" + str(e))" + "ZipFile": "import boto3 # type: ignore\nimport json\nimport logging\nimport urllib.request\n\ns3 = boto3.client(\"s3\")\n\nEVENTBRIDGE_CONFIGURATION = 'EventBridgeConfiguration'\nCONFIGURATION_TYPES = [\"TopicConfigurations\", \"QueueConfigurations\", \"LambdaFunctionConfigurations\"]\n\ndef handler(event: dict, context):\n response_status = \"SUCCESS\"\n error_message = \"\"\n try:\n props = event[\"ResourceProperties\"]\n notification_configuration = props[\"NotificationConfiguration\"]\n managed = props.get('Managed', 'true').lower() == 'true'\n skipDestinationValidation = props.get('SkipDestinationValidation', 'false').lower() == 'true'\n stack_id = event['StackId']\n old = event.get(\"OldResourceProperties\", {}).get(\"NotificationConfiguration\", {})\n if managed:\n config = handle_managed(event[\"RequestType\"], notification_configuration)\n else:\n config = handle_unmanaged(props[\"BucketName\"], stack_id, event[\"RequestType\"], notification_configuration, old)\n s3.put_bucket_notification_configuration(Bucket=props[\"BucketName\"], NotificationConfiguration=config, SkipDestinationValidation=skipDestinationValidation)\n except Exception as e:\n logging.exception(\"Failed to put bucket notification configuration\")\n response_status = \"FAILED\"\n error_message = f\"Error: {str(e)}. \"\n finally:\n submit_response(event, context, response_status, error_message)\n\ndef handle_managed(request_type, notification_configuration):\n if request_type == 'Delete':\n return {}\n return notification_configuration\n\ndef handle_unmanaged(bucket, stack_id, request_type, notification_configuration, old):\n def get_id(n):\n n['Id'] = ''\n strToHash=json.dumps(n, sort_keys=True).replace('\"Name\": \"prefix\"', '\"Name\": \"Prefix\"').replace('\"Name\": \"suffix\"', '\"Name\": \"Suffix\"')\n return f\"{stack_id}-{hash(strToHash)}\"\n def with_id(n):\n n['Id'] = get_id(n)\n return n\n\n external_notifications = {}\n existing_notifications = s3.get_bucket_notification_configuration(Bucket=bucket)\n for t in CONFIGURATION_TYPES:\n if request_type == 'Update':\n old_incoming_ids = [get_id(n) for n in old.get(t, [])]\n external_notifications[t] = [n for n in existing_notifications.get(t, []) if not get_id(n) in old_incoming_ids] \n elif request_type == 'Delete':\n external_notifications[t] = [n for n in existing_notifications.get(t, []) if not n['Id'].startswith(f\"{stack_id}-\")]\n elif request_type == 'Create':\n external_notifications[t] = [n for n in existing_notifications.get(t, [])]\n if EVENTBRIDGE_CONFIGURATION in existing_notifications:\n external_notifications[EVENTBRIDGE_CONFIGURATION] = existing_notifications[EVENTBRIDGE_CONFIGURATION]\n\n if request_type == 'Delete':\n return external_notifications\n\n notifications = {}\n for t in CONFIGURATION_TYPES:\n external = external_notifications.get(t, [])\n incoming = [with_id(n) for n in notification_configuration.get(t, [])]\n notifications[t] = external + incoming\n\n if EVENTBRIDGE_CONFIGURATION in notification_configuration:\n notifications[EVENTBRIDGE_CONFIGURATION] = notification_configuration[EVENTBRIDGE_CONFIGURATION]\n elif EVENTBRIDGE_CONFIGURATION in external_notifications:\n notifications[EVENTBRIDGE_CONFIGURATION] = external_notifications[EVENTBRIDGE_CONFIGURATION]\n\n return notifications\n\ndef submit_response(event: dict, context, response_status: str, error_message: str):\n response_body = json.dumps(\n {\n \"Status\": response_status,\n \"Reason\": f\"{error_message}See the details in CloudWatch Log Stream: {context.log_stream_name}\",\n \"PhysicalResourceId\": event.get(\"PhysicalResourceId\") or event[\"LogicalResourceId\"],\n \"StackId\": event[\"StackId\"],\n \"RequestId\": event[\"RequestId\"],\n \"LogicalResourceId\": event[\"LogicalResourceId\"],\n \"NoEcho\": False,\n }\n ).encode(\"utf-8\")\n headers = {\"content-type\": \"\", \"content-length\": str(len(response_body))}\n try:\n req = urllib.request.Request(url=event[\"ResponseURL\"], headers=headers, data=response_body, method=\"PUT\")\n with urllib.request.urlopen(req) as response:\n print(response.read().decode(\"utf-8\"))\n print(\"Status code: \" + response.reason)\n except Exception as e:\n print(\"send(..) failed executing request.urlopen(..): \" + str(e))" }, "Handler": "index.handler", "Role": { diff --git a/source/patterns/@aws-solutions-constructs/aws-s3-lambda/test/integ.s3lam-no-arguments.js.snapshot/s3lamnoargumentsIntegDefaultTestDeployAssert35992089.assets.json b/source/patterns/@aws-solutions-constructs/aws-s3-lambda/test/integ.s3lam-no-arguments.js.snapshot/s3lamnoargumentsIntegDefaultTestDeployAssert35992089.assets.json index d49573bb1..0f5a614da 100644 --- a/source/patterns/@aws-solutions-constructs/aws-s3-lambda/test/integ.s3lam-no-arguments.js.snapshot/s3lamnoargumentsIntegDefaultTestDeployAssert35992089.assets.json +++ b/source/patterns/@aws-solutions-constructs/aws-s3-lambda/test/integ.s3lam-no-arguments.js.snapshot/s3lamnoargumentsIntegDefaultTestDeployAssert35992089.assets.json @@ -1,5 +1,5 @@ { - "version": "36.0.0", + "version": "36.0.18", "files": { "21fbb51d7b23f6a6c262b46a9caee79d744a3ac019fd45422d988b96d44b2a22": { "source": { diff --git a/source/patterns/@aws-solutions-constructs/aws-s3-lambda/test/integ.s3lam-no-arguments.js.snapshot/tree.json b/source/patterns/@aws-solutions-constructs/aws-s3-lambda/test/integ.s3lam-no-arguments.js.snapshot/tree.json index 2d0fa3129..8f4e6f342 100644 --- a/source/patterns/@aws-solutions-constructs/aws-s3-lambda/test/integ.s3lam-no-arguments.js.snapshot/tree.json +++ b/source/patterns/@aws-solutions-constructs/aws-s3-lambda/test/integ.s3lam-no-arguments.js.snapshot/tree.json @@ -21,7 +21,7 @@ "path": "s3lam-no-arguments/test-s3-lambda/LambdaFunctionServiceRole/ImportLambdaFunctionServiceRole", "constructInfo": { "fqn": "aws-cdk-lib.Resource", - "version": "2.149.0" + "version": "2.154.1" } }, "Resource": { @@ -84,7 +84,7 @@ }, "constructInfo": { "fqn": "aws-cdk-lib.aws_iam.CfnRole", - "version": "2.149.0" + "version": "2.154.1" } }, "DefaultPolicy": { @@ -120,19 +120,19 @@ }, "constructInfo": { "fqn": "aws-cdk-lib.aws_iam.CfnPolicy", - "version": "2.149.0" + "version": "2.154.1" } } }, "constructInfo": { "fqn": "aws-cdk-lib.aws_iam.Policy", - "version": "2.149.0" + "version": "2.154.1" } } }, "constructInfo": { "fqn": "aws-cdk-lib.aws_iam.Role", - "version": "2.149.0" + "version": "2.154.1" } }, "LambdaFunction": { @@ -148,7 +148,7 @@ "path": "s3lam-no-arguments/test-s3-lambda/LambdaFunction/Code/Stage", "constructInfo": { "fqn": "aws-cdk-lib.AssetStaging", - "version": "2.149.0" + "version": "2.154.1" } }, "AssetBucket": { @@ -156,13 +156,13 @@ "path": "s3lam-no-arguments/test-s3-lambda/LambdaFunction/Code/AssetBucket", "constructInfo": { "fqn": "aws-cdk-lib.aws_s3.BucketBase", - "version": "2.149.0" + "version": "2.154.1" } } }, "constructInfo": { "fqn": "aws-cdk-lib.aws_s3_assets.Asset", - "version": "2.149.0" + "version": "2.154.1" } }, "Resource": { @@ -197,13 +197,13 @@ }, "constructInfo": { "fqn": "aws-cdk-lib.aws_lambda.CfnFunction", - "version": "2.149.0" + "version": "2.154.1" } } }, "constructInfo": { "fqn": "aws-cdk-lib.aws_lambda.Function", - "version": "2.149.0" + "version": "2.154.1" } }, "S3LoggingBucket": { @@ -244,7 +244,7 @@ }, "constructInfo": { "fqn": "aws-cdk-lib.aws_s3.CfnBucket", - "version": "2.149.0" + "version": "2.154.1" } }, "Policy": { @@ -378,13 +378,13 @@ }, "constructInfo": { "fqn": "aws-cdk-lib.aws_s3.CfnBucketPolicy", - "version": "2.149.0" + "version": "2.154.1" } } }, "constructInfo": { "fqn": "aws-cdk-lib.aws_s3.BucketPolicy", - "version": "2.149.0" + "version": "2.154.1" } }, "AutoDeleteObjectsCustomResource": { @@ -396,19 +396,19 @@ "path": "s3lam-no-arguments/test-s3-lambda/S3LoggingBucket/AutoDeleteObjectsCustomResource/Default", "constructInfo": { "fqn": "aws-cdk-lib.CfnResource", - "version": "2.149.0" + "version": "2.154.1" } } }, "constructInfo": { "fqn": "aws-cdk-lib.CustomResource", - "version": "2.149.0" + "version": "2.154.1" } } }, "constructInfo": { "fqn": "aws-cdk-lib.aws_s3.Bucket", - "version": "2.149.0" + "version": "2.154.1" } }, "S3Bucket": { @@ -461,7 +461,7 @@ }, "constructInfo": { "fqn": "aws-cdk-lib.aws_s3.CfnBucket", - "version": "2.149.0" + "version": "2.154.1" } }, "Policy": { @@ -520,13 +520,13 @@ }, "constructInfo": { "fqn": "aws-cdk-lib.aws_s3.CfnBucketPolicy", - "version": "2.149.0" + "version": "2.154.1" } } }, "constructInfo": { "fqn": "aws-cdk-lib.aws_s3.BucketPolicy", - "version": "2.149.0" + "version": "2.154.1" } }, "Notifications": { @@ -538,7 +538,7 @@ "path": "s3lam-no-arguments/test-s3-lambda/S3Bucket/Notifications/Resource", "constructInfo": { "fqn": "aws-cdk-lib.CfnResource", - "version": "2.149.0" + "version": "2.154.1" } } }, @@ -574,19 +574,19 @@ }, "constructInfo": { "fqn": "aws-cdk-lib.aws_lambda.CfnPermission", - "version": "2.149.0" + "version": "2.154.1" } } }, "constructInfo": { "fqn": "aws-cdk-lib.aws_s3.Bucket", - "version": "2.149.0" + "version": "2.154.1" } } }, "constructInfo": { "fqn": "@aws-solutions-constructs/aws-s3-lambda.S3ToLambda", - "version": "2.62.0" + "version": "2.67.1" } }, "LatestNodeRuntimeMap": { @@ -594,7 +594,7 @@ "path": "s3lam-no-arguments/LatestNodeRuntimeMap", "constructInfo": { "fqn": "aws-cdk-lib.CfnMapping", - "version": "2.149.0" + "version": "2.154.1" } }, "Custom::S3AutoDeleteObjectsCustomResourceProvider": { @@ -606,7 +606,7 @@ "path": "s3lam-no-arguments/Custom::S3AutoDeleteObjectsCustomResourceProvider/Staging", "constructInfo": { "fqn": "aws-cdk-lib.AssetStaging", - "version": "2.149.0" + "version": "2.154.1" } }, "Role": { @@ -614,7 +614,7 @@ "path": "s3lam-no-arguments/Custom::S3AutoDeleteObjectsCustomResourceProvider/Role", "constructInfo": { "fqn": "aws-cdk-lib.CfnResource", - "version": "2.149.0" + "version": "2.154.1" } }, "Handler": { @@ -622,13 +622,13 @@ "path": "s3lam-no-arguments/Custom::S3AutoDeleteObjectsCustomResourceProvider/Handler", "constructInfo": { "fqn": "aws-cdk-lib.CfnResource", - "version": "2.149.0" + "version": "2.154.1" } } }, "constructInfo": { "fqn": "aws-cdk-lib.CustomResourceProviderBase", - "version": "2.149.0" + "version": "2.154.1" } }, "BucketNotificationsHandler050a0587b7544547bf325f094a3db834": { @@ -644,7 +644,7 @@ "path": "s3lam-no-arguments/BucketNotificationsHandler050a0587b7544547bf325f094a3db834/Role/ImportRole", "constructInfo": { "fqn": "aws-cdk-lib.Resource", - "version": "2.149.0" + "version": "2.154.1" } }, "Resource": { @@ -683,7 +683,7 @@ }, "constructInfo": { "fqn": "aws-cdk-lib.aws_iam.CfnRole", - "version": "2.149.0" + "version": "2.154.1" } }, "DefaultPolicy": { @@ -716,19 +716,19 @@ }, "constructInfo": { "fqn": "aws-cdk-lib.aws_iam.CfnPolicy", - "version": "2.149.0" + "version": "2.154.1" } } }, "constructInfo": { "fqn": "aws-cdk-lib.aws_iam.Policy", - "version": "2.149.0" + "version": "2.154.1" } } }, "constructInfo": { "fqn": "aws-cdk-lib.aws_iam.Role", - "version": "2.149.0" + "version": "2.154.1" } }, "Resource": { @@ -736,7 +736,7 @@ "path": "s3lam-no-arguments/BucketNotificationsHandler050a0587b7544547bf325f094a3db834/Resource", "constructInfo": { "fqn": "aws-cdk-lib.CfnResource", - "version": "2.149.0" + "version": "2.154.1" } } }, @@ -770,7 +770,7 @@ "path": "s3lam-no-arguments/Integ/DefaultTest/DeployAssert/BootstrapVersion", "constructInfo": { "fqn": "aws-cdk-lib.CfnParameter", - "version": "2.149.0" + "version": "2.154.1" } }, "CheckBootstrapVersion": { @@ -778,25 +778,25 @@ "path": "s3lam-no-arguments/Integ/DefaultTest/DeployAssert/CheckBootstrapVersion", "constructInfo": { "fqn": "aws-cdk-lib.CfnRule", - "version": "2.149.0" + "version": "2.154.1" } } }, "constructInfo": { "fqn": "aws-cdk-lib.Stack", - "version": "2.149.0" + "version": "2.154.1" } } }, "constructInfo": { "fqn": "@aws-cdk/integ-tests-alpha.IntegTestCase", - "version": "2.149.0-alpha.0" + "version": "2.154.1-alpha.0" } } }, "constructInfo": { "fqn": "@aws-cdk/integ-tests-alpha.IntegTest", - "version": "2.149.0-alpha.0" + "version": "2.154.1-alpha.0" } }, "BootstrapVersion": { @@ -804,7 +804,7 @@ "path": "s3lam-no-arguments/BootstrapVersion", "constructInfo": { "fqn": "aws-cdk-lib.CfnParameter", - "version": "2.149.0" + "version": "2.154.1" } }, "CheckBootstrapVersion": { @@ -812,13 +812,13 @@ "path": "s3lam-no-arguments/CheckBootstrapVersion", "constructInfo": { "fqn": "aws-cdk-lib.CfnRule", - "version": "2.149.0" + "version": "2.154.1" } } }, "constructInfo": { "fqn": "aws-cdk-lib.Stack", - "version": "2.149.0" + "version": "2.154.1" } }, "Tree": { @@ -832,7 +832,7 @@ }, "constructInfo": { "fqn": "aws-cdk-lib.App", - "version": "2.149.0" + "version": "2.154.1" } } } \ No newline at end of file diff --git a/source/patterns/@aws-solutions-constructs/aws-s3-sns/package.json b/source/patterns/@aws-solutions-constructs/aws-s3-sns/package.json index 03baf2d92..fed458deb 100644 --- a/source/patterns/@aws-solutions-constructs/aws-s3-sns/package.json +++ b/source/patterns/@aws-solutions-constructs/aws-s3-sns/package.json @@ -80,7 +80,7 @@ "peerDependencies": { "@aws-solutions-constructs/core": "0.0.0", "constructs": "^10.0.0", - "aws-cdk-lib": "0.0.0" + "aws-cdk-lib": "^0.0.0" }, "keywords": [ "aws", diff --git a/source/patterns/@aws-solutions-constructs/aws-s3-sns/test/integ.s3sns-customLoggingBucket.js.snapshot/cdk.out b/source/patterns/@aws-solutions-constructs/aws-s3-sns/test/integ.s3sns-customLoggingBucket.js.snapshot/cdk.out index 1f0068d32..0d15a78da 100644 --- a/source/patterns/@aws-solutions-constructs/aws-s3-sns/test/integ.s3sns-customLoggingBucket.js.snapshot/cdk.out +++ b/source/patterns/@aws-solutions-constructs/aws-s3-sns/test/integ.s3sns-customLoggingBucket.js.snapshot/cdk.out @@ -1 +1 @@ -{"version":"36.0.0"} \ No newline at end of file +{"version":"36.0.18"} \ No newline at end of file diff --git a/source/patterns/@aws-solutions-constructs/aws-s3-sns/test/integ.s3sns-customLoggingBucket.js.snapshot/integ.json b/source/patterns/@aws-solutions-constructs/aws-s3-sns/test/integ.s3sns-customLoggingBucket.js.snapshot/integ.json index 5a5423170..8e1b62fd4 100644 --- a/source/patterns/@aws-solutions-constructs/aws-s3-sns/test/integ.s3sns-customLoggingBucket.js.snapshot/integ.json +++ b/source/patterns/@aws-solutions-constructs/aws-s3-sns/test/integ.s3sns-customLoggingBucket.js.snapshot/integ.json @@ -1,5 +1,5 @@ { - "version": "36.0.0", + "version": "36.0.18", "testCases": { "s3sns-customLoggingBucket/Integ/DefaultTest": { "stacks": [ diff --git a/source/patterns/@aws-solutions-constructs/aws-s3-sns/test/integ.s3sns-customLoggingBucket.js.snapshot/manifest.json b/source/patterns/@aws-solutions-constructs/aws-s3-sns/test/integ.s3sns-customLoggingBucket.js.snapshot/manifest.json index 7874e6ec2..cb6dd0f6f 100644 --- a/source/patterns/@aws-solutions-constructs/aws-s3-sns/test/integ.s3sns-customLoggingBucket.js.snapshot/manifest.json +++ b/source/patterns/@aws-solutions-constructs/aws-s3-sns/test/integ.s3sns-customLoggingBucket.js.snapshot/manifest.json @@ -1,5 +1,5 @@ { - "version": "36.0.0", + "version": "36.0.5", "artifacts": { "s3snscustomLoggingBucketIntegDefaultTestDeployAssert43459459.assets": { "type": "cdk:asset-manifest", @@ -66,7 +66,7 @@ "validateOnSynth": false, "assumeRoleArn": "arn:${AWS::Partition}:iam::${AWS::AccountId}:role/cdk-hnb659fds-deploy-role-${AWS::AccountId}-${AWS::Region}", "cloudFormationExecutionRoleArn": "arn:${AWS::Partition}:iam::${AWS::AccountId}:role/cdk-hnb659fds-cfn-exec-role-${AWS::AccountId}-${AWS::Region}", - "stackTemplateAssetObjectUrl": "s3://cdk-hnb659fds-assets-${AWS::AccountId}-${AWS::Region}/7e7794a86064f2f3812c84256dcef2247166b7e003728800bd2f2297b6a10a77.json", + "stackTemplateAssetObjectUrl": "s3://cdk-hnb659fds-assets-${AWS::AccountId}-${AWS::Region}/5e3169018ced6a35b8e4cfc058da84b8b45a74be4e31725e2e0bc4e6da7f281e.json", "requiresBootstrapStackVersion": 6, "bootstrapStackVersionSsmParameter": "/cdk-bootstrap/hnb659fds/version", "additionalDependencies": [ @@ -142,6 +142,12 @@ "data": "LatestNodeRuntimeMap" } ], + "/s3sns-customLoggingBucket/Custom::S3AutoDeleteObjectsCustomResourceProvider": [ + { + "type": "aws:cdk:is-custom-resource-handler-customResourceProvider", + "data": true + } + ], "/s3sns-customLoggingBucket/Custom::S3AutoDeleteObjectsCustomResourceProvider/Role": [ { "type": "aws:cdk:logicalId", diff --git a/source/patterns/@aws-solutions-constructs/aws-s3-sns/test/integ.s3sns-customLoggingBucket.js.snapshot/s3sns-customLoggingBucket.assets.json b/source/patterns/@aws-solutions-constructs/aws-s3-sns/test/integ.s3sns-customLoggingBucket.js.snapshot/s3sns-customLoggingBucket.assets.json index f4518e56d..3276f359d 100644 --- a/source/patterns/@aws-solutions-constructs/aws-s3-sns/test/integ.s3sns-customLoggingBucket.js.snapshot/s3sns-customLoggingBucket.assets.json +++ b/source/patterns/@aws-solutions-constructs/aws-s3-sns/test/integ.s3sns-customLoggingBucket.js.snapshot/s3sns-customLoggingBucket.assets.json @@ -1,5 +1,5 @@ { - "version": "36.0.0", + "version": "36.0.18", "files": { "faa95a81ae7d7373f3e1f242268f904eb748d8d0fdd306e8a6fe515a1905a7d6": { "source": { @@ -14,7 +14,7 @@ } } }, - "7e7794a86064f2f3812c84256dcef2247166b7e003728800bd2f2297b6a10a77": { + "5e3169018ced6a35b8e4cfc058da84b8b45a74be4e31725e2e0bc4e6da7f281e": { "source": { "path": "s3sns-customLoggingBucket.template.json", "packaging": "file" @@ -22,7 +22,7 @@ "destinations": { "current_account-current_region": { "bucketName": "cdk-hnb659fds-assets-${AWS::AccountId}-${AWS::Region}", - "objectKey": "7e7794a86064f2f3812c84256dcef2247166b7e003728800bd2f2297b6a10a77.json", + "objectKey": "5e3169018ced6a35b8e4cfc058da84b8b45a74be4e31725e2e0bc4e6da7f281e.json", "assumeRoleArn": "arn:${AWS::Partition}:iam::${AWS::AccountId}:role/cdk-hnb659fds-file-publishing-role-${AWS::AccountId}-${AWS::Region}" } } diff --git a/source/patterns/@aws-solutions-constructs/aws-s3-sns/test/integ.s3sns-customLoggingBucket.js.snapshot/s3sns-customLoggingBucket.template.json b/source/patterns/@aws-solutions-constructs/aws-s3-sns/test/integ.s3sns-customLoggingBucket.js.snapshot/s3sns-customLoggingBucket.template.json index 7bcc2bd07..267698f16 100644 --- a/source/patterns/@aws-solutions-constructs/aws-s3-sns/test/integ.s3sns-customLoggingBucket.js.snapshot/s3sns-customLoggingBucket.template.json +++ b/source/patterns/@aws-solutions-constructs/aws-s3-sns/test/integ.s3sns-customLoggingBucket.js.snapshot/s3sns-customLoggingBucket.template.json @@ -309,7 +309,8 @@ } ] }, - "Managed": true + "Managed": true, + "SkipDestinationValidation": false }, "DependsOn": [ "tests3snsS3BucketPolicyA51165A8", @@ -631,7 +632,7 @@ "Properties": { "Description": "AWS CloudFormation handler for \"Custom::S3BucketNotifications\" resources (@aws-cdk/aws-s3)", "Code": { - "ZipFile": "import boto3 # type: ignore\nimport json\nimport logging\nimport urllib.request\n\ns3 = boto3.client(\"s3\")\n\nEVENTBRIDGE_CONFIGURATION = 'EventBridgeConfiguration'\nCONFIGURATION_TYPES = [\"TopicConfigurations\", \"QueueConfigurations\", \"LambdaFunctionConfigurations\"]\n\ndef handler(event: dict, context):\n response_status = \"SUCCESS\"\n error_message = \"\"\n try:\n props = event[\"ResourceProperties\"]\n notification_configuration = props[\"NotificationConfiguration\"]\n managed = props.get('Managed', 'true').lower() == 'true'\n stack_id = event['StackId']\n old = event.get(\"OldResourceProperties\", {}).get(\"NotificationConfiguration\", {})\n if managed:\n config = handle_managed(event[\"RequestType\"], notification_configuration)\n else:\n config = handle_unmanaged(props[\"BucketName\"], stack_id, event[\"RequestType\"], notification_configuration, old)\n s3.put_bucket_notification_configuration(Bucket=props[\"BucketName\"], NotificationConfiguration=config)\n except Exception as e:\n logging.exception(\"Failed to put bucket notification configuration\")\n response_status = \"FAILED\"\n error_message = f\"Error: {str(e)}. \"\n finally:\n submit_response(event, context, response_status, error_message)\n\ndef handle_managed(request_type, notification_configuration):\n if request_type == 'Delete':\n return {}\n return notification_configuration\n\ndef handle_unmanaged(bucket, stack_id, request_type, notification_configuration, old):\n def get_id(n):\n n['Id'] = ''\n strToHash=json.dumps(n, sort_keys=True).replace('\"Name\": \"prefix\"', '\"Name\": \"Prefix\"').replace('\"Name\": \"suffix\"', '\"Name\": \"Suffix\"')\n return f\"{stack_id}-{hash(strToHash)}\"\n def with_id(n):\n n['Id'] = get_id(n)\n return n\n\n external_notifications = {}\n existing_notifications = s3.get_bucket_notification_configuration(Bucket=bucket)\n for t in CONFIGURATION_TYPES:\n if request_type == 'Update':\n old_incoming_ids = [get_id(n) for n in old.get(t, [])]\n external_notifications[t] = [n for n in existing_notifications.get(t, []) if not get_id(n) in old_incoming_ids] \n elif request_type == 'Delete':\n external_notifications[t] = [n for n in existing_notifications.get(t, []) if not n['Id'].startswith(f\"{stack_id}-\")]\n elif request_type == 'Create':\n external_notifications[t] = [n for n in existing_notifications.get(t, [])]\n if EVENTBRIDGE_CONFIGURATION in existing_notifications:\n external_notifications[EVENTBRIDGE_CONFIGURATION] = existing_notifications[EVENTBRIDGE_CONFIGURATION]\n\n if request_type == 'Delete':\n return external_notifications\n\n notifications = {}\n for t in CONFIGURATION_TYPES:\n external = external_notifications.get(t, [])\n incoming = [with_id(n) for n in notification_configuration.get(t, [])]\n notifications[t] = external + incoming\n\n if EVENTBRIDGE_CONFIGURATION in notification_configuration:\n notifications[EVENTBRIDGE_CONFIGURATION] = notification_configuration[EVENTBRIDGE_CONFIGURATION]\n elif EVENTBRIDGE_CONFIGURATION in external_notifications:\n notifications[EVENTBRIDGE_CONFIGURATION] = external_notifications[EVENTBRIDGE_CONFIGURATION]\n\n return notifications\n\ndef submit_response(event: dict, context, response_status: str, error_message: str):\n response_body = json.dumps(\n {\n \"Status\": response_status,\n \"Reason\": f\"{error_message}See the details in CloudWatch Log Stream: {context.log_stream_name}\",\n \"PhysicalResourceId\": event.get(\"PhysicalResourceId\") or event[\"LogicalResourceId\"],\n \"StackId\": event[\"StackId\"],\n \"RequestId\": event[\"RequestId\"],\n \"LogicalResourceId\": event[\"LogicalResourceId\"],\n \"NoEcho\": False,\n }\n ).encode(\"utf-8\")\n headers = {\"content-type\": \"\", \"content-length\": str(len(response_body))}\n try:\n req = urllib.request.Request(url=event[\"ResponseURL\"], headers=headers, data=response_body, method=\"PUT\")\n with urllib.request.urlopen(req) as response:\n print(response.read().decode(\"utf-8\"))\n print(\"Status code: \" + response.reason)\n except Exception as e:\n print(\"send(..) failed executing request.urlopen(..): \" + str(e))" + "ZipFile": "import boto3 # type: ignore\nimport json\nimport logging\nimport urllib.request\n\ns3 = boto3.client(\"s3\")\n\nEVENTBRIDGE_CONFIGURATION = 'EventBridgeConfiguration'\nCONFIGURATION_TYPES = [\"TopicConfigurations\", \"QueueConfigurations\", \"LambdaFunctionConfigurations\"]\n\ndef handler(event: dict, context):\n response_status = \"SUCCESS\"\n error_message = \"\"\n try:\n props = event[\"ResourceProperties\"]\n notification_configuration = props[\"NotificationConfiguration\"]\n managed = props.get('Managed', 'true').lower() == 'true'\n skipDestinationValidation = props.get('SkipDestinationValidation', 'false').lower() == 'true'\n stack_id = event['StackId']\n old = event.get(\"OldResourceProperties\", {}).get(\"NotificationConfiguration\", {})\n if managed:\n config = handle_managed(event[\"RequestType\"], notification_configuration)\n else:\n config = handle_unmanaged(props[\"BucketName\"], stack_id, event[\"RequestType\"], notification_configuration, old)\n s3.put_bucket_notification_configuration(Bucket=props[\"BucketName\"], NotificationConfiguration=config, SkipDestinationValidation=skipDestinationValidation)\n except Exception as e:\n logging.exception(\"Failed to put bucket notification configuration\")\n response_status = \"FAILED\"\n error_message = f\"Error: {str(e)}. \"\n finally:\n submit_response(event, context, response_status, error_message)\n\ndef handle_managed(request_type, notification_configuration):\n if request_type == 'Delete':\n return {}\n return notification_configuration\n\ndef handle_unmanaged(bucket, stack_id, request_type, notification_configuration, old):\n def get_id(n):\n n['Id'] = ''\n strToHash=json.dumps(n, sort_keys=True).replace('\"Name\": \"prefix\"', '\"Name\": \"Prefix\"').replace('\"Name\": \"suffix\"', '\"Name\": \"Suffix\"')\n return f\"{stack_id}-{hash(strToHash)}\"\n def with_id(n):\n n['Id'] = get_id(n)\n return n\n\n external_notifications = {}\n existing_notifications = s3.get_bucket_notification_configuration(Bucket=bucket)\n for t in CONFIGURATION_TYPES:\n if request_type == 'Update':\n old_incoming_ids = [get_id(n) for n in old.get(t, [])]\n external_notifications[t] = [n for n in existing_notifications.get(t, []) if not get_id(n) in old_incoming_ids] \n elif request_type == 'Delete':\n external_notifications[t] = [n for n in existing_notifications.get(t, []) if not n['Id'].startswith(f\"{stack_id}-\")]\n elif request_type == 'Create':\n external_notifications[t] = [n for n in existing_notifications.get(t, [])]\n if EVENTBRIDGE_CONFIGURATION in existing_notifications:\n external_notifications[EVENTBRIDGE_CONFIGURATION] = existing_notifications[EVENTBRIDGE_CONFIGURATION]\n\n if request_type == 'Delete':\n return external_notifications\n\n notifications = {}\n for t in CONFIGURATION_TYPES:\n external = external_notifications.get(t, [])\n incoming = [with_id(n) for n in notification_configuration.get(t, [])]\n notifications[t] = external + incoming\n\n if EVENTBRIDGE_CONFIGURATION in notification_configuration:\n notifications[EVENTBRIDGE_CONFIGURATION] = notification_configuration[EVENTBRIDGE_CONFIGURATION]\n elif EVENTBRIDGE_CONFIGURATION in external_notifications:\n notifications[EVENTBRIDGE_CONFIGURATION] = external_notifications[EVENTBRIDGE_CONFIGURATION]\n\n return notifications\n\ndef submit_response(event: dict, context, response_status: str, error_message: str):\n response_body = json.dumps(\n {\n \"Status\": response_status,\n \"Reason\": f\"{error_message}See the details in CloudWatch Log Stream: {context.log_stream_name}\",\n \"PhysicalResourceId\": event.get(\"PhysicalResourceId\") or event[\"LogicalResourceId\"],\n \"StackId\": event[\"StackId\"],\n \"RequestId\": event[\"RequestId\"],\n \"LogicalResourceId\": event[\"LogicalResourceId\"],\n \"NoEcho\": False,\n }\n ).encode(\"utf-8\")\n headers = {\"content-type\": \"\", \"content-length\": str(len(response_body))}\n try:\n req = urllib.request.Request(url=event[\"ResponseURL\"], headers=headers, data=response_body, method=\"PUT\")\n with urllib.request.urlopen(req) as response:\n print(response.read().decode(\"utf-8\"))\n print(\"Status code: \" + response.reason)\n except Exception as e:\n print(\"send(..) failed executing request.urlopen(..): \" + str(e))" }, "Handler": "index.handler", "Role": { diff --git a/source/patterns/@aws-solutions-constructs/aws-s3-sns/test/integ.s3sns-customLoggingBucket.js.snapshot/s3snscustomLoggingBucketIntegDefaultTestDeployAssert43459459.assets.json b/source/patterns/@aws-solutions-constructs/aws-s3-sns/test/integ.s3sns-customLoggingBucket.js.snapshot/s3snscustomLoggingBucketIntegDefaultTestDeployAssert43459459.assets.json index d18f19e1b..f0bb8cc93 100644 --- a/source/patterns/@aws-solutions-constructs/aws-s3-sns/test/integ.s3sns-customLoggingBucket.js.snapshot/s3snscustomLoggingBucketIntegDefaultTestDeployAssert43459459.assets.json +++ b/source/patterns/@aws-solutions-constructs/aws-s3-sns/test/integ.s3sns-customLoggingBucket.js.snapshot/s3snscustomLoggingBucketIntegDefaultTestDeployAssert43459459.assets.json @@ -1,5 +1,5 @@ { - "version": "36.0.0", + "version": "36.0.18", "files": { "21fbb51d7b23f6a6c262b46a9caee79d744a3ac019fd45422d988b96d44b2a22": { "source": { diff --git a/source/patterns/@aws-solutions-constructs/aws-s3-sns/test/integ.s3sns-customLoggingBucket.js.snapshot/tree.json b/source/patterns/@aws-solutions-constructs/aws-s3-sns/test/integ.s3sns-customLoggingBucket.js.snapshot/tree.json index 670fe894c..b271d0610 100644 --- a/source/patterns/@aws-solutions-constructs/aws-s3-sns/test/integ.s3sns-customLoggingBucket.js.snapshot/tree.json +++ b/source/patterns/@aws-solutions-constructs/aws-s3-sns/test/integ.s3sns-customLoggingBucket.js.snapshot/tree.json @@ -63,7 +63,7 @@ }, "constructInfo": { "fqn": "aws-cdk-lib.aws_s3.CfnBucket", - "version": "2.149.0" + "version": "2.154.1" } }, "Policy": { @@ -197,13 +197,13 @@ }, "constructInfo": { "fqn": "aws-cdk-lib.aws_s3.CfnBucketPolicy", - "version": "2.149.0" + "version": "2.154.1" } } }, "constructInfo": { "fqn": "aws-cdk-lib.aws_s3.BucketPolicy", - "version": "2.149.0" + "version": "2.154.1" } }, "AutoDeleteObjectsCustomResource": { @@ -215,19 +215,19 @@ "path": "s3sns-customLoggingBucket/test-s3-sns/S3LoggingBucket/AutoDeleteObjectsCustomResource/Default", "constructInfo": { "fqn": "aws-cdk-lib.CfnResource", - "version": "2.149.0" + "version": "2.154.1" } } }, "constructInfo": { "fqn": "aws-cdk-lib.CustomResource", - "version": "2.149.0" + "version": "2.154.1" } } }, "constructInfo": { "fqn": "aws-cdk-lib.aws_s3.Bucket", - "version": "2.149.0" + "version": "2.154.1" } }, "S3Bucket": { @@ -280,7 +280,7 @@ }, "constructInfo": { "fqn": "aws-cdk-lib.aws_s3.CfnBucket", - "version": "2.149.0" + "version": "2.154.1" } }, "Policy": { @@ -339,13 +339,13 @@ }, "constructInfo": { "fqn": "aws-cdk-lib.aws_s3.CfnBucketPolicy", - "version": "2.149.0" + "version": "2.154.1" } } }, "constructInfo": { "fqn": "aws-cdk-lib.aws_s3.BucketPolicy", - "version": "2.149.0" + "version": "2.154.1" } }, "Notifications": { @@ -357,7 +357,7 @@ "path": "s3sns-customLoggingBucket/test-s3-sns/S3Bucket/Notifications/Resource", "constructInfo": { "fqn": "aws-cdk-lib.CfnResource", - "version": "2.149.0" + "version": "2.154.1" } } }, @@ -369,7 +369,7 @@ }, "constructInfo": { "fqn": "aws-cdk-lib.aws_s3.Bucket", - "version": "2.149.0" + "version": "2.154.1" } }, "'test-s3-snsKey'": { @@ -426,13 +426,13 @@ }, "constructInfo": { "fqn": "aws-cdk-lib.aws_kms.CfnKey", - "version": "2.149.0" + "version": "2.154.1" } } }, "constructInfo": { "fqn": "aws-cdk-lib.aws_kms.Key", - "version": "2.149.0" + "version": "2.154.1" } }, "SnsTopic": { @@ -455,7 +455,7 @@ }, "constructInfo": { "fqn": "aws-cdk-lib.aws_sns.CfnTopic", - "version": "2.149.0" + "version": "2.154.1" } }, "Policy": { @@ -572,25 +572,25 @@ }, "constructInfo": { "fqn": "aws-cdk-lib.aws_sns.CfnTopicPolicy", - "version": "2.149.0" + "version": "2.154.1" } } }, "constructInfo": { "fqn": "aws-cdk-lib.aws_sns.TopicPolicy", - "version": "2.149.0" + "version": "2.154.1" } } }, "constructInfo": { "fqn": "aws-cdk-lib.aws_sns.Topic", - "version": "2.149.0" + "version": "2.154.1" } } }, "constructInfo": { "fqn": "@aws-solutions-constructs/aws-s3-sns.S3ToSns", - "version": "2.62.0" + "version": "2.67.1" } }, "LatestNodeRuntimeMap": { @@ -598,7 +598,7 @@ "path": "s3sns-customLoggingBucket/LatestNodeRuntimeMap", "constructInfo": { "fqn": "aws-cdk-lib.CfnMapping", - "version": "2.149.0" + "version": "2.154.1" } }, "Custom::S3AutoDeleteObjectsCustomResourceProvider": { @@ -610,7 +610,7 @@ "path": "s3sns-customLoggingBucket/Custom::S3AutoDeleteObjectsCustomResourceProvider/Staging", "constructInfo": { "fqn": "aws-cdk-lib.AssetStaging", - "version": "2.149.0" + "version": "2.154.1" } }, "Role": { @@ -618,7 +618,7 @@ "path": "s3sns-customLoggingBucket/Custom::S3AutoDeleteObjectsCustomResourceProvider/Role", "constructInfo": { "fqn": "aws-cdk-lib.CfnResource", - "version": "2.149.0" + "version": "2.154.1" } }, "Handler": { @@ -626,13 +626,13 @@ "path": "s3sns-customLoggingBucket/Custom::S3AutoDeleteObjectsCustomResourceProvider/Handler", "constructInfo": { "fqn": "aws-cdk-lib.CfnResource", - "version": "2.149.0" + "version": "2.154.1" } } }, "constructInfo": { "fqn": "aws-cdk-lib.CustomResourceProviderBase", - "version": "2.149.0" + "version": "2.154.1" } }, "BucketNotificationsHandler050a0587b7544547bf325f094a3db834": { @@ -648,7 +648,7 @@ "path": "s3sns-customLoggingBucket/BucketNotificationsHandler050a0587b7544547bf325f094a3db834/Role/ImportRole", "constructInfo": { "fqn": "aws-cdk-lib.Resource", - "version": "2.149.0" + "version": "2.154.1" } }, "Resource": { @@ -687,7 +687,7 @@ }, "constructInfo": { "fqn": "aws-cdk-lib.aws_iam.CfnRole", - "version": "2.149.0" + "version": "2.154.1" } }, "DefaultPolicy": { @@ -720,19 +720,19 @@ }, "constructInfo": { "fqn": "aws-cdk-lib.aws_iam.CfnPolicy", - "version": "2.149.0" + "version": "2.154.1" } } }, "constructInfo": { "fqn": "aws-cdk-lib.aws_iam.Policy", - "version": "2.149.0" + "version": "2.154.1" } } }, "constructInfo": { "fqn": "aws-cdk-lib.aws_iam.Role", - "version": "2.149.0" + "version": "2.154.1" } }, "Resource": { @@ -740,7 +740,7 @@ "path": "s3sns-customLoggingBucket/BucketNotificationsHandler050a0587b7544547bf325f094a3db834/Resource", "constructInfo": { "fqn": "aws-cdk-lib.CfnResource", - "version": "2.149.0" + "version": "2.154.1" } } }, @@ -774,7 +774,7 @@ "path": "s3sns-customLoggingBucket/Integ/DefaultTest/DeployAssert/BootstrapVersion", "constructInfo": { "fqn": "aws-cdk-lib.CfnParameter", - "version": "2.149.0" + "version": "2.154.1" } }, "CheckBootstrapVersion": { @@ -782,25 +782,25 @@ "path": "s3sns-customLoggingBucket/Integ/DefaultTest/DeployAssert/CheckBootstrapVersion", "constructInfo": { "fqn": "aws-cdk-lib.CfnRule", - "version": "2.149.0" + "version": "2.154.1" } } }, "constructInfo": { "fqn": "aws-cdk-lib.Stack", - "version": "2.149.0" + "version": "2.154.1" } } }, "constructInfo": { "fqn": "@aws-cdk/integ-tests-alpha.IntegTestCase", - "version": "2.149.0-alpha.0" + "version": "2.154.1-alpha.0" } } }, "constructInfo": { "fqn": "@aws-cdk/integ-tests-alpha.IntegTest", - "version": "2.149.0-alpha.0" + "version": "2.154.1-alpha.0" } }, "BootstrapVersion": { @@ -808,7 +808,7 @@ "path": "s3sns-customLoggingBucket/BootstrapVersion", "constructInfo": { "fqn": "aws-cdk-lib.CfnParameter", - "version": "2.149.0" + "version": "2.154.1" } }, "CheckBootstrapVersion": { @@ -816,13 +816,13 @@ "path": "s3sns-customLoggingBucket/CheckBootstrapVersion", "constructInfo": { "fqn": "aws-cdk-lib.CfnRule", - "version": "2.149.0" + "version": "2.154.1" } } }, "constructInfo": { "fqn": "aws-cdk-lib.Stack", - "version": "2.149.0" + "version": "2.154.1" } }, "Tree": { @@ -836,7 +836,7 @@ }, "constructInfo": { "fqn": "aws-cdk-lib.App", - "version": "2.149.0" + "version": "2.154.1" } } } \ No newline at end of file diff --git a/source/patterns/@aws-solutions-constructs/aws-s3-sns/test/integ.s3sns-existingS3Bucket.js.snapshot/cdk.out b/source/patterns/@aws-solutions-constructs/aws-s3-sns/test/integ.s3sns-existingS3Bucket.js.snapshot/cdk.out index 1f0068d32..0d15a78da 100644 --- a/source/patterns/@aws-solutions-constructs/aws-s3-sns/test/integ.s3sns-existingS3Bucket.js.snapshot/cdk.out +++ b/source/patterns/@aws-solutions-constructs/aws-s3-sns/test/integ.s3sns-existingS3Bucket.js.snapshot/cdk.out @@ -1 +1 @@ -{"version":"36.0.0"} \ No newline at end of file +{"version":"36.0.18"} \ No newline at end of file diff --git a/source/patterns/@aws-solutions-constructs/aws-s3-sns/test/integ.s3sns-existingS3Bucket.js.snapshot/integ.json b/source/patterns/@aws-solutions-constructs/aws-s3-sns/test/integ.s3sns-existingS3Bucket.js.snapshot/integ.json index f505d25dd..46899fab3 100644 --- a/source/patterns/@aws-solutions-constructs/aws-s3-sns/test/integ.s3sns-existingS3Bucket.js.snapshot/integ.json +++ b/source/patterns/@aws-solutions-constructs/aws-s3-sns/test/integ.s3sns-existingS3Bucket.js.snapshot/integ.json @@ -1,5 +1,5 @@ { - "version": "36.0.0", + "version": "36.0.18", "testCases": { "s3sns-existingS3Bucket/Integ/DefaultTest": { "stacks": [ diff --git a/source/patterns/@aws-solutions-constructs/aws-s3-sns/test/integ.s3sns-existingS3Bucket.js.snapshot/manifest.json b/source/patterns/@aws-solutions-constructs/aws-s3-sns/test/integ.s3sns-existingS3Bucket.js.snapshot/manifest.json index 79f2d0562..18aa5579a 100644 --- a/source/patterns/@aws-solutions-constructs/aws-s3-sns/test/integ.s3sns-existingS3Bucket.js.snapshot/manifest.json +++ b/source/patterns/@aws-solutions-constructs/aws-s3-sns/test/integ.s3sns-existingS3Bucket.js.snapshot/manifest.json @@ -1,5 +1,5 @@ { - "version": "36.0.0", + "version": "36.0.5", "artifacts": { "s3snsexistingS3BucketIntegDefaultTestDeployAssert53691ABE.assets": { "type": "cdk:asset-manifest", @@ -66,7 +66,7 @@ "validateOnSynth": false, "assumeRoleArn": "arn:${AWS::Partition}:iam::${AWS::AccountId}:role/cdk-hnb659fds-deploy-role-${AWS::AccountId}-${AWS::Region}", "cloudFormationExecutionRoleArn": "arn:${AWS::Partition}:iam::${AWS::AccountId}:role/cdk-hnb659fds-cfn-exec-role-${AWS::AccountId}-${AWS::Region}", - "stackTemplateAssetObjectUrl": "s3://cdk-hnb659fds-assets-${AWS::AccountId}-${AWS::Region}/5376c9abc438ac722832fe0b8983e37f87590e04ea7d30bcf02b9e8075f729c4.json", + "stackTemplateAssetObjectUrl": "s3://cdk-hnb659fds-assets-${AWS::AccountId}-${AWS::Region}/62db6396b66beee98da758accf978d0d029032aab71918bd5cd669cec973748d.json", "requiresBootstrapStackVersion": 6, "bootstrapStackVersionSsmParameter": "/cdk-bootstrap/hnb659fds/version", "additionalDependencies": [ @@ -106,6 +106,12 @@ "data": "LatestNodeRuntimeMap" } ], + "/s3sns-existingS3Bucket/Custom::S3AutoDeleteObjectsCustomResourceProvider": [ + { + "type": "aws:cdk:is-custom-resource-handler-customResourceProvider", + "data": true + } + ], "/s3sns-existingS3Bucket/Custom::S3AutoDeleteObjectsCustomResourceProvider/Role": [ { "type": "aws:cdk:logicalId", diff --git a/source/patterns/@aws-solutions-constructs/aws-s3-sns/test/integ.s3sns-existingS3Bucket.js.snapshot/s3sns-existingS3Bucket.assets.json b/source/patterns/@aws-solutions-constructs/aws-s3-sns/test/integ.s3sns-existingS3Bucket.js.snapshot/s3sns-existingS3Bucket.assets.json index fb0caad85..3e89676a9 100644 --- a/source/patterns/@aws-solutions-constructs/aws-s3-sns/test/integ.s3sns-existingS3Bucket.js.snapshot/s3sns-existingS3Bucket.assets.json +++ b/source/patterns/@aws-solutions-constructs/aws-s3-sns/test/integ.s3sns-existingS3Bucket.js.snapshot/s3sns-existingS3Bucket.assets.json @@ -1,5 +1,5 @@ { - "version": "36.0.0", + "version": "36.0.18", "files": { "faa95a81ae7d7373f3e1f242268f904eb748d8d0fdd306e8a6fe515a1905a7d6": { "source": { @@ -14,7 +14,7 @@ } } }, - "5376c9abc438ac722832fe0b8983e37f87590e04ea7d30bcf02b9e8075f729c4": { + "62db6396b66beee98da758accf978d0d029032aab71918bd5cd669cec973748d": { "source": { "path": "s3sns-existingS3Bucket.template.json", "packaging": "file" @@ -22,7 +22,7 @@ "destinations": { "current_account-current_region": { "bucketName": "cdk-hnb659fds-assets-${AWS::AccountId}-${AWS::Region}", - "objectKey": "5376c9abc438ac722832fe0b8983e37f87590e04ea7d30bcf02b9e8075f729c4.json", + "objectKey": "62db6396b66beee98da758accf978d0d029032aab71918bd5cd669cec973748d.json", "assumeRoleArn": "arn:${AWS::Partition}:iam::${AWS::AccountId}:role/cdk-hnb659fds-file-publishing-role-${AWS::AccountId}-${AWS::Region}" } } diff --git a/source/patterns/@aws-solutions-constructs/aws-s3-sns/test/integ.s3sns-existingS3Bucket.js.snapshot/s3sns-existingS3Bucket.template.json b/source/patterns/@aws-solutions-constructs/aws-s3-sns/test/integ.s3sns-existingS3Bucket.js.snapshot/s3sns-existingS3Bucket.template.json index 69932901f..bda709bab 100644 --- a/source/patterns/@aws-solutions-constructs/aws-s3-sns/test/integ.s3sns-existingS3Bucket.js.snapshot/s3sns-existingS3Bucket.template.json +++ b/source/patterns/@aws-solutions-constructs/aws-s3-sns/test/integ.s3sns-existingS3Bucket.js.snapshot/s3sns-existingS3Bucket.template.json @@ -419,7 +419,8 @@ } ] }, - "Managed": true + "Managed": true, + "SkipDestinationValidation": false }, "DependsOn": [ "scrapBucketPolicy189B0607", @@ -657,7 +658,7 @@ "Properties": { "Description": "AWS CloudFormation handler for \"Custom::S3BucketNotifications\" resources (@aws-cdk/aws-s3)", "Code": { - "ZipFile": "import boto3 # type: ignore\nimport json\nimport logging\nimport urllib.request\n\ns3 = boto3.client(\"s3\")\n\nEVENTBRIDGE_CONFIGURATION = 'EventBridgeConfiguration'\nCONFIGURATION_TYPES = [\"TopicConfigurations\", \"QueueConfigurations\", \"LambdaFunctionConfigurations\"]\n\ndef handler(event: dict, context):\n response_status = \"SUCCESS\"\n error_message = \"\"\n try:\n props = event[\"ResourceProperties\"]\n notification_configuration = props[\"NotificationConfiguration\"]\n managed = props.get('Managed', 'true').lower() == 'true'\n stack_id = event['StackId']\n old = event.get(\"OldResourceProperties\", {}).get(\"NotificationConfiguration\", {})\n if managed:\n config = handle_managed(event[\"RequestType\"], notification_configuration)\n else:\n config = handle_unmanaged(props[\"BucketName\"], stack_id, event[\"RequestType\"], notification_configuration, old)\n s3.put_bucket_notification_configuration(Bucket=props[\"BucketName\"], NotificationConfiguration=config)\n except Exception as e:\n logging.exception(\"Failed to put bucket notification configuration\")\n response_status = \"FAILED\"\n error_message = f\"Error: {str(e)}. \"\n finally:\n submit_response(event, context, response_status, error_message)\n\ndef handle_managed(request_type, notification_configuration):\n if request_type == 'Delete':\n return {}\n return notification_configuration\n\ndef handle_unmanaged(bucket, stack_id, request_type, notification_configuration, old):\n def get_id(n):\n n['Id'] = ''\n strToHash=json.dumps(n, sort_keys=True).replace('\"Name\": \"prefix\"', '\"Name\": \"Prefix\"').replace('\"Name\": \"suffix\"', '\"Name\": \"Suffix\"')\n return f\"{stack_id}-{hash(strToHash)}\"\n def with_id(n):\n n['Id'] = get_id(n)\n return n\n\n external_notifications = {}\n existing_notifications = s3.get_bucket_notification_configuration(Bucket=bucket)\n for t in CONFIGURATION_TYPES:\n if request_type == 'Update':\n old_incoming_ids = [get_id(n) for n in old.get(t, [])]\n external_notifications[t] = [n for n in existing_notifications.get(t, []) if not get_id(n) in old_incoming_ids] \n elif request_type == 'Delete':\n external_notifications[t] = [n for n in existing_notifications.get(t, []) if not n['Id'].startswith(f\"{stack_id}-\")]\n elif request_type == 'Create':\n external_notifications[t] = [n for n in existing_notifications.get(t, [])]\n if EVENTBRIDGE_CONFIGURATION in existing_notifications:\n external_notifications[EVENTBRIDGE_CONFIGURATION] = existing_notifications[EVENTBRIDGE_CONFIGURATION]\n\n if request_type == 'Delete':\n return external_notifications\n\n notifications = {}\n for t in CONFIGURATION_TYPES:\n external = external_notifications.get(t, [])\n incoming = [with_id(n) for n in notification_configuration.get(t, [])]\n notifications[t] = external + incoming\n\n if EVENTBRIDGE_CONFIGURATION in notification_configuration:\n notifications[EVENTBRIDGE_CONFIGURATION] = notification_configuration[EVENTBRIDGE_CONFIGURATION]\n elif EVENTBRIDGE_CONFIGURATION in external_notifications:\n notifications[EVENTBRIDGE_CONFIGURATION] = external_notifications[EVENTBRIDGE_CONFIGURATION]\n\n return notifications\n\ndef submit_response(event: dict, context, response_status: str, error_message: str):\n response_body = json.dumps(\n {\n \"Status\": response_status,\n \"Reason\": f\"{error_message}See the details in CloudWatch Log Stream: {context.log_stream_name}\",\n \"PhysicalResourceId\": event.get(\"PhysicalResourceId\") or event[\"LogicalResourceId\"],\n \"StackId\": event[\"StackId\"],\n \"RequestId\": event[\"RequestId\"],\n \"LogicalResourceId\": event[\"LogicalResourceId\"],\n \"NoEcho\": False,\n }\n ).encode(\"utf-8\")\n headers = {\"content-type\": \"\", \"content-length\": str(len(response_body))}\n try:\n req = urllib.request.Request(url=event[\"ResponseURL\"], headers=headers, data=response_body, method=\"PUT\")\n with urllib.request.urlopen(req) as response:\n print(response.read().decode(\"utf-8\"))\n print(\"Status code: \" + response.reason)\n except Exception as e:\n print(\"send(..) failed executing request.urlopen(..): \" + str(e))" + "ZipFile": "import boto3 # type: ignore\nimport json\nimport logging\nimport urllib.request\n\ns3 = boto3.client(\"s3\")\n\nEVENTBRIDGE_CONFIGURATION = 'EventBridgeConfiguration'\nCONFIGURATION_TYPES = [\"TopicConfigurations\", \"QueueConfigurations\", \"LambdaFunctionConfigurations\"]\n\ndef handler(event: dict, context):\n response_status = \"SUCCESS\"\n error_message = \"\"\n try:\n props = event[\"ResourceProperties\"]\n notification_configuration = props[\"NotificationConfiguration\"]\n managed = props.get('Managed', 'true').lower() == 'true'\n skipDestinationValidation = props.get('SkipDestinationValidation', 'false').lower() == 'true'\n stack_id = event['StackId']\n old = event.get(\"OldResourceProperties\", {}).get(\"NotificationConfiguration\", {})\n if managed:\n config = handle_managed(event[\"RequestType\"], notification_configuration)\n else:\n config = handle_unmanaged(props[\"BucketName\"], stack_id, event[\"RequestType\"], notification_configuration, old)\n s3.put_bucket_notification_configuration(Bucket=props[\"BucketName\"], NotificationConfiguration=config, SkipDestinationValidation=skipDestinationValidation)\n except Exception as e:\n logging.exception(\"Failed to put bucket notification configuration\")\n response_status = \"FAILED\"\n error_message = f\"Error: {str(e)}. \"\n finally:\n submit_response(event, context, response_status, error_message)\n\ndef handle_managed(request_type, notification_configuration):\n if request_type == 'Delete':\n return {}\n return notification_configuration\n\ndef handle_unmanaged(bucket, stack_id, request_type, notification_configuration, old):\n def get_id(n):\n n['Id'] = ''\n strToHash=json.dumps(n, sort_keys=True).replace('\"Name\": \"prefix\"', '\"Name\": \"Prefix\"').replace('\"Name\": \"suffix\"', '\"Name\": \"Suffix\"')\n return f\"{stack_id}-{hash(strToHash)}\"\n def with_id(n):\n n['Id'] = get_id(n)\n return n\n\n external_notifications = {}\n existing_notifications = s3.get_bucket_notification_configuration(Bucket=bucket)\n for t in CONFIGURATION_TYPES:\n if request_type == 'Update':\n old_incoming_ids = [get_id(n) for n in old.get(t, [])]\n external_notifications[t] = [n for n in existing_notifications.get(t, []) if not get_id(n) in old_incoming_ids] \n elif request_type == 'Delete':\n external_notifications[t] = [n for n in existing_notifications.get(t, []) if not n['Id'].startswith(f\"{stack_id}-\")]\n elif request_type == 'Create':\n external_notifications[t] = [n for n in existing_notifications.get(t, [])]\n if EVENTBRIDGE_CONFIGURATION in existing_notifications:\n external_notifications[EVENTBRIDGE_CONFIGURATION] = existing_notifications[EVENTBRIDGE_CONFIGURATION]\n\n if request_type == 'Delete':\n return external_notifications\n\n notifications = {}\n for t in CONFIGURATION_TYPES:\n external = external_notifications.get(t, [])\n incoming = [with_id(n) for n in notification_configuration.get(t, [])]\n notifications[t] = external + incoming\n\n if EVENTBRIDGE_CONFIGURATION in notification_configuration:\n notifications[EVENTBRIDGE_CONFIGURATION] = notification_configuration[EVENTBRIDGE_CONFIGURATION]\n elif EVENTBRIDGE_CONFIGURATION in external_notifications:\n notifications[EVENTBRIDGE_CONFIGURATION] = external_notifications[EVENTBRIDGE_CONFIGURATION]\n\n return notifications\n\ndef submit_response(event: dict, context, response_status: str, error_message: str):\n response_body = json.dumps(\n {\n \"Status\": response_status,\n \"Reason\": f\"{error_message}See the details in CloudWatch Log Stream: {context.log_stream_name}\",\n \"PhysicalResourceId\": event.get(\"PhysicalResourceId\") or event[\"LogicalResourceId\"],\n \"StackId\": event[\"StackId\"],\n \"RequestId\": event[\"RequestId\"],\n \"LogicalResourceId\": event[\"LogicalResourceId\"],\n \"NoEcho\": False,\n }\n ).encode(\"utf-8\")\n headers = {\"content-type\": \"\", \"content-length\": str(len(response_body))}\n try:\n req = urllib.request.Request(url=event[\"ResponseURL\"], headers=headers, data=response_body, method=\"PUT\")\n with urllib.request.urlopen(req) as response:\n print(response.read().decode(\"utf-8\"))\n print(\"Status code: \" + response.reason)\n except Exception as e:\n print(\"send(..) failed executing request.urlopen(..): \" + str(e))" }, "Handler": "index.handler", "Role": { diff --git a/source/patterns/@aws-solutions-constructs/aws-s3-sns/test/integ.s3sns-existingS3Bucket.js.snapshot/s3snsexistingS3BucketIntegDefaultTestDeployAssert53691ABE.assets.json b/source/patterns/@aws-solutions-constructs/aws-s3-sns/test/integ.s3sns-existingS3Bucket.js.snapshot/s3snsexistingS3BucketIntegDefaultTestDeployAssert53691ABE.assets.json index 3207ab1c0..0b6b94cd6 100644 --- a/source/patterns/@aws-solutions-constructs/aws-s3-sns/test/integ.s3sns-existingS3Bucket.js.snapshot/s3snsexistingS3BucketIntegDefaultTestDeployAssert53691ABE.assets.json +++ b/source/patterns/@aws-solutions-constructs/aws-s3-sns/test/integ.s3sns-existingS3Bucket.js.snapshot/s3snsexistingS3BucketIntegDefaultTestDeployAssert53691ABE.assets.json @@ -1,5 +1,5 @@ { - "version": "36.0.0", + "version": "36.0.18", "files": { "21fbb51d7b23f6a6c262b46a9caee79d744a3ac019fd45422d988b96d44b2a22": { "source": { diff --git a/source/patterns/@aws-solutions-constructs/aws-s3-sns/test/integ.s3sns-existingS3Bucket.js.snapshot/tree.json b/source/patterns/@aws-solutions-constructs/aws-s3-sns/test/integ.s3sns-existingS3Bucket.js.snapshot/tree.json index b1f38655a..5474c3ed0 100644 --- a/source/patterns/@aws-solutions-constructs/aws-s3-sns/test/integ.s3sns-existingS3Bucket.js.snapshot/tree.json +++ b/source/patterns/@aws-solutions-constructs/aws-s3-sns/test/integ.s3sns-existingS3Bucket.js.snapshot/tree.json @@ -40,7 +40,7 @@ }, "constructInfo": { "fqn": "aws-cdk-lib.aws_s3.CfnBucket", - "version": "2.149.0" + "version": "2.154.1" } }, "Policy": { @@ -174,13 +174,13 @@ }, "constructInfo": { "fqn": "aws-cdk-lib.aws_s3.CfnBucketPolicy", - "version": "2.149.0" + "version": "2.154.1" } } }, "constructInfo": { "fqn": "aws-cdk-lib.aws_s3.BucketPolicy", - "version": "2.149.0" + "version": "2.154.1" } }, "AutoDeleteObjectsCustomResource": { @@ -192,19 +192,19 @@ "path": "s3sns-existingS3Bucket/scrapBucketLog/AutoDeleteObjectsCustomResource/Default", "constructInfo": { "fqn": "aws-cdk-lib.CfnResource", - "version": "2.149.0" + "version": "2.154.1" } } }, "constructInfo": { "fqn": "aws-cdk-lib.CustomResource", - "version": "2.149.0" + "version": "2.154.1" } } }, "constructInfo": { "fqn": "aws-cdk-lib.aws_s3.Bucket", - "version": "2.149.0" + "version": "2.154.1" } }, "LatestNodeRuntimeMap": { @@ -212,7 +212,7 @@ "path": "s3sns-existingS3Bucket/LatestNodeRuntimeMap", "constructInfo": { "fqn": "aws-cdk-lib.CfnMapping", - "version": "2.149.0" + "version": "2.154.1" } }, "Custom::S3AutoDeleteObjectsCustomResourceProvider": { @@ -224,7 +224,7 @@ "path": "s3sns-existingS3Bucket/Custom::S3AutoDeleteObjectsCustomResourceProvider/Staging", "constructInfo": { "fqn": "aws-cdk-lib.AssetStaging", - "version": "2.149.0" + "version": "2.154.1" } }, "Role": { @@ -232,7 +232,7 @@ "path": "s3sns-existingS3Bucket/Custom::S3AutoDeleteObjectsCustomResourceProvider/Role", "constructInfo": { "fqn": "aws-cdk-lib.CfnResource", - "version": "2.149.0" + "version": "2.154.1" } }, "Handler": { @@ -240,13 +240,13 @@ "path": "s3sns-existingS3Bucket/Custom::S3AutoDeleteObjectsCustomResourceProvider/Handler", "constructInfo": { "fqn": "aws-cdk-lib.CfnResource", - "version": "2.149.0" + "version": "2.154.1" } } }, "constructInfo": { "fqn": "aws-cdk-lib.CustomResourceProviderBase", - "version": "2.149.0" + "version": "2.154.1" } }, "scrapBucket": { @@ -286,7 +286,7 @@ }, "constructInfo": { "fqn": "aws-cdk-lib.aws_s3.CfnBucket", - "version": "2.149.0" + "version": "2.154.1" } }, "Policy": { @@ -384,13 +384,13 @@ }, "constructInfo": { "fqn": "aws-cdk-lib.aws_s3.CfnBucketPolicy", - "version": "2.149.0" + "version": "2.154.1" } } }, "constructInfo": { "fqn": "aws-cdk-lib.aws_s3.BucketPolicy", - "version": "2.149.0" + "version": "2.154.1" } }, "AutoDeleteObjectsCustomResource": { @@ -402,13 +402,13 @@ "path": "s3sns-existingS3Bucket/scrapBucket/AutoDeleteObjectsCustomResource/Default", "constructInfo": { "fqn": "aws-cdk-lib.CfnResource", - "version": "2.149.0" + "version": "2.154.1" } } }, "constructInfo": { "fqn": "aws-cdk-lib.CustomResource", - "version": "2.149.0" + "version": "2.154.1" } }, "Notifications": { @@ -420,7 +420,7 @@ "path": "s3sns-existingS3Bucket/scrapBucket/Notifications/Resource", "constructInfo": { "fqn": "aws-cdk-lib.CfnResource", - "version": "2.149.0" + "version": "2.154.1" } } }, @@ -432,7 +432,7 @@ }, "constructInfo": { "fqn": "aws-cdk-lib.aws_s3.Bucket", - "version": "2.149.0" + "version": "2.154.1" } }, "test-s3-sns": { @@ -493,13 +493,13 @@ }, "constructInfo": { "fqn": "aws-cdk-lib.aws_kms.CfnKey", - "version": "2.149.0" + "version": "2.154.1" } } }, "constructInfo": { "fqn": "aws-cdk-lib.aws_kms.Key", - "version": "2.149.0" + "version": "2.154.1" } }, "SnsTopic": { @@ -522,7 +522,7 @@ }, "constructInfo": { "fqn": "aws-cdk-lib.aws_sns.CfnTopic", - "version": "2.149.0" + "version": "2.154.1" } }, "Policy": { @@ -639,25 +639,25 @@ }, "constructInfo": { "fqn": "aws-cdk-lib.aws_sns.CfnTopicPolicy", - "version": "2.149.0" + "version": "2.154.1" } } }, "constructInfo": { "fqn": "aws-cdk-lib.aws_sns.TopicPolicy", - "version": "2.149.0" + "version": "2.154.1" } } }, "constructInfo": { "fqn": "aws-cdk-lib.aws_sns.Topic", - "version": "2.149.0" + "version": "2.154.1" } } }, "constructInfo": { "fqn": "@aws-solutions-constructs/aws-s3-sns.S3ToSns", - "version": "2.62.0" + "version": "2.67.1" } }, "BucketNotificationsHandler050a0587b7544547bf325f094a3db834": { @@ -673,7 +673,7 @@ "path": "s3sns-existingS3Bucket/BucketNotificationsHandler050a0587b7544547bf325f094a3db834/Role/ImportRole", "constructInfo": { "fqn": "aws-cdk-lib.Resource", - "version": "2.149.0" + "version": "2.154.1" } }, "Resource": { @@ -712,7 +712,7 @@ }, "constructInfo": { "fqn": "aws-cdk-lib.aws_iam.CfnRole", - "version": "2.149.0" + "version": "2.154.1" } }, "DefaultPolicy": { @@ -745,19 +745,19 @@ }, "constructInfo": { "fqn": "aws-cdk-lib.aws_iam.CfnPolicy", - "version": "2.149.0" + "version": "2.154.1" } } }, "constructInfo": { "fqn": "aws-cdk-lib.aws_iam.Policy", - "version": "2.149.0" + "version": "2.154.1" } } }, "constructInfo": { "fqn": "aws-cdk-lib.aws_iam.Role", - "version": "2.149.0" + "version": "2.154.1" } }, "Resource": { @@ -765,7 +765,7 @@ "path": "s3sns-existingS3Bucket/BucketNotificationsHandler050a0587b7544547bf325f094a3db834/Resource", "constructInfo": { "fqn": "aws-cdk-lib.CfnResource", - "version": "2.149.0" + "version": "2.154.1" } } }, @@ -799,7 +799,7 @@ "path": "s3sns-existingS3Bucket/Integ/DefaultTest/DeployAssert/BootstrapVersion", "constructInfo": { "fqn": "aws-cdk-lib.CfnParameter", - "version": "2.149.0" + "version": "2.154.1" } }, "CheckBootstrapVersion": { @@ -807,25 +807,25 @@ "path": "s3sns-existingS3Bucket/Integ/DefaultTest/DeployAssert/CheckBootstrapVersion", "constructInfo": { "fqn": "aws-cdk-lib.CfnRule", - "version": "2.149.0" + "version": "2.154.1" } } }, "constructInfo": { "fqn": "aws-cdk-lib.Stack", - "version": "2.149.0" + "version": "2.154.1" } } }, "constructInfo": { "fqn": "@aws-cdk/integ-tests-alpha.IntegTestCase", - "version": "2.149.0-alpha.0" + "version": "2.154.1-alpha.0" } } }, "constructInfo": { "fqn": "@aws-cdk/integ-tests-alpha.IntegTest", - "version": "2.149.0-alpha.0" + "version": "2.154.1-alpha.0" } }, "BootstrapVersion": { @@ -833,7 +833,7 @@ "path": "s3sns-existingS3Bucket/BootstrapVersion", "constructInfo": { "fqn": "aws-cdk-lib.CfnParameter", - "version": "2.149.0" + "version": "2.154.1" } }, "CheckBootstrapVersion": { @@ -841,13 +841,13 @@ "path": "s3sns-existingS3Bucket/CheckBootstrapVersion", "constructInfo": { "fqn": "aws-cdk-lib.CfnRule", - "version": "2.149.0" + "version": "2.154.1" } } }, "constructInfo": { "fqn": "aws-cdk-lib.Stack", - "version": "2.149.0" + "version": "2.154.1" } }, "Tree": { @@ -861,7 +861,7 @@ }, "constructInfo": { "fqn": "aws-cdk-lib.App", - "version": "2.149.0" + "version": "2.154.1" } } } \ No newline at end of file diff --git a/source/patterns/@aws-solutions-constructs/aws-s3-sns/test/integ.s3sns-existingSnsTopic.js.snapshot/cdk.out b/source/patterns/@aws-solutions-constructs/aws-s3-sns/test/integ.s3sns-existingSnsTopic.js.snapshot/cdk.out index 1f0068d32..0d15a78da 100644 --- a/source/patterns/@aws-solutions-constructs/aws-s3-sns/test/integ.s3sns-existingSnsTopic.js.snapshot/cdk.out +++ b/source/patterns/@aws-solutions-constructs/aws-s3-sns/test/integ.s3sns-existingSnsTopic.js.snapshot/cdk.out @@ -1 +1 @@ -{"version":"36.0.0"} \ No newline at end of file +{"version":"36.0.18"} \ No newline at end of file diff --git a/source/patterns/@aws-solutions-constructs/aws-s3-sns/test/integ.s3sns-existingSnsTopic.js.snapshot/integ.json b/source/patterns/@aws-solutions-constructs/aws-s3-sns/test/integ.s3sns-existingSnsTopic.js.snapshot/integ.json index e8d9cbf17..ab7511c71 100644 --- a/source/patterns/@aws-solutions-constructs/aws-s3-sns/test/integ.s3sns-existingSnsTopic.js.snapshot/integ.json +++ b/source/patterns/@aws-solutions-constructs/aws-s3-sns/test/integ.s3sns-existingSnsTopic.js.snapshot/integ.json @@ -1,5 +1,5 @@ { - "version": "36.0.0", + "version": "36.0.18", "testCases": { "s3sns-existingSnsTopic/Integ/DefaultTest": { "stacks": [ diff --git a/source/patterns/@aws-solutions-constructs/aws-s3-sns/test/integ.s3sns-existingSnsTopic.js.snapshot/manifest.json b/source/patterns/@aws-solutions-constructs/aws-s3-sns/test/integ.s3sns-existingSnsTopic.js.snapshot/manifest.json index 473b38188..642cfcbf9 100644 --- a/source/patterns/@aws-solutions-constructs/aws-s3-sns/test/integ.s3sns-existingSnsTopic.js.snapshot/manifest.json +++ b/source/patterns/@aws-solutions-constructs/aws-s3-sns/test/integ.s3sns-existingSnsTopic.js.snapshot/manifest.json @@ -1,5 +1,5 @@ { - "version": "36.0.0", + "version": "36.0.5", "artifacts": { "s3snsexistingSnsTopicIntegDefaultTestDeployAssert304A22E2.assets": { "type": "cdk:asset-manifest", @@ -66,7 +66,7 @@ "validateOnSynth": false, "assumeRoleArn": "arn:${AWS::Partition}:iam::${AWS::AccountId}:role/cdk-hnb659fds-deploy-role-${AWS::AccountId}-${AWS::Region}", "cloudFormationExecutionRoleArn": "arn:${AWS::Partition}:iam::${AWS::AccountId}:role/cdk-hnb659fds-cfn-exec-role-${AWS::AccountId}-${AWS::Region}", - "stackTemplateAssetObjectUrl": "s3://cdk-hnb659fds-assets-${AWS::AccountId}-${AWS::Region}/3c4fd8bd82da35537d0afaae12fd2e4ea5bd177ca4e97675c66eed7b3ff33950.json", + "stackTemplateAssetObjectUrl": "s3://cdk-hnb659fds-assets-${AWS::AccountId}-${AWS::Region}/0f4471a1db887017c62f2875525740287bb06dfe346ea550e70b9133198bc6a3.json", "requiresBootstrapStackVersion": 6, "bootstrapStackVersionSsmParameter": "/cdk-bootstrap/hnb659fds/version", "additionalDependencies": [ @@ -148,6 +148,12 @@ "data": "LatestNodeRuntimeMap" } ], + "/s3sns-existingSnsTopic/Custom::S3AutoDeleteObjectsCustomResourceProvider": [ + { + "type": "aws:cdk:is-custom-resource-handler-customResourceProvider", + "data": true + } + ], "/s3sns-existingSnsTopic/Custom::S3AutoDeleteObjectsCustomResourceProvider/Role": [ { "type": "aws:cdk:logicalId", diff --git a/source/patterns/@aws-solutions-constructs/aws-s3-sns/test/integ.s3sns-existingSnsTopic.js.snapshot/s3sns-existingSnsTopic.assets.json b/source/patterns/@aws-solutions-constructs/aws-s3-sns/test/integ.s3sns-existingSnsTopic.js.snapshot/s3sns-existingSnsTopic.assets.json index 9a3ad5339..c9682924c 100644 --- a/source/patterns/@aws-solutions-constructs/aws-s3-sns/test/integ.s3sns-existingSnsTopic.js.snapshot/s3sns-existingSnsTopic.assets.json +++ b/source/patterns/@aws-solutions-constructs/aws-s3-sns/test/integ.s3sns-existingSnsTopic.js.snapshot/s3sns-existingSnsTopic.assets.json @@ -1,5 +1,5 @@ { - "version": "36.0.0", + "version": "36.0.18", "files": { "faa95a81ae7d7373f3e1f242268f904eb748d8d0fdd306e8a6fe515a1905a7d6": { "source": { @@ -14,7 +14,7 @@ } } }, - "3c4fd8bd82da35537d0afaae12fd2e4ea5bd177ca4e97675c66eed7b3ff33950": { + "0f4471a1db887017c62f2875525740287bb06dfe346ea550e70b9133198bc6a3": { "source": { "path": "s3sns-existingSnsTopic.template.json", "packaging": "file" @@ -22,7 +22,7 @@ "destinations": { "current_account-current_region": { "bucketName": "cdk-hnb659fds-assets-${AWS::AccountId}-${AWS::Region}", - "objectKey": "3c4fd8bd82da35537d0afaae12fd2e4ea5bd177ca4e97675c66eed7b3ff33950.json", + "objectKey": "0f4471a1db887017c62f2875525740287bb06dfe346ea550e70b9133198bc6a3.json", "assumeRoleArn": "arn:${AWS::Partition}:iam::${AWS::AccountId}:role/cdk-hnb659fds-file-publishing-role-${AWS::AccountId}-${AWS::Region}" } } diff --git a/source/patterns/@aws-solutions-constructs/aws-s3-sns/test/integ.s3sns-existingSnsTopic.js.snapshot/s3sns-existingSnsTopic.template.json b/source/patterns/@aws-solutions-constructs/aws-s3-sns/test/integ.s3sns-existingSnsTopic.js.snapshot/s3sns-existingSnsTopic.template.json index 184f87110..32b93fd65 100644 --- a/source/patterns/@aws-solutions-constructs/aws-s3-sns/test/integ.s3sns-existingSnsTopic.js.snapshot/s3sns-existingSnsTopic.template.json +++ b/source/patterns/@aws-solutions-constructs/aws-s3-sns/test/integ.s3sns-existingSnsTopic.js.snapshot/s3sns-existingSnsTopic.template.json @@ -523,7 +523,8 @@ } ] }, - "Managed": true + "Managed": true, + "SkipDestinationValidation": false }, "DependsOn": [ "SnsTopicPolicy520DD923", @@ -682,7 +683,7 @@ "Properties": { "Description": "AWS CloudFormation handler for \"Custom::S3BucketNotifications\" resources (@aws-cdk/aws-s3)", "Code": { - "ZipFile": "import boto3 # type: ignore\nimport json\nimport logging\nimport urllib.request\n\ns3 = boto3.client(\"s3\")\n\nEVENTBRIDGE_CONFIGURATION = 'EventBridgeConfiguration'\nCONFIGURATION_TYPES = [\"TopicConfigurations\", \"QueueConfigurations\", \"LambdaFunctionConfigurations\"]\n\ndef handler(event: dict, context):\n response_status = \"SUCCESS\"\n error_message = \"\"\n try:\n props = event[\"ResourceProperties\"]\n notification_configuration = props[\"NotificationConfiguration\"]\n managed = props.get('Managed', 'true').lower() == 'true'\n stack_id = event['StackId']\n old = event.get(\"OldResourceProperties\", {}).get(\"NotificationConfiguration\", {})\n if managed:\n config = handle_managed(event[\"RequestType\"], notification_configuration)\n else:\n config = handle_unmanaged(props[\"BucketName\"], stack_id, event[\"RequestType\"], notification_configuration, old)\n s3.put_bucket_notification_configuration(Bucket=props[\"BucketName\"], NotificationConfiguration=config)\n except Exception as e:\n logging.exception(\"Failed to put bucket notification configuration\")\n response_status = \"FAILED\"\n error_message = f\"Error: {str(e)}. \"\n finally:\n submit_response(event, context, response_status, error_message)\n\ndef handle_managed(request_type, notification_configuration):\n if request_type == 'Delete':\n return {}\n return notification_configuration\n\ndef handle_unmanaged(bucket, stack_id, request_type, notification_configuration, old):\n def get_id(n):\n n['Id'] = ''\n strToHash=json.dumps(n, sort_keys=True).replace('\"Name\": \"prefix\"', '\"Name\": \"Prefix\"').replace('\"Name\": \"suffix\"', '\"Name\": \"Suffix\"')\n return f\"{stack_id}-{hash(strToHash)}\"\n def with_id(n):\n n['Id'] = get_id(n)\n return n\n\n external_notifications = {}\n existing_notifications = s3.get_bucket_notification_configuration(Bucket=bucket)\n for t in CONFIGURATION_TYPES:\n if request_type == 'Update':\n old_incoming_ids = [get_id(n) for n in old.get(t, [])]\n external_notifications[t] = [n for n in existing_notifications.get(t, []) if not get_id(n) in old_incoming_ids] \n elif request_type == 'Delete':\n external_notifications[t] = [n for n in existing_notifications.get(t, []) if not n['Id'].startswith(f\"{stack_id}-\")]\n elif request_type == 'Create':\n external_notifications[t] = [n for n in existing_notifications.get(t, [])]\n if EVENTBRIDGE_CONFIGURATION in existing_notifications:\n external_notifications[EVENTBRIDGE_CONFIGURATION] = existing_notifications[EVENTBRIDGE_CONFIGURATION]\n\n if request_type == 'Delete':\n return external_notifications\n\n notifications = {}\n for t in CONFIGURATION_TYPES:\n external = external_notifications.get(t, [])\n incoming = [with_id(n) for n in notification_configuration.get(t, [])]\n notifications[t] = external + incoming\n\n if EVENTBRIDGE_CONFIGURATION in notification_configuration:\n notifications[EVENTBRIDGE_CONFIGURATION] = notification_configuration[EVENTBRIDGE_CONFIGURATION]\n elif EVENTBRIDGE_CONFIGURATION in external_notifications:\n notifications[EVENTBRIDGE_CONFIGURATION] = external_notifications[EVENTBRIDGE_CONFIGURATION]\n\n return notifications\n\ndef submit_response(event: dict, context, response_status: str, error_message: str):\n response_body = json.dumps(\n {\n \"Status\": response_status,\n \"Reason\": f\"{error_message}See the details in CloudWatch Log Stream: {context.log_stream_name}\",\n \"PhysicalResourceId\": event.get(\"PhysicalResourceId\") or event[\"LogicalResourceId\"],\n \"StackId\": event[\"StackId\"],\n \"RequestId\": event[\"RequestId\"],\n \"LogicalResourceId\": event[\"LogicalResourceId\"],\n \"NoEcho\": False,\n }\n ).encode(\"utf-8\")\n headers = {\"content-type\": \"\", \"content-length\": str(len(response_body))}\n try:\n req = urllib.request.Request(url=event[\"ResponseURL\"], headers=headers, data=response_body, method=\"PUT\")\n with urllib.request.urlopen(req) as response:\n print(response.read().decode(\"utf-8\"))\n print(\"Status code: \" + response.reason)\n except Exception as e:\n print(\"send(..) failed executing request.urlopen(..): \" + str(e))" + "ZipFile": "import boto3 # type: ignore\nimport json\nimport logging\nimport urllib.request\n\ns3 = boto3.client(\"s3\")\n\nEVENTBRIDGE_CONFIGURATION = 'EventBridgeConfiguration'\nCONFIGURATION_TYPES = [\"TopicConfigurations\", \"QueueConfigurations\", \"LambdaFunctionConfigurations\"]\n\ndef handler(event: dict, context):\n response_status = \"SUCCESS\"\n error_message = \"\"\n try:\n props = event[\"ResourceProperties\"]\n notification_configuration = props[\"NotificationConfiguration\"]\n managed = props.get('Managed', 'true').lower() == 'true'\n skipDestinationValidation = props.get('SkipDestinationValidation', 'false').lower() == 'true'\n stack_id = event['StackId']\n old = event.get(\"OldResourceProperties\", {}).get(\"NotificationConfiguration\", {})\n if managed:\n config = handle_managed(event[\"RequestType\"], notification_configuration)\n else:\n config = handle_unmanaged(props[\"BucketName\"], stack_id, event[\"RequestType\"], notification_configuration, old)\n s3.put_bucket_notification_configuration(Bucket=props[\"BucketName\"], NotificationConfiguration=config, SkipDestinationValidation=skipDestinationValidation)\n except Exception as e:\n logging.exception(\"Failed to put bucket notification configuration\")\n response_status = \"FAILED\"\n error_message = f\"Error: {str(e)}. \"\n finally:\n submit_response(event, context, response_status, error_message)\n\ndef handle_managed(request_type, notification_configuration):\n if request_type == 'Delete':\n return {}\n return notification_configuration\n\ndef handle_unmanaged(bucket, stack_id, request_type, notification_configuration, old):\n def get_id(n):\n n['Id'] = ''\n strToHash=json.dumps(n, sort_keys=True).replace('\"Name\": \"prefix\"', '\"Name\": \"Prefix\"').replace('\"Name\": \"suffix\"', '\"Name\": \"Suffix\"')\n return f\"{stack_id}-{hash(strToHash)}\"\n def with_id(n):\n n['Id'] = get_id(n)\n return n\n\n external_notifications = {}\n existing_notifications = s3.get_bucket_notification_configuration(Bucket=bucket)\n for t in CONFIGURATION_TYPES:\n if request_type == 'Update':\n old_incoming_ids = [get_id(n) for n in old.get(t, [])]\n external_notifications[t] = [n for n in existing_notifications.get(t, []) if not get_id(n) in old_incoming_ids] \n elif request_type == 'Delete':\n external_notifications[t] = [n for n in existing_notifications.get(t, []) if not n['Id'].startswith(f\"{stack_id}-\")]\n elif request_type == 'Create':\n external_notifications[t] = [n for n in existing_notifications.get(t, [])]\n if EVENTBRIDGE_CONFIGURATION in existing_notifications:\n external_notifications[EVENTBRIDGE_CONFIGURATION] = existing_notifications[EVENTBRIDGE_CONFIGURATION]\n\n if request_type == 'Delete':\n return external_notifications\n\n notifications = {}\n for t in CONFIGURATION_TYPES:\n external = external_notifications.get(t, [])\n incoming = [with_id(n) for n in notification_configuration.get(t, [])]\n notifications[t] = external + incoming\n\n if EVENTBRIDGE_CONFIGURATION in notification_configuration:\n notifications[EVENTBRIDGE_CONFIGURATION] = notification_configuration[EVENTBRIDGE_CONFIGURATION]\n elif EVENTBRIDGE_CONFIGURATION in external_notifications:\n notifications[EVENTBRIDGE_CONFIGURATION] = external_notifications[EVENTBRIDGE_CONFIGURATION]\n\n return notifications\n\ndef submit_response(event: dict, context, response_status: str, error_message: str):\n response_body = json.dumps(\n {\n \"Status\": response_status,\n \"Reason\": f\"{error_message}See the details in CloudWatch Log Stream: {context.log_stream_name}\",\n \"PhysicalResourceId\": event.get(\"PhysicalResourceId\") or event[\"LogicalResourceId\"],\n \"StackId\": event[\"StackId\"],\n \"RequestId\": event[\"RequestId\"],\n \"LogicalResourceId\": event[\"LogicalResourceId\"],\n \"NoEcho\": False,\n }\n ).encode(\"utf-8\")\n headers = {\"content-type\": \"\", \"content-length\": str(len(response_body))}\n try:\n req = urllib.request.Request(url=event[\"ResponseURL\"], headers=headers, data=response_body, method=\"PUT\")\n with urllib.request.urlopen(req) as response:\n print(response.read().decode(\"utf-8\"))\n print(\"Status code: \" + response.reason)\n except Exception as e:\n print(\"send(..) failed executing request.urlopen(..): \" + str(e))" }, "Handler": "index.handler", "Role": { diff --git a/source/patterns/@aws-solutions-constructs/aws-s3-sns/test/integ.s3sns-existingSnsTopic.js.snapshot/s3snsexistingSnsTopicIntegDefaultTestDeployAssert304A22E2.assets.json b/source/patterns/@aws-solutions-constructs/aws-s3-sns/test/integ.s3sns-existingSnsTopic.js.snapshot/s3snsexistingSnsTopicIntegDefaultTestDeployAssert304A22E2.assets.json index 543a469a5..728d7aa4e 100644 --- a/source/patterns/@aws-solutions-constructs/aws-s3-sns/test/integ.s3sns-existingSnsTopic.js.snapshot/s3snsexistingSnsTopicIntegDefaultTestDeployAssert304A22E2.assets.json +++ b/source/patterns/@aws-solutions-constructs/aws-s3-sns/test/integ.s3sns-existingSnsTopic.js.snapshot/s3snsexistingSnsTopicIntegDefaultTestDeployAssert304A22E2.assets.json @@ -1,5 +1,5 @@ { - "version": "36.0.0", + "version": "36.0.18", "files": { "21fbb51d7b23f6a6c262b46a9caee79d744a3ac019fd45422d988b96d44b2a22": { "source": { diff --git a/source/patterns/@aws-solutions-constructs/aws-s3-sns/test/integ.s3sns-existingSnsTopic.js.snapshot/tree.json b/source/patterns/@aws-solutions-constructs/aws-s3-sns/test/integ.s3sns-existingSnsTopic.js.snapshot/tree.json index bf6be8aa1..d6c730b9d 100644 --- a/source/patterns/@aws-solutions-constructs/aws-s3-sns/test/integ.s3sns-existingSnsTopic.js.snapshot/tree.json +++ b/source/patterns/@aws-solutions-constructs/aws-s3-sns/test/integ.s3sns-existingSnsTopic.js.snapshot/tree.json @@ -62,13 +62,13 @@ }, "constructInfo": { "fqn": "aws-cdk-lib.aws_kms.CfnKey", - "version": "2.149.0" + "version": "2.154.1" } } }, "constructInfo": { "fqn": "aws-cdk-lib.aws_kms.Key", - "version": "2.149.0" + "version": "2.154.1" } }, "SnsTopic": { @@ -91,7 +91,7 @@ }, "constructInfo": { "fqn": "aws-cdk-lib.aws_sns.CfnTopic", - "version": "2.149.0" + "version": "2.154.1" } }, "Policy": { @@ -208,19 +208,19 @@ }, "constructInfo": { "fqn": "aws-cdk-lib.aws_sns.CfnTopicPolicy", - "version": "2.149.0" + "version": "2.154.1" } } }, "constructInfo": { "fqn": "aws-cdk-lib.aws_sns.TopicPolicy", - "version": "2.149.0" + "version": "2.154.1" } } }, "constructInfo": { "fqn": "aws-cdk-lib.aws_sns.Topic", - "version": "2.149.0" + "version": "2.154.1" } }, "test-s3-sns": { @@ -265,7 +265,7 @@ }, "constructInfo": { "fqn": "aws-cdk-lib.aws_s3.CfnBucket", - "version": "2.149.0" + "version": "2.154.1" } }, "Policy": { @@ -399,13 +399,13 @@ }, "constructInfo": { "fqn": "aws-cdk-lib.aws_s3.CfnBucketPolicy", - "version": "2.149.0" + "version": "2.154.1" } } }, "constructInfo": { "fqn": "aws-cdk-lib.aws_s3.BucketPolicy", - "version": "2.149.0" + "version": "2.154.1" } }, "AutoDeleteObjectsCustomResource": { @@ -417,19 +417,19 @@ "path": "s3sns-existingSnsTopic/test-s3-sns/S3LoggingBucket/AutoDeleteObjectsCustomResource/Default", "constructInfo": { "fqn": "aws-cdk-lib.CfnResource", - "version": "2.149.0" + "version": "2.154.1" } } }, "constructInfo": { "fqn": "aws-cdk-lib.CustomResource", - "version": "2.149.0" + "version": "2.154.1" } } }, "constructInfo": { "fqn": "aws-cdk-lib.aws_s3.Bucket", - "version": "2.149.0" + "version": "2.154.1" } }, "S3Bucket": { @@ -488,7 +488,7 @@ }, "constructInfo": { "fqn": "aws-cdk-lib.aws_s3.CfnBucket", - "version": "2.149.0" + "version": "2.154.1" } }, "Policy": { @@ -586,13 +586,13 @@ }, "constructInfo": { "fqn": "aws-cdk-lib.aws_s3.CfnBucketPolicy", - "version": "2.149.0" + "version": "2.154.1" } } }, "constructInfo": { "fqn": "aws-cdk-lib.aws_s3.BucketPolicy", - "version": "2.149.0" + "version": "2.154.1" } }, "AutoDeleteObjectsCustomResource": { @@ -604,13 +604,13 @@ "path": "s3sns-existingSnsTopic/test-s3-sns/S3Bucket/AutoDeleteObjectsCustomResource/Default", "constructInfo": { "fqn": "aws-cdk-lib.CfnResource", - "version": "2.149.0" + "version": "2.154.1" } } }, "constructInfo": { "fqn": "aws-cdk-lib.CustomResource", - "version": "2.149.0" + "version": "2.154.1" } }, "Notifications": { @@ -622,7 +622,7 @@ "path": "s3sns-existingSnsTopic/test-s3-sns/S3Bucket/Notifications/Resource", "constructInfo": { "fqn": "aws-cdk-lib.CfnResource", - "version": "2.149.0" + "version": "2.154.1" } } }, @@ -634,13 +634,13 @@ }, "constructInfo": { "fqn": "aws-cdk-lib.aws_s3.Bucket", - "version": "2.149.0" + "version": "2.154.1" } } }, "constructInfo": { "fqn": "@aws-solutions-constructs/aws-s3-sns.S3ToSns", - "version": "2.62.0" + "version": "2.67.1" } }, "LatestNodeRuntimeMap": { @@ -648,7 +648,7 @@ "path": "s3sns-existingSnsTopic/LatestNodeRuntimeMap", "constructInfo": { "fqn": "aws-cdk-lib.CfnMapping", - "version": "2.149.0" + "version": "2.154.1" } }, "Custom::S3AutoDeleteObjectsCustomResourceProvider": { @@ -660,7 +660,7 @@ "path": "s3sns-existingSnsTopic/Custom::S3AutoDeleteObjectsCustomResourceProvider/Staging", "constructInfo": { "fqn": "aws-cdk-lib.AssetStaging", - "version": "2.149.0" + "version": "2.154.1" } }, "Role": { @@ -668,7 +668,7 @@ "path": "s3sns-existingSnsTopic/Custom::S3AutoDeleteObjectsCustomResourceProvider/Role", "constructInfo": { "fqn": "aws-cdk-lib.CfnResource", - "version": "2.149.0" + "version": "2.154.1" } }, "Handler": { @@ -676,13 +676,13 @@ "path": "s3sns-existingSnsTopic/Custom::S3AutoDeleteObjectsCustomResourceProvider/Handler", "constructInfo": { "fqn": "aws-cdk-lib.CfnResource", - "version": "2.149.0" + "version": "2.154.1" } } }, "constructInfo": { "fqn": "aws-cdk-lib.CustomResourceProviderBase", - "version": "2.149.0" + "version": "2.154.1" } }, "BucketNotificationsHandler050a0587b7544547bf325f094a3db834": { @@ -698,7 +698,7 @@ "path": "s3sns-existingSnsTopic/BucketNotificationsHandler050a0587b7544547bf325f094a3db834/Role/ImportRole", "constructInfo": { "fqn": "aws-cdk-lib.Resource", - "version": "2.149.0" + "version": "2.154.1" } }, "Resource": { @@ -737,7 +737,7 @@ }, "constructInfo": { "fqn": "aws-cdk-lib.aws_iam.CfnRole", - "version": "2.149.0" + "version": "2.154.1" } }, "DefaultPolicy": { @@ -770,19 +770,19 @@ }, "constructInfo": { "fqn": "aws-cdk-lib.aws_iam.CfnPolicy", - "version": "2.149.0" + "version": "2.154.1" } } }, "constructInfo": { "fqn": "aws-cdk-lib.aws_iam.Policy", - "version": "2.149.0" + "version": "2.154.1" } } }, "constructInfo": { "fqn": "aws-cdk-lib.aws_iam.Role", - "version": "2.149.0" + "version": "2.154.1" } }, "Resource": { @@ -790,7 +790,7 @@ "path": "s3sns-existingSnsTopic/BucketNotificationsHandler050a0587b7544547bf325f094a3db834/Resource", "constructInfo": { "fqn": "aws-cdk-lib.CfnResource", - "version": "2.149.0" + "version": "2.154.1" } } }, @@ -824,7 +824,7 @@ "path": "s3sns-existingSnsTopic/Integ/DefaultTest/DeployAssert/BootstrapVersion", "constructInfo": { "fqn": "aws-cdk-lib.CfnParameter", - "version": "2.149.0" + "version": "2.154.1" } }, "CheckBootstrapVersion": { @@ -832,25 +832,25 @@ "path": "s3sns-existingSnsTopic/Integ/DefaultTest/DeployAssert/CheckBootstrapVersion", "constructInfo": { "fqn": "aws-cdk-lib.CfnRule", - "version": "2.149.0" + "version": "2.154.1" } } }, "constructInfo": { "fqn": "aws-cdk-lib.Stack", - "version": "2.149.0" + "version": "2.154.1" } } }, "constructInfo": { "fqn": "@aws-cdk/integ-tests-alpha.IntegTestCase", - "version": "2.149.0-alpha.0" + "version": "2.154.1-alpha.0" } } }, "constructInfo": { "fqn": "@aws-cdk/integ-tests-alpha.IntegTest", - "version": "2.149.0-alpha.0" + "version": "2.154.1-alpha.0" } }, "BootstrapVersion": { @@ -858,7 +858,7 @@ "path": "s3sns-existingSnsTopic/BootstrapVersion", "constructInfo": { "fqn": "aws-cdk-lib.CfnParameter", - "version": "2.149.0" + "version": "2.154.1" } }, "CheckBootstrapVersion": { @@ -866,13 +866,13 @@ "path": "s3sns-existingSnsTopic/CheckBootstrapVersion", "constructInfo": { "fqn": "aws-cdk-lib.CfnRule", - "version": "2.149.0" + "version": "2.154.1" } } }, "constructInfo": { "fqn": "aws-cdk-lib.Stack", - "version": "2.149.0" + "version": "2.154.1" } }, "Tree": { @@ -886,7 +886,7 @@ }, "constructInfo": { "fqn": "aws-cdk-lib.App", - "version": "2.149.0" + "version": "2.154.1" } } } \ No newline at end of file diff --git a/source/patterns/@aws-solutions-constructs/aws-s3-sns/test/integ.s3sns-existingUnencryptedSnsTopic.js.snapshot/cdk.out b/source/patterns/@aws-solutions-constructs/aws-s3-sns/test/integ.s3sns-existingUnencryptedSnsTopic.js.snapshot/cdk.out index 1f0068d32..0d15a78da 100644 --- a/source/patterns/@aws-solutions-constructs/aws-s3-sns/test/integ.s3sns-existingUnencryptedSnsTopic.js.snapshot/cdk.out +++ b/source/patterns/@aws-solutions-constructs/aws-s3-sns/test/integ.s3sns-existingUnencryptedSnsTopic.js.snapshot/cdk.out @@ -1 +1 @@ -{"version":"36.0.0"} \ No newline at end of file +{"version":"36.0.18"} \ No newline at end of file diff --git a/source/patterns/@aws-solutions-constructs/aws-s3-sns/test/integ.s3sns-existingUnencryptedSnsTopic.js.snapshot/integ.json b/source/patterns/@aws-solutions-constructs/aws-s3-sns/test/integ.s3sns-existingUnencryptedSnsTopic.js.snapshot/integ.json index 729a6bfb8..0240e0964 100644 --- a/source/patterns/@aws-solutions-constructs/aws-s3-sns/test/integ.s3sns-existingUnencryptedSnsTopic.js.snapshot/integ.json +++ b/source/patterns/@aws-solutions-constructs/aws-s3-sns/test/integ.s3sns-existingUnencryptedSnsTopic.js.snapshot/integ.json @@ -1,5 +1,5 @@ { - "version": "36.0.0", + "version": "36.0.18", "testCases": { "s3sns-existingUnencryptedSnsTopic/Integ/DefaultTest": { "stacks": [ diff --git a/source/patterns/@aws-solutions-constructs/aws-s3-sns/test/integ.s3sns-existingUnencryptedSnsTopic.js.snapshot/manifest.json b/source/patterns/@aws-solutions-constructs/aws-s3-sns/test/integ.s3sns-existingUnencryptedSnsTopic.js.snapshot/manifest.json index 9bf4c7c36..53627461c 100644 --- a/source/patterns/@aws-solutions-constructs/aws-s3-sns/test/integ.s3sns-existingUnencryptedSnsTopic.js.snapshot/manifest.json +++ b/source/patterns/@aws-solutions-constructs/aws-s3-sns/test/integ.s3sns-existingUnencryptedSnsTopic.js.snapshot/manifest.json @@ -1,5 +1,5 @@ { - "version": "36.0.0", + "version": "36.0.5", "artifacts": { "s3snsexistingUnencryptedSnsTopicIntegDefaultTestDeployAssertC680C0D6.assets": { "type": "cdk:asset-manifest", @@ -66,7 +66,7 @@ "validateOnSynth": false, "assumeRoleArn": "arn:${AWS::Partition}:iam::${AWS::AccountId}:role/cdk-hnb659fds-deploy-role-${AWS::AccountId}-${AWS::Region}", "cloudFormationExecutionRoleArn": "arn:${AWS::Partition}:iam::${AWS::AccountId}:role/cdk-hnb659fds-cfn-exec-role-${AWS::AccountId}-${AWS::Region}", - "stackTemplateAssetObjectUrl": "s3://cdk-hnb659fds-assets-${AWS::AccountId}-${AWS::Region}/25245e387ba4c2b630da115487df0c0554f90bfeb3a7940a023581079ed232a1.json", + "stackTemplateAssetObjectUrl": "s3://cdk-hnb659fds-assets-${AWS::AccountId}-${AWS::Region}/bbbf317f8402a0d9664c734f1689aea7ce98b3a74171e30fc620bbf2f18298c9.json", "requiresBootstrapStackVersion": 6, "bootstrapStackVersionSsmParameter": "/cdk-bootstrap/hnb659fds/version", "additionalDependencies": [ @@ -142,6 +142,12 @@ "data": "LatestNodeRuntimeMap" } ], + "/s3sns-existingUnencryptedSnsTopic/Custom::S3AutoDeleteObjectsCustomResourceProvider": [ + { + "type": "aws:cdk:is-custom-resource-handler-customResourceProvider", + "data": true + } + ], "/s3sns-existingUnencryptedSnsTopic/Custom::S3AutoDeleteObjectsCustomResourceProvider/Role": [ { "type": "aws:cdk:logicalId", diff --git a/source/patterns/@aws-solutions-constructs/aws-s3-sns/test/integ.s3sns-existingUnencryptedSnsTopic.js.snapshot/s3sns-existingUnencryptedSnsTopic.assets.json b/source/patterns/@aws-solutions-constructs/aws-s3-sns/test/integ.s3sns-existingUnencryptedSnsTopic.js.snapshot/s3sns-existingUnencryptedSnsTopic.assets.json index d8a786067..286a3bd0b 100644 --- a/source/patterns/@aws-solutions-constructs/aws-s3-sns/test/integ.s3sns-existingUnencryptedSnsTopic.js.snapshot/s3sns-existingUnencryptedSnsTopic.assets.json +++ b/source/patterns/@aws-solutions-constructs/aws-s3-sns/test/integ.s3sns-existingUnencryptedSnsTopic.js.snapshot/s3sns-existingUnencryptedSnsTopic.assets.json @@ -1,5 +1,5 @@ { - "version": "36.0.0", + "version": "36.0.18", "files": { "faa95a81ae7d7373f3e1f242268f904eb748d8d0fdd306e8a6fe515a1905a7d6": { "source": { @@ -14,7 +14,7 @@ } } }, - "25245e387ba4c2b630da115487df0c0554f90bfeb3a7940a023581079ed232a1": { + "bbbf317f8402a0d9664c734f1689aea7ce98b3a74171e30fc620bbf2f18298c9": { "source": { "path": "s3sns-existingUnencryptedSnsTopic.template.json", "packaging": "file" @@ -22,7 +22,7 @@ "destinations": { "current_account-current_region": { "bucketName": "cdk-hnb659fds-assets-${AWS::AccountId}-${AWS::Region}", - "objectKey": "25245e387ba4c2b630da115487df0c0554f90bfeb3a7940a023581079ed232a1.json", + "objectKey": "bbbf317f8402a0d9664c734f1689aea7ce98b3a74171e30fc620bbf2f18298c9.json", "assumeRoleArn": "arn:${AWS::Partition}:iam::${AWS::AccountId}:role/cdk-hnb659fds-file-publishing-role-${AWS::AccountId}-${AWS::Region}" } } diff --git a/source/patterns/@aws-solutions-constructs/aws-s3-sns/test/integ.s3sns-existingUnencryptedSnsTopic.js.snapshot/s3sns-existingUnencryptedSnsTopic.template.json b/source/patterns/@aws-solutions-constructs/aws-s3-sns/test/integ.s3sns-existingUnencryptedSnsTopic.js.snapshot/s3sns-existingUnencryptedSnsTopic.template.json index 1ec7330a2..34acf0582 100644 --- a/source/patterns/@aws-solutions-constructs/aws-s3-sns/test/integ.s3sns-existingUnencryptedSnsTopic.js.snapshot/s3sns-existingUnencryptedSnsTopic.template.json +++ b/source/patterns/@aws-solutions-constructs/aws-s3-sns/test/integ.s3sns-existingUnencryptedSnsTopic.js.snapshot/s3sns-existingUnencryptedSnsTopic.template.json @@ -409,7 +409,8 @@ } ] }, - "Managed": true + "Managed": true, + "SkipDestinationValidation": false }, "DependsOn": [ "tests3snsS3BucketPolicyA51165A8", @@ -568,7 +569,7 @@ "Properties": { "Description": "AWS CloudFormation handler for \"Custom::S3BucketNotifications\" resources (@aws-cdk/aws-s3)", "Code": { - "ZipFile": "import boto3 # type: ignore\nimport json\nimport logging\nimport urllib.request\n\ns3 = boto3.client(\"s3\")\n\nEVENTBRIDGE_CONFIGURATION = 'EventBridgeConfiguration'\nCONFIGURATION_TYPES = [\"TopicConfigurations\", \"QueueConfigurations\", \"LambdaFunctionConfigurations\"]\n\ndef handler(event: dict, context):\n response_status = \"SUCCESS\"\n error_message = \"\"\n try:\n props = event[\"ResourceProperties\"]\n notification_configuration = props[\"NotificationConfiguration\"]\n managed = props.get('Managed', 'true').lower() == 'true'\n stack_id = event['StackId']\n old = event.get(\"OldResourceProperties\", {}).get(\"NotificationConfiguration\", {})\n if managed:\n config = handle_managed(event[\"RequestType\"], notification_configuration)\n else:\n config = handle_unmanaged(props[\"BucketName\"], stack_id, event[\"RequestType\"], notification_configuration, old)\n s3.put_bucket_notification_configuration(Bucket=props[\"BucketName\"], NotificationConfiguration=config)\n except Exception as e:\n logging.exception(\"Failed to put bucket notification configuration\")\n response_status = \"FAILED\"\n error_message = f\"Error: {str(e)}. \"\n finally:\n submit_response(event, context, response_status, error_message)\n\ndef handle_managed(request_type, notification_configuration):\n if request_type == 'Delete':\n return {}\n return notification_configuration\n\ndef handle_unmanaged(bucket, stack_id, request_type, notification_configuration, old):\n def get_id(n):\n n['Id'] = ''\n strToHash=json.dumps(n, sort_keys=True).replace('\"Name\": \"prefix\"', '\"Name\": \"Prefix\"').replace('\"Name\": \"suffix\"', '\"Name\": \"Suffix\"')\n return f\"{stack_id}-{hash(strToHash)}\"\n def with_id(n):\n n['Id'] = get_id(n)\n return n\n\n external_notifications = {}\n existing_notifications = s3.get_bucket_notification_configuration(Bucket=bucket)\n for t in CONFIGURATION_TYPES:\n if request_type == 'Update':\n old_incoming_ids = [get_id(n) for n in old.get(t, [])]\n external_notifications[t] = [n for n in existing_notifications.get(t, []) if not get_id(n) in old_incoming_ids] \n elif request_type == 'Delete':\n external_notifications[t] = [n for n in existing_notifications.get(t, []) if not n['Id'].startswith(f\"{stack_id}-\")]\n elif request_type == 'Create':\n external_notifications[t] = [n for n in existing_notifications.get(t, [])]\n if EVENTBRIDGE_CONFIGURATION in existing_notifications:\n external_notifications[EVENTBRIDGE_CONFIGURATION] = existing_notifications[EVENTBRIDGE_CONFIGURATION]\n\n if request_type == 'Delete':\n return external_notifications\n\n notifications = {}\n for t in CONFIGURATION_TYPES:\n external = external_notifications.get(t, [])\n incoming = [with_id(n) for n in notification_configuration.get(t, [])]\n notifications[t] = external + incoming\n\n if EVENTBRIDGE_CONFIGURATION in notification_configuration:\n notifications[EVENTBRIDGE_CONFIGURATION] = notification_configuration[EVENTBRIDGE_CONFIGURATION]\n elif EVENTBRIDGE_CONFIGURATION in external_notifications:\n notifications[EVENTBRIDGE_CONFIGURATION] = external_notifications[EVENTBRIDGE_CONFIGURATION]\n\n return notifications\n\ndef submit_response(event: dict, context, response_status: str, error_message: str):\n response_body = json.dumps(\n {\n \"Status\": response_status,\n \"Reason\": f\"{error_message}See the details in CloudWatch Log Stream: {context.log_stream_name}\",\n \"PhysicalResourceId\": event.get(\"PhysicalResourceId\") or event[\"LogicalResourceId\"],\n \"StackId\": event[\"StackId\"],\n \"RequestId\": event[\"RequestId\"],\n \"LogicalResourceId\": event[\"LogicalResourceId\"],\n \"NoEcho\": False,\n }\n ).encode(\"utf-8\")\n headers = {\"content-type\": \"\", \"content-length\": str(len(response_body))}\n try:\n req = urllib.request.Request(url=event[\"ResponseURL\"], headers=headers, data=response_body, method=\"PUT\")\n with urllib.request.urlopen(req) as response:\n print(response.read().decode(\"utf-8\"))\n print(\"Status code: \" + response.reason)\n except Exception as e:\n print(\"send(..) failed executing request.urlopen(..): \" + str(e))" + "ZipFile": "import boto3 # type: ignore\nimport json\nimport logging\nimport urllib.request\n\ns3 = boto3.client(\"s3\")\n\nEVENTBRIDGE_CONFIGURATION = 'EventBridgeConfiguration'\nCONFIGURATION_TYPES = [\"TopicConfigurations\", \"QueueConfigurations\", \"LambdaFunctionConfigurations\"]\n\ndef handler(event: dict, context):\n response_status = \"SUCCESS\"\n error_message = \"\"\n try:\n props = event[\"ResourceProperties\"]\n notification_configuration = props[\"NotificationConfiguration\"]\n managed = props.get('Managed', 'true').lower() == 'true'\n skipDestinationValidation = props.get('SkipDestinationValidation', 'false').lower() == 'true'\n stack_id = event['StackId']\n old = event.get(\"OldResourceProperties\", {}).get(\"NotificationConfiguration\", {})\n if managed:\n config = handle_managed(event[\"RequestType\"], notification_configuration)\n else:\n config = handle_unmanaged(props[\"BucketName\"], stack_id, event[\"RequestType\"], notification_configuration, old)\n s3.put_bucket_notification_configuration(Bucket=props[\"BucketName\"], NotificationConfiguration=config, SkipDestinationValidation=skipDestinationValidation)\n except Exception as e:\n logging.exception(\"Failed to put bucket notification configuration\")\n response_status = \"FAILED\"\n error_message = f\"Error: {str(e)}. \"\n finally:\n submit_response(event, context, response_status, error_message)\n\ndef handle_managed(request_type, notification_configuration):\n if request_type == 'Delete':\n return {}\n return notification_configuration\n\ndef handle_unmanaged(bucket, stack_id, request_type, notification_configuration, old):\n def get_id(n):\n n['Id'] = ''\n strToHash=json.dumps(n, sort_keys=True).replace('\"Name\": \"prefix\"', '\"Name\": \"Prefix\"').replace('\"Name\": \"suffix\"', '\"Name\": \"Suffix\"')\n return f\"{stack_id}-{hash(strToHash)}\"\n def with_id(n):\n n['Id'] = get_id(n)\n return n\n\n external_notifications = {}\n existing_notifications = s3.get_bucket_notification_configuration(Bucket=bucket)\n for t in CONFIGURATION_TYPES:\n if request_type == 'Update':\n old_incoming_ids = [get_id(n) for n in old.get(t, [])]\n external_notifications[t] = [n for n in existing_notifications.get(t, []) if not get_id(n) in old_incoming_ids] \n elif request_type == 'Delete':\n external_notifications[t] = [n for n in existing_notifications.get(t, []) if not n['Id'].startswith(f\"{stack_id}-\")]\n elif request_type == 'Create':\n external_notifications[t] = [n for n in existing_notifications.get(t, [])]\n if EVENTBRIDGE_CONFIGURATION in existing_notifications:\n external_notifications[EVENTBRIDGE_CONFIGURATION] = existing_notifications[EVENTBRIDGE_CONFIGURATION]\n\n if request_type == 'Delete':\n return external_notifications\n\n notifications = {}\n for t in CONFIGURATION_TYPES:\n external = external_notifications.get(t, [])\n incoming = [with_id(n) for n in notification_configuration.get(t, [])]\n notifications[t] = external + incoming\n\n if EVENTBRIDGE_CONFIGURATION in notification_configuration:\n notifications[EVENTBRIDGE_CONFIGURATION] = notification_configuration[EVENTBRIDGE_CONFIGURATION]\n elif EVENTBRIDGE_CONFIGURATION in external_notifications:\n notifications[EVENTBRIDGE_CONFIGURATION] = external_notifications[EVENTBRIDGE_CONFIGURATION]\n\n return notifications\n\ndef submit_response(event: dict, context, response_status: str, error_message: str):\n response_body = json.dumps(\n {\n \"Status\": response_status,\n \"Reason\": f\"{error_message}See the details in CloudWatch Log Stream: {context.log_stream_name}\",\n \"PhysicalResourceId\": event.get(\"PhysicalResourceId\") or event[\"LogicalResourceId\"],\n \"StackId\": event[\"StackId\"],\n \"RequestId\": event[\"RequestId\"],\n \"LogicalResourceId\": event[\"LogicalResourceId\"],\n \"NoEcho\": False,\n }\n ).encode(\"utf-8\")\n headers = {\"content-type\": \"\", \"content-length\": str(len(response_body))}\n try:\n req = urllib.request.Request(url=event[\"ResponseURL\"], headers=headers, data=response_body, method=\"PUT\")\n with urllib.request.urlopen(req) as response:\n print(response.read().decode(\"utf-8\"))\n print(\"Status code: \" + response.reason)\n except Exception as e:\n print(\"send(..) failed executing request.urlopen(..): \" + str(e))" }, "Handler": "index.handler", "Role": { diff --git a/source/patterns/@aws-solutions-constructs/aws-s3-sns/test/integ.s3sns-existingUnencryptedSnsTopic.js.snapshot/s3snsexistingUnencryptedSnsTopicIntegDefaultTestDeployAssertC680C0D6.assets.json b/source/patterns/@aws-solutions-constructs/aws-s3-sns/test/integ.s3sns-existingUnencryptedSnsTopic.js.snapshot/s3snsexistingUnencryptedSnsTopicIntegDefaultTestDeployAssertC680C0D6.assets.json index fe132de65..f95df5b23 100644 --- a/source/patterns/@aws-solutions-constructs/aws-s3-sns/test/integ.s3sns-existingUnencryptedSnsTopic.js.snapshot/s3snsexistingUnencryptedSnsTopicIntegDefaultTestDeployAssertC680C0D6.assets.json +++ b/source/patterns/@aws-solutions-constructs/aws-s3-sns/test/integ.s3sns-existingUnencryptedSnsTopic.js.snapshot/s3snsexistingUnencryptedSnsTopicIntegDefaultTestDeployAssertC680C0D6.assets.json @@ -1,5 +1,5 @@ { - "version": "36.0.0", + "version": "36.0.18", "files": { "21fbb51d7b23f6a6c262b46a9caee79d744a3ac019fd45422d988b96d44b2a22": { "source": { diff --git a/source/patterns/@aws-solutions-constructs/aws-s3-sns/test/integ.s3sns-existingUnencryptedSnsTopic.js.snapshot/tree.json b/source/patterns/@aws-solutions-constructs/aws-s3-sns/test/integ.s3sns-existingUnencryptedSnsTopic.js.snapshot/tree.json index 012e0d08b..60c360aa0 100644 --- a/source/patterns/@aws-solutions-constructs/aws-s3-sns/test/integ.s3sns-existingUnencryptedSnsTopic.js.snapshot/tree.json +++ b/source/patterns/@aws-solutions-constructs/aws-s3-sns/test/integ.s3sns-existingUnencryptedSnsTopic.js.snapshot/tree.json @@ -21,7 +21,7 @@ }, "constructInfo": { "fqn": "aws-cdk-lib.aws_sns.CfnTopic", - "version": "2.149.0" + "version": "2.154.1" } }, "Policy": { @@ -69,19 +69,19 @@ }, "constructInfo": { "fqn": "aws-cdk-lib.aws_sns.CfnTopicPolicy", - "version": "2.149.0" + "version": "2.154.1" } } }, "constructInfo": { "fqn": "aws-cdk-lib.aws_sns.TopicPolicy", - "version": "2.149.0" + "version": "2.154.1" } } }, "constructInfo": { "fqn": "aws-cdk-lib.aws_sns.Topic", - "version": "2.149.0" + "version": "2.154.1" } }, "test-s3-sns": { @@ -126,7 +126,7 @@ }, "constructInfo": { "fqn": "aws-cdk-lib.aws_s3.CfnBucket", - "version": "2.149.0" + "version": "2.154.1" } }, "Policy": { @@ -260,13 +260,13 @@ }, "constructInfo": { "fqn": "aws-cdk-lib.aws_s3.CfnBucketPolicy", - "version": "2.149.0" + "version": "2.154.1" } } }, "constructInfo": { "fqn": "aws-cdk-lib.aws_s3.BucketPolicy", - "version": "2.149.0" + "version": "2.154.1" } }, "AutoDeleteObjectsCustomResource": { @@ -278,19 +278,19 @@ "path": "s3sns-existingUnencryptedSnsTopic/test-s3-sns/S3LoggingBucket/AutoDeleteObjectsCustomResource/Default", "constructInfo": { "fqn": "aws-cdk-lib.CfnResource", - "version": "2.149.0" + "version": "2.154.1" } } }, "constructInfo": { "fqn": "aws-cdk-lib.CustomResource", - "version": "2.149.0" + "version": "2.154.1" } } }, "constructInfo": { "fqn": "aws-cdk-lib.aws_s3.Bucket", - "version": "2.149.0" + "version": "2.154.1" } }, "S3Bucket": { @@ -349,7 +349,7 @@ }, "constructInfo": { "fqn": "aws-cdk-lib.aws_s3.CfnBucket", - "version": "2.149.0" + "version": "2.154.1" } }, "Policy": { @@ -447,13 +447,13 @@ }, "constructInfo": { "fqn": "aws-cdk-lib.aws_s3.CfnBucketPolicy", - "version": "2.149.0" + "version": "2.154.1" } } }, "constructInfo": { "fqn": "aws-cdk-lib.aws_s3.BucketPolicy", - "version": "2.149.0" + "version": "2.154.1" } }, "AutoDeleteObjectsCustomResource": { @@ -465,13 +465,13 @@ "path": "s3sns-existingUnencryptedSnsTopic/test-s3-sns/S3Bucket/AutoDeleteObjectsCustomResource/Default", "constructInfo": { "fqn": "aws-cdk-lib.CfnResource", - "version": "2.149.0" + "version": "2.154.1" } } }, "constructInfo": { "fqn": "aws-cdk-lib.CustomResource", - "version": "2.149.0" + "version": "2.154.1" } }, "Notifications": { @@ -483,7 +483,7 @@ "path": "s3sns-existingUnencryptedSnsTopic/test-s3-sns/S3Bucket/Notifications/Resource", "constructInfo": { "fqn": "aws-cdk-lib.CfnResource", - "version": "2.149.0" + "version": "2.154.1" } } }, @@ -495,13 +495,13 @@ }, "constructInfo": { "fqn": "aws-cdk-lib.aws_s3.Bucket", - "version": "2.149.0" + "version": "2.154.1" } } }, "constructInfo": { "fqn": "@aws-solutions-constructs/aws-s3-sns.S3ToSns", - "version": "2.62.0" + "version": "2.67.1" } }, "LatestNodeRuntimeMap": { @@ -509,7 +509,7 @@ "path": "s3sns-existingUnencryptedSnsTopic/LatestNodeRuntimeMap", "constructInfo": { "fqn": "aws-cdk-lib.CfnMapping", - "version": "2.149.0" + "version": "2.154.1" } }, "Custom::S3AutoDeleteObjectsCustomResourceProvider": { @@ -521,7 +521,7 @@ "path": "s3sns-existingUnencryptedSnsTopic/Custom::S3AutoDeleteObjectsCustomResourceProvider/Staging", "constructInfo": { "fqn": "aws-cdk-lib.AssetStaging", - "version": "2.149.0" + "version": "2.154.1" } }, "Role": { @@ -529,7 +529,7 @@ "path": "s3sns-existingUnencryptedSnsTopic/Custom::S3AutoDeleteObjectsCustomResourceProvider/Role", "constructInfo": { "fqn": "aws-cdk-lib.CfnResource", - "version": "2.149.0" + "version": "2.154.1" } }, "Handler": { @@ -537,13 +537,13 @@ "path": "s3sns-existingUnencryptedSnsTopic/Custom::S3AutoDeleteObjectsCustomResourceProvider/Handler", "constructInfo": { "fqn": "aws-cdk-lib.CfnResource", - "version": "2.149.0" + "version": "2.154.1" } } }, "constructInfo": { "fqn": "aws-cdk-lib.CustomResourceProviderBase", - "version": "2.149.0" + "version": "2.154.1" } }, "BucketNotificationsHandler050a0587b7544547bf325f094a3db834": { @@ -559,7 +559,7 @@ "path": "s3sns-existingUnencryptedSnsTopic/BucketNotificationsHandler050a0587b7544547bf325f094a3db834/Role/ImportRole", "constructInfo": { "fqn": "aws-cdk-lib.Resource", - "version": "2.149.0" + "version": "2.154.1" } }, "Resource": { @@ -598,7 +598,7 @@ }, "constructInfo": { "fqn": "aws-cdk-lib.aws_iam.CfnRole", - "version": "2.149.0" + "version": "2.154.1" } }, "DefaultPolicy": { @@ -631,19 +631,19 @@ }, "constructInfo": { "fqn": "aws-cdk-lib.aws_iam.CfnPolicy", - "version": "2.149.0" + "version": "2.154.1" } } }, "constructInfo": { "fqn": "aws-cdk-lib.aws_iam.Policy", - "version": "2.149.0" + "version": "2.154.1" } } }, "constructInfo": { "fqn": "aws-cdk-lib.aws_iam.Role", - "version": "2.149.0" + "version": "2.154.1" } }, "Resource": { @@ -651,7 +651,7 @@ "path": "s3sns-existingUnencryptedSnsTopic/BucketNotificationsHandler050a0587b7544547bf325f094a3db834/Resource", "constructInfo": { "fqn": "aws-cdk-lib.CfnResource", - "version": "2.149.0" + "version": "2.154.1" } } }, @@ -685,7 +685,7 @@ "path": "s3sns-existingUnencryptedSnsTopic/Integ/DefaultTest/DeployAssert/BootstrapVersion", "constructInfo": { "fqn": "aws-cdk-lib.CfnParameter", - "version": "2.149.0" + "version": "2.154.1" } }, "CheckBootstrapVersion": { @@ -693,25 +693,25 @@ "path": "s3sns-existingUnencryptedSnsTopic/Integ/DefaultTest/DeployAssert/CheckBootstrapVersion", "constructInfo": { "fqn": "aws-cdk-lib.CfnRule", - "version": "2.149.0" + "version": "2.154.1" } } }, "constructInfo": { "fqn": "aws-cdk-lib.Stack", - "version": "2.149.0" + "version": "2.154.1" } } }, "constructInfo": { "fqn": "@aws-cdk/integ-tests-alpha.IntegTestCase", - "version": "2.149.0-alpha.0" + "version": "2.154.1-alpha.0" } } }, "constructInfo": { "fqn": "@aws-cdk/integ-tests-alpha.IntegTest", - "version": "2.149.0-alpha.0" + "version": "2.154.1-alpha.0" } }, "BootstrapVersion": { @@ -719,7 +719,7 @@ "path": "s3sns-existingUnencryptedSnsTopic/BootstrapVersion", "constructInfo": { "fqn": "aws-cdk-lib.CfnParameter", - "version": "2.149.0" + "version": "2.154.1" } }, "CheckBootstrapVersion": { @@ -727,13 +727,13 @@ "path": "s3sns-existingUnencryptedSnsTopic/CheckBootstrapVersion", "constructInfo": { "fqn": "aws-cdk-lib.CfnRule", - "version": "2.149.0" + "version": "2.154.1" } } }, "constructInfo": { "fqn": "aws-cdk-lib.Stack", - "version": "2.149.0" + "version": "2.154.1" } }, "Tree": { @@ -747,7 +747,7 @@ }, "constructInfo": { "fqn": "aws-cdk-lib.App", - "version": "2.149.0" + "version": "2.154.1" } } } \ No newline at end of file diff --git a/source/patterns/@aws-solutions-constructs/aws-s3-sns/test/integ.s3sns-newTopicFromProps.js.snapshot/cdk.out b/source/patterns/@aws-solutions-constructs/aws-s3-sns/test/integ.s3sns-newTopicFromProps.js.snapshot/cdk.out index 1f0068d32..0d15a78da 100644 --- a/source/patterns/@aws-solutions-constructs/aws-s3-sns/test/integ.s3sns-newTopicFromProps.js.snapshot/cdk.out +++ b/source/patterns/@aws-solutions-constructs/aws-s3-sns/test/integ.s3sns-newTopicFromProps.js.snapshot/cdk.out @@ -1 +1 @@ -{"version":"36.0.0"} \ No newline at end of file +{"version":"36.0.18"} \ No newline at end of file diff --git a/source/patterns/@aws-solutions-constructs/aws-s3-sns/test/integ.s3sns-newTopicFromProps.js.snapshot/integ.json b/source/patterns/@aws-solutions-constructs/aws-s3-sns/test/integ.s3sns-newTopicFromProps.js.snapshot/integ.json index 3d2a5d89a..80f0ee1a2 100644 --- a/source/patterns/@aws-solutions-constructs/aws-s3-sns/test/integ.s3sns-newTopicFromProps.js.snapshot/integ.json +++ b/source/patterns/@aws-solutions-constructs/aws-s3-sns/test/integ.s3sns-newTopicFromProps.js.snapshot/integ.json @@ -1,5 +1,5 @@ { - "version": "36.0.0", + "version": "36.0.18", "testCases": { "s3sns-newTopicFromProps/Integ/DefaultTest": { "stacks": [ diff --git a/source/patterns/@aws-solutions-constructs/aws-s3-sns/test/integ.s3sns-newTopicFromProps.js.snapshot/manifest.json b/source/patterns/@aws-solutions-constructs/aws-s3-sns/test/integ.s3sns-newTopicFromProps.js.snapshot/manifest.json index 5c170f3cf..4da85c5a8 100644 --- a/source/patterns/@aws-solutions-constructs/aws-s3-sns/test/integ.s3sns-newTopicFromProps.js.snapshot/manifest.json +++ b/source/patterns/@aws-solutions-constructs/aws-s3-sns/test/integ.s3sns-newTopicFromProps.js.snapshot/manifest.json @@ -1,5 +1,5 @@ { - "version": "36.0.0", + "version": "36.0.5", "artifacts": { "s3snsnewTopicFromPropsIntegDefaultTestDeployAssert834567BB.assets": { "type": "cdk:asset-manifest", @@ -66,7 +66,7 @@ "validateOnSynth": false, "assumeRoleArn": "arn:${AWS::Partition}:iam::${AWS::AccountId}:role/cdk-hnb659fds-deploy-role-${AWS::AccountId}-${AWS::Region}", "cloudFormationExecutionRoleArn": "arn:${AWS::Partition}:iam::${AWS::AccountId}:role/cdk-hnb659fds-cfn-exec-role-${AWS::AccountId}-${AWS::Region}", - "stackTemplateAssetObjectUrl": "s3://cdk-hnb659fds-assets-${AWS::AccountId}-${AWS::Region}/70a45783ee783b82d91a1e1d57d21a0da6138b9b87dadaa6c49715e20f3788a8.json", + "stackTemplateAssetObjectUrl": "s3://cdk-hnb659fds-assets-${AWS::AccountId}-${AWS::Region}/e211e9acbc935c58a4dd3c7d83cebff5ab7e302d9113e7bc78b3f4bf8a2b8915.json", "requiresBootstrapStackVersion": 6, "bootstrapStackVersionSsmParameter": "/cdk-bootstrap/hnb659fds/version", "additionalDependencies": [ @@ -148,6 +148,12 @@ "data": "LatestNodeRuntimeMap" } ], + "/s3sns-newTopicFromProps/Custom::S3AutoDeleteObjectsCustomResourceProvider": [ + { + "type": "aws:cdk:is-custom-resource-handler-customResourceProvider", + "data": true + } + ], "/s3sns-newTopicFromProps/Custom::S3AutoDeleteObjectsCustomResourceProvider/Role": [ { "type": "aws:cdk:logicalId", diff --git a/source/patterns/@aws-solutions-constructs/aws-s3-sns/test/integ.s3sns-newTopicFromProps.js.snapshot/s3sns-newTopicFromProps.assets.json b/source/patterns/@aws-solutions-constructs/aws-s3-sns/test/integ.s3sns-newTopicFromProps.js.snapshot/s3sns-newTopicFromProps.assets.json index b30f1fd16..d3c396126 100644 --- a/source/patterns/@aws-solutions-constructs/aws-s3-sns/test/integ.s3sns-newTopicFromProps.js.snapshot/s3sns-newTopicFromProps.assets.json +++ b/source/patterns/@aws-solutions-constructs/aws-s3-sns/test/integ.s3sns-newTopicFromProps.js.snapshot/s3sns-newTopicFromProps.assets.json @@ -1,5 +1,5 @@ { - "version": "36.0.0", + "version": "36.0.18", "files": { "faa95a81ae7d7373f3e1f242268f904eb748d8d0fdd306e8a6fe515a1905a7d6": { "source": { @@ -14,7 +14,7 @@ } } }, - "70a45783ee783b82d91a1e1d57d21a0da6138b9b87dadaa6c49715e20f3788a8": { + "e211e9acbc935c58a4dd3c7d83cebff5ab7e302d9113e7bc78b3f4bf8a2b8915": { "source": { "path": "s3sns-newTopicFromProps.template.json", "packaging": "file" @@ -22,7 +22,7 @@ "destinations": { "current_account-current_region": { "bucketName": "cdk-hnb659fds-assets-${AWS::AccountId}-${AWS::Region}", - "objectKey": "70a45783ee783b82d91a1e1d57d21a0da6138b9b87dadaa6c49715e20f3788a8.json", + "objectKey": "e211e9acbc935c58a4dd3c7d83cebff5ab7e302d9113e7bc78b3f4bf8a2b8915.json", "assumeRoleArn": "arn:${AWS::Partition}:iam::${AWS::AccountId}:role/cdk-hnb659fds-file-publishing-role-${AWS::AccountId}-${AWS::Region}" } } diff --git a/source/patterns/@aws-solutions-constructs/aws-s3-sns/test/integ.s3sns-newTopicFromProps.js.snapshot/s3sns-newTopicFromProps.template.json b/source/patterns/@aws-solutions-constructs/aws-s3-sns/test/integ.s3sns-newTopicFromProps.js.snapshot/s3sns-newTopicFromProps.template.json index 3da06cdcc..b7ad1d414 100644 --- a/source/patterns/@aws-solutions-constructs/aws-s3-sns/test/integ.s3sns-newTopicFromProps.js.snapshot/s3sns-newTopicFromProps.template.json +++ b/source/patterns/@aws-solutions-constructs/aws-s3-sns/test/integ.s3sns-newTopicFromProps.js.snapshot/s3sns-newTopicFromProps.template.json @@ -360,7 +360,8 @@ } ] }, - "Managed": true + "Managed": true, + "SkipDestinationValidation": false }, "DependsOn": [ "tests3snsS3BucketPolicyA51165A8", @@ -683,7 +684,7 @@ "Properties": { "Description": "AWS CloudFormation handler for \"Custom::S3BucketNotifications\" resources (@aws-cdk/aws-s3)", "Code": { - "ZipFile": "import boto3 # type: ignore\nimport json\nimport logging\nimport urllib.request\n\ns3 = boto3.client(\"s3\")\n\nEVENTBRIDGE_CONFIGURATION = 'EventBridgeConfiguration'\nCONFIGURATION_TYPES = [\"TopicConfigurations\", \"QueueConfigurations\", \"LambdaFunctionConfigurations\"]\n\ndef handler(event: dict, context):\n response_status = \"SUCCESS\"\n error_message = \"\"\n try:\n props = event[\"ResourceProperties\"]\n notification_configuration = props[\"NotificationConfiguration\"]\n managed = props.get('Managed', 'true').lower() == 'true'\n stack_id = event['StackId']\n old = event.get(\"OldResourceProperties\", {}).get(\"NotificationConfiguration\", {})\n if managed:\n config = handle_managed(event[\"RequestType\"], notification_configuration)\n else:\n config = handle_unmanaged(props[\"BucketName\"], stack_id, event[\"RequestType\"], notification_configuration, old)\n s3.put_bucket_notification_configuration(Bucket=props[\"BucketName\"], NotificationConfiguration=config)\n except Exception as e:\n logging.exception(\"Failed to put bucket notification configuration\")\n response_status = \"FAILED\"\n error_message = f\"Error: {str(e)}. \"\n finally:\n submit_response(event, context, response_status, error_message)\n\ndef handle_managed(request_type, notification_configuration):\n if request_type == 'Delete':\n return {}\n return notification_configuration\n\ndef handle_unmanaged(bucket, stack_id, request_type, notification_configuration, old):\n def get_id(n):\n n['Id'] = ''\n strToHash=json.dumps(n, sort_keys=True).replace('\"Name\": \"prefix\"', '\"Name\": \"Prefix\"').replace('\"Name\": \"suffix\"', '\"Name\": \"Suffix\"')\n return f\"{stack_id}-{hash(strToHash)}\"\n def with_id(n):\n n['Id'] = get_id(n)\n return n\n\n external_notifications = {}\n existing_notifications = s3.get_bucket_notification_configuration(Bucket=bucket)\n for t in CONFIGURATION_TYPES:\n if request_type == 'Update':\n old_incoming_ids = [get_id(n) for n in old.get(t, [])]\n external_notifications[t] = [n for n in existing_notifications.get(t, []) if not get_id(n) in old_incoming_ids] \n elif request_type == 'Delete':\n external_notifications[t] = [n for n in existing_notifications.get(t, []) if not n['Id'].startswith(f\"{stack_id}-\")]\n elif request_type == 'Create':\n external_notifications[t] = [n for n in existing_notifications.get(t, [])]\n if EVENTBRIDGE_CONFIGURATION in existing_notifications:\n external_notifications[EVENTBRIDGE_CONFIGURATION] = existing_notifications[EVENTBRIDGE_CONFIGURATION]\n\n if request_type == 'Delete':\n return external_notifications\n\n notifications = {}\n for t in CONFIGURATION_TYPES:\n external = external_notifications.get(t, [])\n incoming = [with_id(n) for n in notification_configuration.get(t, [])]\n notifications[t] = external + incoming\n\n if EVENTBRIDGE_CONFIGURATION in notification_configuration:\n notifications[EVENTBRIDGE_CONFIGURATION] = notification_configuration[EVENTBRIDGE_CONFIGURATION]\n elif EVENTBRIDGE_CONFIGURATION in external_notifications:\n notifications[EVENTBRIDGE_CONFIGURATION] = external_notifications[EVENTBRIDGE_CONFIGURATION]\n\n return notifications\n\ndef submit_response(event: dict, context, response_status: str, error_message: str):\n response_body = json.dumps(\n {\n \"Status\": response_status,\n \"Reason\": f\"{error_message}See the details in CloudWatch Log Stream: {context.log_stream_name}\",\n \"PhysicalResourceId\": event.get(\"PhysicalResourceId\") or event[\"LogicalResourceId\"],\n \"StackId\": event[\"StackId\"],\n \"RequestId\": event[\"RequestId\"],\n \"LogicalResourceId\": event[\"LogicalResourceId\"],\n \"NoEcho\": False,\n }\n ).encode(\"utf-8\")\n headers = {\"content-type\": \"\", \"content-length\": str(len(response_body))}\n try:\n req = urllib.request.Request(url=event[\"ResponseURL\"], headers=headers, data=response_body, method=\"PUT\")\n with urllib.request.urlopen(req) as response:\n print(response.read().decode(\"utf-8\"))\n print(\"Status code: \" + response.reason)\n except Exception as e:\n print(\"send(..) failed executing request.urlopen(..): \" + str(e))" + "ZipFile": "import boto3 # type: ignore\nimport json\nimport logging\nimport urllib.request\n\ns3 = boto3.client(\"s3\")\n\nEVENTBRIDGE_CONFIGURATION = 'EventBridgeConfiguration'\nCONFIGURATION_TYPES = [\"TopicConfigurations\", \"QueueConfigurations\", \"LambdaFunctionConfigurations\"]\n\ndef handler(event: dict, context):\n response_status = \"SUCCESS\"\n error_message = \"\"\n try:\n props = event[\"ResourceProperties\"]\n notification_configuration = props[\"NotificationConfiguration\"]\n managed = props.get('Managed', 'true').lower() == 'true'\n skipDestinationValidation = props.get('SkipDestinationValidation', 'false').lower() == 'true'\n stack_id = event['StackId']\n old = event.get(\"OldResourceProperties\", {}).get(\"NotificationConfiguration\", {})\n if managed:\n config = handle_managed(event[\"RequestType\"], notification_configuration)\n else:\n config = handle_unmanaged(props[\"BucketName\"], stack_id, event[\"RequestType\"], notification_configuration, old)\n s3.put_bucket_notification_configuration(Bucket=props[\"BucketName\"], NotificationConfiguration=config, SkipDestinationValidation=skipDestinationValidation)\n except Exception as e:\n logging.exception(\"Failed to put bucket notification configuration\")\n response_status = \"FAILED\"\n error_message = f\"Error: {str(e)}. \"\n finally:\n submit_response(event, context, response_status, error_message)\n\ndef handle_managed(request_type, notification_configuration):\n if request_type == 'Delete':\n return {}\n return notification_configuration\n\ndef handle_unmanaged(bucket, stack_id, request_type, notification_configuration, old):\n def get_id(n):\n n['Id'] = ''\n strToHash=json.dumps(n, sort_keys=True).replace('\"Name\": \"prefix\"', '\"Name\": \"Prefix\"').replace('\"Name\": \"suffix\"', '\"Name\": \"Suffix\"')\n return f\"{stack_id}-{hash(strToHash)}\"\n def with_id(n):\n n['Id'] = get_id(n)\n return n\n\n external_notifications = {}\n existing_notifications = s3.get_bucket_notification_configuration(Bucket=bucket)\n for t in CONFIGURATION_TYPES:\n if request_type == 'Update':\n old_incoming_ids = [get_id(n) for n in old.get(t, [])]\n external_notifications[t] = [n for n in existing_notifications.get(t, []) if not get_id(n) in old_incoming_ids] \n elif request_type == 'Delete':\n external_notifications[t] = [n for n in existing_notifications.get(t, []) if not n['Id'].startswith(f\"{stack_id}-\")]\n elif request_type == 'Create':\n external_notifications[t] = [n for n in existing_notifications.get(t, [])]\n if EVENTBRIDGE_CONFIGURATION in existing_notifications:\n external_notifications[EVENTBRIDGE_CONFIGURATION] = existing_notifications[EVENTBRIDGE_CONFIGURATION]\n\n if request_type == 'Delete':\n return external_notifications\n\n notifications = {}\n for t in CONFIGURATION_TYPES:\n external = external_notifications.get(t, [])\n incoming = [with_id(n) for n in notification_configuration.get(t, [])]\n notifications[t] = external + incoming\n\n if EVENTBRIDGE_CONFIGURATION in notification_configuration:\n notifications[EVENTBRIDGE_CONFIGURATION] = notification_configuration[EVENTBRIDGE_CONFIGURATION]\n elif EVENTBRIDGE_CONFIGURATION in external_notifications:\n notifications[EVENTBRIDGE_CONFIGURATION] = external_notifications[EVENTBRIDGE_CONFIGURATION]\n\n return notifications\n\ndef submit_response(event: dict, context, response_status: str, error_message: str):\n response_body = json.dumps(\n {\n \"Status\": response_status,\n \"Reason\": f\"{error_message}See the details in CloudWatch Log Stream: {context.log_stream_name}\",\n \"PhysicalResourceId\": event.get(\"PhysicalResourceId\") or event[\"LogicalResourceId\"],\n \"StackId\": event[\"StackId\"],\n \"RequestId\": event[\"RequestId\"],\n \"LogicalResourceId\": event[\"LogicalResourceId\"],\n \"NoEcho\": False,\n }\n ).encode(\"utf-8\")\n headers = {\"content-type\": \"\", \"content-length\": str(len(response_body))}\n try:\n req = urllib.request.Request(url=event[\"ResponseURL\"], headers=headers, data=response_body, method=\"PUT\")\n with urllib.request.urlopen(req) as response:\n print(response.read().decode(\"utf-8\"))\n print(\"Status code: \" + response.reason)\n except Exception as e:\n print(\"send(..) failed executing request.urlopen(..): \" + str(e))" }, "Handler": "index.handler", "Role": { diff --git a/source/patterns/@aws-solutions-constructs/aws-s3-sns/test/integ.s3sns-newTopicFromProps.js.snapshot/s3snsnewTopicFromPropsIntegDefaultTestDeployAssert834567BB.assets.json b/source/patterns/@aws-solutions-constructs/aws-s3-sns/test/integ.s3sns-newTopicFromProps.js.snapshot/s3snsnewTopicFromPropsIntegDefaultTestDeployAssert834567BB.assets.json index c12241b00..67dc261c1 100644 --- a/source/patterns/@aws-solutions-constructs/aws-s3-sns/test/integ.s3sns-newTopicFromProps.js.snapshot/s3snsnewTopicFromPropsIntegDefaultTestDeployAssert834567BB.assets.json +++ b/source/patterns/@aws-solutions-constructs/aws-s3-sns/test/integ.s3sns-newTopicFromProps.js.snapshot/s3snsnewTopicFromPropsIntegDefaultTestDeployAssert834567BB.assets.json @@ -1,5 +1,5 @@ { - "version": "36.0.0", + "version": "36.0.18", "files": { "21fbb51d7b23f6a6c262b46a9caee79d744a3ac019fd45422d988b96d44b2a22": { "source": { diff --git a/source/patterns/@aws-solutions-constructs/aws-s3-sns/test/integ.s3sns-newTopicFromProps.js.snapshot/tree.json b/source/patterns/@aws-solutions-constructs/aws-s3-sns/test/integ.s3sns-newTopicFromProps.js.snapshot/tree.json index 6825f2601..6033f9e75 100644 --- a/source/patterns/@aws-solutions-constructs/aws-s3-sns/test/integ.s3sns-newTopicFromProps.js.snapshot/tree.json +++ b/source/patterns/@aws-solutions-constructs/aws-s3-sns/test/integ.s3sns-newTopicFromProps.js.snapshot/tree.json @@ -50,7 +50,7 @@ }, "constructInfo": { "fqn": "aws-cdk-lib.aws_s3.CfnBucket", - "version": "2.149.0" + "version": "2.154.1" } }, "Policy": { @@ -184,13 +184,13 @@ }, "constructInfo": { "fqn": "aws-cdk-lib.aws_s3.CfnBucketPolicy", - "version": "2.149.0" + "version": "2.154.1" } } }, "constructInfo": { "fqn": "aws-cdk-lib.aws_s3.BucketPolicy", - "version": "2.149.0" + "version": "2.154.1" } }, "AutoDeleteObjectsCustomResource": { @@ -202,19 +202,19 @@ "path": "s3sns-newTopicFromProps/test-s3-sns/S3LoggingBucket/AutoDeleteObjectsCustomResource/Default", "constructInfo": { "fqn": "aws-cdk-lib.CfnResource", - "version": "2.149.0" + "version": "2.154.1" } } }, "constructInfo": { "fqn": "aws-cdk-lib.CustomResource", - "version": "2.149.0" + "version": "2.154.1" } } }, "constructInfo": { "fqn": "aws-cdk-lib.aws_s3.Bucket", - "version": "2.149.0" + "version": "2.154.1" } }, "S3Bucket": { @@ -273,7 +273,7 @@ }, "constructInfo": { "fqn": "aws-cdk-lib.aws_s3.CfnBucket", - "version": "2.149.0" + "version": "2.154.1" } }, "Policy": { @@ -371,13 +371,13 @@ }, "constructInfo": { "fqn": "aws-cdk-lib.aws_s3.CfnBucketPolicy", - "version": "2.149.0" + "version": "2.154.1" } } }, "constructInfo": { "fqn": "aws-cdk-lib.aws_s3.BucketPolicy", - "version": "2.149.0" + "version": "2.154.1" } }, "AutoDeleteObjectsCustomResource": { @@ -389,13 +389,13 @@ "path": "s3sns-newTopicFromProps/test-s3-sns/S3Bucket/AutoDeleteObjectsCustomResource/Default", "constructInfo": { "fqn": "aws-cdk-lib.CfnResource", - "version": "2.149.0" + "version": "2.154.1" } } }, "constructInfo": { "fqn": "aws-cdk-lib.CustomResource", - "version": "2.149.0" + "version": "2.154.1" } }, "Notifications": { @@ -407,7 +407,7 @@ "path": "s3sns-newTopicFromProps/test-s3-sns/S3Bucket/Notifications/Resource", "constructInfo": { "fqn": "aws-cdk-lib.CfnResource", - "version": "2.149.0" + "version": "2.154.1" } } }, @@ -419,7 +419,7 @@ }, "constructInfo": { "fqn": "aws-cdk-lib.aws_s3.Bucket", - "version": "2.149.0" + "version": "2.154.1" } }, "'test-s3-snsKey'": { @@ -476,13 +476,13 @@ }, "constructInfo": { "fqn": "aws-cdk-lib.aws_kms.CfnKey", - "version": "2.149.0" + "version": "2.154.1" } } }, "constructInfo": { "fqn": "aws-cdk-lib.aws_kms.Key", - "version": "2.149.0" + "version": "2.154.1" } }, "SnsTopic": { @@ -506,7 +506,7 @@ }, "constructInfo": { "fqn": "aws-cdk-lib.aws_sns.CfnTopic", - "version": "2.149.0" + "version": "2.154.1" } }, "Policy": { @@ -623,25 +623,25 @@ }, "constructInfo": { "fqn": "aws-cdk-lib.aws_sns.CfnTopicPolicy", - "version": "2.149.0" + "version": "2.154.1" } } }, "constructInfo": { "fqn": "aws-cdk-lib.aws_sns.TopicPolicy", - "version": "2.149.0" + "version": "2.154.1" } } }, "constructInfo": { "fqn": "aws-cdk-lib.aws_sns.Topic", - "version": "2.149.0" + "version": "2.154.1" } } }, "constructInfo": { "fqn": "@aws-solutions-constructs/aws-s3-sns.S3ToSns", - "version": "2.62.0" + "version": "2.67.1" } }, "LatestNodeRuntimeMap": { @@ -649,7 +649,7 @@ "path": "s3sns-newTopicFromProps/LatestNodeRuntimeMap", "constructInfo": { "fqn": "aws-cdk-lib.CfnMapping", - "version": "2.149.0" + "version": "2.154.1" } }, "Custom::S3AutoDeleteObjectsCustomResourceProvider": { @@ -661,7 +661,7 @@ "path": "s3sns-newTopicFromProps/Custom::S3AutoDeleteObjectsCustomResourceProvider/Staging", "constructInfo": { "fqn": "aws-cdk-lib.AssetStaging", - "version": "2.149.0" + "version": "2.154.1" } }, "Role": { @@ -669,7 +669,7 @@ "path": "s3sns-newTopicFromProps/Custom::S3AutoDeleteObjectsCustomResourceProvider/Role", "constructInfo": { "fqn": "aws-cdk-lib.CfnResource", - "version": "2.149.0" + "version": "2.154.1" } }, "Handler": { @@ -677,13 +677,13 @@ "path": "s3sns-newTopicFromProps/Custom::S3AutoDeleteObjectsCustomResourceProvider/Handler", "constructInfo": { "fqn": "aws-cdk-lib.CfnResource", - "version": "2.149.0" + "version": "2.154.1" } } }, "constructInfo": { "fqn": "aws-cdk-lib.CustomResourceProviderBase", - "version": "2.149.0" + "version": "2.154.1" } }, "BucketNotificationsHandler050a0587b7544547bf325f094a3db834": { @@ -699,7 +699,7 @@ "path": "s3sns-newTopicFromProps/BucketNotificationsHandler050a0587b7544547bf325f094a3db834/Role/ImportRole", "constructInfo": { "fqn": "aws-cdk-lib.Resource", - "version": "2.149.0" + "version": "2.154.1" } }, "Resource": { @@ -738,7 +738,7 @@ }, "constructInfo": { "fqn": "aws-cdk-lib.aws_iam.CfnRole", - "version": "2.149.0" + "version": "2.154.1" } }, "DefaultPolicy": { @@ -771,19 +771,19 @@ }, "constructInfo": { "fqn": "aws-cdk-lib.aws_iam.CfnPolicy", - "version": "2.149.0" + "version": "2.154.1" } } }, "constructInfo": { "fqn": "aws-cdk-lib.aws_iam.Policy", - "version": "2.149.0" + "version": "2.154.1" } } }, "constructInfo": { "fqn": "aws-cdk-lib.aws_iam.Role", - "version": "2.149.0" + "version": "2.154.1" } }, "Resource": { @@ -791,7 +791,7 @@ "path": "s3sns-newTopicFromProps/BucketNotificationsHandler050a0587b7544547bf325f094a3db834/Resource", "constructInfo": { "fqn": "aws-cdk-lib.CfnResource", - "version": "2.149.0" + "version": "2.154.1" } } }, @@ -825,7 +825,7 @@ "path": "s3sns-newTopicFromProps/Integ/DefaultTest/DeployAssert/BootstrapVersion", "constructInfo": { "fqn": "aws-cdk-lib.CfnParameter", - "version": "2.149.0" + "version": "2.154.1" } }, "CheckBootstrapVersion": { @@ -833,25 +833,25 @@ "path": "s3sns-newTopicFromProps/Integ/DefaultTest/DeployAssert/CheckBootstrapVersion", "constructInfo": { "fqn": "aws-cdk-lib.CfnRule", - "version": "2.149.0" + "version": "2.154.1" } } }, "constructInfo": { "fqn": "aws-cdk-lib.Stack", - "version": "2.149.0" + "version": "2.154.1" } } }, "constructInfo": { "fqn": "@aws-cdk/integ-tests-alpha.IntegTestCase", - "version": "2.149.0-alpha.0" + "version": "2.154.1-alpha.0" } } }, "constructInfo": { "fqn": "@aws-cdk/integ-tests-alpha.IntegTest", - "version": "2.149.0-alpha.0" + "version": "2.154.1-alpha.0" } }, "BootstrapVersion": { @@ -859,7 +859,7 @@ "path": "s3sns-newTopicFromProps/BootstrapVersion", "constructInfo": { "fqn": "aws-cdk-lib.CfnParameter", - "version": "2.149.0" + "version": "2.154.1" } }, "CheckBootstrapVersion": { @@ -867,13 +867,13 @@ "path": "s3sns-newTopicFromProps/CheckBootstrapVersion", "constructInfo": { "fqn": "aws-cdk-lib.CfnRule", - "version": "2.149.0" + "version": "2.154.1" } } }, "constructInfo": { "fqn": "aws-cdk-lib.Stack", - "version": "2.149.0" + "version": "2.154.1" } }, "Tree": { @@ -887,7 +887,7 @@ }, "constructInfo": { "fqn": "aws-cdk-lib.App", - "version": "2.149.0" + "version": "2.154.1" } } } \ No newline at end of file diff --git a/source/patterns/@aws-solutions-constructs/aws-s3-sns/test/integ.s3sns-noArguments.js.snapshot/cdk.out b/source/patterns/@aws-solutions-constructs/aws-s3-sns/test/integ.s3sns-noArguments.js.snapshot/cdk.out index 1f0068d32..0d15a78da 100644 --- a/source/patterns/@aws-solutions-constructs/aws-s3-sns/test/integ.s3sns-noArguments.js.snapshot/cdk.out +++ b/source/patterns/@aws-solutions-constructs/aws-s3-sns/test/integ.s3sns-noArguments.js.snapshot/cdk.out @@ -1 +1 @@ -{"version":"36.0.0"} \ No newline at end of file +{"version":"36.0.18"} \ No newline at end of file diff --git a/source/patterns/@aws-solutions-constructs/aws-s3-sns/test/integ.s3sns-noArguments.js.snapshot/integ.json b/source/patterns/@aws-solutions-constructs/aws-s3-sns/test/integ.s3sns-noArguments.js.snapshot/integ.json index 80976fa78..01ffea655 100644 --- a/source/patterns/@aws-solutions-constructs/aws-s3-sns/test/integ.s3sns-noArguments.js.snapshot/integ.json +++ b/source/patterns/@aws-solutions-constructs/aws-s3-sns/test/integ.s3sns-noArguments.js.snapshot/integ.json @@ -1,5 +1,5 @@ { - "version": "36.0.0", + "version": "36.0.18", "testCases": { "s3sns-noArguments/Integ/DefaultTest": { "stacks": [ diff --git a/source/patterns/@aws-solutions-constructs/aws-s3-sns/test/integ.s3sns-noArguments.js.snapshot/manifest.json b/source/patterns/@aws-solutions-constructs/aws-s3-sns/test/integ.s3sns-noArguments.js.snapshot/manifest.json index 51c9a039d..5fd69199f 100644 --- a/source/patterns/@aws-solutions-constructs/aws-s3-sns/test/integ.s3sns-noArguments.js.snapshot/manifest.json +++ b/source/patterns/@aws-solutions-constructs/aws-s3-sns/test/integ.s3sns-noArguments.js.snapshot/manifest.json @@ -1,5 +1,5 @@ { - "version": "36.0.0", + "version": "36.0.5", "artifacts": { "s3snsnoArgumentsIntegDefaultTestDeployAssert313DD81E.assets": { "type": "cdk:asset-manifest", @@ -66,7 +66,7 @@ "validateOnSynth": false, "assumeRoleArn": "arn:${AWS::Partition}:iam::${AWS::AccountId}:role/cdk-hnb659fds-deploy-role-${AWS::AccountId}-${AWS::Region}", "cloudFormationExecutionRoleArn": "arn:${AWS::Partition}:iam::${AWS::AccountId}:role/cdk-hnb659fds-cfn-exec-role-${AWS::AccountId}-${AWS::Region}", - "stackTemplateAssetObjectUrl": "s3://cdk-hnb659fds-assets-${AWS::AccountId}-${AWS::Region}/cfb3be646671e8fe4a5b9af86568d634b818cda7af93c4d3df4a13c4dfd35613.json", + "stackTemplateAssetObjectUrl": "s3://cdk-hnb659fds-assets-${AWS::AccountId}-${AWS::Region}/2cad37cb25452b26fd2ff244b6c7a3ded255c3e815edc8fc3af0019aa3629aa2.json", "requiresBootstrapStackVersion": 6, "bootstrapStackVersionSsmParameter": "/cdk-bootstrap/hnb659fds/version", "additionalDependencies": [ @@ -148,6 +148,12 @@ "data": "LatestNodeRuntimeMap" } ], + "/s3sns-noArguments/Custom::S3AutoDeleteObjectsCustomResourceProvider": [ + { + "type": "aws:cdk:is-custom-resource-handler-customResourceProvider", + "data": true + } + ], "/s3sns-noArguments/Custom::S3AutoDeleteObjectsCustomResourceProvider/Role": [ { "type": "aws:cdk:logicalId", diff --git a/source/patterns/@aws-solutions-constructs/aws-s3-sns/test/integ.s3sns-noArguments.js.snapshot/s3sns-noArguments.assets.json b/source/patterns/@aws-solutions-constructs/aws-s3-sns/test/integ.s3sns-noArguments.js.snapshot/s3sns-noArguments.assets.json index 93a6295bc..4625fdb3a 100644 --- a/source/patterns/@aws-solutions-constructs/aws-s3-sns/test/integ.s3sns-noArguments.js.snapshot/s3sns-noArguments.assets.json +++ b/source/patterns/@aws-solutions-constructs/aws-s3-sns/test/integ.s3sns-noArguments.js.snapshot/s3sns-noArguments.assets.json @@ -1,5 +1,5 @@ { - "version": "36.0.0", + "version": "36.0.18", "files": { "faa95a81ae7d7373f3e1f242268f904eb748d8d0fdd306e8a6fe515a1905a7d6": { "source": { @@ -14,7 +14,7 @@ } } }, - "cfb3be646671e8fe4a5b9af86568d634b818cda7af93c4d3df4a13c4dfd35613": { + "2cad37cb25452b26fd2ff244b6c7a3ded255c3e815edc8fc3af0019aa3629aa2": { "source": { "path": "s3sns-noArguments.template.json", "packaging": "file" @@ -22,7 +22,7 @@ "destinations": { "current_account-current_region": { "bucketName": "cdk-hnb659fds-assets-${AWS::AccountId}-${AWS::Region}", - "objectKey": "cfb3be646671e8fe4a5b9af86568d634b818cda7af93c4d3df4a13c4dfd35613.json", + "objectKey": "2cad37cb25452b26fd2ff244b6c7a3ded255c3e815edc8fc3af0019aa3629aa2.json", "assumeRoleArn": "arn:${AWS::Partition}:iam::${AWS::AccountId}:role/cdk-hnb659fds-file-publishing-role-${AWS::AccountId}-${AWS::Region}" } } diff --git a/source/patterns/@aws-solutions-constructs/aws-s3-sns/test/integ.s3sns-noArguments.js.snapshot/s3sns-noArguments.template.json b/source/patterns/@aws-solutions-constructs/aws-s3-sns/test/integ.s3sns-noArguments.js.snapshot/s3sns-noArguments.template.json index a3eb644c1..38ea7506b 100644 --- a/source/patterns/@aws-solutions-constructs/aws-s3-sns/test/integ.s3sns-noArguments.js.snapshot/s3sns-noArguments.template.json +++ b/source/patterns/@aws-solutions-constructs/aws-s3-sns/test/integ.s3sns-noArguments.js.snapshot/s3sns-noArguments.template.json @@ -360,7 +360,8 @@ } ] }, - "Managed": true + "Managed": true, + "SkipDestinationValidation": false }, "DependsOn": [ "tests3snsS3BucketPolicyA51165A8", @@ -682,7 +683,7 @@ "Properties": { "Description": "AWS CloudFormation handler for \"Custom::S3BucketNotifications\" resources (@aws-cdk/aws-s3)", "Code": { - "ZipFile": "import boto3 # type: ignore\nimport json\nimport logging\nimport urllib.request\n\ns3 = boto3.client(\"s3\")\n\nEVENTBRIDGE_CONFIGURATION = 'EventBridgeConfiguration'\nCONFIGURATION_TYPES = [\"TopicConfigurations\", \"QueueConfigurations\", \"LambdaFunctionConfigurations\"]\n\ndef handler(event: dict, context):\n response_status = \"SUCCESS\"\n error_message = \"\"\n try:\n props = event[\"ResourceProperties\"]\n notification_configuration = props[\"NotificationConfiguration\"]\n managed = props.get('Managed', 'true').lower() == 'true'\n stack_id = event['StackId']\n old = event.get(\"OldResourceProperties\", {}).get(\"NotificationConfiguration\", {})\n if managed:\n config = handle_managed(event[\"RequestType\"], notification_configuration)\n else:\n config = handle_unmanaged(props[\"BucketName\"], stack_id, event[\"RequestType\"], notification_configuration, old)\n s3.put_bucket_notification_configuration(Bucket=props[\"BucketName\"], NotificationConfiguration=config)\n except Exception as e:\n logging.exception(\"Failed to put bucket notification configuration\")\n response_status = \"FAILED\"\n error_message = f\"Error: {str(e)}. \"\n finally:\n submit_response(event, context, response_status, error_message)\n\ndef handle_managed(request_type, notification_configuration):\n if request_type == 'Delete':\n return {}\n return notification_configuration\n\ndef handle_unmanaged(bucket, stack_id, request_type, notification_configuration, old):\n def get_id(n):\n n['Id'] = ''\n strToHash=json.dumps(n, sort_keys=True).replace('\"Name\": \"prefix\"', '\"Name\": \"Prefix\"').replace('\"Name\": \"suffix\"', '\"Name\": \"Suffix\"')\n return f\"{stack_id}-{hash(strToHash)}\"\n def with_id(n):\n n['Id'] = get_id(n)\n return n\n\n external_notifications = {}\n existing_notifications = s3.get_bucket_notification_configuration(Bucket=bucket)\n for t in CONFIGURATION_TYPES:\n if request_type == 'Update':\n old_incoming_ids = [get_id(n) for n in old.get(t, [])]\n external_notifications[t] = [n for n in existing_notifications.get(t, []) if not get_id(n) in old_incoming_ids] \n elif request_type == 'Delete':\n external_notifications[t] = [n for n in existing_notifications.get(t, []) if not n['Id'].startswith(f\"{stack_id}-\")]\n elif request_type == 'Create':\n external_notifications[t] = [n for n in existing_notifications.get(t, [])]\n if EVENTBRIDGE_CONFIGURATION in existing_notifications:\n external_notifications[EVENTBRIDGE_CONFIGURATION] = existing_notifications[EVENTBRIDGE_CONFIGURATION]\n\n if request_type == 'Delete':\n return external_notifications\n\n notifications = {}\n for t in CONFIGURATION_TYPES:\n external = external_notifications.get(t, [])\n incoming = [with_id(n) for n in notification_configuration.get(t, [])]\n notifications[t] = external + incoming\n\n if EVENTBRIDGE_CONFIGURATION in notification_configuration:\n notifications[EVENTBRIDGE_CONFIGURATION] = notification_configuration[EVENTBRIDGE_CONFIGURATION]\n elif EVENTBRIDGE_CONFIGURATION in external_notifications:\n notifications[EVENTBRIDGE_CONFIGURATION] = external_notifications[EVENTBRIDGE_CONFIGURATION]\n\n return notifications\n\ndef submit_response(event: dict, context, response_status: str, error_message: str):\n response_body = json.dumps(\n {\n \"Status\": response_status,\n \"Reason\": f\"{error_message}See the details in CloudWatch Log Stream: {context.log_stream_name}\",\n \"PhysicalResourceId\": event.get(\"PhysicalResourceId\") or event[\"LogicalResourceId\"],\n \"StackId\": event[\"StackId\"],\n \"RequestId\": event[\"RequestId\"],\n \"LogicalResourceId\": event[\"LogicalResourceId\"],\n \"NoEcho\": False,\n }\n ).encode(\"utf-8\")\n headers = {\"content-type\": \"\", \"content-length\": str(len(response_body))}\n try:\n req = urllib.request.Request(url=event[\"ResponseURL\"], headers=headers, data=response_body, method=\"PUT\")\n with urllib.request.urlopen(req) as response:\n print(response.read().decode(\"utf-8\"))\n print(\"Status code: \" + response.reason)\n except Exception as e:\n print(\"send(..) failed executing request.urlopen(..): \" + str(e))" + "ZipFile": "import boto3 # type: ignore\nimport json\nimport logging\nimport urllib.request\n\ns3 = boto3.client(\"s3\")\n\nEVENTBRIDGE_CONFIGURATION = 'EventBridgeConfiguration'\nCONFIGURATION_TYPES = [\"TopicConfigurations\", \"QueueConfigurations\", \"LambdaFunctionConfigurations\"]\n\ndef handler(event: dict, context):\n response_status = \"SUCCESS\"\n error_message = \"\"\n try:\n props = event[\"ResourceProperties\"]\n notification_configuration = props[\"NotificationConfiguration\"]\n managed = props.get('Managed', 'true').lower() == 'true'\n skipDestinationValidation = props.get('SkipDestinationValidation', 'false').lower() == 'true'\n stack_id = event['StackId']\n old = event.get(\"OldResourceProperties\", {}).get(\"NotificationConfiguration\", {})\n if managed:\n config = handle_managed(event[\"RequestType\"], notification_configuration)\n else:\n config = handle_unmanaged(props[\"BucketName\"], stack_id, event[\"RequestType\"], notification_configuration, old)\n s3.put_bucket_notification_configuration(Bucket=props[\"BucketName\"], NotificationConfiguration=config, SkipDestinationValidation=skipDestinationValidation)\n except Exception as e:\n logging.exception(\"Failed to put bucket notification configuration\")\n response_status = \"FAILED\"\n error_message = f\"Error: {str(e)}. \"\n finally:\n submit_response(event, context, response_status, error_message)\n\ndef handle_managed(request_type, notification_configuration):\n if request_type == 'Delete':\n return {}\n return notification_configuration\n\ndef handle_unmanaged(bucket, stack_id, request_type, notification_configuration, old):\n def get_id(n):\n n['Id'] = ''\n strToHash=json.dumps(n, sort_keys=True).replace('\"Name\": \"prefix\"', '\"Name\": \"Prefix\"').replace('\"Name\": \"suffix\"', '\"Name\": \"Suffix\"')\n return f\"{stack_id}-{hash(strToHash)}\"\n def with_id(n):\n n['Id'] = get_id(n)\n return n\n\n external_notifications = {}\n existing_notifications = s3.get_bucket_notification_configuration(Bucket=bucket)\n for t in CONFIGURATION_TYPES:\n if request_type == 'Update':\n old_incoming_ids = [get_id(n) for n in old.get(t, [])]\n external_notifications[t] = [n for n in existing_notifications.get(t, []) if not get_id(n) in old_incoming_ids] \n elif request_type == 'Delete':\n external_notifications[t] = [n for n in existing_notifications.get(t, []) if not n['Id'].startswith(f\"{stack_id}-\")]\n elif request_type == 'Create':\n external_notifications[t] = [n for n in existing_notifications.get(t, [])]\n if EVENTBRIDGE_CONFIGURATION in existing_notifications:\n external_notifications[EVENTBRIDGE_CONFIGURATION] = existing_notifications[EVENTBRIDGE_CONFIGURATION]\n\n if request_type == 'Delete':\n return external_notifications\n\n notifications = {}\n for t in CONFIGURATION_TYPES:\n external = external_notifications.get(t, [])\n incoming = [with_id(n) for n in notification_configuration.get(t, [])]\n notifications[t] = external + incoming\n\n if EVENTBRIDGE_CONFIGURATION in notification_configuration:\n notifications[EVENTBRIDGE_CONFIGURATION] = notification_configuration[EVENTBRIDGE_CONFIGURATION]\n elif EVENTBRIDGE_CONFIGURATION in external_notifications:\n notifications[EVENTBRIDGE_CONFIGURATION] = external_notifications[EVENTBRIDGE_CONFIGURATION]\n\n return notifications\n\ndef submit_response(event: dict, context, response_status: str, error_message: str):\n response_body = json.dumps(\n {\n \"Status\": response_status,\n \"Reason\": f\"{error_message}See the details in CloudWatch Log Stream: {context.log_stream_name}\",\n \"PhysicalResourceId\": event.get(\"PhysicalResourceId\") or event[\"LogicalResourceId\"],\n \"StackId\": event[\"StackId\"],\n \"RequestId\": event[\"RequestId\"],\n \"LogicalResourceId\": event[\"LogicalResourceId\"],\n \"NoEcho\": False,\n }\n ).encode(\"utf-8\")\n headers = {\"content-type\": \"\", \"content-length\": str(len(response_body))}\n try:\n req = urllib.request.Request(url=event[\"ResponseURL\"], headers=headers, data=response_body, method=\"PUT\")\n with urllib.request.urlopen(req) as response:\n print(response.read().decode(\"utf-8\"))\n print(\"Status code: \" + response.reason)\n except Exception as e:\n print(\"send(..) failed executing request.urlopen(..): \" + str(e))" }, "Handler": "index.handler", "Role": { diff --git a/source/patterns/@aws-solutions-constructs/aws-s3-sns/test/integ.s3sns-noArguments.js.snapshot/s3snsnoArgumentsIntegDefaultTestDeployAssert313DD81E.assets.json b/source/patterns/@aws-solutions-constructs/aws-s3-sns/test/integ.s3sns-noArguments.js.snapshot/s3snsnoArgumentsIntegDefaultTestDeployAssert313DD81E.assets.json index b8cf7d963..e8f997b84 100644 --- a/source/patterns/@aws-solutions-constructs/aws-s3-sns/test/integ.s3sns-noArguments.js.snapshot/s3snsnoArgumentsIntegDefaultTestDeployAssert313DD81E.assets.json +++ b/source/patterns/@aws-solutions-constructs/aws-s3-sns/test/integ.s3sns-noArguments.js.snapshot/s3snsnoArgumentsIntegDefaultTestDeployAssert313DD81E.assets.json @@ -1,5 +1,5 @@ { - "version": "36.0.0", + "version": "36.0.18", "files": { "21fbb51d7b23f6a6c262b46a9caee79d744a3ac019fd45422d988b96d44b2a22": { "source": { diff --git a/source/patterns/@aws-solutions-constructs/aws-s3-sns/test/integ.s3sns-noArguments.js.snapshot/tree.json b/source/patterns/@aws-solutions-constructs/aws-s3-sns/test/integ.s3sns-noArguments.js.snapshot/tree.json index 1c6622974..e7edbbd91 100644 --- a/source/patterns/@aws-solutions-constructs/aws-s3-sns/test/integ.s3sns-noArguments.js.snapshot/tree.json +++ b/source/patterns/@aws-solutions-constructs/aws-s3-sns/test/integ.s3sns-noArguments.js.snapshot/tree.json @@ -50,7 +50,7 @@ }, "constructInfo": { "fqn": "aws-cdk-lib.aws_s3.CfnBucket", - "version": "2.149.0" + "version": "2.154.1" } }, "Policy": { @@ -184,13 +184,13 @@ }, "constructInfo": { "fqn": "aws-cdk-lib.aws_s3.CfnBucketPolicy", - "version": "2.149.0" + "version": "2.154.1" } } }, "constructInfo": { "fqn": "aws-cdk-lib.aws_s3.BucketPolicy", - "version": "2.149.0" + "version": "2.154.1" } }, "AutoDeleteObjectsCustomResource": { @@ -202,19 +202,19 @@ "path": "s3sns-noArguments/test-s3-sns/S3LoggingBucket/AutoDeleteObjectsCustomResource/Default", "constructInfo": { "fqn": "aws-cdk-lib.CfnResource", - "version": "2.149.0" + "version": "2.154.1" } } }, "constructInfo": { "fqn": "aws-cdk-lib.CustomResource", - "version": "2.149.0" + "version": "2.154.1" } } }, "constructInfo": { "fqn": "aws-cdk-lib.aws_s3.Bucket", - "version": "2.149.0" + "version": "2.154.1" } }, "S3Bucket": { @@ -273,7 +273,7 @@ }, "constructInfo": { "fqn": "aws-cdk-lib.aws_s3.CfnBucket", - "version": "2.149.0" + "version": "2.154.1" } }, "Policy": { @@ -371,13 +371,13 @@ }, "constructInfo": { "fqn": "aws-cdk-lib.aws_s3.CfnBucketPolicy", - "version": "2.149.0" + "version": "2.154.1" } } }, "constructInfo": { "fqn": "aws-cdk-lib.aws_s3.BucketPolicy", - "version": "2.149.0" + "version": "2.154.1" } }, "AutoDeleteObjectsCustomResource": { @@ -389,13 +389,13 @@ "path": "s3sns-noArguments/test-s3-sns/S3Bucket/AutoDeleteObjectsCustomResource/Default", "constructInfo": { "fqn": "aws-cdk-lib.CfnResource", - "version": "2.149.0" + "version": "2.154.1" } } }, "constructInfo": { "fqn": "aws-cdk-lib.CustomResource", - "version": "2.149.0" + "version": "2.154.1" } }, "Notifications": { @@ -407,7 +407,7 @@ "path": "s3sns-noArguments/test-s3-sns/S3Bucket/Notifications/Resource", "constructInfo": { "fqn": "aws-cdk-lib.CfnResource", - "version": "2.149.0" + "version": "2.154.1" } } }, @@ -419,7 +419,7 @@ }, "constructInfo": { "fqn": "aws-cdk-lib.aws_s3.Bucket", - "version": "2.149.0" + "version": "2.154.1" } }, "'test-s3-snsKey'": { @@ -476,13 +476,13 @@ }, "constructInfo": { "fqn": "aws-cdk-lib.aws_kms.CfnKey", - "version": "2.149.0" + "version": "2.154.1" } } }, "constructInfo": { "fqn": "aws-cdk-lib.aws_kms.Key", - "version": "2.149.0" + "version": "2.154.1" } }, "SnsTopic": { @@ -505,7 +505,7 @@ }, "constructInfo": { "fqn": "aws-cdk-lib.aws_sns.CfnTopic", - "version": "2.149.0" + "version": "2.154.1" } }, "Policy": { @@ -622,25 +622,25 @@ }, "constructInfo": { "fqn": "aws-cdk-lib.aws_sns.CfnTopicPolicy", - "version": "2.149.0" + "version": "2.154.1" } } }, "constructInfo": { "fqn": "aws-cdk-lib.aws_sns.TopicPolicy", - "version": "2.149.0" + "version": "2.154.1" } } }, "constructInfo": { "fqn": "aws-cdk-lib.aws_sns.Topic", - "version": "2.149.0" + "version": "2.154.1" } } }, "constructInfo": { "fqn": "@aws-solutions-constructs/aws-s3-sns.S3ToSns", - "version": "2.62.0" + "version": "2.67.1" } }, "LatestNodeRuntimeMap": { @@ -648,7 +648,7 @@ "path": "s3sns-noArguments/LatestNodeRuntimeMap", "constructInfo": { "fqn": "aws-cdk-lib.CfnMapping", - "version": "2.149.0" + "version": "2.154.1" } }, "Custom::S3AutoDeleteObjectsCustomResourceProvider": { @@ -660,7 +660,7 @@ "path": "s3sns-noArguments/Custom::S3AutoDeleteObjectsCustomResourceProvider/Staging", "constructInfo": { "fqn": "aws-cdk-lib.AssetStaging", - "version": "2.149.0" + "version": "2.154.1" } }, "Role": { @@ -668,7 +668,7 @@ "path": "s3sns-noArguments/Custom::S3AutoDeleteObjectsCustomResourceProvider/Role", "constructInfo": { "fqn": "aws-cdk-lib.CfnResource", - "version": "2.149.0" + "version": "2.154.1" } }, "Handler": { @@ -676,13 +676,13 @@ "path": "s3sns-noArguments/Custom::S3AutoDeleteObjectsCustomResourceProvider/Handler", "constructInfo": { "fqn": "aws-cdk-lib.CfnResource", - "version": "2.149.0" + "version": "2.154.1" } } }, "constructInfo": { "fqn": "aws-cdk-lib.CustomResourceProviderBase", - "version": "2.149.0" + "version": "2.154.1" } }, "BucketNotificationsHandler050a0587b7544547bf325f094a3db834": { @@ -698,7 +698,7 @@ "path": "s3sns-noArguments/BucketNotificationsHandler050a0587b7544547bf325f094a3db834/Role/ImportRole", "constructInfo": { "fqn": "aws-cdk-lib.Resource", - "version": "2.149.0" + "version": "2.154.1" } }, "Resource": { @@ -737,7 +737,7 @@ }, "constructInfo": { "fqn": "aws-cdk-lib.aws_iam.CfnRole", - "version": "2.149.0" + "version": "2.154.1" } }, "DefaultPolicy": { @@ -770,19 +770,19 @@ }, "constructInfo": { "fqn": "aws-cdk-lib.aws_iam.CfnPolicy", - "version": "2.149.0" + "version": "2.154.1" } } }, "constructInfo": { "fqn": "aws-cdk-lib.aws_iam.Policy", - "version": "2.149.0" + "version": "2.154.1" } } }, "constructInfo": { "fqn": "aws-cdk-lib.aws_iam.Role", - "version": "2.149.0" + "version": "2.154.1" } }, "Resource": { @@ -790,7 +790,7 @@ "path": "s3sns-noArguments/BucketNotificationsHandler050a0587b7544547bf325f094a3db834/Resource", "constructInfo": { "fqn": "aws-cdk-lib.CfnResource", - "version": "2.149.0" + "version": "2.154.1" } } }, @@ -824,7 +824,7 @@ "path": "s3sns-noArguments/Integ/DefaultTest/DeployAssert/BootstrapVersion", "constructInfo": { "fqn": "aws-cdk-lib.CfnParameter", - "version": "2.149.0" + "version": "2.154.1" } }, "CheckBootstrapVersion": { @@ -832,25 +832,25 @@ "path": "s3sns-noArguments/Integ/DefaultTest/DeployAssert/CheckBootstrapVersion", "constructInfo": { "fqn": "aws-cdk-lib.CfnRule", - "version": "2.149.0" + "version": "2.154.1" } } }, "constructInfo": { "fqn": "aws-cdk-lib.Stack", - "version": "2.149.0" + "version": "2.154.1" } } }, "constructInfo": { "fqn": "@aws-cdk/integ-tests-alpha.IntegTestCase", - "version": "2.149.0-alpha.0" + "version": "2.154.1-alpha.0" } } }, "constructInfo": { "fqn": "@aws-cdk/integ-tests-alpha.IntegTest", - "version": "2.149.0-alpha.0" + "version": "2.154.1-alpha.0" } }, "BootstrapVersion": { @@ -858,7 +858,7 @@ "path": "s3sns-noArguments/BootstrapVersion", "constructInfo": { "fqn": "aws-cdk-lib.CfnParameter", - "version": "2.149.0" + "version": "2.154.1" } }, "CheckBootstrapVersion": { @@ -866,13 +866,13 @@ "path": "s3sns-noArguments/CheckBootstrapVersion", "constructInfo": { "fqn": "aws-cdk-lib.CfnRule", - "version": "2.149.0" + "version": "2.154.1" } } }, "constructInfo": { "fqn": "aws-cdk-lib.Stack", - "version": "2.149.0" + "version": "2.154.1" } }, "Tree": { @@ -886,7 +886,7 @@ }, "constructInfo": { "fqn": "aws-cdk-lib.App", - "version": "2.149.0" + "version": "2.154.1" } } } \ No newline at end of file diff --git a/source/patterns/@aws-solutions-constructs/aws-s3-sns/test/integ.s3sns-s3EventTypesAndFilters.js.snapshot/cdk.out b/source/patterns/@aws-solutions-constructs/aws-s3-sns/test/integ.s3sns-s3EventTypesAndFilters.js.snapshot/cdk.out index 1f0068d32..0d15a78da 100644 --- a/source/patterns/@aws-solutions-constructs/aws-s3-sns/test/integ.s3sns-s3EventTypesAndFilters.js.snapshot/cdk.out +++ b/source/patterns/@aws-solutions-constructs/aws-s3-sns/test/integ.s3sns-s3EventTypesAndFilters.js.snapshot/cdk.out @@ -1 +1 @@ -{"version":"36.0.0"} \ No newline at end of file +{"version":"36.0.18"} \ No newline at end of file diff --git a/source/patterns/@aws-solutions-constructs/aws-s3-sns/test/integ.s3sns-s3EventTypesAndFilters.js.snapshot/integ.json b/source/patterns/@aws-solutions-constructs/aws-s3-sns/test/integ.s3sns-s3EventTypesAndFilters.js.snapshot/integ.json index 3239299aa..220a1c3a9 100644 --- a/source/patterns/@aws-solutions-constructs/aws-s3-sns/test/integ.s3sns-s3EventTypesAndFilters.js.snapshot/integ.json +++ b/source/patterns/@aws-solutions-constructs/aws-s3-sns/test/integ.s3sns-s3EventTypesAndFilters.js.snapshot/integ.json @@ -1,5 +1,5 @@ { - "version": "36.0.0", + "version": "36.0.18", "testCases": { "s3sns-s3EventTypesAndFilters/Integ/DefaultTest": { "stacks": [ diff --git a/source/patterns/@aws-solutions-constructs/aws-s3-sns/test/integ.s3sns-s3EventTypesAndFilters.js.snapshot/manifest.json b/source/patterns/@aws-solutions-constructs/aws-s3-sns/test/integ.s3sns-s3EventTypesAndFilters.js.snapshot/manifest.json index 65d0c69d7..f95826948 100644 --- a/source/patterns/@aws-solutions-constructs/aws-s3-sns/test/integ.s3sns-s3EventTypesAndFilters.js.snapshot/manifest.json +++ b/source/patterns/@aws-solutions-constructs/aws-s3-sns/test/integ.s3sns-s3EventTypesAndFilters.js.snapshot/manifest.json @@ -1,5 +1,5 @@ { - "version": "36.0.0", + "version": "36.0.5", "artifacts": { "s3snss3EventTypesAndFiltersIntegDefaultTestDeployAssert277CA5E7.assets": { "type": "cdk:asset-manifest", @@ -66,7 +66,7 @@ "validateOnSynth": false, "assumeRoleArn": "arn:${AWS::Partition}:iam::${AWS::AccountId}:role/cdk-hnb659fds-deploy-role-${AWS::AccountId}-${AWS::Region}", "cloudFormationExecutionRoleArn": "arn:${AWS::Partition}:iam::${AWS::AccountId}:role/cdk-hnb659fds-cfn-exec-role-${AWS::AccountId}-${AWS::Region}", - "stackTemplateAssetObjectUrl": "s3://cdk-hnb659fds-assets-${AWS::AccountId}-${AWS::Region}/b097593c86488b0c6ba858b2d64219e660a0b5acd3af5db056f58cefa868b414.json", + "stackTemplateAssetObjectUrl": "s3://cdk-hnb659fds-assets-${AWS::AccountId}-${AWS::Region}/71acdd18bd599ca339ed12958e4dbbb8d14bf7495a9a50b22ea9ed8c8b43270e.json", "requiresBootstrapStackVersion": 6, "bootstrapStackVersionSsmParameter": "/cdk-bootstrap/hnb659fds/version", "additionalDependencies": [ @@ -148,6 +148,12 @@ "data": "LatestNodeRuntimeMap" } ], + "/s3sns-s3EventTypesAndFilters/Custom::S3AutoDeleteObjectsCustomResourceProvider": [ + { + "type": "aws:cdk:is-custom-resource-handler-customResourceProvider", + "data": true + } + ], "/s3sns-s3EventTypesAndFilters/Custom::S3AutoDeleteObjectsCustomResourceProvider/Role": [ { "type": "aws:cdk:logicalId", diff --git a/source/patterns/@aws-solutions-constructs/aws-s3-sns/test/integ.s3sns-s3EventTypesAndFilters.js.snapshot/s3sns-s3EventTypesAndFilters.assets.json b/source/patterns/@aws-solutions-constructs/aws-s3-sns/test/integ.s3sns-s3EventTypesAndFilters.js.snapshot/s3sns-s3EventTypesAndFilters.assets.json index f106129ba..79fafc404 100644 --- a/source/patterns/@aws-solutions-constructs/aws-s3-sns/test/integ.s3sns-s3EventTypesAndFilters.js.snapshot/s3sns-s3EventTypesAndFilters.assets.json +++ b/source/patterns/@aws-solutions-constructs/aws-s3-sns/test/integ.s3sns-s3EventTypesAndFilters.js.snapshot/s3sns-s3EventTypesAndFilters.assets.json @@ -1,5 +1,5 @@ { - "version": "36.0.0", + "version": "36.0.18", "files": { "faa95a81ae7d7373f3e1f242268f904eb748d8d0fdd306e8a6fe515a1905a7d6": { "source": { @@ -14,7 +14,7 @@ } } }, - "b097593c86488b0c6ba858b2d64219e660a0b5acd3af5db056f58cefa868b414": { + "71acdd18bd599ca339ed12958e4dbbb8d14bf7495a9a50b22ea9ed8c8b43270e": { "source": { "path": "s3sns-s3EventTypesAndFilters.template.json", "packaging": "file" @@ -22,7 +22,7 @@ "destinations": { "current_account-current_region": { "bucketName": "cdk-hnb659fds-assets-${AWS::AccountId}-${AWS::Region}", - "objectKey": "b097593c86488b0c6ba858b2d64219e660a0b5acd3af5db056f58cefa868b414.json", + "objectKey": "71acdd18bd599ca339ed12958e4dbbb8d14bf7495a9a50b22ea9ed8c8b43270e.json", "assumeRoleArn": "arn:${AWS::Partition}:iam::${AWS::AccountId}:role/cdk-hnb659fds-file-publishing-role-${AWS::AccountId}-${AWS::Region}" } } diff --git a/source/patterns/@aws-solutions-constructs/aws-s3-sns/test/integ.s3sns-s3EventTypesAndFilters.js.snapshot/s3sns-s3EventTypesAndFilters.template.json b/source/patterns/@aws-solutions-constructs/aws-s3-sns/test/integ.s3sns-s3EventTypesAndFilters.js.snapshot/s3sns-s3EventTypesAndFilters.template.json index 0fdf62767..1fe90550b 100644 --- a/source/patterns/@aws-solutions-constructs/aws-s3-sns/test/integ.s3sns-s3EventTypesAndFilters.js.snapshot/s3sns-s3EventTypesAndFilters.template.json +++ b/source/patterns/@aws-solutions-constructs/aws-s3-sns/test/integ.s3sns-s3EventTypesAndFilters.js.snapshot/s3sns-s3EventTypesAndFilters.template.json @@ -374,7 +374,8 @@ } ] }, - "Managed": true + "Managed": true, + "SkipDestinationValidation": false }, "DependsOn": [ "tests3snsS3BucketPolicyA51165A8", @@ -696,7 +697,7 @@ "Properties": { "Description": "AWS CloudFormation handler for \"Custom::S3BucketNotifications\" resources (@aws-cdk/aws-s3)", "Code": { - "ZipFile": "import boto3 # type: ignore\nimport json\nimport logging\nimport urllib.request\n\ns3 = boto3.client(\"s3\")\n\nEVENTBRIDGE_CONFIGURATION = 'EventBridgeConfiguration'\nCONFIGURATION_TYPES = [\"TopicConfigurations\", \"QueueConfigurations\", \"LambdaFunctionConfigurations\"]\n\ndef handler(event: dict, context):\n response_status = \"SUCCESS\"\n error_message = \"\"\n try:\n props = event[\"ResourceProperties\"]\n notification_configuration = props[\"NotificationConfiguration\"]\n managed = props.get('Managed', 'true').lower() == 'true'\n stack_id = event['StackId']\n old = event.get(\"OldResourceProperties\", {}).get(\"NotificationConfiguration\", {})\n if managed:\n config = handle_managed(event[\"RequestType\"], notification_configuration)\n else:\n config = handle_unmanaged(props[\"BucketName\"], stack_id, event[\"RequestType\"], notification_configuration, old)\n s3.put_bucket_notification_configuration(Bucket=props[\"BucketName\"], NotificationConfiguration=config)\n except Exception as e:\n logging.exception(\"Failed to put bucket notification configuration\")\n response_status = \"FAILED\"\n error_message = f\"Error: {str(e)}. \"\n finally:\n submit_response(event, context, response_status, error_message)\n\ndef handle_managed(request_type, notification_configuration):\n if request_type == 'Delete':\n return {}\n return notification_configuration\n\ndef handle_unmanaged(bucket, stack_id, request_type, notification_configuration, old):\n def get_id(n):\n n['Id'] = ''\n strToHash=json.dumps(n, sort_keys=True).replace('\"Name\": \"prefix\"', '\"Name\": \"Prefix\"').replace('\"Name\": \"suffix\"', '\"Name\": \"Suffix\"')\n return f\"{stack_id}-{hash(strToHash)}\"\n def with_id(n):\n n['Id'] = get_id(n)\n return n\n\n external_notifications = {}\n existing_notifications = s3.get_bucket_notification_configuration(Bucket=bucket)\n for t in CONFIGURATION_TYPES:\n if request_type == 'Update':\n old_incoming_ids = [get_id(n) for n in old.get(t, [])]\n external_notifications[t] = [n for n in existing_notifications.get(t, []) if not get_id(n) in old_incoming_ids] \n elif request_type == 'Delete':\n external_notifications[t] = [n for n in existing_notifications.get(t, []) if not n['Id'].startswith(f\"{stack_id}-\")]\n elif request_type == 'Create':\n external_notifications[t] = [n for n in existing_notifications.get(t, [])]\n if EVENTBRIDGE_CONFIGURATION in existing_notifications:\n external_notifications[EVENTBRIDGE_CONFIGURATION] = existing_notifications[EVENTBRIDGE_CONFIGURATION]\n\n if request_type == 'Delete':\n return external_notifications\n\n notifications = {}\n for t in CONFIGURATION_TYPES:\n external = external_notifications.get(t, [])\n incoming = [with_id(n) for n in notification_configuration.get(t, [])]\n notifications[t] = external + incoming\n\n if EVENTBRIDGE_CONFIGURATION in notification_configuration:\n notifications[EVENTBRIDGE_CONFIGURATION] = notification_configuration[EVENTBRIDGE_CONFIGURATION]\n elif EVENTBRIDGE_CONFIGURATION in external_notifications:\n notifications[EVENTBRIDGE_CONFIGURATION] = external_notifications[EVENTBRIDGE_CONFIGURATION]\n\n return notifications\n\ndef submit_response(event: dict, context, response_status: str, error_message: str):\n response_body = json.dumps(\n {\n \"Status\": response_status,\n \"Reason\": f\"{error_message}See the details in CloudWatch Log Stream: {context.log_stream_name}\",\n \"PhysicalResourceId\": event.get(\"PhysicalResourceId\") or event[\"LogicalResourceId\"],\n \"StackId\": event[\"StackId\"],\n \"RequestId\": event[\"RequestId\"],\n \"LogicalResourceId\": event[\"LogicalResourceId\"],\n \"NoEcho\": False,\n }\n ).encode(\"utf-8\")\n headers = {\"content-type\": \"\", \"content-length\": str(len(response_body))}\n try:\n req = urllib.request.Request(url=event[\"ResponseURL\"], headers=headers, data=response_body, method=\"PUT\")\n with urllib.request.urlopen(req) as response:\n print(response.read().decode(\"utf-8\"))\n print(\"Status code: \" + response.reason)\n except Exception as e:\n print(\"send(..) failed executing request.urlopen(..): \" + str(e))" + "ZipFile": "import boto3 # type: ignore\nimport json\nimport logging\nimport urllib.request\n\ns3 = boto3.client(\"s3\")\n\nEVENTBRIDGE_CONFIGURATION = 'EventBridgeConfiguration'\nCONFIGURATION_TYPES = [\"TopicConfigurations\", \"QueueConfigurations\", \"LambdaFunctionConfigurations\"]\n\ndef handler(event: dict, context):\n response_status = \"SUCCESS\"\n error_message = \"\"\n try:\n props = event[\"ResourceProperties\"]\n notification_configuration = props[\"NotificationConfiguration\"]\n managed = props.get('Managed', 'true').lower() == 'true'\n skipDestinationValidation = props.get('SkipDestinationValidation', 'false').lower() == 'true'\n stack_id = event['StackId']\n old = event.get(\"OldResourceProperties\", {}).get(\"NotificationConfiguration\", {})\n if managed:\n config = handle_managed(event[\"RequestType\"], notification_configuration)\n else:\n config = handle_unmanaged(props[\"BucketName\"], stack_id, event[\"RequestType\"], notification_configuration, old)\n s3.put_bucket_notification_configuration(Bucket=props[\"BucketName\"], NotificationConfiguration=config, SkipDestinationValidation=skipDestinationValidation)\n except Exception as e:\n logging.exception(\"Failed to put bucket notification configuration\")\n response_status = \"FAILED\"\n error_message = f\"Error: {str(e)}. \"\n finally:\n submit_response(event, context, response_status, error_message)\n\ndef handle_managed(request_type, notification_configuration):\n if request_type == 'Delete':\n return {}\n return notification_configuration\n\ndef handle_unmanaged(bucket, stack_id, request_type, notification_configuration, old):\n def get_id(n):\n n['Id'] = ''\n strToHash=json.dumps(n, sort_keys=True).replace('\"Name\": \"prefix\"', '\"Name\": \"Prefix\"').replace('\"Name\": \"suffix\"', '\"Name\": \"Suffix\"')\n return f\"{stack_id}-{hash(strToHash)}\"\n def with_id(n):\n n['Id'] = get_id(n)\n return n\n\n external_notifications = {}\n existing_notifications = s3.get_bucket_notification_configuration(Bucket=bucket)\n for t in CONFIGURATION_TYPES:\n if request_type == 'Update':\n old_incoming_ids = [get_id(n) for n in old.get(t, [])]\n external_notifications[t] = [n for n in existing_notifications.get(t, []) if not get_id(n) in old_incoming_ids] \n elif request_type == 'Delete':\n external_notifications[t] = [n for n in existing_notifications.get(t, []) if not n['Id'].startswith(f\"{stack_id}-\")]\n elif request_type == 'Create':\n external_notifications[t] = [n for n in existing_notifications.get(t, [])]\n if EVENTBRIDGE_CONFIGURATION in existing_notifications:\n external_notifications[EVENTBRIDGE_CONFIGURATION] = existing_notifications[EVENTBRIDGE_CONFIGURATION]\n\n if request_type == 'Delete':\n return external_notifications\n\n notifications = {}\n for t in CONFIGURATION_TYPES:\n external = external_notifications.get(t, [])\n incoming = [with_id(n) for n in notification_configuration.get(t, [])]\n notifications[t] = external + incoming\n\n if EVENTBRIDGE_CONFIGURATION in notification_configuration:\n notifications[EVENTBRIDGE_CONFIGURATION] = notification_configuration[EVENTBRIDGE_CONFIGURATION]\n elif EVENTBRIDGE_CONFIGURATION in external_notifications:\n notifications[EVENTBRIDGE_CONFIGURATION] = external_notifications[EVENTBRIDGE_CONFIGURATION]\n\n return notifications\n\ndef submit_response(event: dict, context, response_status: str, error_message: str):\n response_body = json.dumps(\n {\n \"Status\": response_status,\n \"Reason\": f\"{error_message}See the details in CloudWatch Log Stream: {context.log_stream_name}\",\n \"PhysicalResourceId\": event.get(\"PhysicalResourceId\") or event[\"LogicalResourceId\"],\n \"StackId\": event[\"StackId\"],\n \"RequestId\": event[\"RequestId\"],\n \"LogicalResourceId\": event[\"LogicalResourceId\"],\n \"NoEcho\": False,\n }\n ).encode(\"utf-8\")\n headers = {\"content-type\": \"\", \"content-length\": str(len(response_body))}\n try:\n req = urllib.request.Request(url=event[\"ResponseURL\"], headers=headers, data=response_body, method=\"PUT\")\n with urllib.request.urlopen(req) as response:\n print(response.read().decode(\"utf-8\"))\n print(\"Status code: \" + response.reason)\n except Exception as e:\n print(\"send(..) failed executing request.urlopen(..): \" + str(e))" }, "Handler": "index.handler", "Role": { diff --git a/source/patterns/@aws-solutions-constructs/aws-s3-sns/test/integ.s3sns-s3EventTypesAndFilters.js.snapshot/s3snss3EventTypesAndFiltersIntegDefaultTestDeployAssert277CA5E7.assets.json b/source/patterns/@aws-solutions-constructs/aws-s3-sns/test/integ.s3sns-s3EventTypesAndFilters.js.snapshot/s3snss3EventTypesAndFiltersIntegDefaultTestDeployAssert277CA5E7.assets.json index 0412c79f3..c4dec757c 100644 --- a/source/patterns/@aws-solutions-constructs/aws-s3-sns/test/integ.s3sns-s3EventTypesAndFilters.js.snapshot/s3snss3EventTypesAndFiltersIntegDefaultTestDeployAssert277CA5E7.assets.json +++ b/source/patterns/@aws-solutions-constructs/aws-s3-sns/test/integ.s3sns-s3EventTypesAndFilters.js.snapshot/s3snss3EventTypesAndFiltersIntegDefaultTestDeployAssert277CA5E7.assets.json @@ -1,5 +1,5 @@ { - "version": "36.0.0", + "version": "36.0.18", "files": { "21fbb51d7b23f6a6c262b46a9caee79d744a3ac019fd45422d988b96d44b2a22": { "source": { diff --git a/source/patterns/@aws-solutions-constructs/aws-s3-sns/test/integ.s3sns-s3EventTypesAndFilters.js.snapshot/tree.json b/source/patterns/@aws-solutions-constructs/aws-s3-sns/test/integ.s3sns-s3EventTypesAndFilters.js.snapshot/tree.json index 138a31f41..92ca78ece 100644 --- a/source/patterns/@aws-solutions-constructs/aws-s3-sns/test/integ.s3sns-s3EventTypesAndFilters.js.snapshot/tree.json +++ b/source/patterns/@aws-solutions-constructs/aws-s3-sns/test/integ.s3sns-s3EventTypesAndFilters.js.snapshot/tree.json @@ -50,7 +50,7 @@ }, "constructInfo": { "fqn": "aws-cdk-lib.aws_s3.CfnBucket", - "version": "2.149.0" + "version": "2.154.1" } }, "Policy": { @@ -184,13 +184,13 @@ }, "constructInfo": { "fqn": "aws-cdk-lib.aws_s3.CfnBucketPolicy", - "version": "2.149.0" + "version": "2.154.1" } } }, "constructInfo": { "fqn": "aws-cdk-lib.aws_s3.BucketPolicy", - "version": "2.149.0" + "version": "2.154.1" } }, "AutoDeleteObjectsCustomResource": { @@ -202,19 +202,19 @@ "path": "s3sns-s3EventTypesAndFilters/test-s3-sns/S3LoggingBucket/AutoDeleteObjectsCustomResource/Default", "constructInfo": { "fqn": "aws-cdk-lib.CfnResource", - "version": "2.149.0" + "version": "2.154.1" } } }, "constructInfo": { "fqn": "aws-cdk-lib.CustomResource", - "version": "2.149.0" + "version": "2.154.1" } } }, "constructInfo": { "fqn": "aws-cdk-lib.aws_s3.Bucket", - "version": "2.149.0" + "version": "2.154.1" } }, "S3Bucket": { @@ -273,7 +273,7 @@ }, "constructInfo": { "fqn": "aws-cdk-lib.aws_s3.CfnBucket", - "version": "2.149.0" + "version": "2.154.1" } }, "Policy": { @@ -371,13 +371,13 @@ }, "constructInfo": { "fqn": "aws-cdk-lib.aws_s3.CfnBucketPolicy", - "version": "2.149.0" + "version": "2.154.1" } } }, "constructInfo": { "fqn": "aws-cdk-lib.aws_s3.BucketPolicy", - "version": "2.149.0" + "version": "2.154.1" } }, "AutoDeleteObjectsCustomResource": { @@ -389,13 +389,13 @@ "path": "s3sns-s3EventTypesAndFilters/test-s3-sns/S3Bucket/AutoDeleteObjectsCustomResource/Default", "constructInfo": { "fqn": "aws-cdk-lib.CfnResource", - "version": "2.149.0" + "version": "2.154.1" } } }, "constructInfo": { "fqn": "aws-cdk-lib.CustomResource", - "version": "2.149.0" + "version": "2.154.1" } }, "Notifications": { @@ -407,7 +407,7 @@ "path": "s3sns-s3EventTypesAndFilters/test-s3-sns/S3Bucket/Notifications/Resource", "constructInfo": { "fqn": "aws-cdk-lib.CfnResource", - "version": "2.149.0" + "version": "2.154.1" } } }, @@ -419,7 +419,7 @@ }, "constructInfo": { "fqn": "aws-cdk-lib.aws_s3.Bucket", - "version": "2.149.0" + "version": "2.154.1" } }, "'test-s3-snsKey'": { @@ -476,13 +476,13 @@ }, "constructInfo": { "fqn": "aws-cdk-lib.aws_kms.CfnKey", - "version": "2.149.0" + "version": "2.154.1" } } }, "constructInfo": { "fqn": "aws-cdk-lib.aws_kms.Key", - "version": "2.149.0" + "version": "2.154.1" } }, "SnsTopic": { @@ -505,7 +505,7 @@ }, "constructInfo": { "fqn": "aws-cdk-lib.aws_sns.CfnTopic", - "version": "2.149.0" + "version": "2.154.1" } }, "Policy": { @@ -622,25 +622,25 @@ }, "constructInfo": { "fqn": "aws-cdk-lib.aws_sns.CfnTopicPolicy", - "version": "2.149.0" + "version": "2.154.1" } } }, "constructInfo": { "fqn": "aws-cdk-lib.aws_sns.TopicPolicy", - "version": "2.149.0" + "version": "2.154.1" } } }, "constructInfo": { "fqn": "aws-cdk-lib.aws_sns.Topic", - "version": "2.149.0" + "version": "2.154.1" } } }, "constructInfo": { "fqn": "@aws-solutions-constructs/aws-s3-sns.S3ToSns", - "version": "2.62.0" + "version": "2.67.1" } }, "LatestNodeRuntimeMap": { @@ -648,7 +648,7 @@ "path": "s3sns-s3EventTypesAndFilters/LatestNodeRuntimeMap", "constructInfo": { "fqn": "aws-cdk-lib.CfnMapping", - "version": "2.149.0" + "version": "2.154.1" } }, "Custom::S3AutoDeleteObjectsCustomResourceProvider": { @@ -660,7 +660,7 @@ "path": "s3sns-s3EventTypesAndFilters/Custom::S3AutoDeleteObjectsCustomResourceProvider/Staging", "constructInfo": { "fqn": "aws-cdk-lib.AssetStaging", - "version": "2.149.0" + "version": "2.154.1" } }, "Role": { @@ -668,7 +668,7 @@ "path": "s3sns-s3EventTypesAndFilters/Custom::S3AutoDeleteObjectsCustomResourceProvider/Role", "constructInfo": { "fqn": "aws-cdk-lib.CfnResource", - "version": "2.149.0" + "version": "2.154.1" } }, "Handler": { @@ -676,13 +676,13 @@ "path": "s3sns-s3EventTypesAndFilters/Custom::S3AutoDeleteObjectsCustomResourceProvider/Handler", "constructInfo": { "fqn": "aws-cdk-lib.CfnResource", - "version": "2.149.0" + "version": "2.154.1" } } }, "constructInfo": { "fqn": "aws-cdk-lib.CustomResourceProviderBase", - "version": "2.149.0" + "version": "2.154.1" } }, "BucketNotificationsHandler050a0587b7544547bf325f094a3db834": { @@ -698,7 +698,7 @@ "path": "s3sns-s3EventTypesAndFilters/BucketNotificationsHandler050a0587b7544547bf325f094a3db834/Role/ImportRole", "constructInfo": { "fqn": "aws-cdk-lib.Resource", - "version": "2.149.0" + "version": "2.154.1" } }, "Resource": { @@ -737,7 +737,7 @@ }, "constructInfo": { "fqn": "aws-cdk-lib.aws_iam.CfnRole", - "version": "2.149.0" + "version": "2.154.1" } }, "DefaultPolicy": { @@ -770,19 +770,19 @@ }, "constructInfo": { "fqn": "aws-cdk-lib.aws_iam.CfnPolicy", - "version": "2.149.0" + "version": "2.154.1" } } }, "constructInfo": { "fqn": "aws-cdk-lib.aws_iam.Policy", - "version": "2.149.0" + "version": "2.154.1" } } }, "constructInfo": { "fqn": "aws-cdk-lib.aws_iam.Role", - "version": "2.149.0" + "version": "2.154.1" } }, "Resource": { @@ -790,7 +790,7 @@ "path": "s3sns-s3EventTypesAndFilters/BucketNotificationsHandler050a0587b7544547bf325f094a3db834/Resource", "constructInfo": { "fqn": "aws-cdk-lib.CfnResource", - "version": "2.149.0" + "version": "2.154.1" } } }, @@ -824,7 +824,7 @@ "path": "s3sns-s3EventTypesAndFilters/Integ/DefaultTest/DeployAssert/BootstrapVersion", "constructInfo": { "fqn": "aws-cdk-lib.CfnParameter", - "version": "2.149.0" + "version": "2.154.1" } }, "CheckBootstrapVersion": { @@ -832,25 +832,25 @@ "path": "s3sns-s3EventTypesAndFilters/Integ/DefaultTest/DeployAssert/CheckBootstrapVersion", "constructInfo": { "fqn": "aws-cdk-lib.CfnRule", - "version": "2.149.0" + "version": "2.154.1" } } }, "constructInfo": { "fqn": "aws-cdk-lib.Stack", - "version": "2.149.0" + "version": "2.154.1" } } }, "constructInfo": { "fqn": "@aws-cdk/integ-tests-alpha.IntegTestCase", - "version": "2.149.0-alpha.0" + "version": "2.154.1-alpha.0" } } }, "constructInfo": { "fqn": "@aws-cdk/integ-tests-alpha.IntegTest", - "version": "2.149.0-alpha.0" + "version": "2.154.1-alpha.0" } }, "BootstrapVersion": { @@ -858,7 +858,7 @@ "path": "s3sns-s3EventTypesAndFilters/BootstrapVersion", "constructInfo": { "fqn": "aws-cdk-lib.CfnParameter", - "version": "2.149.0" + "version": "2.154.1" } }, "CheckBootstrapVersion": { @@ -866,13 +866,13 @@ "path": "s3sns-s3EventTypesAndFilters/CheckBootstrapVersion", "constructInfo": { "fqn": "aws-cdk-lib.CfnRule", - "version": "2.149.0" + "version": "2.154.1" } } }, "constructInfo": { "fqn": "aws-cdk-lib.Stack", - "version": "2.149.0" + "version": "2.154.1" } }, "Tree": { @@ -886,7 +886,7 @@ }, "constructInfo": { "fqn": "aws-cdk-lib.App", - "version": "2.149.0" + "version": "2.154.1" } } } \ No newline at end of file diff --git a/source/patterns/@aws-solutions-constructs/aws-s3-sns/test/integ.s3sns-snsTopicWithAwsManagedKey.js.snapshot/cdk.out b/source/patterns/@aws-solutions-constructs/aws-s3-sns/test/integ.s3sns-snsTopicWithAwsManagedKey.js.snapshot/cdk.out index 1f0068d32..0d15a78da 100644 --- a/source/patterns/@aws-solutions-constructs/aws-s3-sns/test/integ.s3sns-snsTopicWithAwsManagedKey.js.snapshot/cdk.out +++ b/source/patterns/@aws-solutions-constructs/aws-s3-sns/test/integ.s3sns-snsTopicWithAwsManagedKey.js.snapshot/cdk.out @@ -1 +1 @@ -{"version":"36.0.0"} \ No newline at end of file +{"version":"36.0.18"} \ No newline at end of file diff --git a/source/patterns/@aws-solutions-constructs/aws-s3-sns/test/integ.s3sns-snsTopicWithAwsManagedKey.js.snapshot/integ.json b/source/patterns/@aws-solutions-constructs/aws-s3-sns/test/integ.s3sns-snsTopicWithAwsManagedKey.js.snapshot/integ.json index 09afda55c..67c952aca 100644 --- a/source/patterns/@aws-solutions-constructs/aws-s3-sns/test/integ.s3sns-snsTopicWithAwsManagedKey.js.snapshot/integ.json +++ b/source/patterns/@aws-solutions-constructs/aws-s3-sns/test/integ.s3sns-snsTopicWithAwsManagedKey.js.snapshot/integ.json @@ -1,5 +1,5 @@ { - "version": "36.0.0", + "version": "36.0.18", "testCases": { "s3sns-snsTopicWithAwsManagedKey/Integ/DefaultTest": { "stacks": [ diff --git a/source/patterns/@aws-solutions-constructs/aws-s3-sns/test/integ.s3sns-snsTopicWithAwsManagedKey.js.snapshot/manifest.json b/source/patterns/@aws-solutions-constructs/aws-s3-sns/test/integ.s3sns-snsTopicWithAwsManagedKey.js.snapshot/manifest.json index 628528c1e..0164df917 100644 --- a/source/patterns/@aws-solutions-constructs/aws-s3-sns/test/integ.s3sns-snsTopicWithAwsManagedKey.js.snapshot/manifest.json +++ b/source/patterns/@aws-solutions-constructs/aws-s3-sns/test/integ.s3sns-snsTopicWithAwsManagedKey.js.snapshot/manifest.json @@ -1,5 +1,5 @@ { - "version": "36.0.0", + "version": "36.0.5", "artifacts": { "s3snssnsTopicWithAwsManagedKeyIntegDefaultTestDeployAssertBD7193C2.assets": { "type": "cdk:asset-manifest", @@ -66,7 +66,7 @@ "validateOnSynth": false, "assumeRoleArn": "arn:${AWS::Partition}:iam::${AWS::AccountId}:role/cdk-hnb659fds-deploy-role-${AWS::AccountId}-${AWS::Region}", "cloudFormationExecutionRoleArn": "arn:${AWS::Partition}:iam::${AWS::AccountId}:role/cdk-hnb659fds-cfn-exec-role-${AWS::AccountId}-${AWS::Region}", - "stackTemplateAssetObjectUrl": "s3://cdk-hnb659fds-assets-${AWS::AccountId}-${AWS::Region}/dd2488062e0c6ad52c03a714a801f30196a02dc2d852d6e9f94cee1f864fe1c3.json", + "stackTemplateAssetObjectUrl": "s3://cdk-hnb659fds-assets-${AWS::AccountId}-${AWS::Region}/93c61445962a090343bf6a4045124df9ab3bc117dbff38a39aeddf54753038c3.json", "requiresBootstrapStackVersion": 6, "bootstrapStackVersionSsmParameter": "/cdk-bootstrap/hnb659fds/version", "additionalDependencies": [ @@ -142,6 +142,12 @@ "data": "LatestNodeRuntimeMap" } ], + "/s3sns-snsTopicWithAwsManagedKey/Custom::S3AutoDeleteObjectsCustomResourceProvider": [ + { + "type": "aws:cdk:is-custom-resource-handler-customResourceProvider", + "data": true + } + ], "/s3sns-snsTopicWithAwsManagedKey/Custom::S3AutoDeleteObjectsCustomResourceProvider/Role": [ { "type": "aws:cdk:logicalId", diff --git a/source/patterns/@aws-solutions-constructs/aws-s3-sns/test/integ.s3sns-snsTopicWithAwsManagedKey.js.snapshot/s3sns-snsTopicWithAwsManagedKey.assets.json b/source/patterns/@aws-solutions-constructs/aws-s3-sns/test/integ.s3sns-snsTopicWithAwsManagedKey.js.snapshot/s3sns-snsTopicWithAwsManagedKey.assets.json index ec935cad9..fa908ebaf 100644 --- a/source/patterns/@aws-solutions-constructs/aws-s3-sns/test/integ.s3sns-snsTopicWithAwsManagedKey.js.snapshot/s3sns-snsTopicWithAwsManagedKey.assets.json +++ b/source/patterns/@aws-solutions-constructs/aws-s3-sns/test/integ.s3sns-snsTopicWithAwsManagedKey.js.snapshot/s3sns-snsTopicWithAwsManagedKey.assets.json @@ -1,5 +1,5 @@ { - "version": "36.0.0", + "version": "36.0.18", "files": { "faa95a81ae7d7373f3e1f242268f904eb748d8d0fdd306e8a6fe515a1905a7d6": { "source": { @@ -14,7 +14,7 @@ } } }, - "dd2488062e0c6ad52c03a714a801f30196a02dc2d852d6e9f94cee1f864fe1c3": { + "93c61445962a090343bf6a4045124df9ab3bc117dbff38a39aeddf54753038c3": { "source": { "path": "s3sns-snsTopicWithAwsManagedKey.template.json", "packaging": "file" @@ -22,7 +22,7 @@ "destinations": { "current_account-current_region": { "bucketName": "cdk-hnb659fds-assets-${AWS::AccountId}-${AWS::Region}", - "objectKey": "dd2488062e0c6ad52c03a714a801f30196a02dc2d852d6e9f94cee1f864fe1c3.json", + "objectKey": "93c61445962a090343bf6a4045124df9ab3bc117dbff38a39aeddf54753038c3.json", "assumeRoleArn": "arn:${AWS::Partition}:iam::${AWS::AccountId}:role/cdk-hnb659fds-file-publishing-role-${AWS::AccountId}-${AWS::Region}" } } diff --git a/source/patterns/@aws-solutions-constructs/aws-s3-sns/test/integ.s3sns-snsTopicWithAwsManagedKey.js.snapshot/s3sns-snsTopicWithAwsManagedKey.template.json b/source/patterns/@aws-solutions-constructs/aws-s3-sns/test/integ.s3sns-snsTopicWithAwsManagedKey.js.snapshot/s3sns-snsTopicWithAwsManagedKey.template.json index bc23c68e8..0d763206c 100644 --- a/source/patterns/@aws-solutions-constructs/aws-s3-sns/test/integ.s3sns-snsTopicWithAwsManagedKey.js.snapshot/s3sns-snsTopicWithAwsManagedKey.template.json +++ b/source/patterns/@aws-solutions-constructs/aws-s3-sns/test/integ.s3sns-snsTopicWithAwsManagedKey.js.snapshot/s3sns-snsTopicWithAwsManagedKey.template.json @@ -360,7 +360,8 @@ } ] }, - "Managed": true + "Managed": true, + "SkipDestinationValidation": false }, "DependsOn": [ "tests3snsS3BucketPolicyA51165A8", @@ -649,7 +650,7 @@ "Properties": { "Description": "AWS CloudFormation handler for \"Custom::S3BucketNotifications\" resources (@aws-cdk/aws-s3)", "Code": { - "ZipFile": "import boto3 # type: ignore\nimport json\nimport logging\nimport urllib.request\n\ns3 = boto3.client(\"s3\")\n\nEVENTBRIDGE_CONFIGURATION = 'EventBridgeConfiguration'\nCONFIGURATION_TYPES = [\"TopicConfigurations\", \"QueueConfigurations\", \"LambdaFunctionConfigurations\"]\n\ndef handler(event: dict, context):\n response_status = \"SUCCESS\"\n error_message = \"\"\n try:\n props = event[\"ResourceProperties\"]\n notification_configuration = props[\"NotificationConfiguration\"]\n managed = props.get('Managed', 'true').lower() == 'true'\n stack_id = event['StackId']\n old = event.get(\"OldResourceProperties\", {}).get(\"NotificationConfiguration\", {})\n if managed:\n config = handle_managed(event[\"RequestType\"], notification_configuration)\n else:\n config = handle_unmanaged(props[\"BucketName\"], stack_id, event[\"RequestType\"], notification_configuration, old)\n s3.put_bucket_notification_configuration(Bucket=props[\"BucketName\"], NotificationConfiguration=config)\n except Exception as e:\n logging.exception(\"Failed to put bucket notification configuration\")\n response_status = \"FAILED\"\n error_message = f\"Error: {str(e)}. \"\n finally:\n submit_response(event, context, response_status, error_message)\n\ndef handle_managed(request_type, notification_configuration):\n if request_type == 'Delete':\n return {}\n return notification_configuration\n\ndef handle_unmanaged(bucket, stack_id, request_type, notification_configuration, old):\n def get_id(n):\n n['Id'] = ''\n strToHash=json.dumps(n, sort_keys=True).replace('\"Name\": \"prefix\"', '\"Name\": \"Prefix\"').replace('\"Name\": \"suffix\"', '\"Name\": \"Suffix\"')\n return f\"{stack_id}-{hash(strToHash)}\"\n def with_id(n):\n n['Id'] = get_id(n)\n return n\n\n external_notifications = {}\n existing_notifications = s3.get_bucket_notification_configuration(Bucket=bucket)\n for t in CONFIGURATION_TYPES:\n if request_type == 'Update':\n old_incoming_ids = [get_id(n) for n in old.get(t, [])]\n external_notifications[t] = [n for n in existing_notifications.get(t, []) if not get_id(n) in old_incoming_ids] \n elif request_type == 'Delete':\n external_notifications[t] = [n for n in existing_notifications.get(t, []) if not n['Id'].startswith(f\"{stack_id}-\")]\n elif request_type == 'Create':\n external_notifications[t] = [n for n in existing_notifications.get(t, [])]\n if EVENTBRIDGE_CONFIGURATION in existing_notifications:\n external_notifications[EVENTBRIDGE_CONFIGURATION] = existing_notifications[EVENTBRIDGE_CONFIGURATION]\n\n if request_type == 'Delete':\n return external_notifications\n\n notifications = {}\n for t in CONFIGURATION_TYPES:\n external = external_notifications.get(t, [])\n incoming = [with_id(n) for n in notification_configuration.get(t, [])]\n notifications[t] = external + incoming\n\n if EVENTBRIDGE_CONFIGURATION in notification_configuration:\n notifications[EVENTBRIDGE_CONFIGURATION] = notification_configuration[EVENTBRIDGE_CONFIGURATION]\n elif EVENTBRIDGE_CONFIGURATION in external_notifications:\n notifications[EVENTBRIDGE_CONFIGURATION] = external_notifications[EVENTBRIDGE_CONFIGURATION]\n\n return notifications\n\ndef submit_response(event: dict, context, response_status: str, error_message: str):\n response_body = json.dumps(\n {\n \"Status\": response_status,\n \"Reason\": f\"{error_message}See the details in CloudWatch Log Stream: {context.log_stream_name}\",\n \"PhysicalResourceId\": event.get(\"PhysicalResourceId\") or event[\"LogicalResourceId\"],\n \"StackId\": event[\"StackId\"],\n \"RequestId\": event[\"RequestId\"],\n \"LogicalResourceId\": event[\"LogicalResourceId\"],\n \"NoEcho\": False,\n }\n ).encode(\"utf-8\")\n headers = {\"content-type\": \"\", \"content-length\": str(len(response_body))}\n try:\n req = urllib.request.Request(url=event[\"ResponseURL\"], headers=headers, data=response_body, method=\"PUT\")\n with urllib.request.urlopen(req) as response:\n print(response.read().decode(\"utf-8\"))\n print(\"Status code: \" + response.reason)\n except Exception as e:\n print(\"send(..) failed executing request.urlopen(..): \" + str(e))" + "ZipFile": "import boto3 # type: ignore\nimport json\nimport logging\nimport urllib.request\n\ns3 = boto3.client(\"s3\")\n\nEVENTBRIDGE_CONFIGURATION = 'EventBridgeConfiguration'\nCONFIGURATION_TYPES = [\"TopicConfigurations\", \"QueueConfigurations\", \"LambdaFunctionConfigurations\"]\n\ndef handler(event: dict, context):\n response_status = \"SUCCESS\"\n error_message = \"\"\n try:\n props = event[\"ResourceProperties\"]\n notification_configuration = props[\"NotificationConfiguration\"]\n managed = props.get('Managed', 'true').lower() == 'true'\n skipDestinationValidation = props.get('SkipDestinationValidation', 'false').lower() == 'true'\n stack_id = event['StackId']\n old = event.get(\"OldResourceProperties\", {}).get(\"NotificationConfiguration\", {})\n if managed:\n config = handle_managed(event[\"RequestType\"], notification_configuration)\n else:\n config = handle_unmanaged(props[\"BucketName\"], stack_id, event[\"RequestType\"], notification_configuration, old)\n s3.put_bucket_notification_configuration(Bucket=props[\"BucketName\"], NotificationConfiguration=config, SkipDestinationValidation=skipDestinationValidation)\n except Exception as e:\n logging.exception(\"Failed to put bucket notification configuration\")\n response_status = \"FAILED\"\n error_message = f\"Error: {str(e)}. \"\n finally:\n submit_response(event, context, response_status, error_message)\n\ndef handle_managed(request_type, notification_configuration):\n if request_type == 'Delete':\n return {}\n return notification_configuration\n\ndef handle_unmanaged(bucket, stack_id, request_type, notification_configuration, old):\n def get_id(n):\n n['Id'] = ''\n strToHash=json.dumps(n, sort_keys=True).replace('\"Name\": \"prefix\"', '\"Name\": \"Prefix\"').replace('\"Name\": \"suffix\"', '\"Name\": \"Suffix\"')\n return f\"{stack_id}-{hash(strToHash)}\"\n def with_id(n):\n n['Id'] = get_id(n)\n return n\n\n external_notifications = {}\n existing_notifications = s3.get_bucket_notification_configuration(Bucket=bucket)\n for t in CONFIGURATION_TYPES:\n if request_type == 'Update':\n old_incoming_ids = [get_id(n) for n in old.get(t, [])]\n external_notifications[t] = [n for n in existing_notifications.get(t, []) if not get_id(n) in old_incoming_ids] \n elif request_type == 'Delete':\n external_notifications[t] = [n for n in existing_notifications.get(t, []) if not n['Id'].startswith(f\"{stack_id}-\")]\n elif request_type == 'Create':\n external_notifications[t] = [n for n in existing_notifications.get(t, [])]\n if EVENTBRIDGE_CONFIGURATION in existing_notifications:\n external_notifications[EVENTBRIDGE_CONFIGURATION] = existing_notifications[EVENTBRIDGE_CONFIGURATION]\n\n if request_type == 'Delete':\n return external_notifications\n\n notifications = {}\n for t in CONFIGURATION_TYPES:\n external = external_notifications.get(t, [])\n incoming = [with_id(n) for n in notification_configuration.get(t, [])]\n notifications[t] = external + incoming\n\n if EVENTBRIDGE_CONFIGURATION in notification_configuration:\n notifications[EVENTBRIDGE_CONFIGURATION] = notification_configuration[EVENTBRIDGE_CONFIGURATION]\n elif EVENTBRIDGE_CONFIGURATION in external_notifications:\n notifications[EVENTBRIDGE_CONFIGURATION] = external_notifications[EVENTBRIDGE_CONFIGURATION]\n\n return notifications\n\ndef submit_response(event: dict, context, response_status: str, error_message: str):\n response_body = json.dumps(\n {\n \"Status\": response_status,\n \"Reason\": f\"{error_message}See the details in CloudWatch Log Stream: {context.log_stream_name}\",\n \"PhysicalResourceId\": event.get(\"PhysicalResourceId\") or event[\"LogicalResourceId\"],\n \"StackId\": event[\"StackId\"],\n \"RequestId\": event[\"RequestId\"],\n \"LogicalResourceId\": event[\"LogicalResourceId\"],\n \"NoEcho\": False,\n }\n ).encode(\"utf-8\")\n headers = {\"content-type\": \"\", \"content-length\": str(len(response_body))}\n try:\n req = urllib.request.Request(url=event[\"ResponseURL\"], headers=headers, data=response_body, method=\"PUT\")\n with urllib.request.urlopen(req) as response:\n print(response.read().decode(\"utf-8\"))\n print(\"Status code: \" + response.reason)\n except Exception as e:\n print(\"send(..) failed executing request.urlopen(..): \" + str(e))" }, "Handler": "index.handler", "Role": { diff --git a/source/patterns/@aws-solutions-constructs/aws-s3-sns/test/integ.s3sns-snsTopicWithAwsManagedKey.js.snapshot/s3snssnsTopicWithAwsManagedKeyIntegDefaultTestDeployAssertBD7193C2.assets.json b/source/patterns/@aws-solutions-constructs/aws-s3-sns/test/integ.s3sns-snsTopicWithAwsManagedKey.js.snapshot/s3snssnsTopicWithAwsManagedKeyIntegDefaultTestDeployAssertBD7193C2.assets.json index d56ec2fff..767dbfd65 100644 --- a/source/patterns/@aws-solutions-constructs/aws-s3-sns/test/integ.s3sns-snsTopicWithAwsManagedKey.js.snapshot/s3snssnsTopicWithAwsManagedKeyIntegDefaultTestDeployAssertBD7193C2.assets.json +++ b/source/patterns/@aws-solutions-constructs/aws-s3-sns/test/integ.s3sns-snsTopicWithAwsManagedKey.js.snapshot/s3snssnsTopicWithAwsManagedKeyIntegDefaultTestDeployAssertBD7193C2.assets.json @@ -1,5 +1,5 @@ { - "version": "36.0.0", + "version": "36.0.18", "files": { "21fbb51d7b23f6a6c262b46a9caee79d744a3ac019fd45422d988b96d44b2a22": { "source": { diff --git a/source/patterns/@aws-solutions-constructs/aws-s3-sns/test/integ.s3sns-snsTopicWithAwsManagedKey.js.snapshot/tree.json b/source/patterns/@aws-solutions-constructs/aws-s3-sns/test/integ.s3sns-snsTopicWithAwsManagedKey.js.snapshot/tree.json index 35a285915..f87ee0113 100644 --- a/source/patterns/@aws-solutions-constructs/aws-s3-sns/test/integ.s3sns-snsTopicWithAwsManagedKey.js.snapshot/tree.json +++ b/source/patterns/@aws-solutions-constructs/aws-s3-sns/test/integ.s3sns-snsTopicWithAwsManagedKey.js.snapshot/tree.json @@ -50,7 +50,7 @@ }, "constructInfo": { "fqn": "aws-cdk-lib.aws_s3.CfnBucket", - "version": "2.149.0" + "version": "2.154.1" } }, "Policy": { @@ -184,13 +184,13 @@ }, "constructInfo": { "fqn": "aws-cdk-lib.aws_s3.CfnBucketPolicy", - "version": "2.149.0" + "version": "2.154.1" } } }, "constructInfo": { "fqn": "aws-cdk-lib.aws_s3.BucketPolicy", - "version": "2.149.0" + "version": "2.154.1" } }, "AutoDeleteObjectsCustomResource": { @@ -202,19 +202,19 @@ "path": "s3sns-snsTopicWithAwsManagedKey/test-s3-sns/S3LoggingBucket/AutoDeleteObjectsCustomResource/Default", "constructInfo": { "fqn": "aws-cdk-lib.CfnResource", - "version": "2.149.0" + "version": "2.154.1" } } }, "constructInfo": { "fqn": "aws-cdk-lib.CustomResource", - "version": "2.149.0" + "version": "2.154.1" } } }, "constructInfo": { "fqn": "aws-cdk-lib.aws_s3.Bucket", - "version": "2.149.0" + "version": "2.154.1" } }, "S3Bucket": { @@ -273,7 +273,7 @@ }, "constructInfo": { "fqn": "aws-cdk-lib.aws_s3.CfnBucket", - "version": "2.149.0" + "version": "2.154.1" } }, "Policy": { @@ -371,13 +371,13 @@ }, "constructInfo": { "fqn": "aws-cdk-lib.aws_s3.CfnBucketPolicy", - "version": "2.149.0" + "version": "2.154.1" } } }, "constructInfo": { "fqn": "aws-cdk-lib.aws_s3.BucketPolicy", - "version": "2.149.0" + "version": "2.154.1" } }, "AutoDeleteObjectsCustomResource": { @@ -389,13 +389,13 @@ "path": "s3sns-snsTopicWithAwsManagedKey/test-s3-sns/S3Bucket/AutoDeleteObjectsCustomResource/Default", "constructInfo": { "fqn": "aws-cdk-lib.CfnResource", - "version": "2.149.0" + "version": "2.154.1" } } }, "constructInfo": { "fqn": "aws-cdk-lib.CustomResource", - "version": "2.149.0" + "version": "2.154.1" } }, "Notifications": { @@ -407,7 +407,7 @@ "path": "s3sns-snsTopicWithAwsManagedKey/test-s3-sns/S3Bucket/Notifications/Resource", "constructInfo": { "fqn": "aws-cdk-lib.CfnResource", - "version": "2.149.0" + "version": "2.154.1" } } }, @@ -419,7 +419,7 @@ }, "constructInfo": { "fqn": "aws-cdk-lib.aws_s3.Bucket", - "version": "2.149.0" + "version": "2.154.1" } }, "aws-managed-key": { @@ -427,7 +427,7 @@ "path": "s3sns-snsTopicWithAwsManagedKey/test-s3-sns/aws-managed-key", "constructInfo": { "fqn": "aws-cdk-lib.Resource", - "version": "2.149.0" + "version": "2.154.1" } }, "SnsTopic": { @@ -464,7 +464,7 @@ }, "constructInfo": { "fqn": "aws-cdk-lib.aws_sns.CfnTopic", - "version": "2.149.0" + "version": "2.154.1" } }, "Policy": { @@ -581,25 +581,25 @@ }, "constructInfo": { "fqn": "aws-cdk-lib.aws_sns.CfnTopicPolicy", - "version": "2.149.0" + "version": "2.154.1" } } }, "constructInfo": { "fqn": "aws-cdk-lib.aws_sns.TopicPolicy", - "version": "2.149.0" + "version": "2.154.1" } } }, "constructInfo": { "fqn": "aws-cdk-lib.aws_sns.Topic", - "version": "2.149.0" + "version": "2.154.1" } } }, "constructInfo": { "fqn": "@aws-solutions-constructs/aws-s3-sns.S3ToSns", - "version": "2.62.0" + "version": "2.67.1" } }, "LatestNodeRuntimeMap": { @@ -607,7 +607,7 @@ "path": "s3sns-snsTopicWithAwsManagedKey/LatestNodeRuntimeMap", "constructInfo": { "fqn": "aws-cdk-lib.CfnMapping", - "version": "2.149.0" + "version": "2.154.1" } }, "Custom::S3AutoDeleteObjectsCustomResourceProvider": { @@ -619,7 +619,7 @@ "path": "s3sns-snsTopicWithAwsManagedKey/Custom::S3AutoDeleteObjectsCustomResourceProvider/Staging", "constructInfo": { "fqn": "aws-cdk-lib.AssetStaging", - "version": "2.149.0" + "version": "2.154.1" } }, "Role": { @@ -627,7 +627,7 @@ "path": "s3sns-snsTopicWithAwsManagedKey/Custom::S3AutoDeleteObjectsCustomResourceProvider/Role", "constructInfo": { "fqn": "aws-cdk-lib.CfnResource", - "version": "2.149.0" + "version": "2.154.1" } }, "Handler": { @@ -635,13 +635,13 @@ "path": "s3sns-snsTopicWithAwsManagedKey/Custom::S3AutoDeleteObjectsCustomResourceProvider/Handler", "constructInfo": { "fqn": "aws-cdk-lib.CfnResource", - "version": "2.149.0" + "version": "2.154.1" } } }, "constructInfo": { "fqn": "aws-cdk-lib.CustomResourceProviderBase", - "version": "2.149.0" + "version": "2.154.1" } }, "BucketNotificationsHandler050a0587b7544547bf325f094a3db834": { @@ -657,7 +657,7 @@ "path": "s3sns-snsTopicWithAwsManagedKey/BucketNotificationsHandler050a0587b7544547bf325f094a3db834/Role/ImportRole", "constructInfo": { "fqn": "aws-cdk-lib.Resource", - "version": "2.149.0" + "version": "2.154.1" } }, "Resource": { @@ -696,7 +696,7 @@ }, "constructInfo": { "fqn": "aws-cdk-lib.aws_iam.CfnRole", - "version": "2.149.0" + "version": "2.154.1" } }, "DefaultPolicy": { @@ -729,19 +729,19 @@ }, "constructInfo": { "fqn": "aws-cdk-lib.aws_iam.CfnPolicy", - "version": "2.149.0" + "version": "2.154.1" } } }, "constructInfo": { "fqn": "aws-cdk-lib.aws_iam.Policy", - "version": "2.149.0" + "version": "2.154.1" } } }, "constructInfo": { "fqn": "aws-cdk-lib.aws_iam.Role", - "version": "2.149.0" + "version": "2.154.1" } }, "Resource": { @@ -749,7 +749,7 @@ "path": "s3sns-snsTopicWithAwsManagedKey/BucketNotificationsHandler050a0587b7544547bf325f094a3db834/Resource", "constructInfo": { "fqn": "aws-cdk-lib.CfnResource", - "version": "2.149.0" + "version": "2.154.1" } } }, @@ -783,7 +783,7 @@ "path": "s3sns-snsTopicWithAwsManagedKey/Integ/DefaultTest/DeployAssert/BootstrapVersion", "constructInfo": { "fqn": "aws-cdk-lib.CfnParameter", - "version": "2.149.0" + "version": "2.154.1" } }, "CheckBootstrapVersion": { @@ -791,25 +791,25 @@ "path": "s3sns-snsTopicWithAwsManagedKey/Integ/DefaultTest/DeployAssert/CheckBootstrapVersion", "constructInfo": { "fqn": "aws-cdk-lib.CfnRule", - "version": "2.149.0" + "version": "2.154.1" } } }, "constructInfo": { "fqn": "aws-cdk-lib.Stack", - "version": "2.149.0" + "version": "2.154.1" } } }, "constructInfo": { "fqn": "@aws-cdk/integ-tests-alpha.IntegTestCase", - "version": "2.149.0-alpha.0" + "version": "2.154.1-alpha.0" } } }, "constructInfo": { "fqn": "@aws-cdk/integ-tests-alpha.IntegTest", - "version": "2.149.0-alpha.0" + "version": "2.154.1-alpha.0" } }, "BootstrapVersion": { @@ -817,7 +817,7 @@ "path": "s3sns-snsTopicWithAwsManagedKey/BootstrapVersion", "constructInfo": { "fqn": "aws-cdk-lib.CfnParameter", - "version": "2.149.0" + "version": "2.154.1" } }, "CheckBootstrapVersion": { @@ -825,13 +825,13 @@ "path": "s3sns-snsTopicWithAwsManagedKey/CheckBootstrapVersion", "constructInfo": { "fqn": "aws-cdk-lib.CfnRule", - "version": "2.149.0" + "version": "2.154.1" } } }, "constructInfo": { "fqn": "aws-cdk-lib.Stack", - "version": "2.149.0" + "version": "2.154.1" } }, "Tree": { @@ -845,7 +845,7 @@ }, "constructInfo": { "fqn": "aws-cdk-lib.App", - "version": "2.149.0" + "version": "2.154.1" } } } \ No newline at end of file diff --git a/source/patterns/@aws-solutions-constructs/aws-s3-sqs/package.json b/source/patterns/@aws-solutions-constructs/aws-s3-sqs/package.json index d7a22fd37..c16eae220 100644 --- a/source/patterns/@aws-solutions-constructs/aws-s3-sqs/package.json +++ b/source/patterns/@aws-solutions-constructs/aws-s3-sqs/package.json @@ -80,7 +80,7 @@ "peerDependencies": { "@aws-solutions-constructs/core": "0.0.0", "constructs": "^10.0.0", - "aws-cdk-lib": "0.0.0" + "aws-cdk-lib": "^0.0.0" }, "keywords": [ "aws", diff --git a/source/patterns/@aws-solutions-constructs/aws-s3-sqs/test/integ.s3sqs-creatingNewQueue.js.snapshot/cdk.out b/source/patterns/@aws-solutions-constructs/aws-s3-sqs/test/integ.s3sqs-creatingNewQueue.js.snapshot/cdk.out index 1f0068d32..0d15a78da 100644 --- a/source/patterns/@aws-solutions-constructs/aws-s3-sqs/test/integ.s3sqs-creatingNewQueue.js.snapshot/cdk.out +++ b/source/patterns/@aws-solutions-constructs/aws-s3-sqs/test/integ.s3sqs-creatingNewQueue.js.snapshot/cdk.out @@ -1 +1 @@ -{"version":"36.0.0"} \ No newline at end of file +{"version":"36.0.18"} \ No newline at end of file diff --git a/source/patterns/@aws-solutions-constructs/aws-s3-sqs/test/integ.s3sqs-creatingNewQueue.js.snapshot/integ.json b/source/patterns/@aws-solutions-constructs/aws-s3-sqs/test/integ.s3sqs-creatingNewQueue.js.snapshot/integ.json index d106b34fd..f2c74144f 100644 --- a/source/patterns/@aws-solutions-constructs/aws-s3-sqs/test/integ.s3sqs-creatingNewQueue.js.snapshot/integ.json +++ b/source/patterns/@aws-solutions-constructs/aws-s3-sqs/test/integ.s3sqs-creatingNewQueue.js.snapshot/integ.json @@ -1,5 +1,5 @@ { - "version": "36.0.0", + "version": "36.0.18", "testCases": { "s3sqs-creatingNewQueue/Integ/DefaultTest": { "stacks": [ diff --git a/source/patterns/@aws-solutions-constructs/aws-s3-sqs/test/integ.s3sqs-creatingNewQueue.js.snapshot/manifest.json b/source/patterns/@aws-solutions-constructs/aws-s3-sqs/test/integ.s3sqs-creatingNewQueue.js.snapshot/manifest.json index cd961217e..4140b6a9d 100644 --- a/source/patterns/@aws-solutions-constructs/aws-s3-sqs/test/integ.s3sqs-creatingNewQueue.js.snapshot/manifest.json +++ b/source/patterns/@aws-solutions-constructs/aws-s3-sqs/test/integ.s3sqs-creatingNewQueue.js.snapshot/manifest.json @@ -1,5 +1,5 @@ { - "version": "36.0.0", + "version": "36.0.5", "artifacts": { "s3sqscreatingNewQueueIntegDefaultTestDeployAssert480EFBFF.assets": { "type": "cdk:asset-manifest", @@ -66,7 +66,7 @@ "validateOnSynth": false, "assumeRoleArn": "arn:${AWS::Partition}:iam::${AWS::AccountId}:role/cdk-hnb659fds-deploy-role-${AWS::AccountId}-${AWS::Region}", "cloudFormationExecutionRoleArn": "arn:${AWS::Partition}:iam::${AWS::AccountId}:role/cdk-hnb659fds-cfn-exec-role-${AWS::AccountId}-${AWS::Region}", - "stackTemplateAssetObjectUrl": "s3://cdk-hnb659fds-assets-${AWS::AccountId}-${AWS::Region}/d2e9493f1689e55f85205485500c437a1f7f8d435fd76e17584b5c524d364e1e.json", + "stackTemplateAssetObjectUrl": "s3://cdk-hnb659fds-assets-${AWS::AccountId}-${AWS::Region}/20d530215759104400ee4d49061d0f3aa3b06c9ee1b9b5868725762e35c49786.json", "requiresBootstrapStackVersion": 6, "bootstrapStackVersionSsmParameter": "/cdk-bootstrap/hnb659fds/version", "additionalDependencies": [ @@ -148,6 +148,12 @@ "data": "LatestNodeRuntimeMap" } ], + "/s3sqs-creatingNewQueue/Custom::S3AutoDeleteObjectsCustomResourceProvider": [ + { + "type": "aws:cdk:is-custom-resource-handler-customResourceProvider", + "data": true + } + ], "/s3sqs-creatingNewQueue/Custom::S3AutoDeleteObjectsCustomResourceProvider/Role": [ { "type": "aws:cdk:logicalId", diff --git a/source/patterns/@aws-solutions-constructs/aws-s3-sqs/test/integ.s3sqs-creatingNewQueue.js.snapshot/s3sqs-creatingNewQueue.assets.json b/source/patterns/@aws-solutions-constructs/aws-s3-sqs/test/integ.s3sqs-creatingNewQueue.js.snapshot/s3sqs-creatingNewQueue.assets.json index e28ac87fa..b9230868c 100644 --- a/source/patterns/@aws-solutions-constructs/aws-s3-sqs/test/integ.s3sqs-creatingNewQueue.js.snapshot/s3sqs-creatingNewQueue.assets.json +++ b/source/patterns/@aws-solutions-constructs/aws-s3-sqs/test/integ.s3sqs-creatingNewQueue.js.snapshot/s3sqs-creatingNewQueue.assets.json @@ -1,5 +1,5 @@ { - "version": "36.0.0", + "version": "36.0.18", "files": { "faa95a81ae7d7373f3e1f242268f904eb748d8d0fdd306e8a6fe515a1905a7d6": { "source": { @@ -14,7 +14,7 @@ } } }, - "d2e9493f1689e55f85205485500c437a1f7f8d435fd76e17584b5c524d364e1e": { + "20d530215759104400ee4d49061d0f3aa3b06c9ee1b9b5868725762e35c49786": { "source": { "path": "s3sqs-creatingNewQueue.template.json", "packaging": "file" @@ -22,7 +22,7 @@ "destinations": { "current_account-current_region": { "bucketName": "cdk-hnb659fds-assets-${AWS::AccountId}-${AWS::Region}", - "objectKey": "d2e9493f1689e55f85205485500c437a1f7f8d435fd76e17584b5c524d364e1e.json", + "objectKey": "20d530215759104400ee4d49061d0f3aa3b06c9ee1b9b5868725762e35c49786.json", "assumeRoleArn": "arn:${AWS::Partition}:iam::${AWS::AccountId}:role/cdk-hnb659fds-file-publishing-role-${AWS::AccountId}-${AWS::Region}" } } diff --git a/source/patterns/@aws-solutions-constructs/aws-s3-sqs/test/integ.s3sqs-creatingNewQueue.js.snapshot/s3sqs-creatingNewQueue.template.json b/source/patterns/@aws-solutions-constructs/aws-s3-sqs/test/integ.s3sqs-creatingNewQueue.js.snapshot/s3sqs-creatingNewQueue.template.json index 30a3bccaa..22aedc306 100644 --- a/source/patterns/@aws-solutions-constructs/aws-s3-sqs/test/integ.s3sqs-creatingNewQueue.js.snapshot/s3sqs-creatingNewQueue.template.json +++ b/source/patterns/@aws-solutions-constructs/aws-s3-sqs/test/integ.s3sqs-creatingNewQueue.js.snapshot/s3sqs-creatingNewQueue.template.json @@ -271,7 +271,8 @@ } ] }, - "Managed": true + "Managed": true, + "SkipDestinationValidation": false }, "DependsOn": [ "tests3sqsqueuePolicyDDC0D745", @@ -631,7 +632,7 @@ "Properties": { "Description": "AWS CloudFormation handler for \"Custom::S3BucketNotifications\" resources (@aws-cdk/aws-s3)", "Code": { - "ZipFile": "import boto3 # type: ignore\nimport json\nimport logging\nimport urllib.request\n\ns3 = boto3.client(\"s3\")\n\nEVENTBRIDGE_CONFIGURATION = 'EventBridgeConfiguration'\nCONFIGURATION_TYPES = [\"TopicConfigurations\", \"QueueConfigurations\", \"LambdaFunctionConfigurations\"]\n\ndef handler(event: dict, context):\n response_status = \"SUCCESS\"\n error_message = \"\"\n try:\n props = event[\"ResourceProperties\"]\n notification_configuration = props[\"NotificationConfiguration\"]\n managed = props.get('Managed', 'true').lower() == 'true'\n stack_id = event['StackId']\n old = event.get(\"OldResourceProperties\", {}).get(\"NotificationConfiguration\", {})\n if managed:\n config = handle_managed(event[\"RequestType\"], notification_configuration)\n else:\n config = handle_unmanaged(props[\"BucketName\"], stack_id, event[\"RequestType\"], notification_configuration, old)\n s3.put_bucket_notification_configuration(Bucket=props[\"BucketName\"], NotificationConfiguration=config)\n except Exception as e:\n logging.exception(\"Failed to put bucket notification configuration\")\n response_status = \"FAILED\"\n error_message = f\"Error: {str(e)}. \"\n finally:\n submit_response(event, context, response_status, error_message)\n\ndef handle_managed(request_type, notification_configuration):\n if request_type == 'Delete':\n return {}\n return notification_configuration\n\ndef handle_unmanaged(bucket, stack_id, request_type, notification_configuration, old):\n def get_id(n):\n n['Id'] = ''\n strToHash=json.dumps(n, sort_keys=True).replace('\"Name\": \"prefix\"', '\"Name\": \"Prefix\"').replace('\"Name\": \"suffix\"', '\"Name\": \"Suffix\"')\n return f\"{stack_id}-{hash(strToHash)}\"\n def with_id(n):\n n['Id'] = get_id(n)\n return n\n\n external_notifications = {}\n existing_notifications = s3.get_bucket_notification_configuration(Bucket=bucket)\n for t in CONFIGURATION_TYPES:\n if request_type == 'Update':\n old_incoming_ids = [get_id(n) for n in old.get(t, [])]\n external_notifications[t] = [n for n in existing_notifications.get(t, []) if not get_id(n) in old_incoming_ids] \n elif request_type == 'Delete':\n external_notifications[t] = [n for n in existing_notifications.get(t, []) if not n['Id'].startswith(f\"{stack_id}-\")]\n elif request_type == 'Create':\n external_notifications[t] = [n for n in existing_notifications.get(t, [])]\n if EVENTBRIDGE_CONFIGURATION in existing_notifications:\n external_notifications[EVENTBRIDGE_CONFIGURATION] = existing_notifications[EVENTBRIDGE_CONFIGURATION]\n\n if request_type == 'Delete':\n return external_notifications\n\n notifications = {}\n for t in CONFIGURATION_TYPES:\n external = external_notifications.get(t, [])\n incoming = [with_id(n) for n in notification_configuration.get(t, [])]\n notifications[t] = external + incoming\n\n if EVENTBRIDGE_CONFIGURATION in notification_configuration:\n notifications[EVENTBRIDGE_CONFIGURATION] = notification_configuration[EVENTBRIDGE_CONFIGURATION]\n elif EVENTBRIDGE_CONFIGURATION in external_notifications:\n notifications[EVENTBRIDGE_CONFIGURATION] = external_notifications[EVENTBRIDGE_CONFIGURATION]\n\n return notifications\n\ndef submit_response(event: dict, context, response_status: str, error_message: str):\n response_body = json.dumps(\n {\n \"Status\": response_status,\n \"Reason\": f\"{error_message}See the details in CloudWatch Log Stream: {context.log_stream_name}\",\n \"PhysicalResourceId\": event.get(\"PhysicalResourceId\") or event[\"LogicalResourceId\"],\n \"StackId\": event[\"StackId\"],\n \"RequestId\": event[\"RequestId\"],\n \"LogicalResourceId\": event[\"LogicalResourceId\"],\n \"NoEcho\": False,\n }\n ).encode(\"utf-8\")\n headers = {\"content-type\": \"\", \"content-length\": str(len(response_body))}\n try:\n req = urllib.request.Request(url=event[\"ResponseURL\"], headers=headers, data=response_body, method=\"PUT\")\n with urllib.request.urlopen(req) as response:\n print(response.read().decode(\"utf-8\"))\n print(\"Status code: \" + response.reason)\n except Exception as e:\n print(\"send(..) failed executing request.urlopen(..): \" + str(e))" + "ZipFile": "import boto3 # type: ignore\nimport json\nimport logging\nimport urllib.request\n\ns3 = boto3.client(\"s3\")\n\nEVENTBRIDGE_CONFIGURATION = 'EventBridgeConfiguration'\nCONFIGURATION_TYPES = [\"TopicConfigurations\", \"QueueConfigurations\", \"LambdaFunctionConfigurations\"]\n\ndef handler(event: dict, context):\n response_status = \"SUCCESS\"\n error_message = \"\"\n try:\n props = event[\"ResourceProperties\"]\n notification_configuration = props[\"NotificationConfiguration\"]\n managed = props.get('Managed', 'true').lower() == 'true'\n skipDestinationValidation = props.get('SkipDestinationValidation', 'false').lower() == 'true'\n stack_id = event['StackId']\n old = event.get(\"OldResourceProperties\", {}).get(\"NotificationConfiguration\", {})\n if managed:\n config = handle_managed(event[\"RequestType\"], notification_configuration)\n else:\n config = handle_unmanaged(props[\"BucketName\"], stack_id, event[\"RequestType\"], notification_configuration, old)\n s3.put_bucket_notification_configuration(Bucket=props[\"BucketName\"], NotificationConfiguration=config, SkipDestinationValidation=skipDestinationValidation)\n except Exception as e:\n logging.exception(\"Failed to put bucket notification configuration\")\n response_status = \"FAILED\"\n error_message = f\"Error: {str(e)}. \"\n finally:\n submit_response(event, context, response_status, error_message)\n\ndef handle_managed(request_type, notification_configuration):\n if request_type == 'Delete':\n return {}\n return notification_configuration\n\ndef handle_unmanaged(bucket, stack_id, request_type, notification_configuration, old):\n def get_id(n):\n n['Id'] = ''\n strToHash=json.dumps(n, sort_keys=True).replace('\"Name\": \"prefix\"', '\"Name\": \"Prefix\"').replace('\"Name\": \"suffix\"', '\"Name\": \"Suffix\"')\n return f\"{stack_id}-{hash(strToHash)}\"\n def with_id(n):\n n['Id'] = get_id(n)\n return n\n\n external_notifications = {}\n existing_notifications = s3.get_bucket_notification_configuration(Bucket=bucket)\n for t in CONFIGURATION_TYPES:\n if request_type == 'Update':\n old_incoming_ids = [get_id(n) for n in old.get(t, [])]\n external_notifications[t] = [n for n in existing_notifications.get(t, []) if not get_id(n) in old_incoming_ids] \n elif request_type == 'Delete':\n external_notifications[t] = [n for n in existing_notifications.get(t, []) if not n['Id'].startswith(f\"{stack_id}-\")]\n elif request_type == 'Create':\n external_notifications[t] = [n for n in existing_notifications.get(t, [])]\n if EVENTBRIDGE_CONFIGURATION in existing_notifications:\n external_notifications[EVENTBRIDGE_CONFIGURATION] = existing_notifications[EVENTBRIDGE_CONFIGURATION]\n\n if request_type == 'Delete':\n return external_notifications\n\n notifications = {}\n for t in CONFIGURATION_TYPES:\n external = external_notifications.get(t, [])\n incoming = [with_id(n) for n in notification_configuration.get(t, [])]\n notifications[t] = external + incoming\n\n if EVENTBRIDGE_CONFIGURATION in notification_configuration:\n notifications[EVENTBRIDGE_CONFIGURATION] = notification_configuration[EVENTBRIDGE_CONFIGURATION]\n elif EVENTBRIDGE_CONFIGURATION in external_notifications:\n notifications[EVENTBRIDGE_CONFIGURATION] = external_notifications[EVENTBRIDGE_CONFIGURATION]\n\n return notifications\n\ndef submit_response(event: dict, context, response_status: str, error_message: str):\n response_body = json.dumps(\n {\n \"Status\": response_status,\n \"Reason\": f\"{error_message}See the details in CloudWatch Log Stream: {context.log_stream_name}\",\n \"PhysicalResourceId\": event.get(\"PhysicalResourceId\") or event[\"LogicalResourceId\"],\n \"StackId\": event[\"StackId\"],\n \"RequestId\": event[\"RequestId\"],\n \"LogicalResourceId\": event[\"LogicalResourceId\"],\n \"NoEcho\": False,\n }\n ).encode(\"utf-8\")\n headers = {\"content-type\": \"\", \"content-length\": str(len(response_body))}\n try:\n req = urllib.request.Request(url=event[\"ResponseURL\"], headers=headers, data=response_body, method=\"PUT\")\n with urllib.request.urlopen(req) as response:\n print(response.read().decode(\"utf-8\"))\n print(\"Status code: \" + response.reason)\n except Exception as e:\n print(\"send(..) failed executing request.urlopen(..): \" + str(e))" }, "Handler": "index.handler", "Role": { diff --git a/source/patterns/@aws-solutions-constructs/aws-s3-sqs/test/integ.s3sqs-creatingNewQueue.js.snapshot/s3sqscreatingNewQueueIntegDefaultTestDeployAssert480EFBFF.assets.json b/source/patterns/@aws-solutions-constructs/aws-s3-sqs/test/integ.s3sqs-creatingNewQueue.js.snapshot/s3sqscreatingNewQueueIntegDefaultTestDeployAssert480EFBFF.assets.json index 31337486f..4c153872e 100644 --- a/source/patterns/@aws-solutions-constructs/aws-s3-sqs/test/integ.s3sqs-creatingNewQueue.js.snapshot/s3sqscreatingNewQueueIntegDefaultTestDeployAssert480EFBFF.assets.json +++ b/source/patterns/@aws-solutions-constructs/aws-s3-sqs/test/integ.s3sqs-creatingNewQueue.js.snapshot/s3sqscreatingNewQueueIntegDefaultTestDeployAssert480EFBFF.assets.json @@ -1,5 +1,5 @@ { - "version": "36.0.0", + "version": "36.0.18", "files": { "21fbb51d7b23f6a6c262b46a9caee79d744a3ac019fd45422d988b96d44b2a22": { "source": { diff --git a/source/patterns/@aws-solutions-constructs/aws-s3-sqs/test/integ.s3sqs-creatingNewQueue.js.snapshot/tree.json b/source/patterns/@aws-solutions-constructs/aws-s3-sqs/test/integ.s3sqs-creatingNewQueue.js.snapshot/tree.json index c9b53cc77..b62ec069d 100644 --- a/source/patterns/@aws-solutions-constructs/aws-s3-sqs/test/integ.s3sqs-creatingNewQueue.js.snapshot/tree.json +++ b/source/patterns/@aws-solutions-constructs/aws-s3-sqs/test/integ.s3sqs-creatingNewQueue.js.snapshot/tree.json @@ -85,13 +85,13 @@ }, "constructInfo": { "fqn": "aws-cdk-lib.aws_kms.CfnKey", - "version": "2.149.0" + "version": "2.154.1" } } }, "constructInfo": { "fqn": "aws-cdk-lib.aws_kms.Key", - "version": "2.149.0" + "version": "2.154.1" } }, "test-s3-sqs": { @@ -149,7 +149,7 @@ }, "constructInfo": { "fqn": "aws-cdk-lib.aws_s3.CfnBucket", - "version": "2.149.0" + "version": "2.154.1" } }, "Policy": { @@ -247,13 +247,13 @@ }, "constructInfo": { "fqn": "aws-cdk-lib.aws_s3.CfnBucketPolicy", - "version": "2.149.0" + "version": "2.154.1" } } }, "constructInfo": { "fqn": "aws-cdk-lib.aws_s3.BucketPolicy", - "version": "2.149.0" + "version": "2.154.1" } }, "AutoDeleteObjectsCustomResource": { @@ -265,13 +265,13 @@ "path": "s3sqs-creatingNewQueue/test-s3-sqs/S3Bucket/AutoDeleteObjectsCustomResource/Default", "constructInfo": { "fqn": "aws-cdk-lib.CfnResource", - "version": "2.149.0" + "version": "2.154.1" } } }, "constructInfo": { "fqn": "aws-cdk-lib.CustomResource", - "version": "2.149.0" + "version": "2.154.1" } }, "Notifications": { @@ -283,7 +283,7 @@ "path": "s3sqs-creatingNewQueue/test-s3-sqs/S3Bucket/Notifications/Resource", "constructInfo": { "fqn": "aws-cdk-lib.CfnResource", - "version": "2.149.0" + "version": "2.154.1" } } }, @@ -295,7 +295,7 @@ }, "constructInfo": { "fqn": "aws-cdk-lib.aws_s3.Bucket", - "version": "2.149.0" + "version": "2.154.1" } }, "queue-dlq": { @@ -314,7 +314,7 @@ }, "constructInfo": { "fqn": "aws-cdk-lib.aws_sqs.CfnQueue", - "version": "2.149.0" + "version": "2.154.1" } }, "Policy": { @@ -397,19 +397,19 @@ }, "constructInfo": { "fqn": "aws-cdk-lib.aws_sqs.CfnQueuePolicy", - "version": "2.149.0" + "version": "2.154.1" } } }, "constructInfo": { "fqn": "aws-cdk-lib.aws_sqs.QueuePolicy", - "version": "2.149.0" + "version": "2.154.1" } } }, "constructInfo": { "fqn": "aws-cdk-lib.aws_sqs.Queue", - "version": "2.149.0" + "version": "2.154.1" } }, "queue": { @@ -442,7 +442,7 @@ }, "constructInfo": { "fqn": "aws-cdk-lib.aws_sqs.CfnQueue", - "version": "2.149.0" + "version": "2.154.1" } }, "Policy": { @@ -552,25 +552,25 @@ }, "constructInfo": { "fqn": "aws-cdk-lib.aws_sqs.CfnQueuePolicy", - "version": "2.149.0" + "version": "2.154.1" } } }, "constructInfo": { "fqn": "aws-cdk-lib.aws_sqs.QueuePolicy", - "version": "2.149.0" + "version": "2.154.1" } } }, "constructInfo": { "fqn": "aws-cdk-lib.aws_sqs.Queue", - "version": "2.149.0" + "version": "2.154.1" } } }, "constructInfo": { "fqn": "@aws-solutions-constructs/aws-s3-sqs.S3ToSqs", - "version": "2.62.0" + "version": "2.67.1" } }, "LatestNodeRuntimeMap": { @@ -578,7 +578,7 @@ "path": "s3sqs-creatingNewQueue/LatestNodeRuntimeMap", "constructInfo": { "fqn": "aws-cdk-lib.CfnMapping", - "version": "2.149.0" + "version": "2.154.1" } }, "Custom::S3AutoDeleteObjectsCustomResourceProvider": { @@ -590,7 +590,7 @@ "path": "s3sqs-creatingNewQueue/Custom::S3AutoDeleteObjectsCustomResourceProvider/Staging", "constructInfo": { "fqn": "aws-cdk-lib.AssetStaging", - "version": "2.149.0" + "version": "2.154.1" } }, "Role": { @@ -598,7 +598,7 @@ "path": "s3sqs-creatingNewQueue/Custom::S3AutoDeleteObjectsCustomResourceProvider/Role", "constructInfo": { "fqn": "aws-cdk-lib.CfnResource", - "version": "2.149.0" + "version": "2.154.1" } }, "Handler": { @@ -606,13 +606,13 @@ "path": "s3sqs-creatingNewQueue/Custom::S3AutoDeleteObjectsCustomResourceProvider/Handler", "constructInfo": { "fqn": "aws-cdk-lib.CfnResource", - "version": "2.149.0" + "version": "2.154.1" } } }, "constructInfo": { "fqn": "aws-cdk-lib.CustomResourceProviderBase", - "version": "2.149.0" + "version": "2.154.1" } }, "BucketNotificationsHandler050a0587b7544547bf325f094a3db834": { @@ -628,7 +628,7 @@ "path": "s3sqs-creatingNewQueue/BucketNotificationsHandler050a0587b7544547bf325f094a3db834/Role/ImportRole", "constructInfo": { "fqn": "aws-cdk-lib.Resource", - "version": "2.149.0" + "version": "2.154.1" } }, "Resource": { @@ -667,7 +667,7 @@ }, "constructInfo": { "fqn": "aws-cdk-lib.aws_iam.CfnRole", - "version": "2.149.0" + "version": "2.154.1" } }, "DefaultPolicy": { @@ -700,19 +700,19 @@ }, "constructInfo": { "fqn": "aws-cdk-lib.aws_iam.CfnPolicy", - "version": "2.149.0" + "version": "2.154.1" } } }, "constructInfo": { "fqn": "aws-cdk-lib.aws_iam.Policy", - "version": "2.149.0" + "version": "2.154.1" } } }, "constructInfo": { "fqn": "aws-cdk-lib.aws_iam.Role", - "version": "2.149.0" + "version": "2.154.1" } }, "Resource": { @@ -720,7 +720,7 @@ "path": "s3sqs-creatingNewQueue/BucketNotificationsHandler050a0587b7544547bf325f094a3db834/Resource", "constructInfo": { "fqn": "aws-cdk-lib.CfnResource", - "version": "2.149.0" + "version": "2.154.1" } } }, @@ -754,7 +754,7 @@ "path": "s3sqs-creatingNewQueue/Integ/DefaultTest/DeployAssert/BootstrapVersion", "constructInfo": { "fqn": "aws-cdk-lib.CfnParameter", - "version": "2.149.0" + "version": "2.154.1" } }, "CheckBootstrapVersion": { @@ -762,25 +762,25 @@ "path": "s3sqs-creatingNewQueue/Integ/DefaultTest/DeployAssert/CheckBootstrapVersion", "constructInfo": { "fqn": "aws-cdk-lib.CfnRule", - "version": "2.149.0" + "version": "2.154.1" } } }, "constructInfo": { "fqn": "aws-cdk-lib.Stack", - "version": "2.149.0" + "version": "2.154.1" } } }, "constructInfo": { "fqn": "@aws-cdk/integ-tests-alpha.IntegTestCase", - "version": "2.149.0-alpha.0" + "version": "2.154.1-alpha.0" } } }, "constructInfo": { "fqn": "@aws-cdk/integ-tests-alpha.IntegTest", - "version": "2.149.0-alpha.0" + "version": "2.154.1-alpha.0" } }, "BootstrapVersion": { @@ -788,7 +788,7 @@ "path": "s3sqs-creatingNewQueue/BootstrapVersion", "constructInfo": { "fqn": "aws-cdk-lib.CfnParameter", - "version": "2.149.0" + "version": "2.154.1" } }, "CheckBootstrapVersion": { @@ -796,13 +796,13 @@ "path": "s3sqs-creatingNewQueue/CheckBootstrapVersion", "constructInfo": { "fqn": "aws-cdk-lib.CfnRule", - "version": "2.149.0" + "version": "2.154.1" } } }, "constructInfo": { "fqn": "aws-cdk-lib.Stack", - "version": "2.149.0" + "version": "2.154.1" } }, "Tree": { @@ -816,7 +816,7 @@ }, "constructInfo": { "fqn": "aws-cdk-lib.App", - "version": "2.149.0" + "version": "2.154.1" } } } \ No newline at end of file diff --git a/source/patterns/@aws-solutions-constructs/aws-s3-sqs/test/integ.s3sqs-customLoggingBucket.js.snapshot/cdk.out b/source/patterns/@aws-solutions-constructs/aws-s3-sqs/test/integ.s3sqs-customLoggingBucket.js.snapshot/cdk.out index 1f0068d32..0d15a78da 100644 --- a/source/patterns/@aws-solutions-constructs/aws-s3-sqs/test/integ.s3sqs-customLoggingBucket.js.snapshot/cdk.out +++ b/source/patterns/@aws-solutions-constructs/aws-s3-sqs/test/integ.s3sqs-customLoggingBucket.js.snapshot/cdk.out @@ -1 +1 @@ -{"version":"36.0.0"} \ No newline at end of file +{"version":"36.0.18"} \ No newline at end of file diff --git a/source/patterns/@aws-solutions-constructs/aws-s3-sqs/test/integ.s3sqs-customLoggingBucket.js.snapshot/integ.json b/source/patterns/@aws-solutions-constructs/aws-s3-sqs/test/integ.s3sqs-customLoggingBucket.js.snapshot/integ.json index 1355ee3af..d7a7bb308 100644 --- a/source/patterns/@aws-solutions-constructs/aws-s3-sqs/test/integ.s3sqs-customLoggingBucket.js.snapshot/integ.json +++ b/source/patterns/@aws-solutions-constructs/aws-s3-sqs/test/integ.s3sqs-customLoggingBucket.js.snapshot/integ.json @@ -1,5 +1,5 @@ { - "version": "36.0.0", + "version": "36.0.18", "testCases": { "s3sqs-customLoggingBucket/Integ/DefaultTest": { "stacks": [ diff --git a/source/patterns/@aws-solutions-constructs/aws-s3-sqs/test/integ.s3sqs-customLoggingBucket.js.snapshot/manifest.json b/source/patterns/@aws-solutions-constructs/aws-s3-sqs/test/integ.s3sqs-customLoggingBucket.js.snapshot/manifest.json index a242d2ed4..aa793dd67 100644 --- a/source/patterns/@aws-solutions-constructs/aws-s3-sqs/test/integ.s3sqs-customLoggingBucket.js.snapshot/manifest.json +++ b/source/patterns/@aws-solutions-constructs/aws-s3-sqs/test/integ.s3sqs-customLoggingBucket.js.snapshot/manifest.json @@ -1,5 +1,5 @@ { - "version": "36.0.0", + "version": "36.0.5", "artifacts": { "s3sqscustomLoggingBucketIntegDefaultTestDeployAssert5A53409E.assets": { "type": "cdk:asset-manifest", @@ -66,7 +66,7 @@ "validateOnSynth": false, "assumeRoleArn": "arn:${AWS::Partition}:iam::${AWS::AccountId}:role/cdk-hnb659fds-deploy-role-${AWS::AccountId}-${AWS::Region}", "cloudFormationExecutionRoleArn": "arn:${AWS::Partition}:iam::${AWS::AccountId}:role/cdk-hnb659fds-cfn-exec-role-${AWS::AccountId}-${AWS::Region}", - "stackTemplateAssetObjectUrl": "s3://cdk-hnb659fds-assets-${AWS::AccountId}-${AWS::Region}/61170150ad442db34981e9349277955cfc0093ea3ed5a687425bb749309da741.json", + "stackTemplateAssetObjectUrl": "s3://cdk-hnb659fds-assets-${AWS::AccountId}-${AWS::Region}/ff6438a12364a42f25c6e5e972a11450be09d9f59085193473e5ea03e24390b2.json", "requiresBootstrapStackVersion": 6, "bootstrapStackVersionSsmParameter": "/cdk-bootstrap/hnb659fds/version", "additionalDependencies": [ @@ -160,6 +160,12 @@ "data": "LatestNodeRuntimeMap" } ], + "/s3sqs-customLoggingBucket/Custom::S3AutoDeleteObjectsCustomResourceProvider": [ + { + "type": "aws:cdk:is-custom-resource-handler-customResourceProvider", + "data": true + } + ], "/s3sqs-customLoggingBucket/Custom::S3AutoDeleteObjectsCustomResourceProvider/Role": [ { "type": "aws:cdk:logicalId", diff --git a/source/patterns/@aws-solutions-constructs/aws-s3-sqs/test/integ.s3sqs-customLoggingBucket.js.snapshot/s3sqs-customLoggingBucket.assets.json b/source/patterns/@aws-solutions-constructs/aws-s3-sqs/test/integ.s3sqs-customLoggingBucket.js.snapshot/s3sqs-customLoggingBucket.assets.json index 59f8eb724..743cc48d8 100644 --- a/source/patterns/@aws-solutions-constructs/aws-s3-sqs/test/integ.s3sqs-customLoggingBucket.js.snapshot/s3sqs-customLoggingBucket.assets.json +++ b/source/patterns/@aws-solutions-constructs/aws-s3-sqs/test/integ.s3sqs-customLoggingBucket.js.snapshot/s3sqs-customLoggingBucket.assets.json @@ -1,5 +1,5 @@ { - "version": "36.0.0", + "version": "36.0.18", "files": { "faa95a81ae7d7373f3e1f242268f904eb748d8d0fdd306e8a6fe515a1905a7d6": { "source": { @@ -14,7 +14,7 @@ } } }, - "61170150ad442db34981e9349277955cfc0093ea3ed5a687425bb749309da741": { + "ff6438a12364a42f25c6e5e972a11450be09d9f59085193473e5ea03e24390b2": { "source": { "path": "s3sqs-customLoggingBucket.template.json", "packaging": "file" @@ -22,7 +22,7 @@ "destinations": { "current_account-current_region": { "bucketName": "cdk-hnb659fds-assets-${AWS::AccountId}-${AWS::Region}", - "objectKey": "61170150ad442db34981e9349277955cfc0093ea3ed5a687425bb749309da741.json", + "objectKey": "ff6438a12364a42f25c6e5e972a11450be09d9f59085193473e5ea03e24390b2.json", "assumeRoleArn": "arn:${AWS::Partition}:iam::${AWS::AccountId}:role/cdk-hnb659fds-file-publishing-role-${AWS::AccountId}-${AWS::Region}" } } diff --git a/source/patterns/@aws-solutions-constructs/aws-s3-sqs/test/integ.s3sqs-customLoggingBucket.js.snapshot/s3sqs-customLoggingBucket.template.json b/source/patterns/@aws-solutions-constructs/aws-s3-sqs/test/integ.s3sqs-customLoggingBucket.js.snapshot/s3sqs-customLoggingBucket.template.json index 4fbca82b2..8a41fda6f 100644 --- a/source/patterns/@aws-solutions-constructs/aws-s3-sqs/test/integ.s3sqs-customLoggingBucket.js.snapshot/s3sqs-customLoggingBucket.template.json +++ b/source/patterns/@aws-solutions-constructs/aws-s3-sqs/test/integ.s3sqs-customLoggingBucket.js.snapshot/s3sqs-customLoggingBucket.template.json @@ -312,7 +312,8 @@ } ] }, - "Managed": true + "Managed": true, + "SkipDestinationValidation": false }, "DependsOn": [ "tests3sqsqueuePolicyDDC0D745", @@ -740,7 +741,7 @@ "Properties": { "Description": "AWS CloudFormation handler for \"Custom::S3BucketNotifications\" resources (@aws-cdk/aws-s3)", "Code": { - "ZipFile": "import boto3 # type: ignore\nimport json\nimport logging\nimport urllib.request\n\ns3 = boto3.client(\"s3\")\n\nEVENTBRIDGE_CONFIGURATION = 'EventBridgeConfiguration'\nCONFIGURATION_TYPES = [\"TopicConfigurations\", \"QueueConfigurations\", \"LambdaFunctionConfigurations\"]\n\ndef handler(event: dict, context):\n response_status = \"SUCCESS\"\n error_message = \"\"\n try:\n props = event[\"ResourceProperties\"]\n notification_configuration = props[\"NotificationConfiguration\"]\n managed = props.get('Managed', 'true').lower() == 'true'\n stack_id = event['StackId']\n old = event.get(\"OldResourceProperties\", {}).get(\"NotificationConfiguration\", {})\n if managed:\n config = handle_managed(event[\"RequestType\"], notification_configuration)\n else:\n config = handle_unmanaged(props[\"BucketName\"], stack_id, event[\"RequestType\"], notification_configuration, old)\n s3.put_bucket_notification_configuration(Bucket=props[\"BucketName\"], NotificationConfiguration=config)\n except Exception as e:\n logging.exception(\"Failed to put bucket notification configuration\")\n response_status = \"FAILED\"\n error_message = f\"Error: {str(e)}. \"\n finally:\n submit_response(event, context, response_status, error_message)\n\ndef handle_managed(request_type, notification_configuration):\n if request_type == 'Delete':\n return {}\n return notification_configuration\n\ndef handle_unmanaged(bucket, stack_id, request_type, notification_configuration, old):\n def get_id(n):\n n['Id'] = ''\n strToHash=json.dumps(n, sort_keys=True).replace('\"Name\": \"prefix\"', '\"Name\": \"Prefix\"').replace('\"Name\": \"suffix\"', '\"Name\": \"Suffix\"')\n return f\"{stack_id}-{hash(strToHash)}\"\n def with_id(n):\n n['Id'] = get_id(n)\n return n\n\n external_notifications = {}\n existing_notifications = s3.get_bucket_notification_configuration(Bucket=bucket)\n for t in CONFIGURATION_TYPES:\n if request_type == 'Update':\n old_incoming_ids = [get_id(n) for n in old.get(t, [])]\n external_notifications[t] = [n for n in existing_notifications.get(t, []) if not get_id(n) in old_incoming_ids] \n elif request_type == 'Delete':\n external_notifications[t] = [n for n in existing_notifications.get(t, []) if not n['Id'].startswith(f\"{stack_id}-\")]\n elif request_type == 'Create':\n external_notifications[t] = [n for n in existing_notifications.get(t, [])]\n if EVENTBRIDGE_CONFIGURATION in existing_notifications:\n external_notifications[EVENTBRIDGE_CONFIGURATION] = existing_notifications[EVENTBRIDGE_CONFIGURATION]\n\n if request_type == 'Delete':\n return external_notifications\n\n notifications = {}\n for t in CONFIGURATION_TYPES:\n external = external_notifications.get(t, [])\n incoming = [with_id(n) for n in notification_configuration.get(t, [])]\n notifications[t] = external + incoming\n\n if EVENTBRIDGE_CONFIGURATION in notification_configuration:\n notifications[EVENTBRIDGE_CONFIGURATION] = notification_configuration[EVENTBRIDGE_CONFIGURATION]\n elif EVENTBRIDGE_CONFIGURATION in external_notifications:\n notifications[EVENTBRIDGE_CONFIGURATION] = external_notifications[EVENTBRIDGE_CONFIGURATION]\n\n return notifications\n\ndef submit_response(event: dict, context, response_status: str, error_message: str):\n response_body = json.dumps(\n {\n \"Status\": response_status,\n \"Reason\": f\"{error_message}See the details in CloudWatch Log Stream: {context.log_stream_name}\",\n \"PhysicalResourceId\": event.get(\"PhysicalResourceId\") or event[\"LogicalResourceId\"],\n \"StackId\": event[\"StackId\"],\n \"RequestId\": event[\"RequestId\"],\n \"LogicalResourceId\": event[\"LogicalResourceId\"],\n \"NoEcho\": False,\n }\n ).encode(\"utf-8\")\n headers = {\"content-type\": \"\", \"content-length\": str(len(response_body))}\n try:\n req = urllib.request.Request(url=event[\"ResponseURL\"], headers=headers, data=response_body, method=\"PUT\")\n with urllib.request.urlopen(req) as response:\n print(response.read().decode(\"utf-8\"))\n print(\"Status code: \" + response.reason)\n except Exception as e:\n print(\"send(..) failed executing request.urlopen(..): \" + str(e))" + "ZipFile": "import boto3 # type: ignore\nimport json\nimport logging\nimport urllib.request\n\ns3 = boto3.client(\"s3\")\n\nEVENTBRIDGE_CONFIGURATION = 'EventBridgeConfiguration'\nCONFIGURATION_TYPES = [\"TopicConfigurations\", \"QueueConfigurations\", \"LambdaFunctionConfigurations\"]\n\ndef handler(event: dict, context):\n response_status = \"SUCCESS\"\n error_message = \"\"\n try:\n props = event[\"ResourceProperties\"]\n notification_configuration = props[\"NotificationConfiguration\"]\n managed = props.get('Managed', 'true').lower() == 'true'\n skipDestinationValidation = props.get('SkipDestinationValidation', 'false').lower() == 'true'\n stack_id = event['StackId']\n old = event.get(\"OldResourceProperties\", {}).get(\"NotificationConfiguration\", {})\n if managed:\n config = handle_managed(event[\"RequestType\"], notification_configuration)\n else:\n config = handle_unmanaged(props[\"BucketName\"], stack_id, event[\"RequestType\"], notification_configuration, old)\n s3.put_bucket_notification_configuration(Bucket=props[\"BucketName\"], NotificationConfiguration=config, SkipDestinationValidation=skipDestinationValidation)\n except Exception as e:\n logging.exception(\"Failed to put bucket notification configuration\")\n response_status = \"FAILED\"\n error_message = f\"Error: {str(e)}. \"\n finally:\n submit_response(event, context, response_status, error_message)\n\ndef handle_managed(request_type, notification_configuration):\n if request_type == 'Delete':\n return {}\n return notification_configuration\n\ndef handle_unmanaged(bucket, stack_id, request_type, notification_configuration, old):\n def get_id(n):\n n['Id'] = ''\n strToHash=json.dumps(n, sort_keys=True).replace('\"Name\": \"prefix\"', '\"Name\": \"Prefix\"').replace('\"Name\": \"suffix\"', '\"Name\": \"Suffix\"')\n return f\"{stack_id}-{hash(strToHash)}\"\n def with_id(n):\n n['Id'] = get_id(n)\n return n\n\n external_notifications = {}\n existing_notifications = s3.get_bucket_notification_configuration(Bucket=bucket)\n for t in CONFIGURATION_TYPES:\n if request_type == 'Update':\n old_incoming_ids = [get_id(n) for n in old.get(t, [])]\n external_notifications[t] = [n for n in existing_notifications.get(t, []) if not get_id(n) in old_incoming_ids] \n elif request_type == 'Delete':\n external_notifications[t] = [n for n in existing_notifications.get(t, []) if not n['Id'].startswith(f\"{stack_id}-\")]\n elif request_type == 'Create':\n external_notifications[t] = [n for n in existing_notifications.get(t, [])]\n if EVENTBRIDGE_CONFIGURATION in existing_notifications:\n external_notifications[EVENTBRIDGE_CONFIGURATION] = existing_notifications[EVENTBRIDGE_CONFIGURATION]\n\n if request_type == 'Delete':\n return external_notifications\n\n notifications = {}\n for t in CONFIGURATION_TYPES:\n external = external_notifications.get(t, [])\n incoming = [with_id(n) for n in notification_configuration.get(t, [])]\n notifications[t] = external + incoming\n\n if EVENTBRIDGE_CONFIGURATION in notification_configuration:\n notifications[EVENTBRIDGE_CONFIGURATION] = notification_configuration[EVENTBRIDGE_CONFIGURATION]\n elif EVENTBRIDGE_CONFIGURATION in external_notifications:\n notifications[EVENTBRIDGE_CONFIGURATION] = external_notifications[EVENTBRIDGE_CONFIGURATION]\n\n return notifications\n\ndef submit_response(event: dict, context, response_status: str, error_message: str):\n response_body = json.dumps(\n {\n \"Status\": response_status,\n \"Reason\": f\"{error_message}See the details in CloudWatch Log Stream: {context.log_stream_name}\",\n \"PhysicalResourceId\": event.get(\"PhysicalResourceId\") or event[\"LogicalResourceId\"],\n \"StackId\": event[\"StackId\"],\n \"RequestId\": event[\"RequestId\"],\n \"LogicalResourceId\": event[\"LogicalResourceId\"],\n \"NoEcho\": False,\n }\n ).encode(\"utf-8\")\n headers = {\"content-type\": \"\", \"content-length\": str(len(response_body))}\n try:\n req = urllib.request.Request(url=event[\"ResponseURL\"], headers=headers, data=response_body, method=\"PUT\")\n with urllib.request.urlopen(req) as response:\n print(response.read().decode(\"utf-8\"))\n print(\"Status code: \" + response.reason)\n except Exception as e:\n print(\"send(..) failed executing request.urlopen(..): \" + str(e))" }, "Handler": "index.handler", "Role": { diff --git a/source/patterns/@aws-solutions-constructs/aws-s3-sqs/test/integ.s3sqs-customLoggingBucket.js.snapshot/s3sqscustomLoggingBucketIntegDefaultTestDeployAssert5A53409E.assets.json b/source/patterns/@aws-solutions-constructs/aws-s3-sqs/test/integ.s3sqs-customLoggingBucket.js.snapshot/s3sqscustomLoggingBucketIntegDefaultTestDeployAssert5A53409E.assets.json index d94a98e51..8241967f5 100644 --- a/source/patterns/@aws-solutions-constructs/aws-s3-sqs/test/integ.s3sqs-customLoggingBucket.js.snapshot/s3sqscustomLoggingBucketIntegDefaultTestDeployAssert5A53409E.assets.json +++ b/source/patterns/@aws-solutions-constructs/aws-s3-sqs/test/integ.s3sqs-customLoggingBucket.js.snapshot/s3sqscustomLoggingBucketIntegDefaultTestDeployAssert5A53409E.assets.json @@ -1,5 +1,5 @@ { - "version": "36.0.0", + "version": "36.0.18", "files": { "21fbb51d7b23f6a6c262b46a9caee79d744a3ac019fd45422d988b96d44b2a22": { "source": { diff --git a/source/patterns/@aws-solutions-constructs/aws-s3-sqs/test/integ.s3sqs-customLoggingBucket.js.snapshot/tree.json b/source/patterns/@aws-solutions-constructs/aws-s3-sqs/test/integ.s3sqs-customLoggingBucket.js.snapshot/tree.json index 815d9f54b..b47f60784 100644 --- a/source/patterns/@aws-solutions-constructs/aws-s3-sqs/test/integ.s3sqs-customLoggingBucket.js.snapshot/tree.json +++ b/source/patterns/@aws-solutions-constructs/aws-s3-sqs/test/integ.s3sqs-customLoggingBucket.js.snapshot/tree.json @@ -63,7 +63,7 @@ }, "constructInfo": { "fqn": "aws-cdk-lib.aws_s3.CfnBucket", - "version": "2.149.0" + "version": "2.154.1" } }, "Policy": { @@ -197,13 +197,13 @@ }, "constructInfo": { "fqn": "aws-cdk-lib.aws_s3.CfnBucketPolicy", - "version": "2.149.0" + "version": "2.154.1" } } }, "constructInfo": { "fqn": "aws-cdk-lib.aws_s3.BucketPolicy", - "version": "2.149.0" + "version": "2.154.1" } }, "AutoDeleteObjectsCustomResource": { @@ -215,19 +215,19 @@ "path": "s3sqs-customLoggingBucket/test-s3-sqs/S3LoggingBucket/AutoDeleteObjectsCustomResource/Default", "constructInfo": { "fqn": "aws-cdk-lib.CfnResource", - "version": "2.149.0" + "version": "2.154.1" } } }, "constructInfo": { "fqn": "aws-cdk-lib.CustomResource", - "version": "2.149.0" + "version": "2.154.1" } } }, "constructInfo": { "fqn": "aws-cdk-lib.aws_s3.Bucket", - "version": "2.149.0" + "version": "2.154.1" } }, "S3Bucket": { @@ -280,7 +280,7 @@ }, "constructInfo": { "fqn": "aws-cdk-lib.aws_s3.CfnBucket", - "version": "2.149.0" + "version": "2.154.1" } }, "Policy": { @@ -339,13 +339,13 @@ }, "constructInfo": { "fqn": "aws-cdk-lib.aws_s3.CfnBucketPolicy", - "version": "2.149.0" + "version": "2.154.1" } } }, "constructInfo": { "fqn": "aws-cdk-lib.aws_s3.BucketPolicy", - "version": "2.149.0" + "version": "2.154.1" } }, "Notifications": { @@ -357,7 +357,7 @@ "path": "s3sqs-customLoggingBucket/test-s3-sqs/S3Bucket/Notifications/Resource", "constructInfo": { "fqn": "aws-cdk-lib.CfnResource", - "version": "2.149.0" + "version": "2.154.1" } } }, @@ -369,7 +369,7 @@ }, "constructInfo": { "fqn": "aws-cdk-lib.aws_s3.Bucket", - "version": "2.149.0" + "version": "2.154.1" } }, "queue-dlq": { @@ -387,7 +387,7 @@ }, "constructInfo": { "fqn": "aws-cdk-lib.aws_sqs.CfnQueue", - "version": "2.149.0" + "version": "2.154.1" } }, "Policy": { @@ -470,19 +470,19 @@ }, "constructInfo": { "fqn": "aws-cdk-lib.aws_sqs.CfnQueuePolicy", - "version": "2.149.0" + "version": "2.154.1" } } }, "constructInfo": { "fqn": "aws-cdk-lib.aws_sqs.QueuePolicy", - "version": "2.149.0" + "version": "2.154.1" } } }, "constructInfo": { "fqn": "aws-cdk-lib.aws_sqs.Queue", - "version": "2.149.0" + "version": "2.154.1" } }, "'queueKey'": { @@ -562,13 +562,13 @@ }, "constructInfo": { "fqn": "aws-cdk-lib.aws_kms.CfnKey", - "version": "2.149.0" + "version": "2.154.1" } } }, "constructInfo": { "fqn": "aws-cdk-lib.aws_kms.Key", - "version": "2.149.0" + "version": "2.154.1" } }, "queue": { @@ -600,7 +600,7 @@ }, "constructInfo": { "fqn": "aws-cdk-lib.aws_sqs.CfnQueue", - "version": "2.149.0" + "version": "2.154.1" } }, "Policy": { @@ -710,25 +710,25 @@ }, "constructInfo": { "fqn": "aws-cdk-lib.aws_sqs.CfnQueuePolicy", - "version": "2.149.0" + "version": "2.154.1" } } }, "constructInfo": { "fqn": "aws-cdk-lib.aws_sqs.QueuePolicy", - "version": "2.149.0" + "version": "2.154.1" } } }, "constructInfo": { "fqn": "aws-cdk-lib.aws_sqs.Queue", - "version": "2.149.0" + "version": "2.154.1" } } }, "constructInfo": { "fqn": "@aws-solutions-constructs/aws-s3-sqs.S3ToSqs", - "version": "2.62.0" + "version": "2.67.1" } }, "LatestNodeRuntimeMap": { @@ -736,7 +736,7 @@ "path": "s3sqs-customLoggingBucket/LatestNodeRuntimeMap", "constructInfo": { "fqn": "aws-cdk-lib.CfnMapping", - "version": "2.149.0" + "version": "2.154.1" } }, "Custom::S3AutoDeleteObjectsCustomResourceProvider": { @@ -748,7 +748,7 @@ "path": "s3sqs-customLoggingBucket/Custom::S3AutoDeleteObjectsCustomResourceProvider/Staging", "constructInfo": { "fqn": "aws-cdk-lib.AssetStaging", - "version": "2.149.0" + "version": "2.154.1" } }, "Role": { @@ -756,7 +756,7 @@ "path": "s3sqs-customLoggingBucket/Custom::S3AutoDeleteObjectsCustomResourceProvider/Role", "constructInfo": { "fqn": "aws-cdk-lib.CfnResource", - "version": "2.149.0" + "version": "2.154.1" } }, "Handler": { @@ -764,13 +764,13 @@ "path": "s3sqs-customLoggingBucket/Custom::S3AutoDeleteObjectsCustomResourceProvider/Handler", "constructInfo": { "fqn": "aws-cdk-lib.CfnResource", - "version": "2.149.0" + "version": "2.154.1" } } }, "constructInfo": { "fqn": "aws-cdk-lib.CustomResourceProviderBase", - "version": "2.149.0" + "version": "2.154.1" } }, "BucketNotificationsHandler050a0587b7544547bf325f094a3db834": { @@ -786,7 +786,7 @@ "path": "s3sqs-customLoggingBucket/BucketNotificationsHandler050a0587b7544547bf325f094a3db834/Role/ImportRole", "constructInfo": { "fqn": "aws-cdk-lib.Resource", - "version": "2.149.0" + "version": "2.154.1" } }, "Resource": { @@ -825,7 +825,7 @@ }, "constructInfo": { "fqn": "aws-cdk-lib.aws_iam.CfnRole", - "version": "2.149.0" + "version": "2.154.1" } }, "DefaultPolicy": { @@ -858,19 +858,19 @@ }, "constructInfo": { "fqn": "aws-cdk-lib.aws_iam.CfnPolicy", - "version": "2.149.0" + "version": "2.154.1" } } }, "constructInfo": { "fqn": "aws-cdk-lib.aws_iam.Policy", - "version": "2.149.0" + "version": "2.154.1" } } }, "constructInfo": { "fqn": "aws-cdk-lib.aws_iam.Role", - "version": "2.149.0" + "version": "2.154.1" } }, "Resource": { @@ -878,7 +878,7 @@ "path": "s3sqs-customLoggingBucket/BucketNotificationsHandler050a0587b7544547bf325f094a3db834/Resource", "constructInfo": { "fqn": "aws-cdk-lib.CfnResource", - "version": "2.149.0" + "version": "2.154.1" } } }, @@ -912,7 +912,7 @@ "path": "s3sqs-customLoggingBucket/Integ/DefaultTest/DeployAssert/BootstrapVersion", "constructInfo": { "fqn": "aws-cdk-lib.CfnParameter", - "version": "2.149.0" + "version": "2.154.1" } }, "CheckBootstrapVersion": { @@ -920,25 +920,25 @@ "path": "s3sqs-customLoggingBucket/Integ/DefaultTest/DeployAssert/CheckBootstrapVersion", "constructInfo": { "fqn": "aws-cdk-lib.CfnRule", - "version": "2.149.0" + "version": "2.154.1" } } }, "constructInfo": { "fqn": "aws-cdk-lib.Stack", - "version": "2.149.0" + "version": "2.154.1" } } }, "constructInfo": { "fqn": "@aws-cdk/integ-tests-alpha.IntegTestCase", - "version": "2.149.0-alpha.0" + "version": "2.154.1-alpha.0" } } }, "constructInfo": { "fqn": "@aws-cdk/integ-tests-alpha.IntegTest", - "version": "2.149.0-alpha.0" + "version": "2.154.1-alpha.0" } }, "BootstrapVersion": { @@ -946,7 +946,7 @@ "path": "s3sqs-customLoggingBucket/BootstrapVersion", "constructInfo": { "fqn": "aws-cdk-lib.CfnParameter", - "version": "2.149.0" + "version": "2.154.1" } }, "CheckBootstrapVersion": { @@ -954,13 +954,13 @@ "path": "s3sqs-customLoggingBucket/CheckBootstrapVersion", "constructInfo": { "fqn": "aws-cdk-lib.CfnRule", - "version": "2.149.0" + "version": "2.154.1" } } }, "constructInfo": { "fqn": "aws-cdk-lib.Stack", - "version": "2.149.0" + "version": "2.154.1" } }, "Tree": { @@ -974,7 +974,7 @@ }, "constructInfo": { "fqn": "aws-cdk-lib.App", - "version": "2.149.0" + "version": "2.154.1" } } } \ No newline at end of file diff --git a/source/patterns/@aws-solutions-constructs/aws-s3-sqs/test/integ.s3sqs-existingLoggingBucket.js.snapshot/cdk.out b/source/patterns/@aws-solutions-constructs/aws-s3-sqs/test/integ.s3sqs-existingLoggingBucket.js.snapshot/cdk.out index 1f0068d32..0d15a78da 100644 --- a/source/patterns/@aws-solutions-constructs/aws-s3-sqs/test/integ.s3sqs-existingLoggingBucket.js.snapshot/cdk.out +++ b/source/patterns/@aws-solutions-constructs/aws-s3-sqs/test/integ.s3sqs-existingLoggingBucket.js.snapshot/cdk.out @@ -1 +1 @@ -{"version":"36.0.0"} \ No newline at end of file +{"version":"36.0.18"} \ No newline at end of file diff --git a/source/patterns/@aws-solutions-constructs/aws-s3-sqs/test/integ.s3sqs-existingLoggingBucket.js.snapshot/integ.json b/source/patterns/@aws-solutions-constructs/aws-s3-sqs/test/integ.s3sqs-existingLoggingBucket.js.snapshot/integ.json index 801f09f78..197a3cd79 100644 --- a/source/patterns/@aws-solutions-constructs/aws-s3-sqs/test/integ.s3sqs-existingLoggingBucket.js.snapshot/integ.json +++ b/source/patterns/@aws-solutions-constructs/aws-s3-sqs/test/integ.s3sqs-existingLoggingBucket.js.snapshot/integ.json @@ -1,5 +1,5 @@ { - "version": "36.0.0", + "version": "36.0.18", "testCases": { "s3sqs-existingLoggingBucket/Integ/DefaultTest": { "stacks": [ diff --git a/source/patterns/@aws-solutions-constructs/aws-s3-sqs/test/integ.s3sqs-existingLoggingBucket.js.snapshot/manifest.json b/source/patterns/@aws-solutions-constructs/aws-s3-sqs/test/integ.s3sqs-existingLoggingBucket.js.snapshot/manifest.json index bff7e8a52..6761a2aaa 100644 --- a/source/patterns/@aws-solutions-constructs/aws-s3-sqs/test/integ.s3sqs-existingLoggingBucket.js.snapshot/manifest.json +++ b/source/patterns/@aws-solutions-constructs/aws-s3-sqs/test/integ.s3sqs-existingLoggingBucket.js.snapshot/manifest.json @@ -1,5 +1,5 @@ { - "version": "36.0.0", + "version": "36.0.5", "artifacts": { "s3sqsexistingLoggingBucketIntegDefaultTestDeployAssert9EECE2F2.assets": { "type": "cdk:asset-manifest", @@ -66,7 +66,7 @@ "validateOnSynth": false, "assumeRoleArn": "arn:${AWS::Partition}:iam::${AWS::AccountId}:role/cdk-hnb659fds-deploy-role-${AWS::AccountId}-${AWS::Region}", "cloudFormationExecutionRoleArn": "arn:${AWS::Partition}:iam::${AWS::AccountId}:role/cdk-hnb659fds-cfn-exec-role-${AWS::AccountId}-${AWS::Region}", - "stackTemplateAssetObjectUrl": "s3://cdk-hnb659fds-assets-${AWS::AccountId}-${AWS::Region}/8deb74a5448a1adbf87e68727957fba05d1415f37d1b9827130a7c82f90f9389.json", + "stackTemplateAssetObjectUrl": "s3://cdk-hnb659fds-assets-${AWS::AccountId}-${AWS::Region}/79bf84f93d68d37787a767e03d3fa4a29aad6e501ff82bb134295a70b636f25c.json", "requiresBootstrapStackVersion": 6, "bootstrapStackVersionSsmParameter": "/cdk-bootstrap/hnb659fds/version", "additionalDependencies": [ @@ -106,6 +106,12 @@ "data": "LatestNodeRuntimeMap" } ], + "/s3sqs-existingLoggingBucket/Custom::S3AutoDeleteObjectsCustomResourceProvider": [ + { + "type": "aws:cdk:is-custom-resource-handler-customResourceProvider", + "data": true + } + ], "/s3sqs-existingLoggingBucket/Custom::S3AutoDeleteObjectsCustomResourceProvider/Role": [ { "type": "aws:cdk:logicalId", diff --git a/source/patterns/@aws-solutions-constructs/aws-s3-sqs/test/integ.s3sqs-existingLoggingBucket.js.snapshot/s3sqs-existingLoggingBucket.assets.json b/source/patterns/@aws-solutions-constructs/aws-s3-sqs/test/integ.s3sqs-existingLoggingBucket.js.snapshot/s3sqs-existingLoggingBucket.assets.json index f8f0a6eea..0d543c9ed 100644 --- a/source/patterns/@aws-solutions-constructs/aws-s3-sqs/test/integ.s3sqs-existingLoggingBucket.js.snapshot/s3sqs-existingLoggingBucket.assets.json +++ b/source/patterns/@aws-solutions-constructs/aws-s3-sqs/test/integ.s3sqs-existingLoggingBucket.js.snapshot/s3sqs-existingLoggingBucket.assets.json @@ -1,5 +1,5 @@ { - "version": "36.0.0", + "version": "36.0.18", "files": { "faa95a81ae7d7373f3e1f242268f904eb748d8d0fdd306e8a6fe515a1905a7d6": { "source": { @@ -14,7 +14,7 @@ } } }, - "8deb74a5448a1adbf87e68727957fba05d1415f37d1b9827130a7c82f90f9389": { + "79bf84f93d68d37787a767e03d3fa4a29aad6e501ff82bb134295a70b636f25c": { "source": { "path": "s3sqs-existingLoggingBucket.template.json", "packaging": "file" @@ -22,7 +22,7 @@ "destinations": { "current_account-current_region": { "bucketName": "cdk-hnb659fds-assets-${AWS::AccountId}-${AWS::Region}", - "objectKey": "8deb74a5448a1adbf87e68727957fba05d1415f37d1b9827130a7c82f90f9389.json", + "objectKey": "79bf84f93d68d37787a767e03d3fa4a29aad6e501ff82bb134295a70b636f25c.json", "assumeRoleArn": "arn:${AWS::Partition}:iam::${AWS::AccountId}:role/cdk-hnb659fds-file-publishing-role-${AWS::AccountId}-${AWS::Region}" } } diff --git a/source/patterns/@aws-solutions-constructs/aws-s3-sqs/test/integ.s3sqs-existingLoggingBucket.js.snapshot/s3sqs-existingLoggingBucket.template.json b/source/patterns/@aws-solutions-constructs/aws-s3-sqs/test/integ.s3sqs-existingLoggingBucket.js.snapshot/s3sqs-existingLoggingBucket.template.json index 4d59d14db..1923622e6 100644 --- a/source/patterns/@aws-solutions-constructs/aws-s3-sqs/test/integ.s3sqs-existingLoggingBucket.js.snapshot/s3sqs-existingLoggingBucket.template.json +++ b/source/patterns/@aws-solutions-constructs/aws-s3-sqs/test/integ.s3sqs-existingLoggingBucket.js.snapshot/s3sqs-existingLoggingBucket.template.json @@ -612,7 +612,8 @@ } ] }, - "Managed": true + "Managed": true, + "SkipDestinationValidation": false }, "DependsOn": [ "tests3sqstempqueuePolicy6C62431A", @@ -956,7 +957,7 @@ "Properties": { "Description": "AWS CloudFormation handler for \"Custom::S3BucketNotifications\" resources (@aws-cdk/aws-s3)", "Code": { - "ZipFile": "import boto3 # type: ignore\nimport json\nimport logging\nimport urllib.request\n\ns3 = boto3.client(\"s3\")\n\nEVENTBRIDGE_CONFIGURATION = 'EventBridgeConfiguration'\nCONFIGURATION_TYPES = [\"TopicConfigurations\", \"QueueConfigurations\", \"LambdaFunctionConfigurations\"]\n\ndef handler(event: dict, context):\n response_status = \"SUCCESS\"\n error_message = \"\"\n try:\n props = event[\"ResourceProperties\"]\n notification_configuration = props[\"NotificationConfiguration\"]\n managed = props.get('Managed', 'true').lower() == 'true'\n stack_id = event['StackId']\n old = event.get(\"OldResourceProperties\", {}).get(\"NotificationConfiguration\", {})\n if managed:\n config = handle_managed(event[\"RequestType\"], notification_configuration)\n else:\n config = handle_unmanaged(props[\"BucketName\"], stack_id, event[\"RequestType\"], notification_configuration, old)\n s3.put_bucket_notification_configuration(Bucket=props[\"BucketName\"], NotificationConfiguration=config)\n except Exception as e:\n logging.exception(\"Failed to put bucket notification configuration\")\n response_status = \"FAILED\"\n error_message = f\"Error: {str(e)}. \"\n finally:\n submit_response(event, context, response_status, error_message)\n\ndef handle_managed(request_type, notification_configuration):\n if request_type == 'Delete':\n return {}\n return notification_configuration\n\ndef handle_unmanaged(bucket, stack_id, request_type, notification_configuration, old):\n def get_id(n):\n n['Id'] = ''\n strToHash=json.dumps(n, sort_keys=True).replace('\"Name\": \"prefix\"', '\"Name\": \"Prefix\"').replace('\"Name\": \"suffix\"', '\"Name\": \"Suffix\"')\n return f\"{stack_id}-{hash(strToHash)}\"\n def with_id(n):\n n['Id'] = get_id(n)\n return n\n\n external_notifications = {}\n existing_notifications = s3.get_bucket_notification_configuration(Bucket=bucket)\n for t in CONFIGURATION_TYPES:\n if request_type == 'Update':\n old_incoming_ids = [get_id(n) for n in old.get(t, [])]\n external_notifications[t] = [n for n in existing_notifications.get(t, []) if not get_id(n) in old_incoming_ids] \n elif request_type == 'Delete':\n external_notifications[t] = [n for n in existing_notifications.get(t, []) if not n['Id'].startswith(f\"{stack_id}-\")]\n elif request_type == 'Create':\n external_notifications[t] = [n for n in existing_notifications.get(t, [])]\n if EVENTBRIDGE_CONFIGURATION in existing_notifications:\n external_notifications[EVENTBRIDGE_CONFIGURATION] = existing_notifications[EVENTBRIDGE_CONFIGURATION]\n\n if request_type == 'Delete':\n return external_notifications\n\n notifications = {}\n for t in CONFIGURATION_TYPES:\n external = external_notifications.get(t, [])\n incoming = [with_id(n) for n in notification_configuration.get(t, [])]\n notifications[t] = external + incoming\n\n if EVENTBRIDGE_CONFIGURATION in notification_configuration:\n notifications[EVENTBRIDGE_CONFIGURATION] = notification_configuration[EVENTBRIDGE_CONFIGURATION]\n elif EVENTBRIDGE_CONFIGURATION in external_notifications:\n notifications[EVENTBRIDGE_CONFIGURATION] = external_notifications[EVENTBRIDGE_CONFIGURATION]\n\n return notifications\n\ndef submit_response(event: dict, context, response_status: str, error_message: str):\n response_body = json.dumps(\n {\n \"Status\": response_status,\n \"Reason\": f\"{error_message}See the details in CloudWatch Log Stream: {context.log_stream_name}\",\n \"PhysicalResourceId\": event.get(\"PhysicalResourceId\") or event[\"LogicalResourceId\"],\n \"StackId\": event[\"StackId\"],\n \"RequestId\": event[\"RequestId\"],\n \"LogicalResourceId\": event[\"LogicalResourceId\"],\n \"NoEcho\": False,\n }\n ).encode(\"utf-8\")\n headers = {\"content-type\": \"\", \"content-length\": str(len(response_body))}\n try:\n req = urllib.request.Request(url=event[\"ResponseURL\"], headers=headers, data=response_body, method=\"PUT\")\n with urllib.request.urlopen(req) as response:\n print(response.read().decode(\"utf-8\"))\n print(\"Status code: \" + response.reason)\n except Exception as e:\n print(\"send(..) failed executing request.urlopen(..): \" + str(e))" + "ZipFile": "import boto3 # type: ignore\nimport json\nimport logging\nimport urllib.request\n\ns3 = boto3.client(\"s3\")\n\nEVENTBRIDGE_CONFIGURATION = 'EventBridgeConfiguration'\nCONFIGURATION_TYPES = [\"TopicConfigurations\", \"QueueConfigurations\", \"LambdaFunctionConfigurations\"]\n\ndef handler(event: dict, context):\n response_status = \"SUCCESS\"\n error_message = \"\"\n try:\n props = event[\"ResourceProperties\"]\n notification_configuration = props[\"NotificationConfiguration\"]\n managed = props.get('Managed', 'true').lower() == 'true'\n skipDestinationValidation = props.get('SkipDestinationValidation', 'false').lower() == 'true'\n stack_id = event['StackId']\n old = event.get(\"OldResourceProperties\", {}).get(\"NotificationConfiguration\", {})\n if managed:\n config = handle_managed(event[\"RequestType\"], notification_configuration)\n else:\n config = handle_unmanaged(props[\"BucketName\"], stack_id, event[\"RequestType\"], notification_configuration, old)\n s3.put_bucket_notification_configuration(Bucket=props[\"BucketName\"], NotificationConfiguration=config, SkipDestinationValidation=skipDestinationValidation)\n except Exception as e:\n logging.exception(\"Failed to put bucket notification configuration\")\n response_status = \"FAILED\"\n error_message = f\"Error: {str(e)}. \"\n finally:\n submit_response(event, context, response_status, error_message)\n\ndef handle_managed(request_type, notification_configuration):\n if request_type == 'Delete':\n return {}\n return notification_configuration\n\ndef handle_unmanaged(bucket, stack_id, request_type, notification_configuration, old):\n def get_id(n):\n n['Id'] = ''\n strToHash=json.dumps(n, sort_keys=True).replace('\"Name\": \"prefix\"', '\"Name\": \"Prefix\"').replace('\"Name\": \"suffix\"', '\"Name\": \"Suffix\"')\n return f\"{stack_id}-{hash(strToHash)}\"\n def with_id(n):\n n['Id'] = get_id(n)\n return n\n\n external_notifications = {}\n existing_notifications = s3.get_bucket_notification_configuration(Bucket=bucket)\n for t in CONFIGURATION_TYPES:\n if request_type == 'Update':\n old_incoming_ids = [get_id(n) for n in old.get(t, [])]\n external_notifications[t] = [n for n in existing_notifications.get(t, []) if not get_id(n) in old_incoming_ids] \n elif request_type == 'Delete':\n external_notifications[t] = [n for n in existing_notifications.get(t, []) if not n['Id'].startswith(f\"{stack_id}-\")]\n elif request_type == 'Create':\n external_notifications[t] = [n for n in existing_notifications.get(t, [])]\n if EVENTBRIDGE_CONFIGURATION in existing_notifications:\n external_notifications[EVENTBRIDGE_CONFIGURATION] = existing_notifications[EVENTBRIDGE_CONFIGURATION]\n\n if request_type == 'Delete':\n return external_notifications\n\n notifications = {}\n for t in CONFIGURATION_TYPES:\n external = external_notifications.get(t, [])\n incoming = [with_id(n) for n in notification_configuration.get(t, [])]\n notifications[t] = external + incoming\n\n if EVENTBRIDGE_CONFIGURATION in notification_configuration:\n notifications[EVENTBRIDGE_CONFIGURATION] = notification_configuration[EVENTBRIDGE_CONFIGURATION]\n elif EVENTBRIDGE_CONFIGURATION in external_notifications:\n notifications[EVENTBRIDGE_CONFIGURATION] = external_notifications[EVENTBRIDGE_CONFIGURATION]\n\n return notifications\n\ndef submit_response(event: dict, context, response_status: str, error_message: str):\n response_body = json.dumps(\n {\n \"Status\": response_status,\n \"Reason\": f\"{error_message}See the details in CloudWatch Log Stream: {context.log_stream_name}\",\n \"PhysicalResourceId\": event.get(\"PhysicalResourceId\") or event[\"LogicalResourceId\"],\n \"StackId\": event[\"StackId\"],\n \"RequestId\": event[\"RequestId\"],\n \"LogicalResourceId\": event[\"LogicalResourceId\"],\n \"NoEcho\": False,\n }\n ).encode(\"utf-8\")\n headers = {\"content-type\": \"\", \"content-length\": str(len(response_body))}\n try:\n req = urllib.request.Request(url=event[\"ResponseURL\"], headers=headers, data=response_body, method=\"PUT\")\n with urllib.request.urlopen(req) as response:\n print(response.read().decode(\"utf-8\"))\n print(\"Status code: \" + response.reason)\n except Exception as e:\n print(\"send(..) failed executing request.urlopen(..): \" + str(e))" }, "Handler": "index.handler", "Role": { diff --git a/source/patterns/@aws-solutions-constructs/aws-s3-sqs/test/integ.s3sqs-existingLoggingBucket.js.snapshot/s3sqsexistingLoggingBucketIntegDefaultTestDeployAssert9EECE2F2.assets.json b/source/patterns/@aws-solutions-constructs/aws-s3-sqs/test/integ.s3sqs-existingLoggingBucket.js.snapshot/s3sqsexistingLoggingBucketIntegDefaultTestDeployAssert9EECE2F2.assets.json index 7cefa00f1..7590de371 100644 --- a/source/patterns/@aws-solutions-constructs/aws-s3-sqs/test/integ.s3sqs-existingLoggingBucket.js.snapshot/s3sqsexistingLoggingBucketIntegDefaultTestDeployAssert9EECE2F2.assets.json +++ b/source/patterns/@aws-solutions-constructs/aws-s3-sqs/test/integ.s3sqs-existingLoggingBucket.js.snapshot/s3sqsexistingLoggingBucketIntegDefaultTestDeployAssert9EECE2F2.assets.json @@ -1,5 +1,5 @@ { - "version": "36.0.0", + "version": "36.0.18", "files": { "21fbb51d7b23f6a6c262b46a9caee79d744a3ac019fd45422d988b96d44b2a22": { "source": { diff --git a/source/patterns/@aws-solutions-constructs/aws-s3-sqs/test/integ.s3sqs-existingLoggingBucket.js.snapshot/tree.json b/source/patterns/@aws-solutions-constructs/aws-s3-sqs/test/integ.s3sqs-existingLoggingBucket.js.snapshot/tree.json index 52197aa35..9b2ac5115 100644 --- a/source/patterns/@aws-solutions-constructs/aws-s3-sqs/test/integ.s3sqs-existingLoggingBucket.js.snapshot/tree.json +++ b/source/patterns/@aws-solutions-constructs/aws-s3-sqs/test/integ.s3sqs-existingLoggingBucket.js.snapshot/tree.json @@ -40,7 +40,7 @@ }, "constructInfo": { "fqn": "aws-cdk-lib.aws_s3.CfnBucket", - "version": "2.149.0" + "version": "2.154.1" } }, "Policy": { @@ -174,13 +174,13 @@ }, "constructInfo": { "fqn": "aws-cdk-lib.aws_s3.CfnBucketPolicy", - "version": "2.149.0" + "version": "2.154.1" } } }, "constructInfo": { "fqn": "aws-cdk-lib.aws_s3.BucketPolicy", - "version": "2.149.0" + "version": "2.154.1" } }, "AutoDeleteObjectsCustomResource": { @@ -192,19 +192,19 @@ "path": "s3sqs-existingLoggingBucket/scrapBucketLog/AutoDeleteObjectsCustomResource/Default", "constructInfo": { "fqn": "aws-cdk-lib.CfnResource", - "version": "2.149.0" + "version": "2.154.1" } } }, "constructInfo": { "fqn": "aws-cdk-lib.CustomResource", - "version": "2.149.0" + "version": "2.154.1" } } }, "constructInfo": { "fqn": "aws-cdk-lib.aws_s3.Bucket", - "version": "2.149.0" + "version": "2.154.1" } }, "LatestNodeRuntimeMap": { @@ -212,7 +212,7 @@ "path": "s3sqs-existingLoggingBucket/LatestNodeRuntimeMap", "constructInfo": { "fqn": "aws-cdk-lib.CfnMapping", - "version": "2.149.0" + "version": "2.154.1" } }, "Custom::S3AutoDeleteObjectsCustomResourceProvider": { @@ -224,7 +224,7 @@ "path": "s3sqs-existingLoggingBucket/Custom::S3AutoDeleteObjectsCustomResourceProvider/Staging", "constructInfo": { "fqn": "aws-cdk-lib.AssetStaging", - "version": "2.149.0" + "version": "2.154.1" } }, "Role": { @@ -232,7 +232,7 @@ "path": "s3sqs-existingLoggingBucket/Custom::S3AutoDeleteObjectsCustomResourceProvider/Role", "constructInfo": { "fqn": "aws-cdk-lib.CfnResource", - "version": "2.149.0" + "version": "2.154.1" } }, "Handler": { @@ -240,13 +240,13 @@ "path": "s3sqs-existingLoggingBucket/Custom::S3AutoDeleteObjectsCustomResourceProvider/Handler", "constructInfo": { "fqn": "aws-cdk-lib.CfnResource", - "version": "2.149.0" + "version": "2.154.1" } } }, "constructInfo": { "fqn": "aws-cdk-lib.CustomResourceProviderBase", - "version": "2.149.0" + "version": "2.154.1" } }, "scrapBucket": { @@ -286,7 +286,7 @@ }, "constructInfo": { "fqn": "aws-cdk-lib.aws_s3.CfnBucket", - "version": "2.149.0" + "version": "2.154.1" } }, "Policy": { @@ -420,13 +420,13 @@ }, "constructInfo": { "fqn": "aws-cdk-lib.aws_s3.CfnBucketPolicy", - "version": "2.149.0" + "version": "2.154.1" } } }, "constructInfo": { "fqn": "aws-cdk-lib.aws_s3.BucketPolicy", - "version": "2.149.0" + "version": "2.154.1" } }, "AutoDeleteObjectsCustomResource": { @@ -438,19 +438,19 @@ "path": "s3sqs-existingLoggingBucket/scrapBucket/AutoDeleteObjectsCustomResource/Default", "constructInfo": { "fqn": "aws-cdk-lib.CfnResource", - "version": "2.149.0" + "version": "2.154.1" } } }, "constructInfo": { "fqn": "aws-cdk-lib.CustomResource", - "version": "2.149.0" + "version": "2.154.1" } } }, "constructInfo": { "fqn": "aws-cdk-lib.aws_s3.Bucket", - "version": "2.149.0" + "version": "2.154.1" } }, "test-s3-sqs-temp": { @@ -513,7 +513,7 @@ }, "constructInfo": { "fqn": "aws-cdk-lib.aws_s3.CfnBucket", - "version": "2.149.0" + "version": "2.154.1" } }, "Policy": { @@ -611,13 +611,13 @@ }, "constructInfo": { "fqn": "aws-cdk-lib.aws_s3.CfnBucketPolicy", - "version": "2.149.0" + "version": "2.154.1" } } }, "constructInfo": { "fqn": "aws-cdk-lib.aws_s3.BucketPolicy", - "version": "2.149.0" + "version": "2.154.1" } }, "AutoDeleteObjectsCustomResource": { @@ -629,13 +629,13 @@ "path": "s3sqs-existingLoggingBucket/test-s3-sqs-temp/S3Bucket/AutoDeleteObjectsCustomResource/Default", "constructInfo": { "fqn": "aws-cdk-lib.CfnResource", - "version": "2.149.0" + "version": "2.154.1" } } }, "constructInfo": { "fqn": "aws-cdk-lib.CustomResource", - "version": "2.149.0" + "version": "2.154.1" } }, "Notifications": { @@ -647,7 +647,7 @@ "path": "s3sqs-existingLoggingBucket/test-s3-sqs-temp/S3Bucket/Notifications/Resource", "constructInfo": { "fqn": "aws-cdk-lib.CfnResource", - "version": "2.149.0" + "version": "2.154.1" } } }, @@ -659,7 +659,7 @@ }, "constructInfo": { "fqn": "aws-cdk-lib.aws_s3.Bucket", - "version": "2.149.0" + "version": "2.154.1" } }, "queue-dlq": { @@ -677,7 +677,7 @@ }, "constructInfo": { "fqn": "aws-cdk-lib.aws_sqs.CfnQueue", - "version": "2.149.0" + "version": "2.154.1" } }, "Policy": { @@ -760,19 +760,19 @@ }, "constructInfo": { "fqn": "aws-cdk-lib.aws_sqs.CfnQueuePolicy", - "version": "2.149.0" + "version": "2.154.1" } } }, "constructInfo": { "fqn": "aws-cdk-lib.aws_sqs.QueuePolicy", - "version": "2.149.0" + "version": "2.154.1" } } }, "constructInfo": { "fqn": "aws-cdk-lib.aws_sqs.Queue", - "version": "2.149.0" + "version": "2.154.1" } }, "'queueKey'": { @@ -852,13 +852,13 @@ }, "constructInfo": { "fqn": "aws-cdk-lib.aws_kms.CfnKey", - "version": "2.149.0" + "version": "2.154.1" } } }, "constructInfo": { "fqn": "aws-cdk-lib.aws_kms.Key", - "version": "2.149.0" + "version": "2.154.1" } }, "queue": { @@ -890,7 +890,7 @@ }, "constructInfo": { "fqn": "aws-cdk-lib.aws_sqs.CfnQueue", - "version": "2.149.0" + "version": "2.154.1" } }, "Policy": { @@ -1000,25 +1000,25 @@ }, "constructInfo": { "fqn": "aws-cdk-lib.aws_sqs.CfnQueuePolicy", - "version": "2.149.0" + "version": "2.154.1" } } }, "constructInfo": { "fqn": "aws-cdk-lib.aws_sqs.QueuePolicy", - "version": "2.149.0" + "version": "2.154.1" } } }, "constructInfo": { "fqn": "aws-cdk-lib.aws_sqs.Queue", - "version": "2.149.0" + "version": "2.154.1" } } }, "constructInfo": { "fqn": "@aws-solutions-constructs/aws-s3-sqs.S3ToSqs", - "version": "2.62.0" + "version": "2.67.1" } }, "BucketNotificationsHandler050a0587b7544547bf325f094a3db834": { @@ -1034,7 +1034,7 @@ "path": "s3sqs-existingLoggingBucket/BucketNotificationsHandler050a0587b7544547bf325f094a3db834/Role/ImportRole", "constructInfo": { "fqn": "aws-cdk-lib.Resource", - "version": "2.149.0" + "version": "2.154.1" } }, "Resource": { @@ -1073,7 +1073,7 @@ }, "constructInfo": { "fqn": "aws-cdk-lib.aws_iam.CfnRole", - "version": "2.149.0" + "version": "2.154.1" } }, "DefaultPolicy": { @@ -1106,19 +1106,19 @@ }, "constructInfo": { "fqn": "aws-cdk-lib.aws_iam.CfnPolicy", - "version": "2.149.0" + "version": "2.154.1" } } }, "constructInfo": { "fqn": "aws-cdk-lib.aws_iam.Policy", - "version": "2.149.0" + "version": "2.154.1" } } }, "constructInfo": { "fqn": "aws-cdk-lib.aws_iam.Role", - "version": "2.149.0" + "version": "2.154.1" } }, "Resource": { @@ -1126,7 +1126,7 @@ "path": "s3sqs-existingLoggingBucket/BucketNotificationsHandler050a0587b7544547bf325f094a3db834/Resource", "constructInfo": { "fqn": "aws-cdk-lib.CfnResource", - "version": "2.149.0" + "version": "2.154.1" } } }, @@ -1160,7 +1160,7 @@ "path": "s3sqs-existingLoggingBucket/Integ/DefaultTest/DeployAssert/BootstrapVersion", "constructInfo": { "fqn": "aws-cdk-lib.CfnParameter", - "version": "2.149.0" + "version": "2.154.1" } }, "CheckBootstrapVersion": { @@ -1168,25 +1168,25 @@ "path": "s3sqs-existingLoggingBucket/Integ/DefaultTest/DeployAssert/CheckBootstrapVersion", "constructInfo": { "fqn": "aws-cdk-lib.CfnRule", - "version": "2.149.0" + "version": "2.154.1" } } }, "constructInfo": { "fqn": "aws-cdk-lib.Stack", - "version": "2.149.0" + "version": "2.154.1" } } }, "constructInfo": { "fqn": "@aws-cdk/integ-tests-alpha.IntegTestCase", - "version": "2.149.0-alpha.0" + "version": "2.154.1-alpha.0" } } }, "constructInfo": { "fqn": "@aws-cdk/integ-tests-alpha.IntegTest", - "version": "2.149.0-alpha.0" + "version": "2.154.1-alpha.0" } }, "BootstrapVersion": { @@ -1194,7 +1194,7 @@ "path": "s3sqs-existingLoggingBucket/BootstrapVersion", "constructInfo": { "fqn": "aws-cdk-lib.CfnParameter", - "version": "2.149.0" + "version": "2.154.1" } }, "CheckBootstrapVersion": { @@ -1202,13 +1202,13 @@ "path": "s3sqs-existingLoggingBucket/CheckBootstrapVersion", "constructInfo": { "fqn": "aws-cdk-lib.CfnRule", - "version": "2.149.0" + "version": "2.154.1" } } }, "constructInfo": { "fqn": "aws-cdk-lib.Stack", - "version": "2.149.0" + "version": "2.154.1" } }, "Tree": { @@ -1222,7 +1222,7 @@ }, "constructInfo": { "fqn": "aws-cdk-lib.App", - "version": "2.149.0" + "version": "2.154.1" } } } \ No newline at end of file diff --git a/source/patterns/@aws-solutions-constructs/aws-s3-sqs/test/integ.s3sqs-existingQueue.js.snapshot/cdk.out b/source/patterns/@aws-solutions-constructs/aws-s3-sqs/test/integ.s3sqs-existingQueue.js.snapshot/cdk.out index 1f0068d32..0d15a78da 100644 --- a/source/patterns/@aws-solutions-constructs/aws-s3-sqs/test/integ.s3sqs-existingQueue.js.snapshot/cdk.out +++ b/source/patterns/@aws-solutions-constructs/aws-s3-sqs/test/integ.s3sqs-existingQueue.js.snapshot/cdk.out @@ -1 +1 @@ -{"version":"36.0.0"} \ No newline at end of file +{"version":"36.0.18"} \ No newline at end of file diff --git a/source/patterns/@aws-solutions-constructs/aws-s3-sqs/test/integ.s3sqs-existingQueue.js.snapshot/integ.json b/source/patterns/@aws-solutions-constructs/aws-s3-sqs/test/integ.s3sqs-existingQueue.js.snapshot/integ.json index 48bca4001..5a1dd6ab9 100644 --- a/source/patterns/@aws-solutions-constructs/aws-s3-sqs/test/integ.s3sqs-existingQueue.js.snapshot/integ.json +++ b/source/patterns/@aws-solutions-constructs/aws-s3-sqs/test/integ.s3sqs-existingQueue.js.snapshot/integ.json @@ -1,5 +1,5 @@ { - "version": "36.0.0", + "version": "36.0.18", "testCases": { "s3sqs-existingQueue/Integ/DefaultTest": { "stacks": [ diff --git a/source/patterns/@aws-solutions-constructs/aws-s3-sqs/test/integ.s3sqs-existingQueue.js.snapshot/manifest.json b/source/patterns/@aws-solutions-constructs/aws-s3-sqs/test/integ.s3sqs-existingQueue.js.snapshot/manifest.json index e08564157..9c1bda8a0 100644 --- a/source/patterns/@aws-solutions-constructs/aws-s3-sqs/test/integ.s3sqs-existingQueue.js.snapshot/manifest.json +++ b/source/patterns/@aws-solutions-constructs/aws-s3-sqs/test/integ.s3sqs-existingQueue.js.snapshot/manifest.json @@ -1,5 +1,5 @@ { - "version": "36.0.0", + "version": "36.0.5", "artifacts": { "s3sqsexistingQueueIntegDefaultTestDeployAssert82F5925F.assets": { "type": "cdk:asset-manifest", @@ -66,7 +66,7 @@ "validateOnSynth": false, "assumeRoleArn": "arn:${AWS::Partition}:iam::${AWS::AccountId}:role/cdk-hnb659fds-deploy-role-${AWS::AccountId}-${AWS::Region}", "cloudFormationExecutionRoleArn": "arn:${AWS::Partition}:iam::${AWS::AccountId}:role/cdk-hnb659fds-cfn-exec-role-${AWS::AccountId}-${AWS::Region}", - "stackTemplateAssetObjectUrl": "s3://cdk-hnb659fds-assets-${AWS::AccountId}-${AWS::Region}/b99e187552b2e587341c92120c6ffc7135f490816f1e18213177918b4b53e503.json", + "stackTemplateAssetObjectUrl": "s3://cdk-hnb659fds-assets-${AWS::AccountId}-${AWS::Region}/b541e0f455c7d1715567224b68f2b2c9d080651cd3117d1a94067b1dceeb83f1.json", "requiresBootstrapStackVersion": 6, "bootstrapStackVersionSsmParameter": "/cdk-bootstrap/hnb659fds/version", "additionalDependencies": [ @@ -148,6 +148,12 @@ "data": "LatestNodeRuntimeMap" } ], + "/s3sqs-existingQueue/Custom::S3AutoDeleteObjectsCustomResourceProvider": [ + { + "type": "aws:cdk:is-custom-resource-handler-customResourceProvider", + "data": true + } + ], "/s3sqs-existingQueue/Custom::S3AutoDeleteObjectsCustomResourceProvider/Role": [ { "type": "aws:cdk:logicalId", diff --git a/source/patterns/@aws-solutions-constructs/aws-s3-sqs/test/integ.s3sqs-existingQueue.js.snapshot/s3sqs-existingQueue.assets.json b/source/patterns/@aws-solutions-constructs/aws-s3-sqs/test/integ.s3sqs-existingQueue.js.snapshot/s3sqs-existingQueue.assets.json index ff10c979d..9925fd2b2 100644 --- a/source/patterns/@aws-solutions-constructs/aws-s3-sqs/test/integ.s3sqs-existingQueue.js.snapshot/s3sqs-existingQueue.assets.json +++ b/source/patterns/@aws-solutions-constructs/aws-s3-sqs/test/integ.s3sqs-existingQueue.js.snapshot/s3sqs-existingQueue.assets.json @@ -1,5 +1,5 @@ { - "version": "36.0.0", + "version": "36.0.18", "files": { "faa95a81ae7d7373f3e1f242268f904eb748d8d0fdd306e8a6fe515a1905a7d6": { "source": { @@ -14,7 +14,7 @@ } } }, - "b99e187552b2e587341c92120c6ffc7135f490816f1e18213177918b4b53e503": { + "b541e0f455c7d1715567224b68f2b2c9d080651cd3117d1a94067b1dceeb83f1": { "source": { "path": "s3sqs-existingQueue.template.json", "packaging": "file" @@ -22,7 +22,7 @@ "destinations": { "current_account-current_region": { "bucketName": "cdk-hnb659fds-assets-${AWS::AccountId}-${AWS::Region}", - "objectKey": "b99e187552b2e587341c92120c6ffc7135f490816f1e18213177918b4b53e503.json", + "objectKey": "b541e0f455c7d1715567224b68f2b2c9d080651cd3117d1a94067b1dceeb83f1.json", "assumeRoleArn": "arn:${AWS::Partition}:iam::${AWS::AccountId}:role/cdk-hnb659fds-file-publishing-role-${AWS::AccountId}-${AWS::Region}" } } diff --git a/source/patterns/@aws-solutions-constructs/aws-s3-sqs/test/integ.s3sqs-existingQueue.js.snapshot/s3sqs-existingQueue.template.json b/source/patterns/@aws-solutions-constructs/aws-s3-sqs/test/integ.s3sqs-existingQueue.js.snapshot/s3sqs-existingQueue.template.json index 9365a4940..d1d6dfdc7 100644 --- a/source/patterns/@aws-solutions-constructs/aws-s3-sqs/test/integ.s3sqs-existingQueue.js.snapshot/s3sqs-existingQueue.template.json +++ b/source/patterns/@aws-solutions-constructs/aws-s3-sqs/test/integ.s3sqs-existingQueue.js.snapshot/s3sqs-existingQueue.template.json @@ -455,7 +455,8 @@ } ] }, - "Managed": true + "Managed": true, + "SkipDestinationValidation": false }, "DependsOn": [ "testexistingqueuePolicy4D8E287E", @@ -614,7 +615,7 @@ "Properties": { "Description": "AWS CloudFormation handler for \"Custom::S3BucketNotifications\" resources (@aws-cdk/aws-s3)", "Code": { - "ZipFile": "import boto3 # type: ignore\nimport json\nimport logging\nimport urllib.request\n\ns3 = boto3.client(\"s3\")\n\nEVENTBRIDGE_CONFIGURATION = 'EventBridgeConfiguration'\nCONFIGURATION_TYPES = [\"TopicConfigurations\", \"QueueConfigurations\", \"LambdaFunctionConfigurations\"]\n\ndef handler(event: dict, context):\n response_status = \"SUCCESS\"\n error_message = \"\"\n try:\n props = event[\"ResourceProperties\"]\n notification_configuration = props[\"NotificationConfiguration\"]\n managed = props.get('Managed', 'true').lower() == 'true'\n stack_id = event['StackId']\n old = event.get(\"OldResourceProperties\", {}).get(\"NotificationConfiguration\", {})\n if managed:\n config = handle_managed(event[\"RequestType\"], notification_configuration)\n else:\n config = handle_unmanaged(props[\"BucketName\"], stack_id, event[\"RequestType\"], notification_configuration, old)\n s3.put_bucket_notification_configuration(Bucket=props[\"BucketName\"], NotificationConfiguration=config)\n except Exception as e:\n logging.exception(\"Failed to put bucket notification configuration\")\n response_status = \"FAILED\"\n error_message = f\"Error: {str(e)}. \"\n finally:\n submit_response(event, context, response_status, error_message)\n\ndef handle_managed(request_type, notification_configuration):\n if request_type == 'Delete':\n return {}\n return notification_configuration\n\ndef handle_unmanaged(bucket, stack_id, request_type, notification_configuration, old):\n def get_id(n):\n n['Id'] = ''\n strToHash=json.dumps(n, sort_keys=True).replace('\"Name\": \"prefix\"', '\"Name\": \"Prefix\"').replace('\"Name\": \"suffix\"', '\"Name\": \"Suffix\"')\n return f\"{stack_id}-{hash(strToHash)}\"\n def with_id(n):\n n['Id'] = get_id(n)\n return n\n\n external_notifications = {}\n existing_notifications = s3.get_bucket_notification_configuration(Bucket=bucket)\n for t in CONFIGURATION_TYPES:\n if request_type == 'Update':\n old_incoming_ids = [get_id(n) for n in old.get(t, [])]\n external_notifications[t] = [n for n in existing_notifications.get(t, []) if not get_id(n) in old_incoming_ids] \n elif request_type == 'Delete':\n external_notifications[t] = [n for n in existing_notifications.get(t, []) if not n['Id'].startswith(f\"{stack_id}-\")]\n elif request_type == 'Create':\n external_notifications[t] = [n for n in existing_notifications.get(t, [])]\n if EVENTBRIDGE_CONFIGURATION in existing_notifications:\n external_notifications[EVENTBRIDGE_CONFIGURATION] = existing_notifications[EVENTBRIDGE_CONFIGURATION]\n\n if request_type == 'Delete':\n return external_notifications\n\n notifications = {}\n for t in CONFIGURATION_TYPES:\n external = external_notifications.get(t, [])\n incoming = [with_id(n) for n in notification_configuration.get(t, [])]\n notifications[t] = external + incoming\n\n if EVENTBRIDGE_CONFIGURATION in notification_configuration:\n notifications[EVENTBRIDGE_CONFIGURATION] = notification_configuration[EVENTBRIDGE_CONFIGURATION]\n elif EVENTBRIDGE_CONFIGURATION in external_notifications:\n notifications[EVENTBRIDGE_CONFIGURATION] = external_notifications[EVENTBRIDGE_CONFIGURATION]\n\n return notifications\n\ndef submit_response(event: dict, context, response_status: str, error_message: str):\n response_body = json.dumps(\n {\n \"Status\": response_status,\n \"Reason\": f\"{error_message}See the details in CloudWatch Log Stream: {context.log_stream_name}\",\n \"PhysicalResourceId\": event.get(\"PhysicalResourceId\") or event[\"LogicalResourceId\"],\n \"StackId\": event[\"StackId\"],\n \"RequestId\": event[\"RequestId\"],\n \"LogicalResourceId\": event[\"LogicalResourceId\"],\n \"NoEcho\": False,\n }\n ).encode(\"utf-8\")\n headers = {\"content-type\": \"\", \"content-length\": str(len(response_body))}\n try:\n req = urllib.request.Request(url=event[\"ResponseURL\"], headers=headers, data=response_body, method=\"PUT\")\n with urllib.request.urlopen(req) as response:\n print(response.read().decode(\"utf-8\"))\n print(\"Status code: \" + response.reason)\n except Exception as e:\n print(\"send(..) failed executing request.urlopen(..): \" + str(e))" + "ZipFile": "import boto3 # type: ignore\nimport json\nimport logging\nimport urllib.request\n\ns3 = boto3.client(\"s3\")\n\nEVENTBRIDGE_CONFIGURATION = 'EventBridgeConfiguration'\nCONFIGURATION_TYPES = [\"TopicConfigurations\", \"QueueConfigurations\", \"LambdaFunctionConfigurations\"]\n\ndef handler(event: dict, context):\n response_status = \"SUCCESS\"\n error_message = \"\"\n try:\n props = event[\"ResourceProperties\"]\n notification_configuration = props[\"NotificationConfiguration\"]\n managed = props.get('Managed', 'true').lower() == 'true'\n skipDestinationValidation = props.get('SkipDestinationValidation', 'false').lower() == 'true'\n stack_id = event['StackId']\n old = event.get(\"OldResourceProperties\", {}).get(\"NotificationConfiguration\", {})\n if managed:\n config = handle_managed(event[\"RequestType\"], notification_configuration)\n else:\n config = handle_unmanaged(props[\"BucketName\"], stack_id, event[\"RequestType\"], notification_configuration, old)\n s3.put_bucket_notification_configuration(Bucket=props[\"BucketName\"], NotificationConfiguration=config, SkipDestinationValidation=skipDestinationValidation)\n except Exception as e:\n logging.exception(\"Failed to put bucket notification configuration\")\n response_status = \"FAILED\"\n error_message = f\"Error: {str(e)}. \"\n finally:\n submit_response(event, context, response_status, error_message)\n\ndef handle_managed(request_type, notification_configuration):\n if request_type == 'Delete':\n return {}\n return notification_configuration\n\ndef handle_unmanaged(bucket, stack_id, request_type, notification_configuration, old):\n def get_id(n):\n n['Id'] = ''\n strToHash=json.dumps(n, sort_keys=True).replace('\"Name\": \"prefix\"', '\"Name\": \"Prefix\"').replace('\"Name\": \"suffix\"', '\"Name\": \"Suffix\"')\n return f\"{stack_id}-{hash(strToHash)}\"\n def with_id(n):\n n['Id'] = get_id(n)\n return n\n\n external_notifications = {}\n existing_notifications = s3.get_bucket_notification_configuration(Bucket=bucket)\n for t in CONFIGURATION_TYPES:\n if request_type == 'Update':\n old_incoming_ids = [get_id(n) for n in old.get(t, [])]\n external_notifications[t] = [n for n in existing_notifications.get(t, []) if not get_id(n) in old_incoming_ids] \n elif request_type == 'Delete':\n external_notifications[t] = [n for n in existing_notifications.get(t, []) if not n['Id'].startswith(f\"{stack_id}-\")]\n elif request_type == 'Create':\n external_notifications[t] = [n for n in existing_notifications.get(t, [])]\n if EVENTBRIDGE_CONFIGURATION in existing_notifications:\n external_notifications[EVENTBRIDGE_CONFIGURATION] = existing_notifications[EVENTBRIDGE_CONFIGURATION]\n\n if request_type == 'Delete':\n return external_notifications\n\n notifications = {}\n for t in CONFIGURATION_TYPES:\n external = external_notifications.get(t, [])\n incoming = [with_id(n) for n in notification_configuration.get(t, [])]\n notifications[t] = external + incoming\n\n if EVENTBRIDGE_CONFIGURATION in notification_configuration:\n notifications[EVENTBRIDGE_CONFIGURATION] = notification_configuration[EVENTBRIDGE_CONFIGURATION]\n elif EVENTBRIDGE_CONFIGURATION in external_notifications:\n notifications[EVENTBRIDGE_CONFIGURATION] = external_notifications[EVENTBRIDGE_CONFIGURATION]\n\n return notifications\n\ndef submit_response(event: dict, context, response_status: str, error_message: str):\n response_body = json.dumps(\n {\n \"Status\": response_status,\n \"Reason\": f\"{error_message}See the details in CloudWatch Log Stream: {context.log_stream_name}\",\n \"PhysicalResourceId\": event.get(\"PhysicalResourceId\") or event[\"LogicalResourceId\"],\n \"StackId\": event[\"StackId\"],\n \"RequestId\": event[\"RequestId\"],\n \"LogicalResourceId\": event[\"LogicalResourceId\"],\n \"NoEcho\": False,\n }\n ).encode(\"utf-8\")\n headers = {\"content-type\": \"\", \"content-length\": str(len(response_body))}\n try:\n req = urllib.request.Request(url=event[\"ResponseURL\"], headers=headers, data=response_body, method=\"PUT\")\n with urllib.request.urlopen(req) as response:\n print(response.read().decode(\"utf-8\"))\n print(\"Status code: \" + response.reason)\n except Exception as e:\n print(\"send(..) failed executing request.urlopen(..): \" + str(e))" }, "Handler": "index.handler", "Role": { diff --git a/source/patterns/@aws-solutions-constructs/aws-s3-sqs/test/integ.s3sqs-existingQueue.js.snapshot/s3sqsexistingQueueIntegDefaultTestDeployAssert82F5925F.assets.json b/source/patterns/@aws-solutions-constructs/aws-s3-sqs/test/integ.s3sqs-existingQueue.js.snapshot/s3sqsexistingQueueIntegDefaultTestDeployAssert82F5925F.assets.json index 6ed25720e..807954f45 100644 --- a/source/patterns/@aws-solutions-constructs/aws-s3-sqs/test/integ.s3sqs-existingQueue.js.snapshot/s3sqsexistingQueueIntegDefaultTestDeployAssert82F5925F.assets.json +++ b/source/patterns/@aws-solutions-constructs/aws-s3-sqs/test/integ.s3sqs-existingQueue.js.snapshot/s3sqsexistingQueueIntegDefaultTestDeployAssert82F5925F.assets.json @@ -1,5 +1,5 @@ { - "version": "36.0.0", + "version": "36.0.18", "files": { "21fbb51d7b23f6a6c262b46a9caee79d744a3ac019fd45422d988b96d44b2a22": { "source": { diff --git a/source/patterns/@aws-solutions-constructs/aws-s3-sqs/test/integ.s3sqs-existingQueue.js.snapshot/tree.json b/source/patterns/@aws-solutions-constructs/aws-s3-sqs/test/integ.s3sqs-existingQueue.js.snapshot/tree.json index 7363c3b40..77f25a3c8 100644 --- a/source/patterns/@aws-solutions-constructs/aws-s3-sqs/test/integ.s3sqs-existingQueue.js.snapshot/tree.json +++ b/source/patterns/@aws-solutions-constructs/aws-s3-sqs/test/integ.s3sqs-existingQueue.js.snapshot/tree.json @@ -23,7 +23,7 @@ }, "constructInfo": { "fqn": "aws-cdk-lib.aws_sqs.CfnQueue", - "version": "2.149.0" + "version": "2.154.1" } }, "Policy": { @@ -106,19 +106,19 @@ }, "constructInfo": { "fqn": "aws-cdk-lib.aws_sqs.CfnQueuePolicy", - "version": "2.149.0" + "version": "2.154.1" } } }, "constructInfo": { "fqn": "aws-cdk-lib.aws_sqs.QueuePolicy", - "version": "2.149.0" + "version": "2.154.1" } } }, "constructInfo": { "fqn": "aws-cdk-lib.aws_sqs.Queue", - "version": "2.149.0" + "version": "2.154.1" } }, "'test-existing-queueKey'": { @@ -198,13 +198,13 @@ }, "constructInfo": { "fqn": "aws-cdk-lib.aws_kms.CfnKey", - "version": "2.149.0" + "version": "2.154.1" } } }, "constructInfo": { "fqn": "aws-cdk-lib.aws_kms.Key", - "version": "2.149.0" + "version": "2.154.1" } }, "test-existing-queue": { @@ -236,7 +236,7 @@ }, "constructInfo": { "fqn": "aws-cdk-lib.aws_sqs.CfnQueue", - "version": "2.149.0" + "version": "2.154.1" } }, "Policy": { @@ -346,19 +346,19 @@ }, "constructInfo": { "fqn": "aws-cdk-lib.aws_sqs.CfnQueuePolicy", - "version": "2.149.0" + "version": "2.154.1" } } }, "constructInfo": { "fqn": "aws-cdk-lib.aws_sqs.QueuePolicy", - "version": "2.149.0" + "version": "2.154.1" } } }, "constructInfo": { "fqn": "aws-cdk-lib.aws_sqs.Queue", - "version": "2.149.0" + "version": "2.154.1" } }, "test-s3-sqs": { @@ -416,7 +416,7 @@ }, "constructInfo": { "fqn": "aws-cdk-lib.aws_s3.CfnBucket", - "version": "2.149.0" + "version": "2.154.1" } }, "Policy": { @@ -514,13 +514,13 @@ }, "constructInfo": { "fqn": "aws-cdk-lib.aws_s3.CfnBucketPolicy", - "version": "2.149.0" + "version": "2.154.1" } } }, "constructInfo": { "fqn": "aws-cdk-lib.aws_s3.BucketPolicy", - "version": "2.149.0" + "version": "2.154.1" } }, "AutoDeleteObjectsCustomResource": { @@ -532,13 +532,13 @@ "path": "s3sqs-existingQueue/test-s3-sqs/S3Bucket/AutoDeleteObjectsCustomResource/Default", "constructInfo": { "fqn": "aws-cdk-lib.CfnResource", - "version": "2.149.0" + "version": "2.154.1" } } }, "constructInfo": { "fqn": "aws-cdk-lib.CustomResource", - "version": "2.149.0" + "version": "2.154.1" } }, "Notifications": { @@ -550,7 +550,7 @@ "path": "s3sqs-existingQueue/test-s3-sqs/S3Bucket/Notifications/Resource", "constructInfo": { "fqn": "aws-cdk-lib.CfnResource", - "version": "2.149.0" + "version": "2.154.1" } } }, @@ -562,13 +562,13 @@ }, "constructInfo": { "fqn": "aws-cdk-lib.aws_s3.Bucket", - "version": "2.149.0" + "version": "2.154.1" } } }, "constructInfo": { "fqn": "@aws-solutions-constructs/aws-s3-sqs.S3ToSqs", - "version": "2.62.0" + "version": "2.67.1" } }, "LatestNodeRuntimeMap": { @@ -576,7 +576,7 @@ "path": "s3sqs-existingQueue/LatestNodeRuntimeMap", "constructInfo": { "fqn": "aws-cdk-lib.CfnMapping", - "version": "2.149.0" + "version": "2.154.1" } }, "Custom::S3AutoDeleteObjectsCustomResourceProvider": { @@ -588,7 +588,7 @@ "path": "s3sqs-existingQueue/Custom::S3AutoDeleteObjectsCustomResourceProvider/Staging", "constructInfo": { "fqn": "aws-cdk-lib.AssetStaging", - "version": "2.149.0" + "version": "2.154.1" } }, "Role": { @@ -596,7 +596,7 @@ "path": "s3sqs-existingQueue/Custom::S3AutoDeleteObjectsCustomResourceProvider/Role", "constructInfo": { "fqn": "aws-cdk-lib.CfnResource", - "version": "2.149.0" + "version": "2.154.1" } }, "Handler": { @@ -604,13 +604,13 @@ "path": "s3sqs-existingQueue/Custom::S3AutoDeleteObjectsCustomResourceProvider/Handler", "constructInfo": { "fqn": "aws-cdk-lib.CfnResource", - "version": "2.149.0" + "version": "2.154.1" } } }, "constructInfo": { "fqn": "aws-cdk-lib.CustomResourceProviderBase", - "version": "2.149.0" + "version": "2.154.1" } }, "BucketNotificationsHandler050a0587b7544547bf325f094a3db834": { @@ -626,7 +626,7 @@ "path": "s3sqs-existingQueue/BucketNotificationsHandler050a0587b7544547bf325f094a3db834/Role/ImportRole", "constructInfo": { "fqn": "aws-cdk-lib.Resource", - "version": "2.149.0" + "version": "2.154.1" } }, "Resource": { @@ -665,7 +665,7 @@ }, "constructInfo": { "fqn": "aws-cdk-lib.aws_iam.CfnRole", - "version": "2.149.0" + "version": "2.154.1" } }, "DefaultPolicy": { @@ -698,19 +698,19 @@ }, "constructInfo": { "fqn": "aws-cdk-lib.aws_iam.CfnPolicy", - "version": "2.149.0" + "version": "2.154.1" } } }, "constructInfo": { "fqn": "aws-cdk-lib.aws_iam.Policy", - "version": "2.149.0" + "version": "2.154.1" } } }, "constructInfo": { "fqn": "aws-cdk-lib.aws_iam.Role", - "version": "2.149.0" + "version": "2.154.1" } }, "Resource": { @@ -718,7 +718,7 @@ "path": "s3sqs-existingQueue/BucketNotificationsHandler050a0587b7544547bf325f094a3db834/Resource", "constructInfo": { "fqn": "aws-cdk-lib.CfnResource", - "version": "2.149.0" + "version": "2.154.1" } } }, @@ -752,7 +752,7 @@ "path": "s3sqs-existingQueue/Integ/DefaultTest/DeployAssert/BootstrapVersion", "constructInfo": { "fqn": "aws-cdk-lib.CfnParameter", - "version": "2.149.0" + "version": "2.154.1" } }, "CheckBootstrapVersion": { @@ -760,25 +760,25 @@ "path": "s3sqs-existingQueue/Integ/DefaultTest/DeployAssert/CheckBootstrapVersion", "constructInfo": { "fqn": "aws-cdk-lib.CfnRule", - "version": "2.149.0" + "version": "2.154.1" } } }, "constructInfo": { "fqn": "aws-cdk-lib.Stack", - "version": "2.149.0" + "version": "2.154.1" } } }, "constructInfo": { "fqn": "@aws-cdk/integ-tests-alpha.IntegTestCase", - "version": "2.149.0-alpha.0" + "version": "2.154.1-alpha.0" } } }, "constructInfo": { "fqn": "@aws-cdk/integ-tests-alpha.IntegTest", - "version": "2.149.0-alpha.0" + "version": "2.154.1-alpha.0" } }, "BootstrapVersion": { @@ -786,7 +786,7 @@ "path": "s3sqs-existingQueue/BootstrapVersion", "constructInfo": { "fqn": "aws-cdk-lib.CfnParameter", - "version": "2.149.0" + "version": "2.154.1" } }, "CheckBootstrapVersion": { @@ -794,13 +794,13 @@ "path": "s3sqs-existingQueue/CheckBootstrapVersion", "constructInfo": { "fqn": "aws-cdk-lib.CfnRule", - "version": "2.149.0" + "version": "2.154.1" } } }, "constructInfo": { "fqn": "aws-cdk-lib.Stack", - "version": "2.149.0" + "version": "2.154.1" } }, "Tree": { @@ -814,7 +814,7 @@ }, "constructInfo": { "fqn": "aws-cdk-lib.App", - "version": "2.149.0" + "version": "2.154.1" } } } \ No newline at end of file diff --git a/source/patterns/@aws-solutions-constructs/aws-s3-sqs/test/integ.s3sqs-existingS3Bucket.js.snapshot/cdk.out b/source/patterns/@aws-solutions-constructs/aws-s3-sqs/test/integ.s3sqs-existingS3Bucket.js.snapshot/cdk.out index 1f0068d32..0d15a78da 100644 --- a/source/patterns/@aws-solutions-constructs/aws-s3-sqs/test/integ.s3sqs-existingS3Bucket.js.snapshot/cdk.out +++ b/source/patterns/@aws-solutions-constructs/aws-s3-sqs/test/integ.s3sqs-existingS3Bucket.js.snapshot/cdk.out @@ -1 +1 @@ -{"version":"36.0.0"} \ No newline at end of file +{"version":"36.0.18"} \ No newline at end of file diff --git a/source/patterns/@aws-solutions-constructs/aws-s3-sqs/test/integ.s3sqs-existingS3Bucket.js.snapshot/integ.json b/source/patterns/@aws-solutions-constructs/aws-s3-sqs/test/integ.s3sqs-existingS3Bucket.js.snapshot/integ.json index 1450800ef..3f3e50f60 100644 --- a/source/patterns/@aws-solutions-constructs/aws-s3-sqs/test/integ.s3sqs-existingS3Bucket.js.snapshot/integ.json +++ b/source/patterns/@aws-solutions-constructs/aws-s3-sqs/test/integ.s3sqs-existingS3Bucket.js.snapshot/integ.json @@ -1,5 +1,5 @@ { - "version": "36.0.0", + "version": "36.0.18", "testCases": { "s3sqs-existingS3Bucket/Integ/DefaultTest": { "stacks": [ diff --git a/source/patterns/@aws-solutions-constructs/aws-s3-sqs/test/integ.s3sqs-existingS3Bucket.js.snapshot/manifest.json b/source/patterns/@aws-solutions-constructs/aws-s3-sqs/test/integ.s3sqs-existingS3Bucket.js.snapshot/manifest.json index 49696ce1d..373c49cfc 100644 --- a/source/patterns/@aws-solutions-constructs/aws-s3-sqs/test/integ.s3sqs-existingS3Bucket.js.snapshot/manifest.json +++ b/source/patterns/@aws-solutions-constructs/aws-s3-sqs/test/integ.s3sqs-existingS3Bucket.js.snapshot/manifest.json @@ -1,5 +1,5 @@ { - "version": "36.0.0", + "version": "36.0.5", "artifacts": { "s3sqsexistingS3BucketIntegDefaultTestDeployAssertECBDD151.assets": { "type": "cdk:asset-manifest", @@ -66,7 +66,7 @@ "validateOnSynth": false, "assumeRoleArn": "arn:${AWS::Partition}:iam::${AWS::AccountId}:role/cdk-hnb659fds-deploy-role-${AWS::AccountId}-${AWS::Region}", "cloudFormationExecutionRoleArn": "arn:${AWS::Partition}:iam::${AWS::AccountId}:role/cdk-hnb659fds-cfn-exec-role-${AWS::AccountId}-${AWS::Region}", - "stackTemplateAssetObjectUrl": "s3://cdk-hnb659fds-assets-${AWS::AccountId}-${AWS::Region}/cbd1d6fe2ecb5191db2dbe8487bf017f2fc4a0c4cd65bddf532979383d36b4dd.json", + "stackTemplateAssetObjectUrl": "s3://cdk-hnb659fds-assets-${AWS::AccountId}-${AWS::Region}/bc92191a55e3352b3ee8143a7d101bba7d74914f949c3a46c3966217fabfc337.json", "requiresBootstrapStackVersion": 6, "bootstrapStackVersionSsmParameter": "/cdk-bootstrap/hnb659fds/version", "additionalDependencies": [ @@ -106,6 +106,12 @@ "data": "LatestNodeRuntimeMap" } ], + "/s3sqs-existingS3Bucket/Custom::S3AutoDeleteObjectsCustomResourceProvider": [ + { + "type": "aws:cdk:is-custom-resource-handler-customResourceProvider", + "data": true + } + ], "/s3sqs-existingS3Bucket/Custom::S3AutoDeleteObjectsCustomResourceProvider/Role": [ { "type": "aws:cdk:logicalId", diff --git a/source/patterns/@aws-solutions-constructs/aws-s3-sqs/test/integ.s3sqs-existingS3Bucket.js.snapshot/s3sqs-existingS3Bucket.assets.json b/source/patterns/@aws-solutions-constructs/aws-s3-sqs/test/integ.s3sqs-existingS3Bucket.js.snapshot/s3sqs-existingS3Bucket.assets.json index bd6737d72..5864bf729 100644 --- a/source/patterns/@aws-solutions-constructs/aws-s3-sqs/test/integ.s3sqs-existingS3Bucket.js.snapshot/s3sqs-existingS3Bucket.assets.json +++ b/source/patterns/@aws-solutions-constructs/aws-s3-sqs/test/integ.s3sqs-existingS3Bucket.js.snapshot/s3sqs-existingS3Bucket.assets.json @@ -1,5 +1,5 @@ { - "version": "36.0.0", + "version": "36.0.18", "files": { "faa95a81ae7d7373f3e1f242268f904eb748d8d0fdd306e8a6fe515a1905a7d6": { "source": { @@ -14,7 +14,7 @@ } } }, - "cbd1d6fe2ecb5191db2dbe8487bf017f2fc4a0c4cd65bddf532979383d36b4dd": { + "bc92191a55e3352b3ee8143a7d101bba7d74914f949c3a46c3966217fabfc337": { "source": { "path": "s3sqs-existingS3Bucket.template.json", "packaging": "file" @@ -22,7 +22,7 @@ "destinations": { "current_account-current_region": { "bucketName": "cdk-hnb659fds-assets-${AWS::AccountId}-${AWS::Region}", - "objectKey": "cbd1d6fe2ecb5191db2dbe8487bf017f2fc4a0c4cd65bddf532979383d36b4dd.json", + "objectKey": "bc92191a55e3352b3ee8143a7d101bba7d74914f949c3a46c3966217fabfc337.json", "assumeRoleArn": "arn:${AWS::Partition}:iam::${AWS::AccountId}:role/cdk-hnb659fds-file-publishing-role-${AWS::AccountId}-${AWS::Region}" } } diff --git a/source/patterns/@aws-solutions-constructs/aws-s3-sqs/test/integ.s3sqs-existingS3Bucket.js.snapshot/s3sqs-existingS3Bucket.template.json b/source/patterns/@aws-solutions-constructs/aws-s3-sqs/test/integ.s3sqs-existingS3Bucket.js.snapshot/s3sqs-existingS3Bucket.template.json index cec16979d..de214c3f2 100644 --- a/source/patterns/@aws-solutions-constructs/aws-s3-sqs/test/integ.s3sqs-existingS3Bucket.js.snapshot/s3sqs-existingS3Bucket.template.json +++ b/source/patterns/@aws-solutions-constructs/aws-s3-sqs/test/integ.s3sqs-existingS3Bucket.js.snapshot/s3sqs-existingS3Bucket.template.json @@ -422,7 +422,8 @@ } ] }, - "Managed": true + "Managed": true, + "SkipDestinationValidation": false }, "DependsOn": [ "scrapBucketPolicy189B0607", @@ -766,7 +767,7 @@ "Properties": { "Description": "AWS CloudFormation handler for \"Custom::S3BucketNotifications\" resources (@aws-cdk/aws-s3)", "Code": { - "ZipFile": "import boto3 # type: ignore\nimport json\nimport logging\nimport urllib.request\n\ns3 = boto3.client(\"s3\")\n\nEVENTBRIDGE_CONFIGURATION = 'EventBridgeConfiguration'\nCONFIGURATION_TYPES = [\"TopicConfigurations\", \"QueueConfigurations\", \"LambdaFunctionConfigurations\"]\n\ndef handler(event: dict, context):\n response_status = \"SUCCESS\"\n error_message = \"\"\n try:\n props = event[\"ResourceProperties\"]\n notification_configuration = props[\"NotificationConfiguration\"]\n managed = props.get('Managed', 'true').lower() == 'true'\n stack_id = event['StackId']\n old = event.get(\"OldResourceProperties\", {}).get(\"NotificationConfiguration\", {})\n if managed:\n config = handle_managed(event[\"RequestType\"], notification_configuration)\n else:\n config = handle_unmanaged(props[\"BucketName\"], stack_id, event[\"RequestType\"], notification_configuration, old)\n s3.put_bucket_notification_configuration(Bucket=props[\"BucketName\"], NotificationConfiguration=config)\n except Exception as e:\n logging.exception(\"Failed to put bucket notification configuration\")\n response_status = \"FAILED\"\n error_message = f\"Error: {str(e)}. \"\n finally:\n submit_response(event, context, response_status, error_message)\n\ndef handle_managed(request_type, notification_configuration):\n if request_type == 'Delete':\n return {}\n return notification_configuration\n\ndef handle_unmanaged(bucket, stack_id, request_type, notification_configuration, old):\n def get_id(n):\n n['Id'] = ''\n strToHash=json.dumps(n, sort_keys=True).replace('\"Name\": \"prefix\"', '\"Name\": \"Prefix\"').replace('\"Name\": \"suffix\"', '\"Name\": \"Suffix\"')\n return f\"{stack_id}-{hash(strToHash)}\"\n def with_id(n):\n n['Id'] = get_id(n)\n return n\n\n external_notifications = {}\n existing_notifications = s3.get_bucket_notification_configuration(Bucket=bucket)\n for t in CONFIGURATION_TYPES:\n if request_type == 'Update':\n old_incoming_ids = [get_id(n) for n in old.get(t, [])]\n external_notifications[t] = [n for n in existing_notifications.get(t, []) if not get_id(n) in old_incoming_ids] \n elif request_type == 'Delete':\n external_notifications[t] = [n for n in existing_notifications.get(t, []) if not n['Id'].startswith(f\"{stack_id}-\")]\n elif request_type == 'Create':\n external_notifications[t] = [n for n in existing_notifications.get(t, [])]\n if EVENTBRIDGE_CONFIGURATION in existing_notifications:\n external_notifications[EVENTBRIDGE_CONFIGURATION] = existing_notifications[EVENTBRIDGE_CONFIGURATION]\n\n if request_type == 'Delete':\n return external_notifications\n\n notifications = {}\n for t in CONFIGURATION_TYPES:\n external = external_notifications.get(t, [])\n incoming = [with_id(n) for n in notification_configuration.get(t, [])]\n notifications[t] = external + incoming\n\n if EVENTBRIDGE_CONFIGURATION in notification_configuration:\n notifications[EVENTBRIDGE_CONFIGURATION] = notification_configuration[EVENTBRIDGE_CONFIGURATION]\n elif EVENTBRIDGE_CONFIGURATION in external_notifications:\n notifications[EVENTBRIDGE_CONFIGURATION] = external_notifications[EVENTBRIDGE_CONFIGURATION]\n\n return notifications\n\ndef submit_response(event: dict, context, response_status: str, error_message: str):\n response_body = json.dumps(\n {\n \"Status\": response_status,\n \"Reason\": f\"{error_message}See the details in CloudWatch Log Stream: {context.log_stream_name}\",\n \"PhysicalResourceId\": event.get(\"PhysicalResourceId\") or event[\"LogicalResourceId\"],\n \"StackId\": event[\"StackId\"],\n \"RequestId\": event[\"RequestId\"],\n \"LogicalResourceId\": event[\"LogicalResourceId\"],\n \"NoEcho\": False,\n }\n ).encode(\"utf-8\")\n headers = {\"content-type\": \"\", \"content-length\": str(len(response_body))}\n try:\n req = urllib.request.Request(url=event[\"ResponseURL\"], headers=headers, data=response_body, method=\"PUT\")\n with urllib.request.urlopen(req) as response:\n print(response.read().decode(\"utf-8\"))\n print(\"Status code: \" + response.reason)\n except Exception as e:\n print(\"send(..) failed executing request.urlopen(..): \" + str(e))" + "ZipFile": "import boto3 # type: ignore\nimport json\nimport logging\nimport urllib.request\n\ns3 = boto3.client(\"s3\")\n\nEVENTBRIDGE_CONFIGURATION = 'EventBridgeConfiguration'\nCONFIGURATION_TYPES = [\"TopicConfigurations\", \"QueueConfigurations\", \"LambdaFunctionConfigurations\"]\n\ndef handler(event: dict, context):\n response_status = \"SUCCESS\"\n error_message = \"\"\n try:\n props = event[\"ResourceProperties\"]\n notification_configuration = props[\"NotificationConfiguration\"]\n managed = props.get('Managed', 'true').lower() == 'true'\n skipDestinationValidation = props.get('SkipDestinationValidation', 'false').lower() == 'true'\n stack_id = event['StackId']\n old = event.get(\"OldResourceProperties\", {}).get(\"NotificationConfiguration\", {})\n if managed:\n config = handle_managed(event[\"RequestType\"], notification_configuration)\n else:\n config = handle_unmanaged(props[\"BucketName\"], stack_id, event[\"RequestType\"], notification_configuration, old)\n s3.put_bucket_notification_configuration(Bucket=props[\"BucketName\"], NotificationConfiguration=config, SkipDestinationValidation=skipDestinationValidation)\n except Exception as e:\n logging.exception(\"Failed to put bucket notification configuration\")\n response_status = \"FAILED\"\n error_message = f\"Error: {str(e)}. \"\n finally:\n submit_response(event, context, response_status, error_message)\n\ndef handle_managed(request_type, notification_configuration):\n if request_type == 'Delete':\n return {}\n return notification_configuration\n\ndef handle_unmanaged(bucket, stack_id, request_type, notification_configuration, old):\n def get_id(n):\n n['Id'] = ''\n strToHash=json.dumps(n, sort_keys=True).replace('\"Name\": \"prefix\"', '\"Name\": \"Prefix\"').replace('\"Name\": \"suffix\"', '\"Name\": \"Suffix\"')\n return f\"{stack_id}-{hash(strToHash)}\"\n def with_id(n):\n n['Id'] = get_id(n)\n return n\n\n external_notifications = {}\n existing_notifications = s3.get_bucket_notification_configuration(Bucket=bucket)\n for t in CONFIGURATION_TYPES:\n if request_type == 'Update':\n old_incoming_ids = [get_id(n) for n in old.get(t, [])]\n external_notifications[t] = [n for n in existing_notifications.get(t, []) if not get_id(n) in old_incoming_ids] \n elif request_type == 'Delete':\n external_notifications[t] = [n for n in existing_notifications.get(t, []) if not n['Id'].startswith(f\"{stack_id}-\")]\n elif request_type == 'Create':\n external_notifications[t] = [n for n in existing_notifications.get(t, [])]\n if EVENTBRIDGE_CONFIGURATION in existing_notifications:\n external_notifications[EVENTBRIDGE_CONFIGURATION] = existing_notifications[EVENTBRIDGE_CONFIGURATION]\n\n if request_type == 'Delete':\n return external_notifications\n\n notifications = {}\n for t in CONFIGURATION_TYPES:\n external = external_notifications.get(t, [])\n incoming = [with_id(n) for n in notification_configuration.get(t, [])]\n notifications[t] = external + incoming\n\n if EVENTBRIDGE_CONFIGURATION in notification_configuration:\n notifications[EVENTBRIDGE_CONFIGURATION] = notification_configuration[EVENTBRIDGE_CONFIGURATION]\n elif EVENTBRIDGE_CONFIGURATION in external_notifications:\n notifications[EVENTBRIDGE_CONFIGURATION] = external_notifications[EVENTBRIDGE_CONFIGURATION]\n\n return notifications\n\ndef submit_response(event: dict, context, response_status: str, error_message: str):\n response_body = json.dumps(\n {\n \"Status\": response_status,\n \"Reason\": f\"{error_message}See the details in CloudWatch Log Stream: {context.log_stream_name}\",\n \"PhysicalResourceId\": event.get(\"PhysicalResourceId\") or event[\"LogicalResourceId\"],\n \"StackId\": event[\"StackId\"],\n \"RequestId\": event[\"RequestId\"],\n \"LogicalResourceId\": event[\"LogicalResourceId\"],\n \"NoEcho\": False,\n }\n ).encode(\"utf-8\")\n headers = {\"content-type\": \"\", \"content-length\": str(len(response_body))}\n try:\n req = urllib.request.Request(url=event[\"ResponseURL\"], headers=headers, data=response_body, method=\"PUT\")\n with urllib.request.urlopen(req) as response:\n print(response.read().decode(\"utf-8\"))\n print(\"Status code: \" + response.reason)\n except Exception as e:\n print(\"send(..) failed executing request.urlopen(..): \" + str(e))" }, "Handler": "index.handler", "Role": { diff --git a/source/patterns/@aws-solutions-constructs/aws-s3-sqs/test/integ.s3sqs-existingS3Bucket.js.snapshot/s3sqsexistingS3BucketIntegDefaultTestDeployAssertECBDD151.assets.json b/source/patterns/@aws-solutions-constructs/aws-s3-sqs/test/integ.s3sqs-existingS3Bucket.js.snapshot/s3sqsexistingS3BucketIntegDefaultTestDeployAssertECBDD151.assets.json index d9fcb308e..fbcc299b4 100644 --- a/source/patterns/@aws-solutions-constructs/aws-s3-sqs/test/integ.s3sqs-existingS3Bucket.js.snapshot/s3sqsexistingS3BucketIntegDefaultTestDeployAssertECBDD151.assets.json +++ b/source/patterns/@aws-solutions-constructs/aws-s3-sqs/test/integ.s3sqs-existingS3Bucket.js.snapshot/s3sqsexistingS3BucketIntegDefaultTestDeployAssertECBDD151.assets.json @@ -1,5 +1,5 @@ { - "version": "36.0.0", + "version": "36.0.18", "files": { "21fbb51d7b23f6a6c262b46a9caee79d744a3ac019fd45422d988b96d44b2a22": { "source": { diff --git a/source/patterns/@aws-solutions-constructs/aws-s3-sqs/test/integ.s3sqs-existingS3Bucket.js.snapshot/tree.json b/source/patterns/@aws-solutions-constructs/aws-s3-sqs/test/integ.s3sqs-existingS3Bucket.js.snapshot/tree.json index 905706193..f75f3ef3a 100644 --- a/source/patterns/@aws-solutions-constructs/aws-s3-sqs/test/integ.s3sqs-existingS3Bucket.js.snapshot/tree.json +++ b/source/patterns/@aws-solutions-constructs/aws-s3-sqs/test/integ.s3sqs-existingS3Bucket.js.snapshot/tree.json @@ -40,7 +40,7 @@ }, "constructInfo": { "fqn": "aws-cdk-lib.aws_s3.CfnBucket", - "version": "2.149.0" + "version": "2.154.1" } }, "Policy": { @@ -174,13 +174,13 @@ }, "constructInfo": { "fqn": "aws-cdk-lib.aws_s3.CfnBucketPolicy", - "version": "2.149.0" + "version": "2.154.1" } } }, "constructInfo": { "fqn": "aws-cdk-lib.aws_s3.BucketPolicy", - "version": "2.149.0" + "version": "2.154.1" } }, "AutoDeleteObjectsCustomResource": { @@ -192,19 +192,19 @@ "path": "s3sqs-existingS3Bucket/scrapBucketLog/AutoDeleteObjectsCustomResource/Default", "constructInfo": { "fqn": "aws-cdk-lib.CfnResource", - "version": "2.149.0" + "version": "2.154.1" } } }, "constructInfo": { "fqn": "aws-cdk-lib.CustomResource", - "version": "2.149.0" + "version": "2.154.1" } } }, "constructInfo": { "fqn": "aws-cdk-lib.aws_s3.Bucket", - "version": "2.149.0" + "version": "2.154.1" } }, "LatestNodeRuntimeMap": { @@ -212,7 +212,7 @@ "path": "s3sqs-existingS3Bucket/LatestNodeRuntimeMap", "constructInfo": { "fqn": "aws-cdk-lib.CfnMapping", - "version": "2.149.0" + "version": "2.154.1" } }, "Custom::S3AutoDeleteObjectsCustomResourceProvider": { @@ -224,7 +224,7 @@ "path": "s3sqs-existingS3Bucket/Custom::S3AutoDeleteObjectsCustomResourceProvider/Staging", "constructInfo": { "fqn": "aws-cdk-lib.AssetStaging", - "version": "2.149.0" + "version": "2.154.1" } }, "Role": { @@ -232,7 +232,7 @@ "path": "s3sqs-existingS3Bucket/Custom::S3AutoDeleteObjectsCustomResourceProvider/Role", "constructInfo": { "fqn": "aws-cdk-lib.CfnResource", - "version": "2.149.0" + "version": "2.154.1" } }, "Handler": { @@ -240,13 +240,13 @@ "path": "s3sqs-existingS3Bucket/Custom::S3AutoDeleteObjectsCustomResourceProvider/Handler", "constructInfo": { "fqn": "aws-cdk-lib.CfnResource", - "version": "2.149.0" + "version": "2.154.1" } } }, "constructInfo": { "fqn": "aws-cdk-lib.CustomResourceProviderBase", - "version": "2.149.0" + "version": "2.154.1" } }, "scrapBucket": { @@ -286,7 +286,7 @@ }, "constructInfo": { "fqn": "aws-cdk-lib.aws_s3.CfnBucket", - "version": "2.149.0" + "version": "2.154.1" } }, "Policy": { @@ -384,13 +384,13 @@ }, "constructInfo": { "fqn": "aws-cdk-lib.aws_s3.CfnBucketPolicy", - "version": "2.149.0" + "version": "2.154.1" } } }, "constructInfo": { "fqn": "aws-cdk-lib.aws_s3.BucketPolicy", - "version": "2.149.0" + "version": "2.154.1" } }, "AutoDeleteObjectsCustomResource": { @@ -402,13 +402,13 @@ "path": "s3sqs-existingS3Bucket/scrapBucket/AutoDeleteObjectsCustomResource/Default", "constructInfo": { "fqn": "aws-cdk-lib.CfnResource", - "version": "2.149.0" + "version": "2.154.1" } } }, "constructInfo": { "fqn": "aws-cdk-lib.CustomResource", - "version": "2.149.0" + "version": "2.154.1" } }, "Notifications": { @@ -420,7 +420,7 @@ "path": "s3sqs-existingS3Bucket/scrapBucket/Notifications/Resource", "constructInfo": { "fqn": "aws-cdk-lib.CfnResource", - "version": "2.149.0" + "version": "2.154.1" } } }, @@ -432,7 +432,7 @@ }, "constructInfo": { "fqn": "aws-cdk-lib.aws_s3.Bucket", - "version": "2.149.0" + "version": "2.154.1" } }, "test-s3-sqs": { @@ -454,7 +454,7 @@ }, "constructInfo": { "fqn": "aws-cdk-lib.aws_sqs.CfnQueue", - "version": "2.149.0" + "version": "2.154.1" } }, "Policy": { @@ -537,19 +537,19 @@ }, "constructInfo": { "fqn": "aws-cdk-lib.aws_sqs.CfnQueuePolicy", - "version": "2.149.0" + "version": "2.154.1" } } }, "constructInfo": { "fqn": "aws-cdk-lib.aws_sqs.QueuePolicy", - "version": "2.149.0" + "version": "2.154.1" } } }, "constructInfo": { "fqn": "aws-cdk-lib.aws_sqs.Queue", - "version": "2.149.0" + "version": "2.154.1" } }, "'queueKey'": { @@ -629,13 +629,13 @@ }, "constructInfo": { "fqn": "aws-cdk-lib.aws_kms.CfnKey", - "version": "2.149.0" + "version": "2.154.1" } } }, "constructInfo": { "fqn": "aws-cdk-lib.aws_kms.Key", - "version": "2.149.0" + "version": "2.154.1" } }, "queue": { @@ -667,7 +667,7 @@ }, "constructInfo": { "fqn": "aws-cdk-lib.aws_sqs.CfnQueue", - "version": "2.149.0" + "version": "2.154.1" } }, "Policy": { @@ -777,25 +777,25 @@ }, "constructInfo": { "fqn": "aws-cdk-lib.aws_sqs.CfnQueuePolicy", - "version": "2.149.0" + "version": "2.154.1" } } }, "constructInfo": { "fqn": "aws-cdk-lib.aws_sqs.QueuePolicy", - "version": "2.149.0" + "version": "2.154.1" } } }, "constructInfo": { "fqn": "aws-cdk-lib.aws_sqs.Queue", - "version": "2.149.0" + "version": "2.154.1" } } }, "constructInfo": { "fqn": "@aws-solutions-constructs/aws-s3-sqs.S3ToSqs", - "version": "2.62.0" + "version": "2.67.1" } }, "BucketNotificationsHandler050a0587b7544547bf325f094a3db834": { @@ -811,7 +811,7 @@ "path": "s3sqs-existingS3Bucket/BucketNotificationsHandler050a0587b7544547bf325f094a3db834/Role/ImportRole", "constructInfo": { "fqn": "aws-cdk-lib.Resource", - "version": "2.149.0" + "version": "2.154.1" } }, "Resource": { @@ -850,7 +850,7 @@ }, "constructInfo": { "fqn": "aws-cdk-lib.aws_iam.CfnRole", - "version": "2.149.0" + "version": "2.154.1" } }, "DefaultPolicy": { @@ -883,19 +883,19 @@ }, "constructInfo": { "fqn": "aws-cdk-lib.aws_iam.CfnPolicy", - "version": "2.149.0" + "version": "2.154.1" } } }, "constructInfo": { "fqn": "aws-cdk-lib.aws_iam.Policy", - "version": "2.149.0" + "version": "2.154.1" } } }, "constructInfo": { "fqn": "aws-cdk-lib.aws_iam.Role", - "version": "2.149.0" + "version": "2.154.1" } }, "Resource": { @@ -903,7 +903,7 @@ "path": "s3sqs-existingS3Bucket/BucketNotificationsHandler050a0587b7544547bf325f094a3db834/Resource", "constructInfo": { "fqn": "aws-cdk-lib.CfnResource", - "version": "2.149.0" + "version": "2.154.1" } } }, @@ -937,7 +937,7 @@ "path": "s3sqs-existingS3Bucket/Integ/DefaultTest/DeployAssert/BootstrapVersion", "constructInfo": { "fqn": "aws-cdk-lib.CfnParameter", - "version": "2.149.0" + "version": "2.154.1" } }, "CheckBootstrapVersion": { @@ -945,25 +945,25 @@ "path": "s3sqs-existingS3Bucket/Integ/DefaultTest/DeployAssert/CheckBootstrapVersion", "constructInfo": { "fqn": "aws-cdk-lib.CfnRule", - "version": "2.149.0" + "version": "2.154.1" } } }, "constructInfo": { "fqn": "aws-cdk-lib.Stack", - "version": "2.149.0" + "version": "2.154.1" } } }, "constructInfo": { "fqn": "@aws-cdk/integ-tests-alpha.IntegTestCase", - "version": "2.149.0-alpha.0" + "version": "2.154.1-alpha.0" } } }, "constructInfo": { "fqn": "@aws-cdk/integ-tests-alpha.IntegTest", - "version": "2.149.0-alpha.0" + "version": "2.154.1-alpha.0" } }, "BootstrapVersion": { @@ -971,7 +971,7 @@ "path": "s3sqs-existingS3Bucket/BootstrapVersion", "constructInfo": { "fqn": "aws-cdk-lib.CfnParameter", - "version": "2.149.0" + "version": "2.154.1" } }, "CheckBootstrapVersion": { @@ -979,13 +979,13 @@ "path": "s3sqs-existingS3Bucket/CheckBootstrapVersion", "constructInfo": { "fqn": "aws-cdk-lib.CfnRule", - "version": "2.149.0" + "version": "2.154.1" } } }, "constructInfo": { "fqn": "aws-cdk-lib.Stack", - "version": "2.149.0" + "version": "2.154.1" } }, "Tree": { @@ -999,7 +999,7 @@ }, "constructInfo": { "fqn": "aws-cdk-lib.App", - "version": "2.149.0" + "version": "2.154.1" } } } \ No newline at end of file diff --git a/source/patterns/@aws-solutions-constructs/aws-s3-sqs/test/integ.s3sqs-noArguments.js.snapshot/cdk.out b/source/patterns/@aws-solutions-constructs/aws-s3-sqs/test/integ.s3sqs-noArguments.js.snapshot/cdk.out index 1f0068d32..0d15a78da 100644 --- a/source/patterns/@aws-solutions-constructs/aws-s3-sqs/test/integ.s3sqs-noArguments.js.snapshot/cdk.out +++ b/source/patterns/@aws-solutions-constructs/aws-s3-sqs/test/integ.s3sqs-noArguments.js.snapshot/cdk.out @@ -1 +1 @@ -{"version":"36.0.0"} \ No newline at end of file +{"version":"36.0.18"} \ No newline at end of file diff --git a/source/patterns/@aws-solutions-constructs/aws-s3-sqs/test/integ.s3sqs-noArguments.js.snapshot/integ.json b/source/patterns/@aws-solutions-constructs/aws-s3-sqs/test/integ.s3sqs-noArguments.js.snapshot/integ.json index c784a6925..39c0e7d7d 100644 --- a/source/patterns/@aws-solutions-constructs/aws-s3-sqs/test/integ.s3sqs-noArguments.js.snapshot/integ.json +++ b/source/patterns/@aws-solutions-constructs/aws-s3-sqs/test/integ.s3sqs-noArguments.js.snapshot/integ.json @@ -1,5 +1,5 @@ { - "version": "36.0.0", + "version": "36.0.18", "testCases": { "s3sqs-noArguments/Integ/DefaultTest": { "stacks": [ diff --git a/source/patterns/@aws-solutions-constructs/aws-s3-sqs/test/integ.s3sqs-noArguments.js.snapshot/manifest.json b/source/patterns/@aws-solutions-constructs/aws-s3-sqs/test/integ.s3sqs-noArguments.js.snapshot/manifest.json index a0d42aabb..24cde6502 100644 --- a/source/patterns/@aws-solutions-constructs/aws-s3-sqs/test/integ.s3sqs-noArguments.js.snapshot/manifest.json +++ b/source/patterns/@aws-solutions-constructs/aws-s3-sqs/test/integ.s3sqs-noArguments.js.snapshot/manifest.json @@ -1,5 +1,5 @@ { - "version": "36.0.0", + "version": "36.0.5", "artifacts": { "s3sqsnoArgumentsIntegDefaultTestDeployAssert15EDF636.assets": { "type": "cdk:asset-manifest", @@ -66,7 +66,7 @@ "validateOnSynth": false, "assumeRoleArn": "arn:${AWS::Partition}:iam::${AWS::AccountId}:role/cdk-hnb659fds-deploy-role-${AWS::AccountId}-${AWS::Region}", "cloudFormationExecutionRoleArn": "arn:${AWS::Partition}:iam::${AWS::AccountId}:role/cdk-hnb659fds-cfn-exec-role-${AWS::AccountId}-${AWS::Region}", - "stackTemplateAssetObjectUrl": "s3://cdk-hnb659fds-assets-${AWS::AccountId}-${AWS::Region}/ae6329b008cd68cf4c0151d75834bee63773f4fc8619dba22f17ac5f0ac4a2d5.json", + "stackTemplateAssetObjectUrl": "s3://cdk-hnb659fds-assets-${AWS::AccountId}-${AWS::Region}/70bd66777ea4faafa10563cab976ee4962de08e96dd07ad32746e4fdc7214b7c.json", "requiresBootstrapStackVersion": 6, "bootstrapStackVersionSsmParameter": "/cdk-bootstrap/hnb659fds/version", "additionalDependencies": [ @@ -166,6 +166,12 @@ "data": "LatestNodeRuntimeMap" } ], + "/s3sqs-noArguments/Custom::S3AutoDeleteObjectsCustomResourceProvider": [ + { + "type": "aws:cdk:is-custom-resource-handler-customResourceProvider", + "data": true + } + ], "/s3sqs-noArguments/Custom::S3AutoDeleteObjectsCustomResourceProvider/Role": [ { "type": "aws:cdk:logicalId", diff --git a/source/patterns/@aws-solutions-constructs/aws-s3-sqs/test/integ.s3sqs-noArguments.js.snapshot/s3sqs-noArguments.assets.json b/source/patterns/@aws-solutions-constructs/aws-s3-sqs/test/integ.s3sqs-noArguments.js.snapshot/s3sqs-noArguments.assets.json index b1b6762c0..7ad38c911 100644 --- a/source/patterns/@aws-solutions-constructs/aws-s3-sqs/test/integ.s3sqs-noArguments.js.snapshot/s3sqs-noArguments.assets.json +++ b/source/patterns/@aws-solutions-constructs/aws-s3-sqs/test/integ.s3sqs-noArguments.js.snapshot/s3sqs-noArguments.assets.json @@ -1,5 +1,5 @@ { - "version": "36.0.0", + "version": "36.0.18", "files": { "faa95a81ae7d7373f3e1f242268f904eb748d8d0fdd306e8a6fe515a1905a7d6": { "source": { @@ -14,7 +14,7 @@ } } }, - "ae6329b008cd68cf4c0151d75834bee63773f4fc8619dba22f17ac5f0ac4a2d5": { + "70bd66777ea4faafa10563cab976ee4962de08e96dd07ad32746e4fdc7214b7c": { "source": { "path": "s3sqs-noArguments.template.json", "packaging": "file" @@ -22,7 +22,7 @@ "destinations": { "current_account-current_region": { "bucketName": "cdk-hnb659fds-assets-${AWS::AccountId}-${AWS::Region}", - "objectKey": "ae6329b008cd68cf4c0151d75834bee63773f4fc8619dba22f17ac5f0ac4a2d5.json", + "objectKey": "70bd66777ea4faafa10563cab976ee4962de08e96dd07ad32746e4fdc7214b7c.json", "assumeRoleArn": "arn:${AWS::Partition}:iam::${AWS::AccountId}:role/cdk-hnb659fds-file-publishing-role-${AWS::AccountId}-${AWS::Region}" } } diff --git a/source/patterns/@aws-solutions-constructs/aws-s3-sqs/test/integ.s3sqs-noArguments.js.snapshot/s3sqs-noArguments.template.json b/source/patterns/@aws-solutions-constructs/aws-s3-sqs/test/integ.s3sqs-noArguments.js.snapshot/s3sqs-noArguments.template.json index 7db214957..c419600a4 100644 --- a/source/patterns/@aws-solutions-constructs/aws-s3-sqs/test/integ.s3sqs-noArguments.js.snapshot/s3sqs-noArguments.template.json +++ b/source/patterns/@aws-solutions-constructs/aws-s3-sqs/test/integ.s3sqs-noArguments.js.snapshot/s3sqs-noArguments.template.json @@ -363,7 +363,8 @@ } ] }, - "Managed": true + "Managed": true, + "SkipDestinationValidation": false }, "DependsOn": [ "tests3sqsqueuePolicyDDC0D745", @@ -791,7 +792,7 @@ "Properties": { "Description": "AWS CloudFormation handler for \"Custom::S3BucketNotifications\" resources (@aws-cdk/aws-s3)", "Code": { - "ZipFile": "import boto3 # type: ignore\nimport json\nimport logging\nimport urllib.request\n\ns3 = boto3.client(\"s3\")\n\nEVENTBRIDGE_CONFIGURATION = 'EventBridgeConfiguration'\nCONFIGURATION_TYPES = [\"TopicConfigurations\", \"QueueConfigurations\", \"LambdaFunctionConfigurations\"]\n\ndef handler(event: dict, context):\n response_status = \"SUCCESS\"\n error_message = \"\"\n try:\n props = event[\"ResourceProperties\"]\n notification_configuration = props[\"NotificationConfiguration\"]\n managed = props.get('Managed', 'true').lower() == 'true'\n stack_id = event['StackId']\n old = event.get(\"OldResourceProperties\", {}).get(\"NotificationConfiguration\", {})\n if managed:\n config = handle_managed(event[\"RequestType\"], notification_configuration)\n else:\n config = handle_unmanaged(props[\"BucketName\"], stack_id, event[\"RequestType\"], notification_configuration, old)\n s3.put_bucket_notification_configuration(Bucket=props[\"BucketName\"], NotificationConfiguration=config)\n except Exception as e:\n logging.exception(\"Failed to put bucket notification configuration\")\n response_status = \"FAILED\"\n error_message = f\"Error: {str(e)}. \"\n finally:\n submit_response(event, context, response_status, error_message)\n\ndef handle_managed(request_type, notification_configuration):\n if request_type == 'Delete':\n return {}\n return notification_configuration\n\ndef handle_unmanaged(bucket, stack_id, request_type, notification_configuration, old):\n def get_id(n):\n n['Id'] = ''\n strToHash=json.dumps(n, sort_keys=True).replace('\"Name\": \"prefix\"', '\"Name\": \"Prefix\"').replace('\"Name\": \"suffix\"', '\"Name\": \"Suffix\"')\n return f\"{stack_id}-{hash(strToHash)}\"\n def with_id(n):\n n['Id'] = get_id(n)\n return n\n\n external_notifications = {}\n existing_notifications = s3.get_bucket_notification_configuration(Bucket=bucket)\n for t in CONFIGURATION_TYPES:\n if request_type == 'Update':\n old_incoming_ids = [get_id(n) for n in old.get(t, [])]\n external_notifications[t] = [n for n in existing_notifications.get(t, []) if not get_id(n) in old_incoming_ids] \n elif request_type == 'Delete':\n external_notifications[t] = [n for n in existing_notifications.get(t, []) if not n['Id'].startswith(f\"{stack_id}-\")]\n elif request_type == 'Create':\n external_notifications[t] = [n for n in existing_notifications.get(t, [])]\n if EVENTBRIDGE_CONFIGURATION in existing_notifications:\n external_notifications[EVENTBRIDGE_CONFIGURATION] = existing_notifications[EVENTBRIDGE_CONFIGURATION]\n\n if request_type == 'Delete':\n return external_notifications\n\n notifications = {}\n for t in CONFIGURATION_TYPES:\n external = external_notifications.get(t, [])\n incoming = [with_id(n) for n in notification_configuration.get(t, [])]\n notifications[t] = external + incoming\n\n if EVENTBRIDGE_CONFIGURATION in notification_configuration:\n notifications[EVENTBRIDGE_CONFIGURATION] = notification_configuration[EVENTBRIDGE_CONFIGURATION]\n elif EVENTBRIDGE_CONFIGURATION in external_notifications:\n notifications[EVENTBRIDGE_CONFIGURATION] = external_notifications[EVENTBRIDGE_CONFIGURATION]\n\n return notifications\n\ndef submit_response(event: dict, context, response_status: str, error_message: str):\n response_body = json.dumps(\n {\n \"Status\": response_status,\n \"Reason\": f\"{error_message}See the details in CloudWatch Log Stream: {context.log_stream_name}\",\n \"PhysicalResourceId\": event.get(\"PhysicalResourceId\") or event[\"LogicalResourceId\"],\n \"StackId\": event[\"StackId\"],\n \"RequestId\": event[\"RequestId\"],\n \"LogicalResourceId\": event[\"LogicalResourceId\"],\n \"NoEcho\": False,\n }\n ).encode(\"utf-8\")\n headers = {\"content-type\": \"\", \"content-length\": str(len(response_body))}\n try:\n req = urllib.request.Request(url=event[\"ResponseURL\"], headers=headers, data=response_body, method=\"PUT\")\n with urllib.request.urlopen(req) as response:\n print(response.read().decode(\"utf-8\"))\n print(\"Status code: \" + response.reason)\n except Exception as e:\n print(\"send(..) failed executing request.urlopen(..): \" + str(e))" + "ZipFile": "import boto3 # type: ignore\nimport json\nimport logging\nimport urllib.request\n\ns3 = boto3.client(\"s3\")\n\nEVENTBRIDGE_CONFIGURATION = 'EventBridgeConfiguration'\nCONFIGURATION_TYPES = [\"TopicConfigurations\", \"QueueConfigurations\", \"LambdaFunctionConfigurations\"]\n\ndef handler(event: dict, context):\n response_status = \"SUCCESS\"\n error_message = \"\"\n try:\n props = event[\"ResourceProperties\"]\n notification_configuration = props[\"NotificationConfiguration\"]\n managed = props.get('Managed', 'true').lower() == 'true'\n skipDestinationValidation = props.get('SkipDestinationValidation', 'false').lower() == 'true'\n stack_id = event['StackId']\n old = event.get(\"OldResourceProperties\", {}).get(\"NotificationConfiguration\", {})\n if managed:\n config = handle_managed(event[\"RequestType\"], notification_configuration)\n else:\n config = handle_unmanaged(props[\"BucketName\"], stack_id, event[\"RequestType\"], notification_configuration, old)\n s3.put_bucket_notification_configuration(Bucket=props[\"BucketName\"], NotificationConfiguration=config, SkipDestinationValidation=skipDestinationValidation)\n except Exception as e:\n logging.exception(\"Failed to put bucket notification configuration\")\n response_status = \"FAILED\"\n error_message = f\"Error: {str(e)}. \"\n finally:\n submit_response(event, context, response_status, error_message)\n\ndef handle_managed(request_type, notification_configuration):\n if request_type == 'Delete':\n return {}\n return notification_configuration\n\ndef handle_unmanaged(bucket, stack_id, request_type, notification_configuration, old):\n def get_id(n):\n n['Id'] = ''\n strToHash=json.dumps(n, sort_keys=True).replace('\"Name\": \"prefix\"', '\"Name\": \"Prefix\"').replace('\"Name\": \"suffix\"', '\"Name\": \"Suffix\"')\n return f\"{stack_id}-{hash(strToHash)}\"\n def with_id(n):\n n['Id'] = get_id(n)\n return n\n\n external_notifications = {}\n existing_notifications = s3.get_bucket_notification_configuration(Bucket=bucket)\n for t in CONFIGURATION_TYPES:\n if request_type == 'Update':\n old_incoming_ids = [get_id(n) for n in old.get(t, [])]\n external_notifications[t] = [n for n in existing_notifications.get(t, []) if not get_id(n) in old_incoming_ids] \n elif request_type == 'Delete':\n external_notifications[t] = [n for n in existing_notifications.get(t, []) if not n['Id'].startswith(f\"{stack_id}-\")]\n elif request_type == 'Create':\n external_notifications[t] = [n for n in existing_notifications.get(t, [])]\n if EVENTBRIDGE_CONFIGURATION in existing_notifications:\n external_notifications[EVENTBRIDGE_CONFIGURATION] = existing_notifications[EVENTBRIDGE_CONFIGURATION]\n\n if request_type == 'Delete':\n return external_notifications\n\n notifications = {}\n for t in CONFIGURATION_TYPES:\n external = external_notifications.get(t, [])\n incoming = [with_id(n) for n in notification_configuration.get(t, [])]\n notifications[t] = external + incoming\n\n if EVENTBRIDGE_CONFIGURATION in notification_configuration:\n notifications[EVENTBRIDGE_CONFIGURATION] = notification_configuration[EVENTBRIDGE_CONFIGURATION]\n elif EVENTBRIDGE_CONFIGURATION in external_notifications:\n notifications[EVENTBRIDGE_CONFIGURATION] = external_notifications[EVENTBRIDGE_CONFIGURATION]\n\n return notifications\n\ndef submit_response(event: dict, context, response_status: str, error_message: str):\n response_body = json.dumps(\n {\n \"Status\": response_status,\n \"Reason\": f\"{error_message}See the details in CloudWatch Log Stream: {context.log_stream_name}\",\n \"PhysicalResourceId\": event.get(\"PhysicalResourceId\") or event[\"LogicalResourceId\"],\n \"StackId\": event[\"StackId\"],\n \"RequestId\": event[\"RequestId\"],\n \"LogicalResourceId\": event[\"LogicalResourceId\"],\n \"NoEcho\": False,\n }\n ).encode(\"utf-8\")\n headers = {\"content-type\": \"\", \"content-length\": str(len(response_body))}\n try:\n req = urllib.request.Request(url=event[\"ResponseURL\"], headers=headers, data=response_body, method=\"PUT\")\n with urllib.request.urlopen(req) as response:\n print(response.read().decode(\"utf-8\"))\n print(\"Status code: \" + response.reason)\n except Exception as e:\n print(\"send(..) failed executing request.urlopen(..): \" + str(e))" }, "Handler": "index.handler", "Role": { diff --git a/source/patterns/@aws-solutions-constructs/aws-s3-sqs/test/integ.s3sqs-noArguments.js.snapshot/s3sqsnoArgumentsIntegDefaultTestDeployAssert15EDF636.assets.json b/source/patterns/@aws-solutions-constructs/aws-s3-sqs/test/integ.s3sqs-noArguments.js.snapshot/s3sqsnoArgumentsIntegDefaultTestDeployAssert15EDF636.assets.json index 89c62004c..b991fae05 100644 --- a/source/patterns/@aws-solutions-constructs/aws-s3-sqs/test/integ.s3sqs-noArguments.js.snapshot/s3sqsnoArgumentsIntegDefaultTestDeployAssert15EDF636.assets.json +++ b/source/patterns/@aws-solutions-constructs/aws-s3-sqs/test/integ.s3sqs-noArguments.js.snapshot/s3sqsnoArgumentsIntegDefaultTestDeployAssert15EDF636.assets.json @@ -1,5 +1,5 @@ { - "version": "36.0.0", + "version": "36.0.18", "files": { "21fbb51d7b23f6a6c262b46a9caee79d744a3ac019fd45422d988b96d44b2a22": { "source": { diff --git a/source/patterns/@aws-solutions-constructs/aws-s3-sqs/test/integ.s3sqs-noArguments.js.snapshot/tree.json b/source/patterns/@aws-solutions-constructs/aws-s3-sqs/test/integ.s3sqs-noArguments.js.snapshot/tree.json index 95e2286d8..5cd24efb4 100644 --- a/source/patterns/@aws-solutions-constructs/aws-s3-sqs/test/integ.s3sqs-noArguments.js.snapshot/tree.json +++ b/source/patterns/@aws-solutions-constructs/aws-s3-sqs/test/integ.s3sqs-noArguments.js.snapshot/tree.json @@ -50,7 +50,7 @@ }, "constructInfo": { "fqn": "aws-cdk-lib.aws_s3.CfnBucket", - "version": "2.149.0" + "version": "2.154.1" } }, "Policy": { @@ -184,13 +184,13 @@ }, "constructInfo": { "fqn": "aws-cdk-lib.aws_s3.CfnBucketPolicy", - "version": "2.149.0" + "version": "2.154.1" } } }, "constructInfo": { "fqn": "aws-cdk-lib.aws_s3.BucketPolicy", - "version": "2.149.0" + "version": "2.154.1" } }, "AutoDeleteObjectsCustomResource": { @@ -202,19 +202,19 @@ "path": "s3sqs-noArguments/test-s3-sqs/S3LoggingBucket/AutoDeleteObjectsCustomResource/Default", "constructInfo": { "fqn": "aws-cdk-lib.CfnResource", - "version": "2.149.0" + "version": "2.154.1" } } }, "constructInfo": { "fqn": "aws-cdk-lib.CustomResource", - "version": "2.149.0" + "version": "2.154.1" } } }, "constructInfo": { "fqn": "aws-cdk-lib.aws_s3.Bucket", - "version": "2.149.0" + "version": "2.154.1" } }, "S3Bucket": { @@ -273,7 +273,7 @@ }, "constructInfo": { "fqn": "aws-cdk-lib.aws_s3.CfnBucket", - "version": "2.149.0" + "version": "2.154.1" } }, "Policy": { @@ -371,13 +371,13 @@ }, "constructInfo": { "fqn": "aws-cdk-lib.aws_s3.CfnBucketPolicy", - "version": "2.149.0" + "version": "2.154.1" } } }, "constructInfo": { "fqn": "aws-cdk-lib.aws_s3.BucketPolicy", - "version": "2.149.0" + "version": "2.154.1" } }, "AutoDeleteObjectsCustomResource": { @@ -389,13 +389,13 @@ "path": "s3sqs-noArguments/test-s3-sqs/S3Bucket/AutoDeleteObjectsCustomResource/Default", "constructInfo": { "fqn": "aws-cdk-lib.CfnResource", - "version": "2.149.0" + "version": "2.154.1" } } }, "constructInfo": { "fqn": "aws-cdk-lib.CustomResource", - "version": "2.149.0" + "version": "2.154.1" } }, "Notifications": { @@ -407,7 +407,7 @@ "path": "s3sqs-noArguments/test-s3-sqs/S3Bucket/Notifications/Resource", "constructInfo": { "fqn": "aws-cdk-lib.CfnResource", - "version": "2.149.0" + "version": "2.154.1" } } }, @@ -419,7 +419,7 @@ }, "constructInfo": { "fqn": "aws-cdk-lib.aws_s3.Bucket", - "version": "2.149.0" + "version": "2.154.1" } }, "queue-dlq": { @@ -437,7 +437,7 @@ }, "constructInfo": { "fqn": "aws-cdk-lib.aws_sqs.CfnQueue", - "version": "2.149.0" + "version": "2.154.1" } }, "Policy": { @@ -520,19 +520,19 @@ }, "constructInfo": { "fqn": "aws-cdk-lib.aws_sqs.CfnQueuePolicy", - "version": "2.149.0" + "version": "2.154.1" } } }, "constructInfo": { "fqn": "aws-cdk-lib.aws_sqs.QueuePolicy", - "version": "2.149.0" + "version": "2.154.1" } } }, "constructInfo": { "fqn": "aws-cdk-lib.aws_sqs.Queue", - "version": "2.149.0" + "version": "2.154.1" } }, "'queueKey'": { @@ -612,13 +612,13 @@ }, "constructInfo": { "fqn": "aws-cdk-lib.aws_kms.CfnKey", - "version": "2.149.0" + "version": "2.154.1" } } }, "constructInfo": { "fqn": "aws-cdk-lib.aws_kms.Key", - "version": "2.149.0" + "version": "2.154.1" } }, "queue": { @@ -650,7 +650,7 @@ }, "constructInfo": { "fqn": "aws-cdk-lib.aws_sqs.CfnQueue", - "version": "2.149.0" + "version": "2.154.1" } }, "Policy": { @@ -760,25 +760,25 @@ }, "constructInfo": { "fqn": "aws-cdk-lib.aws_sqs.CfnQueuePolicy", - "version": "2.149.0" + "version": "2.154.1" } } }, "constructInfo": { "fqn": "aws-cdk-lib.aws_sqs.QueuePolicy", - "version": "2.149.0" + "version": "2.154.1" } } }, "constructInfo": { "fqn": "aws-cdk-lib.aws_sqs.Queue", - "version": "2.149.0" + "version": "2.154.1" } } }, "constructInfo": { "fqn": "@aws-solutions-constructs/aws-s3-sqs.S3ToSqs", - "version": "2.62.0" + "version": "2.67.1" } }, "LatestNodeRuntimeMap": { @@ -786,7 +786,7 @@ "path": "s3sqs-noArguments/LatestNodeRuntimeMap", "constructInfo": { "fqn": "aws-cdk-lib.CfnMapping", - "version": "2.149.0" + "version": "2.154.1" } }, "Custom::S3AutoDeleteObjectsCustomResourceProvider": { @@ -798,7 +798,7 @@ "path": "s3sqs-noArguments/Custom::S3AutoDeleteObjectsCustomResourceProvider/Staging", "constructInfo": { "fqn": "aws-cdk-lib.AssetStaging", - "version": "2.149.0" + "version": "2.154.1" } }, "Role": { @@ -806,7 +806,7 @@ "path": "s3sqs-noArguments/Custom::S3AutoDeleteObjectsCustomResourceProvider/Role", "constructInfo": { "fqn": "aws-cdk-lib.CfnResource", - "version": "2.149.0" + "version": "2.154.1" } }, "Handler": { @@ -814,13 +814,13 @@ "path": "s3sqs-noArguments/Custom::S3AutoDeleteObjectsCustomResourceProvider/Handler", "constructInfo": { "fqn": "aws-cdk-lib.CfnResource", - "version": "2.149.0" + "version": "2.154.1" } } }, "constructInfo": { "fqn": "aws-cdk-lib.CustomResourceProviderBase", - "version": "2.149.0" + "version": "2.154.1" } }, "BucketNotificationsHandler050a0587b7544547bf325f094a3db834": { @@ -836,7 +836,7 @@ "path": "s3sqs-noArguments/BucketNotificationsHandler050a0587b7544547bf325f094a3db834/Role/ImportRole", "constructInfo": { "fqn": "aws-cdk-lib.Resource", - "version": "2.149.0" + "version": "2.154.1" } }, "Resource": { @@ -875,7 +875,7 @@ }, "constructInfo": { "fqn": "aws-cdk-lib.aws_iam.CfnRole", - "version": "2.149.0" + "version": "2.154.1" } }, "DefaultPolicy": { @@ -908,19 +908,19 @@ }, "constructInfo": { "fqn": "aws-cdk-lib.aws_iam.CfnPolicy", - "version": "2.149.0" + "version": "2.154.1" } } }, "constructInfo": { "fqn": "aws-cdk-lib.aws_iam.Policy", - "version": "2.149.0" + "version": "2.154.1" } } }, "constructInfo": { "fqn": "aws-cdk-lib.aws_iam.Role", - "version": "2.149.0" + "version": "2.154.1" } }, "Resource": { @@ -928,7 +928,7 @@ "path": "s3sqs-noArguments/BucketNotificationsHandler050a0587b7544547bf325f094a3db834/Resource", "constructInfo": { "fqn": "aws-cdk-lib.CfnResource", - "version": "2.149.0" + "version": "2.154.1" } } }, @@ -962,7 +962,7 @@ "path": "s3sqs-noArguments/Integ/DefaultTest/DeployAssert/BootstrapVersion", "constructInfo": { "fqn": "aws-cdk-lib.CfnParameter", - "version": "2.149.0" + "version": "2.154.1" } }, "CheckBootstrapVersion": { @@ -970,25 +970,25 @@ "path": "s3sqs-noArguments/Integ/DefaultTest/DeployAssert/CheckBootstrapVersion", "constructInfo": { "fqn": "aws-cdk-lib.CfnRule", - "version": "2.149.0" + "version": "2.154.1" } } }, "constructInfo": { "fqn": "aws-cdk-lib.Stack", - "version": "2.149.0" + "version": "2.154.1" } } }, "constructInfo": { "fqn": "@aws-cdk/integ-tests-alpha.IntegTestCase", - "version": "2.149.0-alpha.0" + "version": "2.154.1-alpha.0" } } }, "constructInfo": { "fqn": "@aws-cdk/integ-tests-alpha.IntegTest", - "version": "2.149.0-alpha.0" + "version": "2.154.1-alpha.0" } }, "BootstrapVersion": { @@ -996,7 +996,7 @@ "path": "s3sqs-noArguments/BootstrapVersion", "constructInfo": { "fqn": "aws-cdk-lib.CfnParameter", - "version": "2.149.0" + "version": "2.154.1" } }, "CheckBootstrapVersion": { @@ -1004,13 +1004,13 @@ "path": "s3sqs-noArguments/CheckBootstrapVersion", "constructInfo": { "fqn": "aws-cdk-lib.CfnRule", - "version": "2.149.0" + "version": "2.154.1" } } }, "constructInfo": { "fqn": "aws-cdk-lib.Stack", - "version": "2.149.0" + "version": "2.154.1" } }, "Tree": { @@ -1024,7 +1024,7 @@ }, "constructInfo": { "fqn": "aws-cdk-lib.App", - "version": "2.149.0" + "version": "2.154.1" } } } \ No newline at end of file diff --git a/source/patterns/@aws-solutions-constructs/aws-s3-stepfunctions/package.json b/source/patterns/@aws-solutions-constructs/aws-s3-stepfunctions/package.json index cdc2665c2..84abf10e0 100644 --- a/source/patterns/@aws-solutions-constructs/aws-s3-stepfunctions/package.json +++ b/source/patterns/@aws-solutions-constructs/aws-s3-stepfunctions/package.json @@ -82,7 +82,7 @@ "@aws-solutions-constructs/core": "0.0.0", "@aws-solutions-constructs/aws-eventbridge-stepfunctions": "0.0.0", "constructs": "^10.0.0", - "aws-cdk-lib": "0.0.0" + "aws-cdk-lib": "^0.0.0" }, "keywords": [ "aws", diff --git a/source/patterns/@aws-solutions-constructs/aws-s3-stepfunctions/test/integ.s3stp-customLoggingBucket.js.snapshot/cdk.out b/source/patterns/@aws-solutions-constructs/aws-s3-stepfunctions/test/integ.s3stp-customLoggingBucket.js.snapshot/cdk.out index 1f0068d32..0d15a78da 100644 --- a/source/patterns/@aws-solutions-constructs/aws-s3-stepfunctions/test/integ.s3stp-customLoggingBucket.js.snapshot/cdk.out +++ b/source/patterns/@aws-solutions-constructs/aws-s3-stepfunctions/test/integ.s3stp-customLoggingBucket.js.snapshot/cdk.out @@ -1 +1 @@ -{"version":"36.0.0"} \ No newline at end of file +{"version":"36.0.18"} \ No newline at end of file diff --git a/source/patterns/@aws-solutions-constructs/aws-s3-stepfunctions/test/integ.s3stp-customLoggingBucket.js.snapshot/integ.json b/source/patterns/@aws-solutions-constructs/aws-s3-stepfunctions/test/integ.s3stp-customLoggingBucket.js.snapshot/integ.json index c941760d7..3a4c584cb 100644 --- a/source/patterns/@aws-solutions-constructs/aws-s3-stepfunctions/test/integ.s3stp-customLoggingBucket.js.snapshot/integ.json +++ b/source/patterns/@aws-solutions-constructs/aws-s3-stepfunctions/test/integ.s3stp-customLoggingBucket.js.snapshot/integ.json @@ -1,5 +1,5 @@ { - "version": "36.0.0", + "version": "36.0.18", "testCases": { "s3stp-customLoggingBucket/Integ/DefaultTest": { "stacks": [ diff --git a/source/patterns/@aws-solutions-constructs/aws-s3-stepfunctions/test/integ.s3stp-customLoggingBucket.js.snapshot/manifest.json b/source/patterns/@aws-solutions-constructs/aws-s3-stepfunctions/test/integ.s3stp-customLoggingBucket.js.snapshot/manifest.json index c9db0a1d1..0670ef67d 100644 --- a/source/patterns/@aws-solutions-constructs/aws-s3-stepfunctions/test/integ.s3stp-customLoggingBucket.js.snapshot/manifest.json +++ b/source/patterns/@aws-solutions-constructs/aws-s3-stepfunctions/test/integ.s3stp-customLoggingBucket.js.snapshot/manifest.json @@ -1,5 +1,5 @@ { - "version": "36.0.0", + "version": "36.0.5", "artifacts": { "s3stpcustomLoggingBucketIntegDefaultTestDeployAssert2EFDBF9D.assets": { "type": "cdk:asset-manifest", @@ -66,7 +66,7 @@ "validateOnSynth": false, "assumeRoleArn": "arn:${AWS::Partition}:iam::${AWS::AccountId}:role/cdk-hnb659fds-deploy-role-${AWS::AccountId}-${AWS::Region}", "cloudFormationExecutionRoleArn": "arn:${AWS::Partition}:iam::${AWS::AccountId}:role/cdk-hnb659fds-cfn-exec-role-${AWS::AccountId}-${AWS::Region}", - "stackTemplateAssetObjectUrl": "s3://cdk-hnb659fds-assets-${AWS::AccountId}-${AWS::Region}/c6c0bdf2053f0dbd7ef43c97cc0daaacae8e677437c381c6adb39ccce5632b96.json", + "stackTemplateAssetObjectUrl": "s3://cdk-hnb659fds-assets-${AWS::AccountId}-${AWS::Region}/3d1adbd7b0d119fc845c1a918d386cd022b4ca63b9cedcdb6c0a84fe748a98d8.json", "requiresBootstrapStackVersion": 6, "bootstrapStackVersionSsmParameter": "/cdk-bootstrap/hnb659fds/version", "additionalDependencies": [ @@ -202,6 +202,12 @@ "data": "LatestNodeRuntimeMap" } ], + "/s3stp-customLoggingBucket/Custom::S3AutoDeleteObjectsCustomResourceProvider": [ + { + "type": "aws:cdk:is-custom-resource-handler-customResourceProvider", + "data": true + } + ], "/s3stp-customLoggingBucket/Custom::S3AutoDeleteObjectsCustomResourceProvider/Role": [ { "type": "aws:cdk:logicalId", diff --git a/source/patterns/@aws-solutions-constructs/aws-s3-stepfunctions/test/integ.s3stp-customLoggingBucket.js.snapshot/s3stp-customLoggingBucket.assets.json b/source/patterns/@aws-solutions-constructs/aws-s3-stepfunctions/test/integ.s3stp-customLoggingBucket.js.snapshot/s3stp-customLoggingBucket.assets.json index b075beac8..6bf523af4 100644 --- a/source/patterns/@aws-solutions-constructs/aws-s3-stepfunctions/test/integ.s3stp-customLoggingBucket.js.snapshot/s3stp-customLoggingBucket.assets.json +++ b/source/patterns/@aws-solutions-constructs/aws-s3-stepfunctions/test/integ.s3stp-customLoggingBucket.js.snapshot/s3stp-customLoggingBucket.assets.json @@ -1,5 +1,5 @@ { - "version": "36.0.0", + "version": "36.0.18", "files": { "faa95a81ae7d7373f3e1f242268f904eb748d8d0fdd306e8a6fe515a1905a7d6": { "source": { @@ -14,7 +14,7 @@ } } }, - "c6c0bdf2053f0dbd7ef43c97cc0daaacae8e677437c381c6adb39ccce5632b96": { + "3d1adbd7b0d119fc845c1a918d386cd022b4ca63b9cedcdb6c0a84fe748a98d8": { "source": { "path": "s3stp-customLoggingBucket.template.json", "packaging": "file" @@ -22,7 +22,7 @@ "destinations": { "current_account-current_region": { "bucketName": "cdk-hnb659fds-assets-${AWS::AccountId}-${AWS::Region}", - "objectKey": "c6c0bdf2053f0dbd7ef43c97cc0daaacae8e677437c381c6adb39ccce5632b96.json", + "objectKey": "3d1adbd7b0d119fc845c1a918d386cd022b4ca63b9cedcdb6c0a84fe748a98d8.json", "assumeRoleArn": "arn:${AWS::Partition}:iam::${AWS::AccountId}:role/cdk-hnb659fds-file-publishing-role-${AWS::AccountId}-${AWS::Region}" } } diff --git a/source/patterns/@aws-solutions-constructs/aws-s3-stepfunctions/test/integ.s3stp-customLoggingBucket.js.snapshot/s3stp-customLoggingBucket.template.json b/source/patterns/@aws-solutions-constructs/aws-s3-stepfunctions/test/integ.s3stp-customLoggingBucket.js.snapshot/s3stp-customLoggingBucket.template.json index 6e590b8d7..2e95b337a 100644 --- a/source/patterns/@aws-solutions-constructs/aws-s3-stepfunctions/test/integ.s3stp-customLoggingBucket.js.snapshot/s3stp-customLoggingBucket.template.json +++ b/source/patterns/@aws-solutions-constructs/aws-s3-stepfunctions/test/integ.s3stp-customLoggingBucket.js.snapshot/s3stp-customLoggingBucket.template.json @@ -432,7 +432,8 @@ "NotificationConfiguration": { "EventBridgeConfiguration": {} }, - "Managed": true + "Managed": true, + "SkipDestinationValidation": false }, "DependsOn": [ "tests3stepfunctionsS3BucketPolicy816CD289" @@ -917,7 +918,7 @@ "Properties": { "Description": "AWS CloudFormation handler for \"Custom::S3BucketNotifications\" resources (@aws-cdk/aws-s3)", "Code": { - "ZipFile": "import boto3 # type: ignore\nimport json\nimport logging\nimport urllib.request\n\ns3 = boto3.client(\"s3\")\n\nEVENTBRIDGE_CONFIGURATION = 'EventBridgeConfiguration'\nCONFIGURATION_TYPES = [\"TopicConfigurations\", \"QueueConfigurations\", \"LambdaFunctionConfigurations\"]\n\ndef handler(event: dict, context):\n response_status = \"SUCCESS\"\n error_message = \"\"\n try:\n props = event[\"ResourceProperties\"]\n notification_configuration = props[\"NotificationConfiguration\"]\n managed = props.get('Managed', 'true').lower() == 'true'\n stack_id = event['StackId']\n old = event.get(\"OldResourceProperties\", {}).get(\"NotificationConfiguration\", {})\n if managed:\n config = handle_managed(event[\"RequestType\"], notification_configuration)\n else:\n config = handle_unmanaged(props[\"BucketName\"], stack_id, event[\"RequestType\"], notification_configuration, old)\n s3.put_bucket_notification_configuration(Bucket=props[\"BucketName\"], NotificationConfiguration=config)\n except Exception as e:\n logging.exception(\"Failed to put bucket notification configuration\")\n response_status = \"FAILED\"\n error_message = f\"Error: {str(e)}. \"\n finally:\n submit_response(event, context, response_status, error_message)\n\ndef handle_managed(request_type, notification_configuration):\n if request_type == 'Delete':\n return {}\n return notification_configuration\n\ndef handle_unmanaged(bucket, stack_id, request_type, notification_configuration, old):\n def get_id(n):\n n['Id'] = ''\n strToHash=json.dumps(n, sort_keys=True).replace('\"Name\": \"prefix\"', '\"Name\": \"Prefix\"').replace('\"Name\": \"suffix\"', '\"Name\": \"Suffix\"')\n return f\"{stack_id}-{hash(strToHash)}\"\n def with_id(n):\n n['Id'] = get_id(n)\n return n\n\n external_notifications = {}\n existing_notifications = s3.get_bucket_notification_configuration(Bucket=bucket)\n for t in CONFIGURATION_TYPES:\n if request_type == 'Update':\n old_incoming_ids = [get_id(n) for n in old.get(t, [])]\n external_notifications[t] = [n for n in existing_notifications.get(t, []) if not get_id(n) in old_incoming_ids] \n elif request_type == 'Delete':\n external_notifications[t] = [n for n in existing_notifications.get(t, []) if not n['Id'].startswith(f\"{stack_id}-\")]\n elif request_type == 'Create':\n external_notifications[t] = [n for n in existing_notifications.get(t, [])]\n if EVENTBRIDGE_CONFIGURATION in existing_notifications:\n external_notifications[EVENTBRIDGE_CONFIGURATION] = existing_notifications[EVENTBRIDGE_CONFIGURATION]\n\n if request_type == 'Delete':\n return external_notifications\n\n notifications = {}\n for t in CONFIGURATION_TYPES:\n external = external_notifications.get(t, [])\n incoming = [with_id(n) for n in notification_configuration.get(t, [])]\n notifications[t] = external + incoming\n\n if EVENTBRIDGE_CONFIGURATION in notification_configuration:\n notifications[EVENTBRIDGE_CONFIGURATION] = notification_configuration[EVENTBRIDGE_CONFIGURATION]\n elif EVENTBRIDGE_CONFIGURATION in external_notifications:\n notifications[EVENTBRIDGE_CONFIGURATION] = external_notifications[EVENTBRIDGE_CONFIGURATION]\n\n return notifications\n\ndef submit_response(event: dict, context, response_status: str, error_message: str):\n response_body = json.dumps(\n {\n \"Status\": response_status,\n \"Reason\": f\"{error_message}See the details in CloudWatch Log Stream: {context.log_stream_name}\",\n \"PhysicalResourceId\": event.get(\"PhysicalResourceId\") or event[\"LogicalResourceId\"],\n \"StackId\": event[\"StackId\"],\n \"RequestId\": event[\"RequestId\"],\n \"LogicalResourceId\": event[\"LogicalResourceId\"],\n \"NoEcho\": False,\n }\n ).encode(\"utf-8\")\n headers = {\"content-type\": \"\", \"content-length\": str(len(response_body))}\n try:\n req = urllib.request.Request(url=event[\"ResponseURL\"], headers=headers, data=response_body, method=\"PUT\")\n with urllib.request.urlopen(req) as response:\n print(response.read().decode(\"utf-8\"))\n print(\"Status code: \" + response.reason)\n except Exception as e:\n print(\"send(..) failed executing request.urlopen(..): \" + str(e))" + "ZipFile": "import boto3 # type: ignore\nimport json\nimport logging\nimport urllib.request\n\ns3 = boto3.client(\"s3\")\n\nEVENTBRIDGE_CONFIGURATION = 'EventBridgeConfiguration'\nCONFIGURATION_TYPES = [\"TopicConfigurations\", \"QueueConfigurations\", \"LambdaFunctionConfigurations\"]\n\ndef handler(event: dict, context):\n response_status = \"SUCCESS\"\n error_message = \"\"\n try:\n props = event[\"ResourceProperties\"]\n notification_configuration = props[\"NotificationConfiguration\"]\n managed = props.get('Managed', 'true').lower() == 'true'\n skipDestinationValidation = props.get('SkipDestinationValidation', 'false').lower() == 'true'\n stack_id = event['StackId']\n old = event.get(\"OldResourceProperties\", {}).get(\"NotificationConfiguration\", {})\n if managed:\n config = handle_managed(event[\"RequestType\"], notification_configuration)\n else:\n config = handle_unmanaged(props[\"BucketName\"], stack_id, event[\"RequestType\"], notification_configuration, old)\n s3.put_bucket_notification_configuration(Bucket=props[\"BucketName\"], NotificationConfiguration=config, SkipDestinationValidation=skipDestinationValidation)\n except Exception as e:\n logging.exception(\"Failed to put bucket notification configuration\")\n response_status = \"FAILED\"\n error_message = f\"Error: {str(e)}. \"\n finally:\n submit_response(event, context, response_status, error_message)\n\ndef handle_managed(request_type, notification_configuration):\n if request_type == 'Delete':\n return {}\n return notification_configuration\n\ndef handle_unmanaged(bucket, stack_id, request_type, notification_configuration, old):\n def get_id(n):\n n['Id'] = ''\n strToHash=json.dumps(n, sort_keys=True).replace('\"Name\": \"prefix\"', '\"Name\": \"Prefix\"').replace('\"Name\": \"suffix\"', '\"Name\": \"Suffix\"')\n return f\"{stack_id}-{hash(strToHash)}\"\n def with_id(n):\n n['Id'] = get_id(n)\n return n\n\n external_notifications = {}\n existing_notifications = s3.get_bucket_notification_configuration(Bucket=bucket)\n for t in CONFIGURATION_TYPES:\n if request_type == 'Update':\n old_incoming_ids = [get_id(n) for n in old.get(t, [])]\n external_notifications[t] = [n for n in existing_notifications.get(t, []) if not get_id(n) in old_incoming_ids] \n elif request_type == 'Delete':\n external_notifications[t] = [n for n in existing_notifications.get(t, []) if not n['Id'].startswith(f\"{stack_id}-\")]\n elif request_type == 'Create':\n external_notifications[t] = [n for n in existing_notifications.get(t, [])]\n if EVENTBRIDGE_CONFIGURATION in existing_notifications:\n external_notifications[EVENTBRIDGE_CONFIGURATION] = existing_notifications[EVENTBRIDGE_CONFIGURATION]\n\n if request_type == 'Delete':\n return external_notifications\n\n notifications = {}\n for t in CONFIGURATION_TYPES:\n external = external_notifications.get(t, [])\n incoming = [with_id(n) for n in notification_configuration.get(t, [])]\n notifications[t] = external + incoming\n\n if EVENTBRIDGE_CONFIGURATION in notification_configuration:\n notifications[EVENTBRIDGE_CONFIGURATION] = notification_configuration[EVENTBRIDGE_CONFIGURATION]\n elif EVENTBRIDGE_CONFIGURATION in external_notifications:\n notifications[EVENTBRIDGE_CONFIGURATION] = external_notifications[EVENTBRIDGE_CONFIGURATION]\n\n return notifications\n\ndef submit_response(event: dict, context, response_status: str, error_message: str):\n response_body = json.dumps(\n {\n \"Status\": response_status,\n \"Reason\": f\"{error_message}See the details in CloudWatch Log Stream: {context.log_stream_name}\",\n \"PhysicalResourceId\": event.get(\"PhysicalResourceId\") or event[\"LogicalResourceId\"],\n \"StackId\": event[\"StackId\"],\n \"RequestId\": event[\"RequestId\"],\n \"LogicalResourceId\": event[\"LogicalResourceId\"],\n \"NoEcho\": False,\n }\n ).encode(\"utf-8\")\n headers = {\"content-type\": \"\", \"content-length\": str(len(response_body))}\n try:\n req = urllib.request.Request(url=event[\"ResponseURL\"], headers=headers, data=response_body, method=\"PUT\")\n with urllib.request.urlopen(req) as response:\n print(response.read().decode(\"utf-8\"))\n print(\"Status code: \" + response.reason)\n except Exception as e:\n print(\"send(..) failed executing request.urlopen(..): \" + str(e))" }, "Handler": "index.handler", "Role": { diff --git a/source/patterns/@aws-solutions-constructs/aws-s3-stepfunctions/test/integ.s3stp-customLoggingBucket.js.snapshot/s3stpcustomLoggingBucketIntegDefaultTestDeployAssert2EFDBF9D.assets.json b/source/patterns/@aws-solutions-constructs/aws-s3-stepfunctions/test/integ.s3stp-customLoggingBucket.js.snapshot/s3stpcustomLoggingBucketIntegDefaultTestDeployAssert2EFDBF9D.assets.json index 4b632ecdd..45c0481fc 100644 --- a/source/patterns/@aws-solutions-constructs/aws-s3-stepfunctions/test/integ.s3stp-customLoggingBucket.js.snapshot/s3stpcustomLoggingBucketIntegDefaultTestDeployAssert2EFDBF9D.assets.json +++ b/source/patterns/@aws-solutions-constructs/aws-s3-stepfunctions/test/integ.s3stp-customLoggingBucket.js.snapshot/s3stpcustomLoggingBucketIntegDefaultTestDeployAssert2EFDBF9D.assets.json @@ -1,5 +1,5 @@ { - "version": "36.0.0", + "version": "36.0.18", "files": { "21fbb51d7b23f6a6c262b46a9caee79d744a3ac019fd45422d988b96d44b2a22": { "source": { diff --git a/source/patterns/@aws-solutions-constructs/aws-s3-stepfunctions/test/integ.s3stp-customLoggingBucket.js.snapshot/tree.json b/source/patterns/@aws-solutions-constructs/aws-s3-stepfunctions/test/integ.s3stp-customLoggingBucket.js.snapshot/tree.json index c344ef973..821f17c82 100644 --- a/source/patterns/@aws-solutions-constructs/aws-s3-stepfunctions/test/integ.s3stp-customLoggingBucket.js.snapshot/tree.json +++ b/source/patterns/@aws-solutions-constructs/aws-s3-stepfunctions/test/integ.s3stp-customLoggingBucket.js.snapshot/tree.json @@ -21,7 +21,7 @@ "path": "s3stp-customLoggingBucket/lambdas3stp-test/ServiceRole/ImportServiceRole", "constructInfo": { "fqn": "aws-cdk-lib.Resource", - "version": "2.150.0" + "version": "2.154.1" } }, "Resource": { @@ -60,13 +60,13 @@ }, "constructInfo": { "fqn": "aws-cdk-lib.aws_iam.CfnRole", - "version": "2.150.0" + "version": "2.154.1" } } }, "constructInfo": { "fqn": "aws-cdk-lib.aws_iam.Role", - "version": "2.150.0" + "version": "2.154.1" } }, "Resource": { @@ -90,13 +90,13 @@ }, "constructInfo": { "fqn": "aws-cdk-lib.aws_lambda.CfnFunction", - "version": "2.150.0" + "version": "2.154.1" } } }, "constructInfo": { "fqn": "aws-cdk-lib.aws_lambda.Function", - "version": "2.150.0" + "version": "2.154.1" } }, "tasks3stp-test": { @@ -104,7 +104,7 @@ "path": "s3stp-customLoggingBucket/tasks3stp-test", "constructInfo": { "fqn": "aws-cdk-lib.aws_stepfunctions_tasks.LambdaInvoke", - "version": "2.150.0" + "version": "2.154.1" } }, "test-s3-stepfunctions": { @@ -162,7 +162,7 @@ }, "constructInfo": { "fqn": "aws-cdk-lib.aws_s3.CfnBucket", - "version": "2.150.0" + "version": "2.154.1" } }, "Policy": { @@ -296,13 +296,13 @@ }, "constructInfo": { "fqn": "aws-cdk-lib.aws_s3.CfnBucketPolicy", - "version": "2.150.0" + "version": "2.154.1" } } }, "constructInfo": { "fqn": "aws-cdk-lib.aws_s3.BucketPolicy", - "version": "2.150.0" + "version": "2.154.1" } }, "AutoDeleteObjectsCustomResource": { @@ -314,19 +314,19 @@ "path": "s3stp-customLoggingBucket/test-s3-stepfunctions/S3LoggingBucket/AutoDeleteObjectsCustomResource/Default", "constructInfo": { "fqn": "aws-cdk-lib.CfnResource", - "version": "2.150.0" + "version": "2.154.1" } } }, "constructInfo": { "fqn": "aws-cdk-lib.CustomResource", - "version": "2.150.0" + "version": "2.154.1" } } }, "constructInfo": { "fqn": "aws-cdk-lib.aws_s3.Bucket", - "version": "2.150.0" + "version": "2.154.1" } }, "S3Bucket": { @@ -385,7 +385,7 @@ }, "constructInfo": { "fqn": "aws-cdk-lib.aws_s3.CfnBucket", - "version": "2.150.0" + "version": "2.154.1" } }, "Policy": { @@ -483,13 +483,13 @@ }, "constructInfo": { "fqn": "aws-cdk-lib.aws_s3.CfnBucketPolicy", - "version": "2.150.0" + "version": "2.154.1" } } }, "constructInfo": { "fqn": "aws-cdk-lib.aws_s3.BucketPolicy", - "version": "2.150.0" + "version": "2.154.1" } }, "AutoDeleteObjectsCustomResource": { @@ -501,13 +501,13 @@ "path": "s3stp-customLoggingBucket/test-s3-stepfunctions/S3Bucket/AutoDeleteObjectsCustomResource/Default", "constructInfo": { "fqn": "aws-cdk-lib.CfnResource", - "version": "2.150.0" + "version": "2.154.1" } } }, "constructInfo": { "fqn": "aws-cdk-lib.CustomResource", - "version": "2.150.0" + "version": "2.154.1" } }, "Notifications": { @@ -519,7 +519,7 @@ "path": "s3stp-customLoggingBucket/test-s3-stepfunctions/S3Bucket/Notifications/Resource", "constructInfo": { "fqn": "aws-cdk-lib.CfnResource", - "version": "2.150.0" + "version": "2.154.1" } } }, @@ -531,7 +531,7 @@ }, "constructInfo": { "fqn": "aws-cdk-lib.aws_s3.Bucket", - "version": "2.150.0" + "version": "2.154.1" } }, "test-s3-stepfunctions-event-rule-step-function-construct": { @@ -573,13 +573,13 @@ }, "constructInfo": { "fqn": "aws-cdk-lib.aws_logs.CfnLogGroup", - "version": "2.150.0" + "version": "2.154.1" } } }, "constructInfo": { "fqn": "aws-cdk-lib.aws_logs.LogGroup", - "version": "2.150.0" + "version": "2.154.1" } }, "StateMachine": { @@ -595,7 +595,7 @@ "path": "s3stp-customLoggingBucket/test-s3-stepfunctions/test-s3-stepfunctions-event-rule-step-function-construct/StateMachine/Role/ImportRole", "constructInfo": { "fqn": "aws-cdk-lib.Resource", - "version": "2.150.0" + "version": "2.154.1" } }, "Resource": { @@ -620,7 +620,7 @@ }, "constructInfo": { "fqn": "aws-cdk-lib.aws_iam.CfnRole", - "version": "2.150.0" + "version": "2.154.1" } }, "DefaultPolicy": { @@ -688,19 +688,19 @@ }, "constructInfo": { "fqn": "aws-cdk-lib.aws_iam.CfnPolicy", - "version": "2.150.0" + "version": "2.154.1" } } }, "constructInfo": { "fqn": "aws-cdk-lib.aws_iam.Policy", - "version": "2.150.0" + "version": "2.154.1" } } }, "constructInfo": { "fqn": "aws-cdk-lib.aws_iam.Role", - "version": "2.150.0" + "version": "2.154.1" } }, "Resource": { @@ -753,13 +753,13 @@ }, "constructInfo": { "fqn": "aws-cdk-lib.aws_stepfunctions.CfnStateMachine", - "version": "2.150.0" + "version": "2.154.1" } } }, "constructInfo": { "fqn": "aws-cdk-lib.aws_stepfunctions.StateMachine", - "version": "2.150.0" + "version": "2.154.1" } }, "EventsRuleRole": { @@ -771,7 +771,7 @@ "path": "s3stp-customLoggingBucket/test-s3-stepfunctions/test-s3-stepfunctions-event-rule-step-function-construct/EventsRuleRole/ImportEventsRuleRole", "constructInfo": { "fqn": "aws-cdk-lib.Resource", - "version": "2.150.0" + "version": "2.154.1" } }, "Resource": { @@ -796,7 +796,7 @@ }, "constructInfo": { "fqn": "aws-cdk-lib.aws_iam.CfnRole", - "version": "2.150.0" + "version": "2.154.1" } }, "DefaultPolicy": { @@ -831,19 +831,19 @@ }, "constructInfo": { "fqn": "aws-cdk-lib.aws_iam.CfnPolicy", - "version": "2.150.0" + "version": "2.154.1" } } }, "constructInfo": { "fqn": "aws-cdk-lib.aws_iam.Policy", - "version": "2.150.0" + "version": "2.154.1" } } }, "constructInfo": { "fqn": "aws-cdk-lib.aws_iam.Role", - "version": "2.150.0" + "version": "2.154.1" } }, "EventsRule": { @@ -892,13 +892,13 @@ }, "constructInfo": { "fqn": "aws-cdk-lib.aws_events.CfnRule", - "version": "2.150.0" + "version": "2.154.1" } } }, "constructInfo": { "fqn": "aws-cdk-lib.aws_events.Rule", - "version": "2.150.0" + "version": "2.154.1" } }, "ExecutionFailedAlarm": { @@ -931,13 +931,13 @@ }, "constructInfo": { "fqn": "aws-cdk-lib.aws_cloudwatch.CfnAlarm", - "version": "2.150.0" + "version": "2.154.1" } } }, "constructInfo": { "fqn": "aws-cdk-lib.aws_cloudwatch.Alarm", - "version": "2.150.0" + "version": "2.154.1" } }, "ExecutionThrottledAlarm": { @@ -970,13 +970,13 @@ }, "constructInfo": { "fqn": "aws-cdk-lib.aws_cloudwatch.CfnAlarm", - "version": "2.150.0" + "version": "2.154.1" } } }, "constructInfo": { "fqn": "aws-cdk-lib.aws_cloudwatch.Alarm", - "version": "2.150.0" + "version": "2.154.1" } }, "ExecutionAbortedAlarm": { @@ -1009,25 +1009,25 @@ }, "constructInfo": { "fqn": "aws-cdk-lib.aws_cloudwatch.CfnAlarm", - "version": "2.150.0" + "version": "2.154.1" } } }, "constructInfo": { "fqn": "aws-cdk-lib.aws_cloudwatch.Alarm", - "version": "2.150.0" + "version": "2.154.1" } } }, "constructInfo": { "fqn": "@aws-solutions-constructs/aws-eventbridge-stepfunctions.EventbridgeToStepfunctions", - "version": "2.63.0" + "version": "2.67.1" } } }, "constructInfo": { "fqn": "@aws-solutions-constructs/aws-s3-stepfunctions.S3ToStepfunctions", - "version": "2.63.0" + "version": "2.67.1" } }, "LatestNodeRuntimeMap": { @@ -1035,7 +1035,7 @@ "path": "s3stp-customLoggingBucket/LatestNodeRuntimeMap", "constructInfo": { "fqn": "aws-cdk-lib.CfnMapping", - "version": "2.150.0" + "version": "2.154.1" } }, "Custom::S3AutoDeleteObjectsCustomResourceProvider": { @@ -1047,7 +1047,7 @@ "path": "s3stp-customLoggingBucket/Custom::S3AutoDeleteObjectsCustomResourceProvider/Staging", "constructInfo": { "fqn": "aws-cdk-lib.AssetStaging", - "version": "2.150.0" + "version": "2.154.1" } }, "Role": { @@ -1055,7 +1055,7 @@ "path": "s3stp-customLoggingBucket/Custom::S3AutoDeleteObjectsCustomResourceProvider/Role", "constructInfo": { "fqn": "aws-cdk-lib.CfnResource", - "version": "2.150.0" + "version": "2.154.1" } }, "Handler": { @@ -1063,13 +1063,13 @@ "path": "s3stp-customLoggingBucket/Custom::S3AutoDeleteObjectsCustomResourceProvider/Handler", "constructInfo": { "fqn": "aws-cdk-lib.CfnResource", - "version": "2.150.0" + "version": "2.154.1" } } }, "constructInfo": { "fqn": "aws-cdk-lib.CustomResourceProviderBase", - "version": "2.150.0" + "version": "2.154.1" } }, "BucketNotificationsHandler050a0587b7544547bf325f094a3db834": { @@ -1085,7 +1085,7 @@ "path": "s3stp-customLoggingBucket/BucketNotificationsHandler050a0587b7544547bf325f094a3db834/Role/ImportRole", "constructInfo": { "fqn": "aws-cdk-lib.Resource", - "version": "2.150.0" + "version": "2.154.1" } }, "Resource": { @@ -1124,7 +1124,7 @@ }, "constructInfo": { "fqn": "aws-cdk-lib.aws_iam.CfnRole", - "version": "2.150.0" + "version": "2.154.1" } }, "DefaultPolicy": { @@ -1157,19 +1157,19 @@ }, "constructInfo": { "fqn": "aws-cdk-lib.aws_iam.CfnPolicy", - "version": "2.150.0" + "version": "2.154.1" } } }, "constructInfo": { "fqn": "aws-cdk-lib.aws_iam.Policy", - "version": "2.150.0" + "version": "2.154.1" } } }, "constructInfo": { "fqn": "aws-cdk-lib.aws_iam.Role", - "version": "2.150.0" + "version": "2.154.1" } }, "Resource": { @@ -1177,7 +1177,7 @@ "path": "s3stp-customLoggingBucket/BucketNotificationsHandler050a0587b7544547bf325f094a3db834/Resource", "constructInfo": { "fqn": "aws-cdk-lib.CfnResource", - "version": "2.150.0" + "version": "2.154.1" } } }, @@ -1211,7 +1211,7 @@ "path": "s3stp-customLoggingBucket/Integ/DefaultTest/DeployAssert/BootstrapVersion", "constructInfo": { "fqn": "aws-cdk-lib.CfnParameter", - "version": "2.150.0" + "version": "2.154.1" } }, "CheckBootstrapVersion": { @@ -1219,25 +1219,25 @@ "path": "s3stp-customLoggingBucket/Integ/DefaultTest/DeployAssert/CheckBootstrapVersion", "constructInfo": { "fqn": "aws-cdk-lib.CfnRule", - "version": "2.150.0" + "version": "2.154.1" } } }, "constructInfo": { "fqn": "aws-cdk-lib.Stack", - "version": "2.150.0" + "version": "2.154.1" } } }, "constructInfo": { "fqn": "@aws-cdk/integ-tests-alpha.IntegTestCase", - "version": "2.150.0-alpha.0" + "version": "2.154.1-alpha.0" } } }, "constructInfo": { "fqn": "@aws-cdk/integ-tests-alpha.IntegTest", - "version": "2.150.0-alpha.0" + "version": "2.154.1-alpha.0" } }, "BootstrapVersion": { @@ -1245,7 +1245,7 @@ "path": "s3stp-customLoggingBucket/BootstrapVersion", "constructInfo": { "fqn": "aws-cdk-lib.CfnParameter", - "version": "2.150.0" + "version": "2.154.1" } }, "CheckBootstrapVersion": { @@ -1253,13 +1253,13 @@ "path": "s3stp-customLoggingBucket/CheckBootstrapVersion", "constructInfo": { "fqn": "aws-cdk-lib.CfnRule", - "version": "2.150.0" + "version": "2.154.1" } } }, "constructInfo": { "fqn": "aws-cdk-lib.Stack", - "version": "2.150.0" + "version": "2.154.1" } }, "Tree": { @@ -1273,7 +1273,7 @@ }, "constructInfo": { "fqn": "aws-cdk-lib.App", - "version": "2.150.0" + "version": "2.154.1" } } } \ No newline at end of file diff --git a/source/patterns/@aws-solutions-constructs/aws-s3-stepfunctions/test/integ.s3stp-pre-existing-bucket.js.snapshot/cdk.out b/source/patterns/@aws-solutions-constructs/aws-s3-stepfunctions/test/integ.s3stp-pre-existing-bucket.js.snapshot/cdk.out index 1f0068d32..0d15a78da 100644 --- a/source/patterns/@aws-solutions-constructs/aws-s3-stepfunctions/test/integ.s3stp-pre-existing-bucket.js.snapshot/cdk.out +++ b/source/patterns/@aws-solutions-constructs/aws-s3-stepfunctions/test/integ.s3stp-pre-existing-bucket.js.snapshot/cdk.out @@ -1 +1 @@ -{"version":"36.0.0"} \ No newline at end of file +{"version":"36.0.18"} \ No newline at end of file diff --git a/source/patterns/@aws-solutions-constructs/aws-s3-stepfunctions/test/integ.s3stp-pre-existing-bucket.js.snapshot/integ.json b/source/patterns/@aws-solutions-constructs/aws-s3-stepfunctions/test/integ.s3stp-pre-existing-bucket.js.snapshot/integ.json index 594e7c267..da3fe9054 100644 --- a/source/patterns/@aws-solutions-constructs/aws-s3-stepfunctions/test/integ.s3stp-pre-existing-bucket.js.snapshot/integ.json +++ b/source/patterns/@aws-solutions-constructs/aws-s3-stepfunctions/test/integ.s3stp-pre-existing-bucket.js.snapshot/integ.json @@ -1,5 +1,5 @@ { - "version": "36.0.0", + "version": "36.0.18", "testCases": { "s3stp-pre-existing-bucket/Integ/DefaultTest": { "stacks": [ diff --git a/source/patterns/@aws-solutions-constructs/aws-s3-stepfunctions/test/integ.s3stp-pre-existing-bucket.js.snapshot/manifest.json b/source/patterns/@aws-solutions-constructs/aws-s3-stepfunctions/test/integ.s3stp-pre-existing-bucket.js.snapshot/manifest.json index ebd4239e7..01238f50f 100644 --- a/source/patterns/@aws-solutions-constructs/aws-s3-stepfunctions/test/integ.s3stp-pre-existing-bucket.js.snapshot/manifest.json +++ b/source/patterns/@aws-solutions-constructs/aws-s3-stepfunctions/test/integ.s3stp-pre-existing-bucket.js.snapshot/manifest.json @@ -1,5 +1,5 @@ { - "version": "36.0.0", + "version": "36.0.5", "artifacts": { "s3stppreexistingbucketIntegDefaultTestDeployAssert71C6CEBC.assets": { "type": "cdk:asset-manifest", @@ -66,7 +66,7 @@ "validateOnSynth": false, "assumeRoleArn": "arn:${AWS::Partition}:iam::${AWS::AccountId}:role/cdk-hnb659fds-deploy-role-${AWS::AccountId}-${AWS::Region}", "cloudFormationExecutionRoleArn": "arn:${AWS::Partition}:iam::${AWS::AccountId}:role/cdk-hnb659fds-cfn-exec-role-${AWS::AccountId}-${AWS::Region}", - "stackTemplateAssetObjectUrl": "s3://cdk-hnb659fds-assets-${AWS::AccountId}-${AWS::Region}/a1cb6cd78a7729ad3115b09a7bf44962b22019b9cf23a1e16949338b0aede045.json", + "stackTemplateAssetObjectUrl": "s3://cdk-hnb659fds-assets-${AWS::AccountId}-${AWS::Region}/651b65da8db533c3c46ff7f63eb9b3a1afdcc036b27bef76c6df60511ef65b57.json", "requiresBootstrapStackVersion": 6, "bootstrapStackVersionSsmParameter": "/cdk-bootstrap/hnb659fds/version", "additionalDependencies": [ @@ -106,6 +106,12 @@ "data": "LatestNodeRuntimeMap" } ], + "/s3stp-pre-existing-bucket/Custom::S3AutoDeleteObjectsCustomResourceProvider": [ + { + "type": "aws:cdk:is-custom-resource-handler-customResourceProvider", + "data": true + } + ], "/s3stp-pre-existing-bucket/Custom::S3AutoDeleteObjectsCustomResourceProvider/Role": [ { "type": "aws:cdk:logicalId", diff --git a/source/patterns/@aws-solutions-constructs/aws-s3-stepfunctions/test/integ.s3stp-pre-existing-bucket.js.snapshot/s3stp-pre-existing-bucket.assets.json b/source/patterns/@aws-solutions-constructs/aws-s3-stepfunctions/test/integ.s3stp-pre-existing-bucket.js.snapshot/s3stp-pre-existing-bucket.assets.json index 37952fc34..2e63f8577 100644 --- a/source/patterns/@aws-solutions-constructs/aws-s3-stepfunctions/test/integ.s3stp-pre-existing-bucket.js.snapshot/s3stp-pre-existing-bucket.assets.json +++ b/source/patterns/@aws-solutions-constructs/aws-s3-stepfunctions/test/integ.s3stp-pre-existing-bucket.js.snapshot/s3stp-pre-existing-bucket.assets.json @@ -1,5 +1,5 @@ { - "version": "36.0.0", + "version": "36.0.18", "files": { "faa95a81ae7d7373f3e1f242268f904eb748d8d0fdd306e8a6fe515a1905a7d6": { "source": { @@ -14,7 +14,7 @@ } } }, - "a1cb6cd78a7729ad3115b09a7bf44962b22019b9cf23a1e16949338b0aede045": { + "651b65da8db533c3c46ff7f63eb9b3a1afdcc036b27bef76c6df60511ef65b57": { "source": { "path": "s3stp-pre-existing-bucket.template.json", "packaging": "file" @@ -22,7 +22,7 @@ "destinations": { "current_account-current_region": { "bucketName": "cdk-hnb659fds-assets-${AWS::AccountId}-${AWS::Region}", - "objectKey": "a1cb6cd78a7729ad3115b09a7bf44962b22019b9cf23a1e16949338b0aede045.json", + "objectKey": "651b65da8db533c3c46ff7f63eb9b3a1afdcc036b27bef76c6df60511ef65b57.json", "assumeRoleArn": "arn:${AWS::Partition}:iam::${AWS::AccountId}:role/cdk-hnb659fds-file-publishing-role-${AWS::AccountId}-${AWS::Region}" } } diff --git a/source/patterns/@aws-solutions-constructs/aws-s3-stepfunctions/test/integ.s3stp-pre-existing-bucket.js.snapshot/s3stp-pre-existing-bucket.template.json b/source/patterns/@aws-solutions-constructs/aws-s3-stepfunctions/test/integ.s3stp-pre-existing-bucket.js.snapshot/s3stp-pre-existing-bucket.template.json index 2a71b5052..f695cf6af 100644 --- a/source/patterns/@aws-solutions-constructs/aws-s3-stepfunctions/test/integ.s3stp-pre-existing-bucket.js.snapshot/s3stp-pre-existing-bucket.template.json +++ b/source/patterns/@aws-solutions-constructs/aws-s3-stepfunctions/test/integ.s3stp-pre-existing-bucket.js.snapshot/s3stp-pre-existing-bucket.template.json @@ -422,7 +422,8 @@ "NotificationConfiguration": { "EventBridgeConfiguration": {} }, - "Managed": true + "Managed": true, + "SkipDestinationValidation": false }, "DependsOn": [ "scrapBucketPolicy189B0607" @@ -495,7 +496,7 @@ "Properties": { "Description": "AWS CloudFormation handler for \"Custom::S3BucketNotifications\" resources (@aws-cdk/aws-s3)", "Code": { - "ZipFile": "import boto3 # type: ignore\nimport json\nimport logging\nimport urllib.request\n\ns3 = boto3.client(\"s3\")\n\nEVENTBRIDGE_CONFIGURATION = 'EventBridgeConfiguration'\nCONFIGURATION_TYPES = [\"TopicConfigurations\", \"QueueConfigurations\", \"LambdaFunctionConfigurations\"]\n\ndef handler(event: dict, context):\n response_status = \"SUCCESS\"\n error_message = \"\"\n try:\n props = event[\"ResourceProperties\"]\n notification_configuration = props[\"NotificationConfiguration\"]\n managed = props.get('Managed', 'true').lower() == 'true'\n stack_id = event['StackId']\n old = event.get(\"OldResourceProperties\", {}).get(\"NotificationConfiguration\", {})\n if managed:\n config = handle_managed(event[\"RequestType\"], notification_configuration)\n else:\n config = handle_unmanaged(props[\"BucketName\"], stack_id, event[\"RequestType\"], notification_configuration, old)\n s3.put_bucket_notification_configuration(Bucket=props[\"BucketName\"], NotificationConfiguration=config)\n except Exception as e:\n logging.exception(\"Failed to put bucket notification configuration\")\n response_status = \"FAILED\"\n error_message = f\"Error: {str(e)}. \"\n finally:\n submit_response(event, context, response_status, error_message)\n\ndef handle_managed(request_type, notification_configuration):\n if request_type == 'Delete':\n return {}\n return notification_configuration\n\ndef handle_unmanaged(bucket, stack_id, request_type, notification_configuration, old):\n def get_id(n):\n n['Id'] = ''\n strToHash=json.dumps(n, sort_keys=True).replace('\"Name\": \"prefix\"', '\"Name\": \"Prefix\"').replace('\"Name\": \"suffix\"', '\"Name\": \"Suffix\"')\n return f\"{stack_id}-{hash(strToHash)}\"\n def with_id(n):\n n['Id'] = get_id(n)\n return n\n\n external_notifications = {}\n existing_notifications = s3.get_bucket_notification_configuration(Bucket=bucket)\n for t in CONFIGURATION_TYPES:\n if request_type == 'Update':\n old_incoming_ids = [get_id(n) for n in old.get(t, [])]\n external_notifications[t] = [n for n in existing_notifications.get(t, []) if not get_id(n) in old_incoming_ids] \n elif request_type == 'Delete':\n external_notifications[t] = [n for n in existing_notifications.get(t, []) if not n['Id'].startswith(f\"{stack_id}-\")]\n elif request_type == 'Create':\n external_notifications[t] = [n for n in existing_notifications.get(t, [])]\n if EVENTBRIDGE_CONFIGURATION in existing_notifications:\n external_notifications[EVENTBRIDGE_CONFIGURATION] = existing_notifications[EVENTBRIDGE_CONFIGURATION]\n\n if request_type == 'Delete':\n return external_notifications\n\n notifications = {}\n for t in CONFIGURATION_TYPES:\n external = external_notifications.get(t, [])\n incoming = [with_id(n) for n in notification_configuration.get(t, [])]\n notifications[t] = external + incoming\n\n if EVENTBRIDGE_CONFIGURATION in notification_configuration:\n notifications[EVENTBRIDGE_CONFIGURATION] = notification_configuration[EVENTBRIDGE_CONFIGURATION]\n elif EVENTBRIDGE_CONFIGURATION in external_notifications:\n notifications[EVENTBRIDGE_CONFIGURATION] = external_notifications[EVENTBRIDGE_CONFIGURATION]\n\n return notifications\n\ndef submit_response(event: dict, context, response_status: str, error_message: str):\n response_body = json.dumps(\n {\n \"Status\": response_status,\n \"Reason\": f\"{error_message}See the details in CloudWatch Log Stream: {context.log_stream_name}\",\n \"PhysicalResourceId\": event.get(\"PhysicalResourceId\") or event[\"LogicalResourceId\"],\n \"StackId\": event[\"StackId\"],\n \"RequestId\": event[\"RequestId\"],\n \"LogicalResourceId\": event[\"LogicalResourceId\"],\n \"NoEcho\": False,\n }\n ).encode(\"utf-8\")\n headers = {\"content-type\": \"\", \"content-length\": str(len(response_body))}\n try:\n req = urllib.request.Request(url=event[\"ResponseURL\"], headers=headers, data=response_body, method=\"PUT\")\n with urllib.request.urlopen(req) as response:\n print(response.read().decode(\"utf-8\"))\n print(\"Status code: \" + response.reason)\n except Exception as e:\n print(\"send(..) failed executing request.urlopen(..): \" + str(e))" + "ZipFile": "import boto3 # type: ignore\nimport json\nimport logging\nimport urllib.request\n\ns3 = boto3.client(\"s3\")\n\nEVENTBRIDGE_CONFIGURATION = 'EventBridgeConfiguration'\nCONFIGURATION_TYPES = [\"TopicConfigurations\", \"QueueConfigurations\", \"LambdaFunctionConfigurations\"]\n\ndef handler(event: dict, context):\n response_status = \"SUCCESS\"\n error_message = \"\"\n try:\n props = event[\"ResourceProperties\"]\n notification_configuration = props[\"NotificationConfiguration\"]\n managed = props.get('Managed', 'true').lower() == 'true'\n skipDestinationValidation = props.get('SkipDestinationValidation', 'false').lower() == 'true'\n stack_id = event['StackId']\n old = event.get(\"OldResourceProperties\", {}).get(\"NotificationConfiguration\", {})\n if managed:\n config = handle_managed(event[\"RequestType\"], notification_configuration)\n else:\n config = handle_unmanaged(props[\"BucketName\"], stack_id, event[\"RequestType\"], notification_configuration, old)\n s3.put_bucket_notification_configuration(Bucket=props[\"BucketName\"], NotificationConfiguration=config, SkipDestinationValidation=skipDestinationValidation)\n except Exception as e:\n logging.exception(\"Failed to put bucket notification configuration\")\n response_status = \"FAILED\"\n error_message = f\"Error: {str(e)}. \"\n finally:\n submit_response(event, context, response_status, error_message)\n\ndef handle_managed(request_type, notification_configuration):\n if request_type == 'Delete':\n return {}\n return notification_configuration\n\ndef handle_unmanaged(bucket, stack_id, request_type, notification_configuration, old):\n def get_id(n):\n n['Id'] = ''\n strToHash=json.dumps(n, sort_keys=True).replace('\"Name\": \"prefix\"', '\"Name\": \"Prefix\"').replace('\"Name\": \"suffix\"', '\"Name\": \"Suffix\"')\n return f\"{stack_id}-{hash(strToHash)}\"\n def with_id(n):\n n['Id'] = get_id(n)\n return n\n\n external_notifications = {}\n existing_notifications = s3.get_bucket_notification_configuration(Bucket=bucket)\n for t in CONFIGURATION_TYPES:\n if request_type == 'Update':\n old_incoming_ids = [get_id(n) for n in old.get(t, [])]\n external_notifications[t] = [n for n in existing_notifications.get(t, []) if not get_id(n) in old_incoming_ids] \n elif request_type == 'Delete':\n external_notifications[t] = [n for n in existing_notifications.get(t, []) if not n['Id'].startswith(f\"{stack_id}-\")]\n elif request_type == 'Create':\n external_notifications[t] = [n for n in existing_notifications.get(t, [])]\n if EVENTBRIDGE_CONFIGURATION in existing_notifications:\n external_notifications[EVENTBRIDGE_CONFIGURATION] = existing_notifications[EVENTBRIDGE_CONFIGURATION]\n\n if request_type == 'Delete':\n return external_notifications\n\n notifications = {}\n for t in CONFIGURATION_TYPES:\n external = external_notifications.get(t, [])\n incoming = [with_id(n) for n in notification_configuration.get(t, [])]\n notifications[t] = external + incoming\n\n if EVENTBRIDGE_CONFIGURATION in notification_configuration:\n notifications[EVENTBRIDGE_CONFIGURATION] = notification_configuration[EVENTBRIDGE_CONFIGURATION]\n elif EVENTBRIDGE_CONFIGURATION in external_notifications:\n notifications[EVENTBRIDGE_CONFIGURATION] = external_notifications[EVENTBRIDGE_CONFIGURATION]\n\n return notifications\n\ndef submit_response(event: dict, context, response_status: str, error_message: str):\n response_body = json.dumps(\n {\n \"Status\": response_status,\n \"Reason\": f\"{error_message}See the details in CloudWatch Log Stream: {context.log_stream_name}\",\n \"PhysicalResourceId\": event.get(\"PhysicalResourceId\") or event[\"LogicalResourceId\"],\n \"StackId\": event[\"StackId\"],\n \"RequestId\": event[\"RequestId\"],\n \"LogicalResourceId\": event[\"LogicalResourceId\"],\n \"NoEcho\": False,\n }\n ).encode(\"utf-8\")\n headers = {\"content-type\": \"\", \"content-length\": str(len(response_body))}\n try:\n req = urllib.request.Request(url=event[\"ResponseURL\"], headers=headers, data=response_body, method=\"PUT\")\n with urllib.request.urlopen(req) as response:\n print(response.read().decode(\"utf-8\"))\n print(\"Status code: \" + response.reason)\n except Exception as e:\n print(\"send(..) failed executing request.urlopen(..): \" + str(e))" }, "Handler": "index.handler", "Role": { diff --git a/source/patterns/@aws-solutions-constructs/aws-s3-stepfunctions/test/integ.s3stp-pre-existing-bucket.js.snapshot/s3stppreexistingbucketIntegDefaultTestDeployAssert71C6CEBC.assets.json b/source/patterns/@aws-solutions-constructs/aws-s3-stepfunctions/test/integ.s3stp-pre-existing-bucket.js.snapshot/s3stppreexistingbucketIntegDefaultTestDeployAssert71C6CEBC.assets.json index c1db2d80b..ec33e9ff1 100644 --- a/source/patterns/@aws-solutions-constructs/aws-s3-stepfunctions/test/integ.s3stp-pre-existing-bucket.js.snapshot/s3stppreexistingbucketIntegDefaultTestDeployAssert71C6CEBC.assets.json +++ b/source/patterns/@aws-solutions-constructs/aws-s3-stepfunctions/test/integ.s3stp-pre-existing-bucket.js.snapshot/s3stppreexistingbucketIntegDefaultTestDeployAssert71C6CEBC.assets.json @@ -1,5 +1,5 @@ { - "version": "36.0.0", + "version": "36.0.18", "files": { "21fbb51d7b23f6a6c262b46a9caee79d744a3ac019fd45422d988b96d44b2a22": { "source": { diff --git a/source/patterns/@aws-solutions-constructs/aws-s3-stepfunctions/test/integ.s3stp-pre-existing-bucket.js.snapshot/tree.json b/source/patterns/@aws-solutions-constructs/aws-s3-stepfunctions/test/integ.s3stp-pre-existing-bucket.js.snapshot/tree.json index 42a894ae2..d248e04c2 100644 --- a/source/patterns/@aws-solutions-constructs/aws-s3-stepfunctions/test/integ.s3stp-pre-existing-bucket.js.snapshot/tree.json +++ b/source/patterns/@aws-solutions-constructs/aws-s3-stepfunctions/test/integ.s3stp-pre-existing-bucket.js.snapshot/tree.json @@ -40,7 +40,7 @@ }, "constructInfo": { "fqn": "aws-cdk-lib.aws_s3.CfnBucket", - "version": "2.150.0" + "version": "2.154.1" } }, "Policy": { @@ -174,13 +174,13 @@ }, "constructInfo": { "fqn": "aws-cdk-lib.aws_s3.CfnBucketPolicy", - "version": "2.150.0" + "version": "2.154.1" } } }, "constructInfo": { "fqn": "aws-cdk-lib.aws_s3.BucketPolicy", - "version": "2.150.0" + "version": "2.154.1" } }, "AutoDeleteObjectsCustomResource": { @@ -192,19 +192,19 @@ "path": "s3stp-pre-existing-bucket/scrapBucketLog/AutoDeleteObjectsCustomResource/Default", "constructInfo": { "fqn": "aws-cdk-lib.CfnResource", - "version": "2.150.0" + "version": "2.154.1" } } }, "constructInfo": { "fqn": "aws-cdk-lib.CustomResource", - "version": "2.150.0" + "version": "2.154.1" } } }, "constructInfo": { "fqn": "aws-cdk-lib.aws_s3.Bucket", - "version": "2.150.0" + "version": "2.154.1" } }, "LatestNodeRuntimeMap": { @@ -212,7 +212,7 @@ "path": "s3stp-pre-existing-bucket/LatestNodeRuntimeMap", "constructInfo": { "fqn": "aws-cdk-lib.CfnMapping", - "version": "2.150.0" + "version": "2.154.1" } }, "Custom::S3AutoDeleteObjectsCustomResourceProvider": { @@ -224,7 +224,7 @@ "path": "s3stp-pre-existing-bucket/Custom::S3AutoDeleteObjectsCustomResourceProvider/Staging", "constructInfo": { "fqn": "aws-cdk-lib.AssetStaging", - "version": "2.150.0" + "version": "2.154.1" } }, "Role": { @@ -232,7 +232,7 @@ "path": "s3stp-pre-existing-bucket/Custom::S3AutoDeleteObjectsCustomResourceProvider/Role", "constructInfo": { "fqn": "aws-cdk-lib.CfnResource", - "version": "2.150.0" + "version": "2.154.1" } }, "Handler": { @@ -240,13 +240,13 @@ "path": "s3stp-pre-existing-bucket/Custom::S3AutoDeleteObjectsCustomResourceProvider/Handler", "constructInfo": { "fqn": "aws-cdk-lib.CfnResource", - "version": "2.150.0" + "version": "2.154.1" } } }, "constructInfo": { "fqn": "aws-cdk-lib.CustomResourceProviderBase", - "version": "2.150.0" + "version": "2.154.1" } }, "scrapBucket": { @@ -286,7 +286,7 @@ }, "constructInfo": { "fqn": "aws-cdk-lib.aws_s3.CfnBucket", - "version": "2.150.0" + "version": "2.154.1" } }, "Policy": { @@ -384,13 +384,13 @@ }, "constructInfo": { "fqn": "aws-cdk-lib.aws_s3.CfnBucketPolicy", - "version": "2.150.0" + "version": "2.154.1" } } }, "constructInfo": { "fqn": "aws-cdk-lib.aws_s3.BucketPolicy", - "version": "2.150.0" + "version": "2.154.1" } }, "AutoDeleteObjectsCustomResource": { @@ -402,13 +402,13 @@ "path": "s3stp-pre-existing-bucket/scrapBucket/AutoDeleteObjectsCustomResource/Default", "constructInfo": { "fqn": "aws-cdk-lib.CfnResource", - "version": "2.150.0" + "version": "2.154.1" } } }, "constructInfo": { "fqn": "aws-cdk-lib.CustomResource", - "version": "2.150.0" + "version": "2.154.1" } }, "Notifications": { @@ -420,7 +420,7 @@ "path": "s3stp-pre-existing-bucket/scrapBucket/Notifications/Resource", "constructInfo": { "fqn": "aws-cdk-lib.CfnResource", - "version": "2.150.0" + "version": "2.154.1" } } }, @@ -432,7 +432,7 @@ }, "constructInfo": { "fqn": "aws-cdk-lib.aws_s3.Bucket", - "version": "2.150.0" + "version": "2.154.1" } }, "BucketNotificationsHandler050a0587b7544547bf325f094a3db834": { @@ -448,7 +448,7 @@ "path": "s3stp-pre-existing-bucket/BucketNotificationsHandler050a0587b7544547bf325f094a3db834/Role/ImportRole", "constructInfo": { "fqn": "aws-cdk-lib.Resource", - "version": "2.150.0" + "version": "2.154.1" } }, "Resource": { @@ -487,7 +487,7 @@ }, "constructInfo": { "fqn": "aws-cdk-lib.aws_iam.CfnRole", - "version": "2.150.0" + "version": "2.154.1" } }, "DefaultPolicy": { @@ -520,19 +520,19 @@ }, "constructInfo": { "fqn": "aws-cdk-lib.aws_iam.CfnPolicy", - "version": "2.150.0" + "version": "2.154.1" } } }, "constructInfo": { "fqn": "aws-cdk-lib.aws_iam.Policy", - "version": "2.150.0" + "version": "2.154.1" } } }, "constructInfo": { "fqn": "aws-cdk-lib.aws_iam.Role", - "version": "2.150.0" + "version": "2.154.1" } }, "Resource": { @@ -540,7 +540,7 @@ "path": "s3stp-pre-existing-bucket/BucketNotificationsHandler050a0587b7544547bf325f094a3db834/Resource", "constructInfo": { "fqn": "aws-cdk-lib.CfnResource", - "version": "2.150.0" + "version": "2.154.1" } } }, @@ -562,7 +562,7 @@ "path": "s3stp-pre-existing-bucket/lambdas3stp-test/ServiceRole/ImportServiceRole", "constructInfo": { "fqn": "aws-cdk-lib.Resource", - "version": "2.150.0" + "version": "2.154.1" } }, "Resource": { @@ -601,13 +601,13 @@ }, "constructInfo": { "fqn": "aws-cdk-lib.aws_iam.CfnRole", - "version": "2.150.0" + "version": "2.154.1" } } }, "constructInfo": { "fqn": "aws-cdk-lib.aws_iam.Role", - "version": "2.150.0" + "version": "2.154.1" } }, "Resource": { @@ -631,13 +631,13 @@ }, "constructInfo": { "fqn": "aws-cdk-lib.aws_lambda.CfnFunction", - "version": "2.150.0" + "version": "2.154.1" } } }, "constructInfo": { "fqn": "aws-cdk-lib.aws_lambda.Function", - "version": "2.150.0" + "version": "2.154.1" } }, "tasks3stp-test": { @@ -645,7 +645,7 @@ "path": "s3stp-pre-existing-bucket/tasks3stp-test", "constructInfo": { "fqn": "aws-cdk-lib.aws_stepfunctions_tasks.LambdaInvoke", - "version": "2.150.0" + "version": "2.154.1" } }, "test-s3-stepfunctions-pre-existing-bucket-construct": { @@ -691,13 +691,13 @@ }, "constructInfo": { "fqn": "aws-cdk-lib.aws_logs.CfnLogGroup", - "version": "2.150.0" + "version": "2.154.1" } } }, "constructInfo": { "fqn": "aws-cdk-lib.aws_logs.LogGroup", - "version": "2.150.0" + "version": "2.154.1" } }, "StateMachine": { @@ -713,7 +713,7 @@ "path": "s3stp-pre-existing-bucket/test-s3-stepfunctions-pre-existing-bucket-construct/test-s3-stepfunctions-pre-existing-bucket-construct-event-rule-step-function-construct/StateMachine/Role/ImportRole", "constructInfo": { "fqn": "aws-cdk-lib.Resource", - "version": "2.150.0" + "version": "2.154.1" } }, "Resource": { @@ -738,7 +738,7 @@ }, "constructInfo": { "fqn": "aws-cdk-lib.aws_iam.CfnRole", - "version": "2.150.0" + "version": "2.154.1" } }, "DefaultPolicy": { @@ -806,19 +806,19 @@ }, "constructInfo": { "fqn": "aws-cdk-lib.aws_iam.CfnPolicy", - "version": "2.150.0" + "version": "2.154.1" } } }, "constructInfo": { "fqn": "aws-cdk-lib.aws_iam.Policy", - "version": "2.150.0" + "version": "2.154.1" } } }, "constructInfo": { "fqn": "aws-cdk-lib.aws_iam.Role", - "version": "2.150.0" + "version": "2.154.1" } }, "Resource": { @@ -871,13 +871,13 @@ }, "constructInfo": { "fqn": "aws-cdk-lib.aws_stepfunctions.CfnStateMachine", - "version": "2.150.0" + "version": "2.154.1" } } }, "constructInfo": { "fqn": "aws-cdk-lib.aws_stepfunctions.StateMachine", - "version": "2.150.0" + "version": "2.154.1" } }, "EventsRuleRole": { @@ -889,7 +889,7 @@ "path": "s3stp-pre-existing-bucket/test-s3-stepfunctions-pre-existing-bucket-construct/test-s3-stepfunctions-pre-existing-bucket-construct-event-rule-step-function-construct/EventsRuleRole/ImportEventsRuleRole", "constructInfo": { "fqn": "aws-cdk-lib.Resource", - "version": "2.150.0" + "version": "2.154.1" } }, "Resource": { @@ -914,7 +914,7 @@ }, "constructInfo": { "fqn": "aws-cdk-lib.aws_iam.CfnRole", - "version": "2.150.0" + "version": "2.154.1" } }, "DefaultPolicy": { @@ -949,19 +949,19 @@ }, "constructInfo": { "fqn": "aws-cdk-lib.aws_iam.CfnPolicy", - "version": "2.150.0" + "version": "2.154.1" } } }, "constructInfo": { "fqn": "aws-cdk-lib.aws_iam.Policy", - "version": "2.150.0" + "version": "2.154.1" } } }, "constructInfo": { "fqn": "aws-cdk-lib.aws_iam.Role", - "version": "2.150.0" + "version": "2.154.1" } }, "EventsRule": { @@ -1010,13 +1010,13 @@ }, "constructInfo": { "fqn": "aws-cdk-lib.aws_events.CfnRule", - "version": "2.150.0" + "version": "2.154.1" } } }, "constructInfo": { "fqn": "aws-cdk-lib.aws_events.Rule", - "version": "2.150.0" + "version": "2.154.1" } }, "ExecutionFailedAlarm": { @@ -1049,13 +1049,13 @@ }, "constructInfo": { "fqn": "aws-cdk-lib.aws_cloudwatch.CfnAlarm", - "version": "2.150.0" + "version": "2.154.1" } } }, "constructInfo": { "fqn": "aws-cdk-lib.aws_cloudwatch.Alarm", - "version": "2.150.0" + "version": "2.154.1" } }, "ExecutionThrottledAlarm": { @@ -1088,13 +1088,13 @@ }, "constructInfo": { "fqn": "aws-cdk-lib.aws_cloudwatch.CfnAlarm", - "version": "2.150.0" + "version": "2.154.1" } } }, "constructInfo": { "fqn": "aws-cdk-lib.aws_cloudwatch.Alarm", - "version": "2.150.0" + "version": "2.154.1" } }, "ExecutionAbortedAlarm": { @@ -1127,25 +1127,25 @@ }, "constructInfo": { "fqn": "aws-cdk-lib.aws_cloudwatch.CfnAlarm", - "version": "2.150.0" + "version": "2.154.1" } } }, "constructInfo": { "fqn": "aws-cdk-lib.aws_cloudwatch.Alarm", - "version": "2.150.0" + "version": "2.154.1" } } }, "constructInfo": { "fqn": "@aws-solutions-constructs/aws-eventbridge-stepfunctions.EventbridgeToStepfunctions", - "version": "2.63.0" + "version": "2.67.1" } } }, "constructInfo": { "fqn": "@aws-solutions-constructs/aws-s3-stepfunctions.S3ToStepfunctions", - "version": "2.63.0" + "version": "2.67.1" } }, "Integ": { @@ -1173,7 +1173,7 @@ "path": "s3stp-pre-existing-bucket/Integ/DefaultTest/DeployAssert/BootstrapVersion", "constructInfo": { "fqn": "aws-cdk-lib.CfnParameter", - "version": "2.150.0" + "version": "2.154.1" } }, "CheckBootstrapVersion": { @@ -1181,25 +1181,25 @@ "path": "s3stp-pre-existing-bucket/Integ/DefaultTest/DeployAssert/CheckBootstrapVersion", "constructInfo": { "fqn": "aws-cdk-lib.CfnRule", - "version": "2.150.0" + "version": "2.154.1" } } }, "constructInfo": { "fqn": "aws-cdk-lib.Stack", - "version": "2.150.0" + "version": "2.154.1" } } }, "constructInfo": { "fqn": "@aws-cdk/integ-tests-alpha.IntegTestCase", - "version": "2.150.0-alpha.0" + "version": "2.154.1-alpha.0" } } }, "constructInfo": { "fqn": "@aws-cdk/integ-tests-alpha.IntegTest", - "version": "2.150.0-alpha.0" + "version": "2.154.1-alpha.0" } }, "BootstrapVersion": { @@ -1207,7 +1207,7 @@ "path": "s3stp-pre-existing-bucket/BootstrapVersion", "constructInfo": { "fqn": "aws-cdk-lib.CfnParameter", - "version": "2.150.0" + "version": "2.154.1" } }, "CheckBootstrapVersion": { @@ -1215,13 +1215,13 @@ "path": "s3stp-pre-existing-bucket/CheckBootstrapVersion", "constructInfo": { "fqn": "aws-cdk-lib.CfnRule", - "version": "2.150.0" + "version": "2.154.1" } } }, "constructInfo": { "fqn": "aws-cdk-lib.Stack", - "version": "2.150.0" + "version": "2.154.1" } }, "Tree": { @@ -1235,7 +1235,7 @@ }, "constructInfo": { "fqn": "aws-cdk-lib.App", - "version": "2.150.0" + "version": "2.154.1" } } } \ No newline at end of file diff --git a/source/patterns/@aws-solutions-constructs/aws-s3-stepfunctions/test/integ.s3stp-s3-stepfunctions-no-argument.js.snapshot/cdk.out b/source/patterns/@aws-solutions-constructs/aws-s3-stepfunctions/test/integ.s3stp-s3-stepfunctions-no-argument.js.snapshot/cdk.out index 1f0068d32..0d15a78da 100644 --- a/source/patterns/@aws-solutions-constructs/aws-s3-stepfunctions/test/integ.s3stp-s3-stepfunctions-no-argument.js.snapshot/cdk.out +++ b/source/patterns/@aws-solutions-constructs/aws-s3-stepfunctions/test/integ.s3stp-s3-stepfunctions-no-argument.js.snapshot/cdk.out @@ -1 +1 @@ -{"version":"36.0.0"} \ No newline at end of file +{"version":"36.0.18"} \ No newline at end of file diff --git a/source/patterns/@aws-solutions-constructs/aws-s3-stepfunctions/test/integ.s3stp-s3-stepfunctions-no-argument.js.snapshot/integ.json b/source/patterns/@aws-solutions-constructs/aws-s3-stepfunctions/test/integ.s3stp-s3-stepfunctions-no-argument.js.snapshot/integ.json index 2d721fbd1..bf87834d6 100644 --- a/source/patterns/@aws-solutions-constructs/aws-s3-stepfunctions/test/integ.s3stp-s3-stepfunctions-no-argument.js.snapshot/integ.json +++ b/source/patterns/@aws-solutions-constructs/aws-s3-stepfunctions/test/integ.s3stp-s3-stepfunctions-no-argument.js.snapshot/integ.json @@ -1,5 +1,5 @@ { - "version": "36.0.0", + "version": "36.0.18", "testCases": { "s3stp-s3-stepfunctions-no-argument/Integ/DefaultTest": { "stacks": [ diff --git a/source/patterns/@aws-solutions-constructs/aws-s3-stepfunctions/test/integ.s3stp-s3-stepfunctions-no-argument.js.snapshot/manifest.json b/source/patterns/@aws-solutions-constructs/aws-s3-stepfunctions/test/integ.s3stp-s3-stepfunctions-no-argument.js.snapshot/manifest.json index 11e08cce4..a67dc31f3 100644 --- a/source/patterns/@aws-solutions-constructs/aws-s3-stepfunctions/test/integ.s3stp-s3-stepfunctions-no-argument.js.snapshot/manifest.json +++ b/source/patterns/@aws-solutions-constructs/aws-s3-stepfunctions/test/integ.s3stp-s3-stepfunctions-no-argument.js.snapshot/manifest.json @@ -1,5 +1,5 @@ { - "version": "36.0.0", + "version": "36.0.5", "artifacts": { "s3stps3stepfunctionsnoargumentIntegDefaultTestDeployAssertB7C63989.assets": { "type": "cdk:asset-manifest", @@ -66,7 +66,7 @@ "validateOnSynth": false, "assumeRoleArn": "arn:${AWS::Partition}:iam::${AWS::AccountId}:role/cdk-hnb659fds-deploy-role-${AWS::AccountId}-${AWS::Region}", "cloudFormationExecutionRoleArn": "arn:${AWS::Partition}:iam::${AWS::AccountId}:role/cdk-hnb659fds-cfn-exec-role-${AWS::AccountId}-${AWS::Region}", - "stackTemplateAssetObjectUrl": "s3://cdk-hnb659fds-assets-${AWS::AccountId}-${AWS::Region}/428e5a974b09edff0f411a390d84ee53a298e3d6a88f18647d99a3c6bfe4d199.json", + "stackTemplateAssetObjectUrl": "s3://cdk-hnb659fds-assets-${AWS::AccountId}-${AWS::Region}/7e469a4f8951d0ed47ff7285591386a122ad7f89d58781aa927a2e143a465f87.json", "requiresBootstrapStackVersion": 6, "bootstrapStackVersionSsmParameter": "/cdk-bootstrap/hnb659fds/version", "additionalDependencies": [ @@ -202,6 +202,12 @@ "data": "LatestNodeRuntimeMap" } ], + "/s3stp-s3-stepfunctions-no-argument/Custom::S3AutoDeleteObjectsCustomResourceProvider": [ + { + "type": "aws:cdk:is-custom-resource-handler-customResourceProvider", + "data": true + } + ], "/s3stp-s3-stepfunctions-no-argument/Custom::S3AutoDeleteObjectsCustomResourceProvider/Role": [ { "type": "aws:cdk:logicalId", diff --git a/source/patterns/@aws-solutions-constructs/aws-s3-stepfunctions/test/integ.s3stp-s3-stepfunctions-no-argument.js.snapshot/s3stp-s3-stepfunctions-no-argument.assets.json b/source/patterns/@aws-solutions-constructs/aws-s3-stepfunctions/test/integ.s3stp-s3-stepfunctions-no-argument.js.snapshot/s3stp-s3-stepfunctions-no-argument.assets.json index 74ace7b3b..4ff20192b 100644 --- a/source/patterns/@aws-solutions-constructs/aws-s3-stepfunctions/test/integ.s3stp-s3-stepfunctions-no-argument.js.snapshot/s3stp-s3-stepfunctions-no-argument.assets.json +++ b/source/patterns/@aws-solutions-constructs/aws-s3-stepfunctions/test/integ.s3stp-s3-stepfunctions-no-argument.js.snapshot/s3stp-s3-stepfunctions-no-argument.assets.json @@ -1,5 +1,5 @@ { - "version": "36.0.0", + "version": "36.0.18", "files": { "faa95a81ae7d7373f3e1f242268f904eb748d8d0fdd306e8a6fe515a1905a7d6": { "source": { @@ -14,7 +14,7 @@ } } }, - "428e5a974b09edff0f411a390d84ee53a298e3d6a88f18647d99a3c6bfe4d199": { + "7e469a4f8951d0ed47ff7285591386a122ad7f89d58781aa927a2e143a465f87": { "source": { "path": "s3stp-s3-stepfunctions-no-argument.template.json", "packaging": "file" @@ -22,7 +22,7 @@ "destinations": { "current_account-current_region": { "bucketName": "cdk-hnb659fds-assets-${AWS::AccountId}-${AWS::Region}", - "objectKey": "428e5a974b09edff0f411a390d84ee53a298e3d6a88f18647d99a3c6bfe4d199.json", + "objectKey": "7e469a4f8951d0ed47ff7285591386a122ad7f89d58781aa927a2e143a465f87.json", "assumeRoleArn": "arn:${AWS::Partition}:iam::${AWS::AccountId}:role/cdk-hnb659fds-file-publishing-role-${AWS::AccountId}-${AWS::Region}" } } diff --git a/source/patterns/@aws-solutions-constructs/aws-s3-stepfunctions/test/integ.s3stp-s3-stepfunctions-no-argument.js.snapshot/s3stp-s3-stepfunctions-no-argument.template.json b/source/patterns/@aws-solutions-constructs/aws-s3-stepfunctions/test/integ.s3stp-s3-stepfunctions-no-argument.js.snapshot/s3stp-s3-stepfunctions-no-argument.template.json index a25d621a5..72e1d4742 100644 --- a/source/patterns/@aws-solutions-constructs/aws-s3-stepfunctions/test/integ.s3stp-s3-stepfunctions-no-argument.js.snapshot/s3stp-s3-stepfunctions-no-argument.template.json +++ b/source/patterns/@aws-solutions-constructs/aws-s3-stepfunctions/test/integ.s3stp-s3-stepfunctions-no-argument.js.snapshot/s3stp-s3-stepfunctions-no-argument.template.json @@ -429,7 +429,8 @@ "NotificationConfiguration": { "EventBridgeConfiguration": {} }, - "Managed": true + "Managed": true, + "SkipDestinationValidation": false }, "DependsOn": [ "tests3stepfunctionsconstructS3BucketPolicyC7A413B9" @@ -914,7 +915,7 @@ "Properties": { "Description": "AWS CloudFormation handler for \"Custom::S3BucketNotifications\" resources (@aws-cdk/aws-s3)", "Code": { - "ZipFile": "import boto3 # type: ignore\nimport json\nimport logging\nimport urllib.request\n\ns3 = boto3.client(\"s3\")\n\nEVENTBRIDGE_CONFIGURATION = 'EventBridgeConfiguration'\nCONFIGURATION_TYPES = [\"TopicConfigurations\", \"QueueConfigurations\", \"LambdaFunctionConfigurations\"]\n\ndef handler(event: dict, context):\n response_status = \"SUCCESS\"\n error_message = \"\"\n try:\n props = event[\"ResourceProperties\"]\n notification_configuration = props[\"NotificationConfiguration\"]\n managed = props.get('Managed', 'true').lower() == 'true'\n stack_id = event['StackId']\n old = event.get(\"OldResourceProperties\", {}).get(\"NotificationConfiguration\", {})\n if managed:\n config = handle_managed(event[\"RequestType\"], notification_configuration)\n else:\n config = handle_unmanaged(props[\"BucketName\"], stack_id, event[\"RequestType\"], notification_configuration, old)\n s3.put_bucket_notification_configuration(Bucket=props[\"BucketName\"], NotificationConfiguration=config)\n except Exception as e:\n logging.exception(\"Failed to put bucket notification configuration\")\n response_status = \"FAILED\"\n error_message = f\"Error: {str(e)}. \"\n finally:\n submit_response(event, context, response_status, error_message)\n\ndef handle_managed(request_type, notification_configuration):\n if request_type == 'Delete':\n return {}\n return notification_configuration\n\ndef handle_unmanaged(bucket, stack_id, request_type, notification_configuration, old):\n def get_id(n):\n n['Id'] = ''\n strToHash=json.dumps(n, sort_keys=True).replace('\"Name\": \"prefix\"', '\"Name\": \"Prefix\"').replace('\"Name\": \"suffix\"', '\"Name\": \"Suffix\"')\n return f\"{stack_id}-{hash(strToHash)}\"\n def with_id(n):\n n['Id'] = get_id(n)\n return n\n\n external_notifications = {}\n existing_notifications = s3.get_bucket_notification_configuration(Bucket=bucket)\n for t in CONFIGURATION_TYPES:\n if request_type == 'Update':\n old_incoming_ids = [get_id(n) for n in old.get(t, [])]\n external_notifications[t] = [n for n in existing_notifications.get(t, []) if not get_id(n) in old_incoming_ids] \n elif request_type == 'Delete':\n external_notifications[t] = [n for n in existing_notifications.get(t, []) if not n['Id'].startswith(f\"{stack_id}-\")]\n elif request_type == 'Create':\n external_notifications[t] = [n for n in existing_notifications.get(t, [])]\n if EVENTBRIDGE_CONFIGURATION in existing_notifications:\n external_notifications[EVENTBRIDGE_CONFIGURATION] = existing_notifications[EVENTBRIDGE_CONFIGURATION]\n\n if request_type == 'Delete':\n return external_notifications\n\n notifications = {}\n for t in CONFIGURATION_TYPES:\n external = external_notifications.get(t, [])\n incoming = [with_id(n) for n in notification_configuration.get(t, [])]\n notifications[t] = external + incoming\n\n if EVENTBRIDGE_CONFIGURATION in notification_configuration:\n notifications[EVENTBRIDGE_CONFIGURATION] = notification_configuration[EVENTBRIDGE_CONFIGURATION]\n elif EVENTBRIDGE_CONFIGURATION in external_notifications:\n notifications[EVENTBRIDGE_CONFIGURATION] = external_notifications[EVENTBRIDGE_CONFIGURATION]\n\n return notifications\n\ndef submit_response(event: dict, context, response_status: str, error_message: str):\n response_body = json.dumps(\n {\n \"Status\": response_status,\n \"Reason\": f\"{error_message}See the details in CloudWatch Log Stream: {context.log_stream_name}\",\n \"PhysicalResourceId\": event.get(\"PhysicalResourceId\") or event[\"LogicalResourceId\"],\n \"StackId\": event[\"StackId\"],\n \"RequestId\": event[\"RequestId\"],\n \"LogicalResourceId\": event[\"LogicalResourceId\"],\n \"NoEcho\": False,\n }\n ).encode(\"utf-8\")\n headers = {\"content-type\": \"\", \"content-length\": str(len(response_body))}\n try:\n req = urllib.request.Request(url=event[\"ResponseURL\"], headers=headers, data=response_body, method=\"PUT\")\n with urllib.request.urlopen(req) as response:\n print(response.read().decode(\"utf-8\"))\n print(\"Status code: \" + response.reason)\n except Exception as e:\n print(\"send(..) failed executing request.urlopen(..): \" + str(e))" + "ZipFile": "import boto3 # type: ignore\nimport json\nimport logging\nimport urllib.request\n\ns3 = boto3.client(\"s3\")\n\nEVENTBRIDGE_CONFIGURATION = 'EventBridgeConfiguration'\nCONFIGURATION_TYPES = [\"TopicConfigurations\", \"QueueConfigurations\", \"LambdaFunctionConfigurations\"]\n\ndef handler(event: dict, context):\n response_status = \"SUCCESS\"\n error_message = \"\"\n try:\n props = event[\"ResourceProperties\"]\n notification_configuration = props[\"NotificationConfiguration\"]\n managed = props.get('Managed', 'true').lower() == 'true'\n skipDestinationValidation = props.get('SkipDestinationValidation', 'false').lower() == 'true'\n stack_id = event['StackId']\n old = event.get(\"OldResourceProperties\", {}).get(\"NotificationConfiguration\", {})\n if managed:\n config = handle_managed(event[\"RequestType\"], notification_configuration)\n else:\n config = handle_unmanaged(props[\"BucketName\"], stack_id, event[\"RequestType\"], notification_configuration, old)\n s3.put_bucket_notification_configuration(Bucket=props[\"BucketName\"], NotificationConfiguration=config, SkipDestinationValidation=skipDestinationValidation)\n except Exception as e:\n logging.exception(\"Failed to put bucket notification configuration\")\n response_status = \"FAILED\"\n error_message = f\"Error: {str(e)}. \"\n finally:\n submit_response(event, context, response_status, error_message)\n\ndef handle_managed(request_type, notification_configuration):\n if request_type == 'Delete':\n return {}\n return notification_configuration\n\ndef handle_unmanaged(bucket, stack_id, request_type, notification_configuration, old):\n def get_id(n):\n n['Id'] = ''\n strToHash=json.dumps(n, sort_keys=True).replace('\"Name\": \"prefix\"', '\"Name\": \"Prefix\"').replace('\"Name\": \"suffix\"', '\"Name\": \"Suffix\"')\n return f\"{stack_id}-{hash(strToHash)}\"\n def with_id(n):\n n['Id'] = get_id(n)\n return n\n\n external_notifications = {}\n existing_notifications = s3.get_bucket_notification_configuration(Bucket=bucket)\n for t in CONFIGURATION_TYPES:\n if request_type == 'Update':\n old_incoming_ids = [get_id(n) for n in old.get(t, [])]\n external_notifications[t] = [n for n in existing_notifications.get(t, []) if not get_id(n) in old_incoming_ids] \n elif request_type == 'Delete':\n external_notifications[t] = [n for n in existing_notifications.get(t, []) if not n['Id'].startswith(f\"{stack_id}-\")]\n elif request_type == 'Create':\n external_notifications[t] = [n for n in existing_notifications.get(t, [])]\n if EVENTBRIDGE_CONFIGURATION in existing_notifications:\n external_notifications[EVENTBRIDGE_CONFIGURATION] = existing_notifications[EVENTBRIDGE_CONFIGURATION]\n\n if request_type == 'Delete':\n return external_notifications\n\n notifications = {}\n for t in CONFIGURATION_TYPES:\n external = external_notifications.get(t, [])\n incoming = [with_id(n) for n in notification_configuration.get(t, [])]\n notifications[t] = external + incoming\n\n if EVENTBRIDGE_CONFIGURATION in notification_configuration:\n notifications[EVENTBRIDGE_CONFIGURATION] = notification_configuration[EVENTBRIDGE_CONFIGURATION]\n elif EVENTBRIDGE_CONFIGURATION in external_notifications:\n notifications[EVENTBRIDGE_CONFIGURATION] = external_notifications[EVENTBRIDGE_CONFIGURATION]\n\n return notifications\n\ndef submit_response(event: dict, context, response_status: str, error_message: str):\n response_body = json.dumps(\n {\n \"Status\": response_status,\n \"Reason\": f\"{error_message}See the details in CloudWatch Log Stream: {context.log_stream_name}\",\n \"PhysicalResourceId\": event.get(\"PhysicalResourceId\") or event[\"LogicalResourceId\"],\n \"StackId\": event[\"StackId\"],\n \"RequestId\": event[\"RequestId\"],\n \"LogicalResourceId\": event[\"LogicalResourceId\"],\n \"NoEcho\": False,\n }\n ).encode(\"utf-8\")\n headers = {\"content-type\": \"\", \"content-length\": str(len(response_body))}\n try:\n req = urllib.request.Request(url=event[\"ResponseURL\"], headers=headers, data=response_body, method=\"PUT\")\n with urllib.request.urlopen(req) as response:\n print(response.read().decode(\"utf-8\"))\n print(\"Status code: \" + response.reason)\n except Exception as e:\n print(\"send(..) failed executing request.urlopen(..): \" + str(e))" }, "Handler": "index.handler", "Role": { diff --git a/source/patterns/@aws-solutions-constructs/aws-s3-stepfunctions/test/integ.s3stp-s3-stepfunctions-no-argument.js.snapshot/s3stps3stepfunctionsnoargumentIntegDefaultTestDeployAssertB7C63989.assets.json b/source/patterns/@aws-solutions-constructs/aws-s3-stepfunctions/test/integ.s3stp-s3-stepfunctions-no-argument.js.snapshot/s3stps3stepfunctionsnoargumentIntegDefaultTestDeployAssertB7C63989.assets.json index fcb8e9e28..28b80ea28 100644 --- a/source/patterns/@aws-solutions-constructs/aws-s3-stepfunctions/test/integ.s3stp-s3-stepfunctions-no-argument.js.snapshot/s3stps3stepfunctionsnoargumentIntegDefaultTestDeployAssertB7C63989.assets.json +++ b/source/patterns/@aws-solutions-constructs/aws-s3-stepfunctions/test/integ.s3stp-s3-stepfunctions-no-argument.js.snapshot/s3stps3stepfunctionsnoargumentIntegDefaultTestDeployAssertB7C63989.assets.json @@ -1,5 +1,5 @@ { - "version": "36.0.0", + "version": "36.0.18", "files": { "21fbb51d7b23f6a6c262b46a9caee79d744a3ac019fd45422d988b96d44b2a22": { "source": { diff --git a/source/patterns/@aws-solutions-constructs/aws-s3-stepfunctions/test/integ.s3stp-s3-stepfunctions-no-argument.js.snapshot/tree.json b/source/patterns/@aws-solutions-constructs/aws-s3-stepfunctions/test/integ.s3stp-s3-stepfunctions-no-argument.js.snapshot/tree.json index 8e41e3d24..9c7f0d146 100644 --- a/source/patterns/@aws-solutions-constructs/aws-s3-stepfunctions/test/integ.s3stp-s3-stepfunctions-no-argument.js.snapshot/tree.json +++ b/source/patterns/@aws-solutions-constructs/aws-s3-stepfunctions/test/integ.s3stp-s3-stepfunctions-no-argument.js.snapshot/tree.json @@ -21,7 +21,7 @@ "path": "s3stp-s3-stepfunctions-no-argument/lambdas3stp-test/ServiceRole/ImportServiceRole", "constructInfo": { "fqn": "aws-cdk-lib.Resource", - "version": "2.150.0" + "version": "2.154.1" } }, "Resource": { @@ -60,13 +60,13 @@ }, "constructInfo": { "fqn": "aws-cdk-lib.aws_iam.CfnRole", - "version": "2.150.0" + "version": "2.154.1" } } }, "constructInfo": { "fqn": "aws-cdk-lib.aws_iam.Role", - "version": "2.150.0" + "version": "2.154.1" } }, "Resource": { @@ -90,13 +90,13 @@ }, "constructInfo": { "fqn": "aws-cdk-lib.aws_lambda.CfnFunction", - "version": "2.150.0" + "version": "2.154.1" } } }, "constructInfo": { "fqn": "aws-cdk-lib.aws_lambda.Function", - "version": "2.150.0" + "version": "2.154.1" } }, "tasks3stp-test": { @@ -104,7 +104,7 @@ "path": "s3stp-s3-stepfunctions-no-argument/tasks3stp-test", "constructInfo": { "fqn": "aws-cdk-lib.aws_stepfunctions_tasks.LambdaInvoke", - "version": "2.150.0" + "version": "2.154.1" } }, "test-s3-stepfunctions-construct": { @@ -149,7 +149,7 @@ }, "constructInfo": { "fqn": "aws-cdk-lib.aws_s3.CfnBucket", - "version": "2.150.0" + "version": "2.154.1" } }, "Policy": { @@ -283,13 +283,13 @@ }, "constructInfo": { "fqn": "aws-cdk-lib.aws_s3.CfnBucketPolicy", - "version": "2.150.0" + "version": "2.154.1" } } }, "constructInfo": { "fqn": "aws-cdk-lib.aws_s3.BucketPolicy", - "version": "2.150.0" + "version": "2.154.1" } }, "AutoDeleteObjectsCustomResource": { @@ -301,19 +301,19 @@ "path": "s3stp-s3-stepfunctions-no-argument/test-s3-stepfunctions-construct/S3LoggingBucket/AutoDeleteObjectsCustomResource/Default", "constructInfo": { "fqn": "aws-cdk-lib.CfnResource", - "version": "2.150.0" + "version": "2.154.1" } } }, "constructInfo": { "fqn": "aws-cdk-lib.CustomResource", - "version": "2.150.0" + "version": "2.154.1" } } }, "constructInfo": { "fqn": "aws-cdk-lib.aws_s3.Bucket", - "version": "2.150.0" + "version": "2.154.1" } }, "S3Bucket": { @@ -372,7 +372,7 @@ }, "constructInfo": { "fqn": "aws-cdk-lib.aws_s3.CfnBucket", - "version": "2.150.0" + "version": "2.154.1" } }, "Policy": { @@ -470,13 +470,13 @@ }, "constructInfo": { "fqn": "aws-cdk-lib.aws_s3.CfnBucketPolicy", - "version": "2.150.0" + "version": "2.154.1" } } }, "constructInfo": { "fqn": "aws-cdk-lib.aws_s3.BucketPolicy", - "version": "2.150.0" + "version": "2.154.1" } }, "AutoDeleteObjectsCustomResource": { @@ -488,13 +488,13 @@ "path": "s3stp-s3-stepfunctions-no-argument/test-s3-stepfunctions-construct/S3Bucket/AutoDeleteObjectsCustomResource/Default", "constructInfo": { "fqn": "aws-cdk-lib.CfnResource", - "version": "2.150.0" + "version": "2.154.1" } } }, "constructInfo": { "fqn": "aws-cdk-lib.CustomResource", - "version": "2.150.0" + "version": "2.154.1" } }, "Notifications": { @@ -506,7 +506,7 @@ "path": "s3stp-s3-stepfunctions-no-argument/test-s3-stepfunctions-construct/S3Bucket/Notifications/Resource", "constructInfo": { "fqn": "aws-cdk-lib.CfnResource", - "version": "2.150.0" + "version": "2.154.1" } } }, @@ -518,7 +518,7 @@ }, "constructInfo": { "fqn": "aws-cdk-lib.aws_s3.Bucket", - "version": "2.150.0" + "version": "2.154.1" } }, "test-s3-stepfunctions-construct-event-rule-step-function-construct": { @@ -560,13 +560,13 @@ }, "constructInfo": { "fqn": "aws-cdk-lib.aws_logs.CfnLogGroup", - "version": "2.150.0" + "version": "2.154.1" } } }, "constructInfo": { "fqn": "aws-cdk-lib.aws_logs.LogGroup", - "version": "2.150.0" + "version": "2.154.1" } }, "StateMachine": { @@ -582,7 +582,7 @@ "path": "s3stp-s3-stepfunctions-no-argument/test-s3-stepfunctions-construct/test-s3-stepfunctions-construct-event-rule-step-function-construct/StateMachine/Role/ImportRole", "constructInfo": { "fqn": "aws-cdk-lib.Resource", - "version": "2.150.0" + "version": "2.154.1" } }, "Resource": { @@ -607,7 +607,7 @@ }, "constructInfo": { "fqn": "aws-cdk-lib.aws_iam.CfnRole", - "version": "2.150.0" + "version": "2.154.1" } }, "DefaultPolicy": { @@ -675,19 +675,19 @@ }, "constructInfo": { "fqn": "aws-cdk-lib.aws_iam.CfnPolicy", - "version": "2.150.0" + "version": "2.154.1" } } }, "constructInfo": { "fqn": "aws-cdk-lib.aws_iam.Policy", - "version": "2.150.0" + "version": "2.154.1" } } }, "constructInfo": { "fqn": "aws-cdk-lib.aws_iam.Role", - "version": "2.150.0" + "version": "2.154.1" } }, "Resource": { @@ -740,13 +740,13 @@ }, "constructInfo": { "fqn": "aws-cdk-lib.aws_stepfunctions.CfnStateMachine", - "version": "2.150.0" + "version": "2.154.1" } } }, "constructInfo": { "fqn": "aws-cdk-lib.aws_stepfunctions.StateMachine", - "version": "2.150.0" + "version": "2.154.1" } }, "EventsRuleRole": { @@ -758,7 +758,7 @@ "path": "s3stp-s3-stepfunctions-no-argument/test-s3-stepfunctions-construct/test-s3-stepfunctions-construct-event-rule-step-function-construct/EventsRuleRole/ImportEventsRuleRole", "constructInfo": { "fqn": "aws-cdk-lib.Resource", - "version": "2.150.0" + "version": "2.154.1" } }, "Resource": { @@ -783,7 +783,7 @@ }, "constructInfo": { "fqn": "aws-cdk-lib.aws_iam.CfnRole", - "version": "2.150.0" + "version": "2.154.1" } }, "DefaultPolicy": { @@ -818,19 +818,19 @@ }, "constructInfo": { "fqn": "aws-cdk-lib.aws_iam.CfnPolicy", - "version": "2.150.0" + "version": "2.154.1" } } }, "constructInfo": { "fqn": "aws-cdk-lib.aws_iam.Policy", - "version": "2.150.0" + "version": "2.154.1" } } }, "constructInfo": { "fqn": "aws-cdk-lib.aws_iam.Role", - "version": "2.150.0" + "version": "2.154.1" } }, "EventsRule": { @@ -879,13 +879,13 @@ }, "constructInfo": { "fqn": "aws-cdk-lib.aws_events.CfnRule", - "version": "2.150.0" + "version": "2.154.1" } } }, "constructInfo": { "fqn": "aws-cdk-lib.aws_events.Rule", - "version": "2.150.0" + "version": "2.154.1" } }, "ExecutionFailedAlarm": { @@ -918,13 +918,13 @@ }, "constructInfo": { "fqn": "aws-cdk-lib.aws_cloudwatch.CfnAlarm", - "version": "2.150.0" + "version": "2.154.1" } } }, "constructInfo": { "fqn": "aws-cdk-lib.aws_cloudwatch.Alarm", - "version": "2.150.0" + "version": "2.154.1" } }, "ExecutionThrottledAlarm": { @@ -957,13 +957,13 @@ }, "constructInfo": { "fqn": "aws-cdk-lib.aws_cloudwatch.CfnAlarm", - "version": "2.150.0" + "version": "2.154.1" } } }, "constructInfo": { "fqn": "aws-cdk-lib.aws_cloudwatch.Alarm", - "version": "2.150.0" + "version": "2.154.1" } }, "ExecutionAbortedAlarm": { @@ -996,25 +996,25 @@ }, "constructInfo": { "fqn": "aws-cdk-lib.aws_cloudwatch.CfnAlarm", - "version": "2.150.0" + "version": "2.154.1" } } }, "constructInfo": { "fqn": "aws-cdk-lib.aws_cloudwatch.Alarm", - "version": "2.150.0" + "version": "2.154.1" } } }, "constructInfo": { "fqn": "@aws-solutions-constructs/aws-eventbridge-stepfunctions.EventbridgeToStepfunctions", - "version": "2.63.0" + "version": "2.67.1" } } }, "constructInfo": { "fqn": "@aws-solutions-constructs/aws-s3-stepfunctions.S3ToStepfunctions", - "version": "2.63.0" + "version": "2.67.1" } }, "LatestNodeRuntimeMap": { @@ -1022,7 +1022,7 @@ "path": "s3stp-s3-stepfunctions-no-argument/LatestNodeRuntimeMap", "constructInfo": { "fqn": "aws-cdk-lib.CfnMapping", - "version": "2.150.0" + "version": "2.154.1" } }, "Custom::S3AutoDeleteObjectsCustomResourceProvider": { @@ -1034,7 +1034,7 @@ "path": "s3stp-s3-stepfunctions-no-argument/Custom::S3AutoDeleteObjectsCustomResourceProvider/Staging", "constructInfo": { "fqn": "aws-cdk-lib.AssetStaging", - "version": "2.150.0" + "version": "2.154.1" } }, "Role": { @@ -1042,7 +1042,7 @@ "path": "s3stp-s3-stepfunctions-no-argument/Custom::S3AutoDeleteObjectsCustomResourceProvider/Role", "constructInfo": { "fqn": "aws-cdk-lib.CfnResource", - "version": "2.150.0" + "version": "2.154.1" } }, "Handler": { @@ -1050,13 +1050,13 @@ "path": "s3stp-s3-stepfunctions-no-argument/Custom::S3AutoDeleteObjectsCustomResourceProvider/Handler", "constructInfo": { "fqn": "aws-cdk-lib.CfnResource", - "version": "2.150.0" + "version": "2.154.1" } } }, "constructInfo": { "fqn": "aws-cdk-lib.CustomResourceProviderBase", - "version": "2.150.0" + "version": "2.154.1" } }, "BucketNotificationsHandler050a0587b7544547bf325f094a3db834": { @@ -1072,7 +1072,7 @@ "path": "s3stp-s3-stepfunctions-no-argument/BucketNotificationsHandler050a0587b7544547bf325f094a3db834/Role/ImportRole", "constructInfo": { "fqn": "aws-cdk-lib.Resource", - "version": "2.150.0" + "version": "2.154.1" } }, "Resource": { @@ -1111,7 +1111,7 @@ }, "constructInfo": { "fqn": "aws-cdk-lib.aws_iam.CfnRole", - "version": "2.150.0" + "version": "2.154.1" } }, "DefaultPolicy": { @@ -1144,19 +1144,19 @@ }, "constructInfo": { "fqn": "aws-cdk-lib.aws_iam.CfnPolicy", - "version": "2.150.0" + "version": "2.154.1" } } }, "constructInfo": { "fqn": "aws-cdk-lib.aws_iam.Policy", - "version": "2.150.0" + "version": "2.154.1" } } }, "constructInfo": { "fqn": "aws-cdk-lib.aws_iam.Role", - "version": "2.150.0" + "version": "2.154.1" } }, "Resource": { @@ -1164,7 +1164,7 @@ "path": "s3stp-s3-stepfunctions-no-argument/BucketNotificationsHandler050a0587b7544547bf325f094a3db834/Resource", "constructInfo": { "fqn": "aws-cdk-lib.CfnResource", - "version": "2.150.0" + "version": "2.154.1" } } }, @@ -1198,7 +1198,7 @@ "path": "s3stp-s3-stepfunctions-no-argument/Integ/DefaultTest/DeployAssert/BootstrapVersion", "constructInfo": { "fqn": "aws-cdk-lib.CfnParameter", - "version": "2.150.0" + "version": "2.154.1" } }, "CheckBootstrapVersion": { @@ -1206,25 +1206,25 @@ "path": "s3stp-s3-stepfunctions-no-argument/Integ/DefaultTest/DeployAssert/CheckBootstrapVersion", "constructInfo": { "fqn": "aws-cdk-lib.CfnRule", - "version": "2.150.0" + "version": "2.154.1" } } }, "constructInfo": { "fqn": "aws-cdk-lib.Stack", - "version": "2.150.0" + "version": "2.154.1" } } }, "constructInfo": { "fqn": "@aws-cdk/integ-tests-alpha.IntegTestCase", - "version": "2.150.0-alpha.0" + "version": "2.154.1-alpha.0" } } }, "constructInfo": { "fqn": "@aws-cdk/integ-tests-alpha.IntegTest", - "version": "2.150.0-alpha.0" + "version": "2.154.1-alpha.0" } }, "BootstrapVersion": { @@ -1232,7 +1232,7 @@ "path": "s3stp-s3-stepfunctions-no-argument/BootstrapVersion", "constructInfo": { "fqn": "aws-cdk-lib.CfnParameter", - "version": "2.150.0" + "version": "2.154.1" } }, "CheckBootstrapVersion": { @@ -1240,13 +1240,13 @@ "path": "s3stp-s3-stepfunctions-no-argument/CheckBootstrapVersion", "constructInfo": { "fqn": "aws-cdk-lib.CfnRule", - "version": "2.150.0" + "version": "2.154.1" } } }, "constructInfo": { "fqn": "aws-cdk-lib.Stack", - "version": "2.150.0" + "version": "2.154.1" } }, "Tree": { @@ -1260,7 +1260,7 @@ }, "constructInfo": { "fqn": "aws-cdk-lib.App", - "version": "2.150.0" + "version": "2.154.1" } } } \ No newline at end of file diff --git a/source/patterns/@aws-solutions-constructs/aws-sns-lambda/package.json b/source/patterns/@aws-solutions-constructs/aws-sns-lambda/package.json index 8b82a97ab..7dbb42ad1 100644 --- a/source/patterns/@aws-solutions-constructs/aws-sns-lambda/package.json +++ b/source/patterns/@aws-solutions-constructs/aws-sns-lambda/package.json @@ -80,7 +80,7 @@ "peerDependencies": { "@aws-solutions-constructs/core": "0.0.0", "constructs": "^10.0.0", - "aws-cdk-lib": "0.0.0" + "aws-cdk-lib": "^0.0.0" }, "keywords": [ "aws", diff --git a/source/patterns/@aws-solutions-constructs/aws-sns-sqs/package.json b/source/patterns/@aws-solutions-constructs/aws-sns-sqs/package.json index 5b086732c..652e6f340 100644 --- a/source/patterns/@aws-solutions-constructs/aws-sns-sqs/package.json +++ b/source/patterns/@aws-solutions-constructs/aws-sns-sqs/package.json @@ -80,7 +80,7 @@ "peerDependencies": { "@aws-solutions-constructs/core": "0.0.0", "constructs": "^10.0.0", - "aws-cdk-lib": "0.0.0" + "aws-cdk-lib": "^0.0.0" }, "keywords": [ "aws", diff --git a/source/patterns/@aws-solutions-constructs/aws-sqs-lambda/package.json b/source/patterns/@aws-solutions-constructs/aws-sqs-lambda/package.json index 4b6de2331..fa97dd4d6 100644 --- a/source/patterns/@aws-solutions-constructs/aws-sqs-lambda/package.json +++ b/source/patterns/@aws-solutions-constructs/aws-sqs-lambda/package.json @@ -80,7 +80,7 @@ "peerDependencies": { "@aws-solutions-constructs/core": "0.0.0", "constructs": "^10.0.0", - "aws-cdk-lib": "0.0.0" + "aws-cdk-lib": "^0.0.0" }, "keywords": [ "aws", diff --git a/source/patterns/@aws-solutions-constructs/aws-wafwebacl-alb/package.json b/source/patterns/@aws-solutions-constructs/aws-wafwebacl-alb/package.json index ceb7f1c39..884db5760 100644 --- a/source/patterns/@aws-solutions-constructs/aws-wafwebacl-alb/package.json +++ b/source/patterns/@aws-solutions-constructs/aws-wafwebacl-alb/package.json @@ -82,7 +82,7 @@ "@aws-solutions-constructs/core": "0.0.0", "@aws-solutions-constructs/aws-route53-alb": "0.0.0", "constructs": "^10.0.0", - "aws-cdk-lib": "0.0.0" + "aws-cdk-lib": "^0.0.0" }, "keywords": [ "aws", diff --git a/source/patterns/@aws-solutions-constructs/aws-wafwebacl-apigateway/package.json b/source/patterns/@aws-solutions-constructs/aws-wafwebacl-apigateway/package.json index 6527c0018..d58901fa2 100644 --- a/source/patterns/@aws-solutions-constructs/aws-wafwebacl-apigateway/package.json +++ b/source/patterns/@aws-solutions-constructs/aws-wafwebacl-apigateway/package.json @@ -80,7 +80,7 @@ "peerDependencies": { "@aws-solutions-constructs/core": "0.0.0", "constructs": "^10.0.0", - "aws-cdk-lib": "0.0.0" + "aws-cdk-lib": "^0.0.0" }, "keywords": [ "aws", diff --git a/source/patterns/@aws-solutions-constructs/aws-wafwebacl-appsync/package.json b/source/patterns/@aws-solutions-constructs/aws-wafwebacl-appsync/package.json index b55fe53ab..50d0c7b09 100644 --- a/source/patterns/@aws-solutions-constructs/aws-wafwebacl-appsync/package.json +++ b/source/patterns/@aws-solutions-constructs/aws-wafwebacl-appsync/package.json @@ -79,7 +79,7 @@ }, "peerDependencies": { "@aws-solutions-constructs/core": "0.0.0", - "aws-cdk-lib": "0.0.0", + "aws-cdk-lib": "^0.0.0", "constructs": "^10.0.0" }, "keywords": [ diff --git a/source/patterns/@aws-solutions-constructs/aws-wafwebacl-cloudfront/package.json b/source/patterns/@aws-solutions-constructs/aws-wafwebacl-cloudfront/package.json index 1ae9a62cb..9da86db55 100644 --- a/source/patterns/@aws-solutions-constructs/aws-wafwebacl-cloudfront/package.json +++ b/source/patterns/@aws-solutions-constructs/aws-wafwebacl-cloudfront/package.json @@ -80,7 +80,7 @@ "peerDependencies": { "@aws-solutions-constructs/core": "0.0.0", "constructs": "^10.0.0", - "aws-cdk-lib": "0.0.0" + "aws-cdk-lib": "^0.0.0" }, "keywords": [ "aws", diff --git a/source/patterns/@aws-solutions-constructs/core/package.json b/source/patterns/@aws-solutions-constructs/core/package.json index a2b8afbcf..a02ed96cb 100644 --- a/source/patterns/@aws-solutions-constructs/core/package.json +++ b/source/patterns/@aws-solutions-constructs/core/package.json @@ -88,6 +88,6 @@ ], "peerDependencies": { "constructs": "^10.0.0", - "aws-cdk-lib": "0.0.0" + "aws-cdk-lib": "^0.0.0" } } \ No newline at end of file diff --git a/source/patterns/@aws-solutions-constructs/resources/package.json b/source/patterns/@aws-solutions-constructs/resources/package.json index 0041def74..8364cd845 100644 --- a/source/patterns/@aws-solutions-constructs/resources/package.json +++ b/source/patterns/@aws-solutions-constructs/resources/package.json @@ -87,6 +87,6 @@ "peerDependencies": { "@aws-solutions-constructs/core": "0.0.0", "constructs": "^10.0.0", - "aws-cdk-lib": "0.0.0" + "aws-cdk-lib": "^0.0.0" } } \ No newline at end of file