From bbf1ad4f9f287afcc080c27e6432b3ff5a7caa70 Mon Sep 17 00:00:00 2001 From: mazyu36 Date: Fri, 19 Jul 2024 03:44:40 +0900 Subject: [PATCH] chore(synthetics): add nodejs puppeteer 8 runtime (#30851) ### Issue # (if applicable) Closes #30850. ### Reason for this change Add new runtime https://docs.aws.amazon.com/AmazonCloudWatch/latest/monitoring/CloudWatch_Synthetics_Library_nodejs_puppeteer.html#CloudWatch_Synthetics_runtimeversion-nodejs-puppeteer-8.0 ### Description of changes Add new runtime ### Description of how you validated changes No test added because just add runtime enum. ### Checklist - [x] My code adheres to the [CONTRIBUTING GUIDE](https://github.com/aws/aws-cdk/blob/main/CONTRIBUTING.md) and [DESIGN GUIDELINES](https://github.com/aws/aws-cdk/blob/main/docs/DESIGN_GUIDELINES.md) ---- *By submitting this pull request, I confirm that my contribution is made under the terms of the Apache-2.0 license* --- ...efaultTestDeployAssert3AD5A094.assets.json | 10 +- ...aultTestDeployAssert3AD5A094.template.json | 215 +++++++- .../index.js | 6 +- .../canary-one.assets.json | 4 +- .../canary-one.template.json | 255 +++++++++ .../integ.canary.js.snapshot/manifest.json | 76 ++- .../test/integ.canary.js.snapshot/tree.json | 493 ++++++++++++++++++ .../test/aws-synthetics/test/integ.canary.ts | 2 + .../aws-cdk-lib/aws-synthetics/lib/runtime.ts | 14 + .../aws-synthetics/test/canary.test.ts | 60 +-- 10 files changed, 1080 insertions(+), 55 deletions(-) rename packages/@aws-cdk-testing/framework-integ/test/aws-synthetics/test/integ.canary.js.snapshot/{asset.eafc02f6925151c95ac6a6ae81a3e36d4cf4e77db52eec8e467ce2a69454a41a.bundle => asset.3cef2cdbb46b3821e641ffb8b9af9731af5f7e4a9e857ab633dbcd9023de724d.bundle}/index.js (99%) diff --git a/packages/@aws-cdk-testing/framework-integ/test/aws-synthetics/test/integ.canary.js.snapshot/IntegCanaryTestDefaultTestDeployAssert3AD5A094.assets.json b/packages/@aws-cdk-testing/framework-integ/test/aws-synthetics/test/integ.canary.js.snapshot/IntegCanaryTestDefaultTestDeployAssert3AD5A094.assets.json index 22d441cf8f50f..0ebd84175d18e 100644 --- a/packages/@aws-cdk-testing/framework-integ/test/aws-synthetics/test/integ.canary.js.snapshot/IntegCanaryTestDefaultTestDeployAssert3AD5A094.assets.json +++ b/packages/@aws-cdk-testing/framework-integ/test/aws-synthetics/test/integ.canary.js.snapshot/IntegCanaryTestDefaultTestDeployAssert3AD5A094.assets.json @@ -1,20 +1,20 @@ { "version": "36.0.0", "files": { - "eafc02f6925151c95ac6a6ae81a3e36d4cf4e77db52eec8e467ce2a69454a41a": { + "3cef2cdbb46b3821e641ffb8b9af9731af5f7e4a9e857ab633dbcd9023de724d": { "source": { - "path": "asset.eafc02f6925151c95ac6a6ae81a3e36d4cf4e77db52eec8e467ce2a69454a41a.bundle", + "path": "asset.3cef2cdbb46b3821e641ffb8b9af9731af5f7e4a9e857ab633dbcd9023de724d.bundle", "packaging": "zip" }, "destinations": { "current_account-current_region": { "bucketName": "cdk-hnb659fds-assets-${AWS::AccountId}-${AWS::Region}", - "objectKey": "eafc02f6925151c95ac6a6ae81a3e36d4cf4e77db52eec8e467ce2a69454a41a.zip", + "objectKey": "3cef2cdbb46b3821e641ffb8b9af9731af5f7e4a9e857ab633dbcd9023de724d.zip", "assumeRoleArn": "arn:${AWS::Partition}:iam::${AWS::AccountId}:role/cdk-hnb659fds-file-publishing-role-${AWS::AccountId}-${AWS::Region}" } } }, - "c604634d500d8e3c2fcc8b1d12a69a0e3728d5bb5e9e3e7118abad1baa677eac": { + "8c0bb05c9b4d0f76f702a52227e1b8ee8733db1a5ec5642188fc88c634a57091": { "source": { "path": "IntegCanaryTestDefaultTestDeployAssert3AD5A094.template.json", "packaging": "file" @@ -22,7 +22,7 @@ "destinations": { "current_account-current_region": { "bucketName": "cdk-hnb659fds-assets-${AWS::AccountId}-${AWS::Region}", - "objectKey": "c604634d500d8e3c2fcc8b1d12a69a0e3728d5bb5e9e3e7118abad1baa677eac.json", + "objectKey": "8c0bb05c9b4d0f76f702a52227e1b8ee8733db1a5ec5642188fc88c634a57091.json", "assumeRoleArn": "arn:${AWS::Partition}:iam::${AWS::AccountId}:role/cdk-hnb659fds-file-publishing-role-${AWS::AccountId}-${AWS::Region}" } } diff --git a/packages/@aws-cdk-testing/framework-integ/test/aws-synthetics/test/integ.canary.js.snapshot/IntegCanaryTestDefaultTestDeployAssert3AD5A094.template.json b/packages/@aws-cdk-testing/framework-integ/test/aws-synthetics/test/integ.canary.js.snapshot/IntegCanaryTestDefaultTestDeployAssert3AD5A094.template.json index f7dc66f3e61dc..d9f0cde1cecfc 100644 --- a/packages/@aws-cdk-testing/framework-integ/test/aws-synthetics/test/integ.canary.js.snapshot/IntegCanaryTestDefaultTestDeployAssert3AD5A094.template.json +++ b/packages/@aws-cdk-testing/framework-integ/test/aws-synthetics/test/integ.canary.js.snapshot/IntegCanaryTestDefaultTestDeployAssert3AD5A094.template.json @@ -34,7 +34,7 @@ "outputPaths": [ "CanaryRuns.0.Status.State" ], - "salt": "1720059390257" + "salt": "1721214952980" }, "UpdateReplacePolicy": "Delete", "DeletionPolicy": "Delete" @@ -335,6 +335,24 @@ "*" ] }, + { + "Action": [ + "states:StartExecution" + ], + "Effect": "Allow", + "Resource": [ + "*" + ] + }, + { + "Action": [ + "synthetics:GetCanaryRuns" + ], + "Effect": "Allow", + "Resource": [ + "*" + ] + }, { "Action": [ "states:StartExecution" @@ -366,7 +384,7 @@ "S3Bucket": { "Fn::Sub": "cdk-hnb659fds-assets-${AWS::AccountId}-${AWS::Region}" }, - "S3Key": "eafc02f6925151c95ac6a6ae81a3e36d4cf4e77db52eec8e467ce2a69454a41a.zip" + "S3Key": "3cef2cdbb46b3821e641ffb8b9af9731af5f7e4a9e857ab633dbcd9023de724d.zip" }, "Timeout": 120, "Handler": "index.handler", @@ -476,6 +494,15 @@ "*" ] }, + { + "Action": [ + "synthetics:GetCanaryRuns" + ], + "Effect": "Allow", + "Resource": [ + "*" + ] + }, { "Action": [ "synthetics:GetCanaryRuns" @@ -507,7 +534,7 @@ "S3Bucket": { "Fn::Sub": "cdk-hnb659fds-assets-${AWS::AccountId}-${AWS::Region}" }, - "S3Key": "eafc02f6925151c95ac6a6ae81a3e36d4cf4e77db52eec8e467ce2a69454a41a.zip" + "S3Key": "3cef2cdbb46b3821e641ffb8b9af9731af5f7e4a9e857ab633dbcd9023de724d.zip" }, "Timeout": 120, "Handler": "index.isComplete", @@ -557,7 +584,7 @@ "S3Bucket": { "Fn::Sub": "cdk-hnb659fds-assets-${AWS::AccountId}-${AWS::Region}" }, - "S3Key": "eafc02f6925151c95ac6a6ae81a3e36d4cf4e77db52eec8e467ce2a69454a41a.zip" + "S3Key": "3cef2cdbb46b3821e641ffb8b9af9731af5f7e4a9e857ab633dbcd9023de724d.zip" }, "Timeout": 120, "Handler": "index.onTimeout", @@ -603,7 +630,7 @@ "outputPaths": [ "CanaryRuns.0.Status.State" ], - "salt": "1720059390258" + "salt": "1721214952981" }, "UpdateReplacePolicy": "Delete", "DeletionPolicy": "Delete" @@ -759,7 +786,7 @@ "outputPaths": [ "CanaryRuns.0.Status.State" ], - "salt": "1720059390259" + "salt": "1721214952981" }, "UpdateReplacePolicy": "Delete", "DeletionPolicy": "Delete" @@ -915,7 +942,7 @@ "outputPaths": [ "CanaryRuns.0.Status.State" ], - "salt": "1720059390259" + "salt": "1721214952982" }, "UpdateReplacePolicy": "Delete", "DeletionPolicy": "Delete" @@ -1071,7 +1098,7 @@ "outputPaths": [ "CanaryRuns.0.Status.State" ], - "salt": "1720059390260" + "salt": "1721214952982" }, "UpdateReplacePolicy": "Delete", "DeletionPolicy": "Delete" @@ -1227,7 +1254,7 @@ "outputPaths": [ "CanaryRuns.0.Status.State" ], - "salt": "1720059390260" + "salt": "1721214952983" }, "UpdateReplacePolicy": "Delete", "DeletionPolicy": "Delete" @@ -1383,7 +1410,7 @@ "outputPaths": [ "CanaryRuns.0.Status.State" ], - "salt": "1720059390260" + "salt": "1721214952983" }, "UpdateReplacePolicy": "Delete", "DeletionPolicy": "Delete" @@ -1505,6 +1532,162 @@ "AwsApiCallSyntheticsgetCanaryRuns7529a951b35a7be38dbb382fdb631be1WaitForRole61C8790D" ] }, + "AwsApiCallSyntheticsgetCanaryRuns4b48cf669b28df275fb8f9ab27c9d17e": { + "Type": "Custom::DeployAssert@SdkCallSyntheticsgetCanaryRuns", + "Properties": { + "ServiceToken": { + "Fn::GetAtt": [ + "SingletonFunction1488541a7b23466481b69b4408076b81HandlerCD40AE9F", + "Arn" + ] + }, + "service": "Synthetics", + "api": "getCanaryRuns", + "expected": "{\"$StringLike\":\"PASSED\"}", + "actualPath": "CanaryRuns.0.Status.State", + "stateMachineArn": { + "Ref": "AwsApiCallSyntheticsgetCanaryRuns4b48cf669b28df275fb8f9ab27c9d17eWaitForFECC3890" + }, + "parameters": { + "Name": { + "Fn::Join": [ + "", + [ + "\"", + { + "Fn::ImportValue": "canary-one:ExportsOutputRefSynNodejsPuppeteer803AA42A6D92351B1A" + }, + "\"" + ] + ] + } + }, + "flattenResponse": "true", + "outputPaths": [ + "CanaryRuns.0.Status.State" + ], + "salt": "1721214952983" + }, + "UpdateReplacePolicy": "Delete", + "DeletionPolicy": "Delete" + }, + "AwsApiCallSyntheticsgetCanaryRuns4b48cf669b28df275fb8f9ab27c9d17eWaitForIsCompleteProviderInvokeA02A5118": { + "Type": "AWS::Lambda::Permission", + "Properties": { + "Action": "lambda:InvokeFunction", + "FunctionName": { + "Fn::GetAtt": [ + "SingletonFunction76b3e830a873425f8453eddd85c86925Handler81461ECE", + "Arn" + ] + }, + "Principal": { + "Fn::GetAtt": [ + "AwsApiCallSyntheticsgetCanaryRuns4b48cf669b28df275fb8f9ab27c9d17eWaitForRoleF9F0C461", + "Arn" + ] + } + } + }, + "AwsApiCallSyntheticsgetCanaryRuns4b48cf669b28df275fb8f9ab27c9d17eWaitForTimeoutProviderInvoke9F40F361": { + "Type": "AWS::Lambda::Permission", + "Properties": { + "Action": "lambda:InvokeFunction", + "FunctionName": { + "Fn::GetAtt": [ + "SingletonFunction5c1898e096fb4e3e95d5f6c67f3ce41aHandlerADF3E6EA", + "Arn" + ] + }, + "Principal": { + "Fn::GetAtt": [ + "AwsApiCallSyntheticsgetCanaryRuns4b48cf669b28df275fb8f9ab27c9d17eWaitForRoleF9F0C461", + "Arn" + ] + } + } + }, + "AwsApiCallSyntheticsgetCanaryRuns4b48cf669b28df275fb8f9ab27c9d17eWaitForRoleF9F0C461": { + "Type": "AWS::IAM::Role", + "Properties": { + "AssumeRolePolicyDocument": { + "Version": "2012-10-17", + "Statement": [ + { + "Action": "sts:AssumeRole", + "Effect": "Allow", + "Principal": { + "Service": "states.amazonaws.com" + } + } + ] + }, + "Policies": [ + { + "PolicyName": "InlineInvokeFunctions", + "PolicyDocument": { + "Version": "2012-10-17", + "Statement": [ + { + "Action": "lambda:InvokeFunction", + "Effect": "Allow", + "Resource": [ + { + "Fn::GetAtt": [ + "SingletonFunction76b3e830a873425f8453eddd85c86925Handler81461ECE", + "Arn" + ] + }, + { + "Fn::GetAtt": [ + "SingletonFunction5c1898e096fb4e3e95d5f6c67f3ce41aHandlerADF3E6EA", + "Arn" + ] + } + ] + } + ] + } + } + ] + } + }, + "AwsApiCallSyntheticsgetCanaryRuns4b48cf669b28df275fb8f9ab27c9d17eWaitForFECC3890": { + "Type": "AWS::StepFunctions::StateMachine", + "Properties": { + "DefinitionString": { + "Fn::Join": [ + "", + [ + "{\"StartAt\":\"framework-isComplete-task\",\"States\":{\"framework-isComplete-task\":{\"End\":true,\"Retry\":[{\"ErrorEquals\":[\"States.ALL\"],\"IntervalSeconds\":5,\"MaxAttempts\":60,\"BackoffRate\":1}],\"Catch\":[{\"ErrorEquals\":[\"States.ALL\"],\"Next\":\"framework-onTimeout-task\"}],\"Type\":\"Task\",\"Resource\":\"", + { + "Fn::GetAtt": [ + "SingletonFunction76b3e830a873425f8453eddd85c86925Handler81461ECE", + "Arn" + ] + }, + "\"},\"framework-onTimeout-task\":{\"End\":true,\"Type\":\"Task\",\"Resource\":\"", + { + "Fn::GetAtt": [ + "SingletonFunction5c1898e096fb4e3e95d5f6c67f3ce41aHandlerADF3E6EA", + "Arn" + ] + }, + "\"}}}" + ] + ] + }, + "RoleArn": { + "Fn::GetAtt": [ + "AwsApiCallSyntheticsgetCanaryRuns4b48cf669b28df275fb8f9ab27c9d17eWaitForRoleF9F0C461", + "Arn" + ] + } + }, + "DependsOn": [ + "AwsApiCallSyntheticsgetCanaryRuns4b48cf669b28df275fb8f9ab27c9d17eWaitForRoleF9F0C461" + ] + }, "AwsApiCallSyntheticsgetCanaryRunsf99e1fdf6a0501dc2db966a65404911a": { "Type": "Custom::DeployAssert@SdkCallSyntheticsgetCanaryRuns", "Properties": { @@ -1539,7 +1722,7 @@ "outputPaths": [ "CanaryRuns.0.Status.State" ], - "salt": "1720059390261" + "salt": "1721214952983" }, "UpdateReplacePolicy": "Delete", "DeletionPolicy": "Delete" @@ -1695,7 +1878,7 @@ "outputPaths": [ "CanaryRuns.0.Status.State" ], - "salt": "1720059390261" + "salt": "1721214952984" }, "UpdateReplacePolicy": "Delete", "DeletionPolicy": "Delete" @@ -1875,6 +2058,14 @@ ] } }, + "AssertionResultsAwsApiCallSyntheticsgetCanaryRuns4b48cf669b28df275fb8f9ab27c9d17e": { + "Value": { + "Fn::GetAtt": [ + "AwsApiCallSyntheticsgetCanaryRuns4b48cf669b28df275fb8f9ab27c9d17e", + "assertion" + ] + } + }, "AssertionResultsAwsApiCallSyntheticsgetCanaryRunsf99e1fdf6a0501dc2db966a65404911a": { "Value": { "Fn::GetAtt": [ diff --git a/packages/@aws-cdk-testing/framework-integ/test/aws-synthetics/test/integ.canary.js.snapshot/asset.eafc02f6925151c95ac6a6ae81a3e36d4cf4e77db52eec8e467ce2a69454a41a.bundle/index.js b/packages/@aws-cdk-testing/framework-integ/test/aws-synthetics/test/integ.canary.js.snapshot/asset.3cef2cdbb46b3821e641ffb8b9af9731af5f7e4a9e857ab633dbcd9023de724d.bundle/index.js similarity index 99% rename from packages/@aws-cdk-testing/framework-integ/test/aws-synthetics/test/integ.canary.js.snapshot/asset.eafc02f6925151c95ac6a6ae81a3e36d4cf4e77db52eec8e467ce2a69454a41a.bundle/index.js rename to packages/@aws-cdk-testing/framework-integ/test/aws-synthetics/test/integ.canary.js.snapshot/asset.3cef2cdbb46b3821e641ffb8b9af9731af5f7e4a9e857ab633dbcd9023de724d.bundle/index.js index b29fadc70c1e6..a1206ea985dc1 100644 --- a/packages/@aws-cdk-testing/framework-integ/test/aws-synthetics/test/integ.canary.js.snapshot/asset.eafc02f6925151c95ac6a6ae81a3e36d4cf4e77db52eec8e467ce2a69454a41a.bundle/index.js +++ b/packages/@aws-cdk-testing/framework-integ/test/aws-synthetics/test/integ.canary.js.snapshot/asset.3cef2cdbb46b3821e641ffb8b9af9731af5f7e4a9e857ab633dbcd9023de724d.bundle/index.js @@ -1,3 +1,4 @@ +"use strict"; var __create = Object.create; var __defProp = Object.defineProperty; var __getOwnPropDesc = Object.getOwnPropertyDescriptor; @@ -31052,6 +31053,7 @@ var CustomResourceHandler = class { constructor(event, context) { this.event = event; this.context = context; + this.timedOut = false; this.timeout = setTimeout(async () => { await this.respond({ status: "FAILED", @@ -31063,9 +31065,6 @@ var CustomResourceHandler = class { this.event = event; this.physicalResourceId = extractPhysicalResourceId(event); } - physicalResourceId; - timeout; - timedOut = false; /** * Handles executing the custom resource event. If `stateMachineArn` is present * in the props then trigger the waiter statemachine @@ -31199,7 +31198,6 @@ var AssertionHandler = class extends CustomResourceHandler { } }; var MatchCreator = class { - parsedObj; constructor(obj) { this.parsedObj = { matcher: obj diff --git a/packages/@aws-cdk-testing/framework-integ/test/aws-synthetics/test/integ.canary.js.snapshot/canary-one.assets.json b/packages/@aws-cdk-testing/framework-integ/test/aws-synthetics/test/integ.canary.js.snapshot/canary-one.assets.json index 0841f11c230d6..c04d59b278548 100644 --- a/packages/@aws-cdk-testing/framework-integ/test/aws-synthetics/test/integ.canary.js.snapshot/canary-one.assets.json +++ b/packages/@aws-cdk-testing/framework-integ/test/aws-synthetics/test/integ.canary.js.snapshot/canary-one.assets.json @@ -53,7 +53,7 @@ } } }, - "afc48d18079ead86139ceb93b1c5b248db7cf62bccddc757fc0bcb86d42f2166": { + "10bd361dd68440cb9e995cff511c50c3dedb3b1f8738d33d617124c232bfe370": { "source": { "path": "canary-one.template.json", "packaging": "file" @@ -61,7 +61,7 @@ "destinations": { "current_account-current_region": { "bucketName": "cdk-hnb659fds-assets-${AWS::AccountId}-${AWS::Region}", - "objectKey": "afc48d18079ead86139ceb93b1c5b248db7cf62bccddc757fc0bcb86d42f2166.json", + "objectKey": "10bd361dd68440cb9e995cff511c50c3dedb3b1f8738d33d617124c232bfe370.json", "assumeRoleArn": "arn:${AWS::Partition}:iam::${AWS::AccountId}:role/cdk-hnb659fds-file-publishing-role-${AWS::AccountId}-${AWS::Region}" } } diff --git a/packages/@aws-cdk-testing/framework-integ/test/aws-synthetics/test/integ.canary.js.snapshot/canary-one.template.json b/packages/@aws-cdk-testing/framework-integ/test/aws-synthetics/test/integ.canary.js.snapshot/canary-one.template.json index 722bda2b55e9a..3a5ef9da098ef 100644 --- a/packages/@aws-cdk-testing/framework-integ/test/aws-synthetics/test/integ.canary.js.snapshot/canary-one.template.json +++ b/packages/@aws-cdk-testing/framework-integ/test/aws-synthetics/test/integ.canary.js.snapshot/canary-one.template.json @@ -1938,6 +1938,253 @@ "UpdateReplacePolicy": "Delete", "DeletionPolicy": "Delete" }, + "SynNodejsPuppeteer80ArtifactsBucket5177BBC8": { + "Type": "AWS::S3::Bucket", + "Properties": { + "BucketEncryption": { + "ServerSideEncryptionConfiguration": [ + { + "ServerSideEncryptionByDefault": { + "SSEAlgorithm": "aws:kms" + } + } + ] + } + }, + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Retain" + }, + "SynNodejsPuppeteer80ArtifactsBucketPolicy5D5182F2": { + "Type": "AWS::S3::BucketPolicy", + "Properties": { + "Bucket": { + "Ref": "SynNodejsPuppeteer80ArtifactsBucket5177BBC8" + }, + "PolicyDocument": { + "Statement": [ + { + "Action": "s3:*", + "Condition": { + "Bool": { + "aws:SecureTransport": "false" + } + }, + "Effect": "Deny", + "Principal": { + "AWS": "*" + }, + "Resource": [ + { + "Fn::GetAtt": [ + "SynNodejsPuppeteer80ArtifactsBucket5177BBC8", + "Arn" + ] + }, + { + "Fn::Join": [ + "", + [ + { + "Fn::GetAtt": [ + "SynNodejsPuppeteer80ArtifactsBucket5177BBC8", + "Arn" + ] + }, + "/*" + ] + ] + } + ] + } + ], + "Version": "2012-10-17" + } + } + }, + "SynNodejsPuppeteer80ServiceRole0E16E509": { + "Type": "AWS::IAM::Role", + "Properties": { + "AssumeRolePolicyDocument": { + "Statement": [ + { + "Action": "sts:AssumeRole", + "Effect": "Allow", + "Principal": { + "Service": "lambda.amazonaws.com" + } + } + ], + "Version": "2012-10-17" + }, + "Policies": [ + { + "PolicyDocument": { + "Statement": [ + { + "Action": "s3:ListAllMyBuckets", + "Effect": "Allow", + "Resource": "*" + }, + { + "Action": "s3:GetBucketLocation", + "Effect": "Allow", + "Resource": { + "Fn::GetAtt": [ + "SynNodejsPuppeteer80ArtifactsBucket5177BBC8", + "Arn" + ] + } + }, + { + "Action": "s3:PutObject", + "Effect": "Allow", + "Resource": { + "Fn::Join": [ + "", + [ + { + "Fn::GetAtt": [ + "SynNodejsPuppeteer80ArtifactsBucket5177BBC8", + "Arn" + ] + }, + "/*" + ] + ] + } + }, + { + "Action": "cloudwatch:PutMetricData", + "Condition": { + "StringEquals": { + "cloudwatch:namespace": "CloudWatchSynthetics" + } + }, + "Effect": "Allow", + "Resource": "*" + }, + { + "Action": [ + "logs:CreateLogGroup", + "logs:CreateLogStream", + "logs:PutLogEvents" + ], + "Effect": "Allow", + "Resource": { + "Fn::Join": [ + "", + [ + "arn:", + { + "Ref": "AWS::Partition" + }, + ":logs:", + { + "Ref": "AWS::Region" + }, + ":", + { + "Ref": "AWS::AccountId" + }, + ":log-group:/aws/lambda/cwsyn-*" + ] + ] + } + } + ], + "Version": "2012-10-17" + }, + "PolicyName": "canaryPolicy" + } + ] + } + }, + "SynNodejsPuppeteer803AA42A6D": { + "Type": "AWS::Synthetics::Canary", + "Properties": { + "ArtifactS3Location": { + "Fn::Join": [ + "", + [ + "s3://", + { + "Ref": "SynNodejsPuppeteer80ArtifactsBucket5177BBC8" + } + ] + ] + }, + "Code": { + "Handler": "canary.handler", + "S3Bucket": { + "Fn::Sub": "cdk-hnb659fds-assets-${AWS::AccountId}-${AWS::Region}" + }, + "S3Key": "d6b51cbdd22d449b9e57c20ef9d0977e1cfbf06806f8008ce376101a2ad432a8.zip" + }, + "ExecutionRoleArn": { + "Fn::GetAtt": [ + "SynNodejsPuppeteer80ServiceRole0E16E509", + "Arn" + ] + }, + "Name": "canaryonesynnod1be7c1", + "RunConfig": { + "EnvironmentVariables": { + "URL": { + "Fn::Join": [ + "", + [ + "https://", + { + "Ref": "ApiGateway11E7F47B" + }, + ".execute-api.", + { + "Ref": "AWS::Region" + }, + ".", + { + "Ref": "AWS::URLSuffix" + }, + "/", + { + "Ref": "ApiGatewayDeploymentStageprod1C6D5CD6" + }, + "/" + ] + ] + } + } + }, + "RuntimeVersion": "syn-nodejs-puppeteer-8.0", + "Schedule": { + "DurationInSeconds": "0", + "Expression": "rate(5 minutes)" + }, + "StartCanaryAfterCreation": true, + "Tags": [ + { + "Key": "aws-cdk:auto-delete-underlying-resources", + "Value": "true" + } + ] + } + }, + "SynNodejsPuppeteer80AutoDeleteUnderlyingResourcesCustomResource2EF582E0": { + "Type": "Custom::SyntheticsAutoDeleteUnderlyingResources", + "Properties": { + "ServiceToken": { + "Fn::GetAtt": [ + "CustomSyntheticsAutoDeleteUnderlyingResourcesCustomResourceProviderHandler26776D4E", + "Arn" + ] + }, + "CanaryName": { + "Ref": "SynNodejsPuppeteer803AA42A6D" + } + }, + "UpdateReplacePolicy": "Delete", + "DeletionPolicy": "Delete" + }, "SynPythonSelenium21ArtifactsBucket889F10E3": { "Type": "AWS::S3::Bucket", "Properties": { @@ -2640,6 +2887,14 @@ "Name": "canary-one:ExportsOutputRefSynNodejsPuppeteer70DA1BD3951FA832AF" } }, + "ExportsOutputRefSynNodejsPuppeteer803AA42A6D92351B1A": { + "Value": { + "Ref": "SynNodejsPuppeteer803AA42A6D" + }, + "Export": { + "Name": "canary-one:ExportsOutputRefSynNodejsPuppeteer803AA42A6D92351B1A" + } + }, "ExportsOutputRefSynPythonSelenium2123B5E7A50E411E2E": { "Value": { "Ref": "SynPythonSelenium2123B5E7A5" diff --git a/packages/@aws-cdk-testing/framework-integ/test/aws-synthetics/test/integ.canary.js.snapshot/manifest.json b/packages/@aws-cdk-testing/framework-integ/test/aws-synthetics/test/integ.canary.js.snapshot/manifest.json index e09f3a7c0f933..fcfb869e2a222 100644 --- a/packages/@aws-cdk-testing/framework-integ/test/aws-synthetics/test/integ.canary.js.snapshot/manifest.json +++ b/packages/@aws-cdk-testing/framework-integ/test/aws-synthetics/test/integ.canary.js.snapshot/manifest.json @@ -18,7 +18,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}/afc48d18079ead86139ceb93b1c5b248db7cf62bccddc757fc0bcb86d42f2166.json", + "stackTemplateAssetObjectUrl": "s3://cdk-hnb659fds-assets-${AWS::AccountId}-${AWS::Region}/10bd361dd68440cb9e995cff511c50c3dedb3b1f8738d33d617124c232bfe370.json", "requiresBootstrapStackVersion": 6, "bootstrapStackVersionSsmParameter": "/cdk-bootstrap/hnb659fds/version", "additionalDependencies": [ @@ -310,6 +310,36 @@ "data": "SynNodejsPuppeteer70AutoDeleteUnderlyingResourcesCustomResourceCE549EF1" } ], + "/canary-one/SynNodejsPuppeteer80/ArtifactsBucket/Resource": [ + { + "type": "aws:cdk:logicalId", + "data": "SynNodejsPuppeteer80ArtifactsBucket5177BBC8" + } + ], + "/canary-one/SynNodejsPuppeteer80/ArtifactsBucket/Policy/Resource": [ + { + "type": "aws:cdk:logicalId", + "data": "SynNodejsPuppeteer80ArtifactsBucketPolicy5D5182F2" + } + ], + "/canary-one/SynNodejsPuppeteer80/ServiceRole/Resource": [ + { + "type": "aws:cdk:logicalId", + "data": "SynNodejsPuppeteer80ServiceRole0E16E509" + } + ], + "/canary-one/SynNodejsPuppeteer80/Resource": [ + { + "type": "aws:cdk:logicalId", + "data": "SynNodejsPuppeteer803AA42A6D" + } + ], + "/canary-one/SynNodejsPuppeteer80/AutoDeleteUnderlyingResourcesCustomResource/Default": [ + { + "type": "aws:cdk:logicalId", + "data": "SynNodejsPuppeteer80AutoDeleteUnderlyingResourcesCustomResource2EF582E0" + } + ], "/canary-one/SynPythonSelenium21/ArtifactsBucket/Resource": [ { "type": "aws:cdk:logicalId", @@ -412,6 +442,12 @@ "data": "ExportsOutputRefSynNodejsPuppeteer70DA1BD3951FA832AF" } ], + "/canary-one/Exports/Output{\"Ref\":\"SynNodejsPuppeteer803AA42A6D\"}": [ + { + "type": "aws:cdk:logicalId", + "data": "ExportsOutputRefSynNodejsPuppeteer803AA42A6D92351B1A" + } + ], "/canary-one/Exports/Output{\"Ref\":\"SynPythonSelenium2123B5E7A5\"}": [ { "type": "aws:cdk:logicalId", @@ -456,7 +492,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}/c604634d500d8e3c2fcc8b1d12a69a0e3728d5bb5e9e3e7118abad1baa677eac.json", + "stackTemplateAssetObjectUrl": "s3://cdk-hnb659fds-assets-${AWS::AccountId}-${AWS::Region}/8c0bb05c9b4d0f76f702a52227e1b8ee8733db1a5ec5642188fc88c634a57091.json", "requiresBootstrapStackVersion": 6, "bootstrapStackVersionSsmParameter": "/cdk-bootstrap/hnb659fds/version", "additionalDependencies": [ @@ -767,6 +803,42 @@ "data": "AssertionResultsAwsApiCallSyntheticsgetCanaryRuns7529a951b35a7be38dbb382fdb631be1" } ], + "/IntegCanaryTest/DefaultTest/DeployAssert/AwsApiCallSyntheticsgetCanaryRuns4b48cf669b28df275fb8f9ab27c9d17e/Default/Default": [ + { + "type": "aws:cdk:logicalId", + "data": "AwsApiCallSyntheticsgetCanaryRuns4b48cf669b28df275fb8f9ab27c9d17e" + } + ], + "/IntegCanaryTest/DefaultTest/DeployAssert/AwsApiCallSyntheticsgetCanaryRuns4b48cf669b28df275fb8f9ab27c9d17e/WaitFor/IsCompleteProvider/Invoke": [ + { + "type": "aws:cdk:logicalId", + "data": "AwsApiCallSyntheticsgetCanaryRuns4b48cf669b28df275fb8f9ab27c9d17eWaitForIsCompleteProviderInvokeA02A5118" + } + ], + "/IntegCanaryTest/DefaultTest/DeployAssert/AwsApiCallSyntheticsgetCanaryRuns4b48cf669b28df275fb8f9ab27c9d17e/WaitFor/TimeoutProvider/Invoke": [ + { + "type": "aws:cdk:logicalId", + "data": "AwsApiCallSyntheticsgetCanaryRuns4b48cf669b28df275fb8f9ab27c9d17eWaitForTimeoutProviderInvoke9F40F361" + } + ], + "/IntegCanaryTest/DefaultTest/DeployAssert/AwsApiCallSyntheticsgetCanaryRuns4b48cf669b28df275fb8f9ab27c9d17e/WaitFor/Role": [ + { + "type": "aws:cdk:logicalId", + "data": "AwsApiCallSyntheticsgetCanaryRuns4b48cf669b28df275fb8f9ab27c9d17eWaitForRoleF9F0C461" + } + ], + "/IntegCanaryTest/DefaultTest/DeployAssert/AwsApiCallSyntheticsgetCanaryRuns4b48cf669b28df275fb8f9ab27c9d17e/WaitFor/Resource": [ + { + "type": "aws:cdk:logicalId", + "data": "AwsApiCallSyntheticsgetCanaryRuns4b48cf669b28df275fb8f9ab27c9d17eWaitForFECC3890" + } + ], + "/IntegCanaryTest/DefaultTest/DeployAssert/AwsApiCallSyntheticsgetCanaryRuns4b48cf669b28df275fb8f9ab27c9d17e/AssertionResults": [ + { + "type": "aws:cdk:logicalId", + "data": "AssertionResultsAwsApiCallSyntheticsgetCanaryRuns4b48cf669b28df275fb8f9ab27c9d17e" + } + ], "/IntegCanaryTest/DefaultTest/DeployAssert/AwsApiCallSyntheticsgetCanaryRunsf99e1fdf6a0501dc2db966a65404911a/Default/Default": [ { "type": "aws:cdk:logicalId", diff --git a/packages/@aws-cdk-testing/framework-integ/test/aws-synthetics/test/integ.canary.js.snapshot/tree.json b/packages/@aws-cdk-testing/framework-integ/test/aws-synthetics/test/integ.canary.js.snapshot/tree.json index 1d700636decc6..9537bd9ea25e1 100644 --- a/packages/@aws-cdk-testing/framework-integ/test/aws-synthetics/test/integ.canary.js.snapshot/tree.json +++ b/packages/@aws-cdk-testing/framework-integ/test/aws-synthetics/test/integ.canary.js.snapshot/tree.json @@ -2649,6 +2649,359 @@ "version": "0.0.0" } }, + "SynNodejsPuppeteer80": { + "id": "SynNodejsPuppeteer80", + "path": "canary-one/SynNodejsPuppeteer80", + "children": { + "ArtifactsBucket": { + "id": "ArtifactsBucket", + "path": "canary-one/SynNodejsPuppeteer80/ArtifactsBucket", + "children": { + "Resource": { + "id": "Resource", + "path": "canary-one/SynNodejsPuppeteer80/ArtifactsBucket/Resource", + "attributes": { + "aws:cdk:cloudformation:type": "AWS::S3::Bucket", + "aws:cdk:cloudformation:props": { + "bucketEncryption": { + "serverSideEncryptionConfiguration": [ + { + "serverSideEncryptionByDefault": { + "sseAlgorithm": "aws:kms" + } + } + ] + } + } + }, + "constructInfo": { + "fqn": "aws-cdk-lib.aws_s3.CfnBucket", + "version": "0.0.0" + } + }, + "Policy": { + "id": "Policy", + "path": "canary-one/SynNodejsPuppeteer80/ArtifactsBucket/Policy", + "children": { + "Resource": { + "id": "Resource", + "path": "canary-one/SynNodejsPuppeteer80/ArtifactsBucket/Policy/Resource", + "attributes": { + "aws:cdk:cloudformation:type": "AWS::S3::BucketPolicy", + "aws:cdk:cloudformation:props": { + "bucket": { + "Ref": "SynNodejsPuppeteer80ArtifactsBucket5177BBC8" + }, + "policyDocument": { + "Statement": [ + { + "Action": "s3:*", + "Condition": { + "Bool": { + "aws:SecureTransport": "false" + } + }, + "Effect": "Deny", + "Principal": { + "AWS": "*" + }, + "Resource": [ + { + "Fn::GetAtt": [ + "SynNodejsPuppeteer80ArtifactsBucket5177BBC8", + "Arn" + ] + }, + { + "Fn::Join": [ + "", + [ + { + "Fn::GetAtt": [ + "SynNodejsPuppeteer80ArtifactsBucket5177BBC8", + "Arn" + ] + }, + "/*" + ] + ] + } + ] + } + ], + "Version": "2012-10-17" + } + } + }, + "constructInfo": { + "fqn": "aws-cdk-lib.aws_s3.CfnBucketPolicy", + "version": "0.0.0" + } + } + }, + "constructInfo": { + "fqn": "aws-cdk-lib.aws_s3.BucketPolicy", + "version": "0.0.0" + } + } + }, + "constructInfo": { + "fqn": "aws-cdk-lib.aws_s3.Bucket", + "version": "0.0.0" + } + }, + "ServiceRole": { + "id": "ServiceRole", + "path": "canary-one/SynNodejsPuppeteer80/ServiceRole", + "children": { + "ImportServiceRole": { + "id": "ImportServiceRole", + "path": "canary-one/SynNodejsPuppeteer80/ServiceRole/ImportServiceRole", + "constructInfo": { + "fqn": "aws-cdk-lib.Resource", + "version": "0.0.0" + } + }, + "Resource": { + "id": "Resource", + "path": "canary-one/SynNodejsPuppeteer80/ServiceRole/Resource", + "attributes": { + "aws:cdk:cloudformation:type": "AWS::IAM::Role", + "aws:cdk:cloudformation:props": { + "assumeRolePolicyDocument": { + "Statement": [ + { + "Action": "sts:AssumeRole", + "Effect": "Allow", + "Principal": { + "Service": "lambda.amazonaws.com" + } + } + ], + "Version": "2012-10-17" + }, + "policies": [ + { + "policyName": "canaryPolicy", + "policyDocument": { + "Statement": [ + { + "Action": "s3:ListAllMyBuckets", + "Effect": "Allow", + "Resource": "*" + }, + { + "Action": "s3:GetBucketLocation", + "Effect": "Allow", + "Resource": { + "Fn::GetAtt": [ + "SynNodejsPuppeteer80ArtifactsBucket5177BBC8", + "Arn" + ] + } + }, + { + "Action": "s3:PutObject", + "Effect": "Allow", + "Resource": { + "Fn::Join": [ + "", + [ + { + "Fn::GetAtt": [ + "SynNodejsPuppeteer80ArtifactsBucket5177BBC8", + "Arn" + ] + }, + "/*" + ] + ] + } + }, + { + "Action": "cloudwatch:PutMetricData", + "Condition": { + "StringEquals": { + "cloudwatch:namespace": "CloudWatchSynthetics" + } + }, + "Effect": "Allow", + "Resource": "*" + }, + { + "Action": [ + "logs:CreateLogGroup", + "logs:CreateLogStream", + "logs:PutLogEvents" + ], + "Effect": "Allow", + "Resource": { + "Fn::Join": [ + "", + [ + "arn:", + { + "Ref": "AWS::Partition" + }, + ":logs:", + { + "Ref": "AWS::Region" + }, + ":", + { + "Ref": "AWS::AccountId" + }, + ":log-group:/aws/lambda/cwsyn-*" + ] + ] + } + } + ], + "Version": "2012-10-17" + } + } + ] + } + }, + "constructInfo": { + "fqn": "aws-cdk-lib.aws_iam.CfnRole", + "version": "0.0.0" + } + } + }, + "constructInfo": { + "fqn": "aws-cdk-lib.aws_iam.Role", + "version": "0.0.0" + } + }, + "Code": { + "id": "Code", + "path": "canary-one/SynNodejsPuppeteer80/Code", + "children": { + "Stage": { + "id": "Stage", + "path": "canary-one/SynNodejsPuppeteer80/Code/Stage", + "constructInfo": { + "fqn": "aws-cdk-lib.AssetStaging", + "version": "0.0.0" + } + }, + "AssetBucket": { + "id": "AssetBucket", + "path": "canary-one/SynNodejsPuppeteer80/Code/AssetBucket", + "constructInfo": { + "fqn": "aws-cdk-lib.aws_s3.BucketBase", + "version": "0.0.0" + } + } + }, + "constructInfo": { + "fqn": "aws-cdk-lib.aws_s3_assets.Asset", + "version": "0.0.0" + } + }, + "Resource": { + "id": "Resource", + "path": "canary-one/SynNodejsPuppeteer80/Resource", + "attributes": { + "aws:cdk:cloudformation:type": "AWS::Synthetics::Canary", + "aws:cdk:cloudformation:props": { + "artifactS3Location": { + "Fn::Join": [ + "", + [ + "s3://", + { + "Ref": "SynNodejsPuppeteer80ArtifactsBucket5177BBC8" + } + ] + ] + }, + "code": { + "handler": "canary.handler", + "s3Bucket": { + "Fn::Sub": "cdk-hnb659fds-assets-${AWS::AccountId}-${AWS::Region}" + }, + "s3Key": "d6b51cbdd22d449b9e57c20ef9d0977e1cfbf06806f8008ce376101a2ad432a8.zip" + }, + "executionRoleArn": { + "Fn::GetAtt": [ + "SynNodejsPuppeteer80ServiceRole0E16E509", + "Arn" + ] + }, + "name": "canaryonesynnod1be7c1", + "runConfig": { + "environmentVariables": { + "URL": { + "Fn::Join": [ + "", + [ + "https://", + { + "Ref": "ApiGateway11E7F47B" + }, + ".execute-api.", + { + "Ref": "AWS::Region" + }, + ".", + { + "Ref": "AWS::URLSuffix" + }, + "/", + { + "Ref": "ApiGatewayDeploymentStageprod1C6D5CD6" + }, + "/" + ] + ] + } + } + }, + "runtimeVersion": "syn-nodejs-puppeteer-8.0", + "schedule": { + "durationInSeconds": "0", + "expression": "rate(5 minutes)" + }, + "startCanaryAfterCreation": true, + "tags": [ + { + "key": "aws-cdk:auto-delete-underlying-resources", + "value": "true" + } + ] + } + }, + "constructInfo": { + "fqn": "aws-cdk-lib.aws_synthetics.CfnCanary", + "version": "0.0.0" + } + }, + "AutoDeleteUnderlyingResourcesCustomResource": { + "id": "AutoDeleteUnderlyingResourcesCustomResource", + "path": "canary-one/SynNodejsPuppeteer80/AutoDeleteUnderlyingResourcesCustomResource", + "children": { + "Default": { + "id": "Default", + "path": "canary-one/SynNodejsPuppeteer80/AutoDeleteUnderlyingResourcesCustomResource/Default", + "constructInfo": { + "fqn": "aws-cdk-lib.CfnResource", + "version": "0.0.0" + } + } + }, + "constructInfo": { + "fqn": "aws-cdk-lib.CustomResource", + "version": "0.0.0" + } + } + }, + "constructInfo": { + "fqn": "aws-cdk-lib.aws_synthetics.Canary", + "version": "0.0.0" + } + }, "SynPythonSelenium21": { "id": "SynPythonSelenium21", "path": "canary-one/SynPythonSelenium21", @@ -3415,6 +3768,14 @@ "version": "0.0.0" } }, + "Output{\"Ref\":\"SynNodejsPuppeteer803AA42A6D\"}": { + "id": "Output{\"Ref\":\"SynNodejsPuppeteer803AA42A6D\"}", + "path": "canary-one/Exports/Output{\"Ref\":\"SynNodejsPuppeteer803AA42A6D\"}", + "constructInfo": { + "fqn": "aws-cdk-lib.CfnOutput", + "version": "0.0.0" + } + }, "Output{\"Ref\":\"SynPythonSelenium2123B5E7A5\"}": { "id": "Output{\"Ref\":\"SynPythonSelenium2123B5E7A5\"}", "path": "canary-one/Exports/Output{\"Ref\":\"SynPythonSelenium2123B5E7A5\"}", @@ -4513,6 +4874,138 @@ "version": "0.0.0" } }, + "AwsApiCallSyntheticsgetCanaryRuns4b48cf669b28df275fb8f9ab27c9d17e": { + "id": "AwsApiCallSyntheticsgetCanaryRuns4b48cf669b28df275fb8f9ab27c9d17e", + "path": "IntegCanaryTest/DefaultTest/DeployAssert/AwsApiCallSyntheticsgetCanaryRuns4b48cf669b28df275fb8f9ab27c9d17e", + "children": { + "SdkProvider": { + "id": "SdkProvider", + "path": "IntegCanaryTest/DefaultTest/DeployAssert/AwsApiCallSyntheticsgetCanaryRuns4b48cf669b28df275fb8f9ab27c9d17e/SdkProvider", + "children": { + "AssertionsProvider": { + "id": "AssertionsProvider", + "path": "IntegCanaryTest/DefaultTest/DeployAssert/AwsApiCallSyntheticsgetCanaryRuns4b48cf669b28df275fb8f9ab27c9d17e/SdkProvider/AssertionsProvider", + "constructInfo": { + "fqn": "constructs.Construct", + "version": "10.3.0" + } + } + }, + "constructInfo": { + "fqn": "@aws-cdk/integ-tests-alpha.AssertionsProvider", + "version": "0.0.0" + } + }, + "Default": { + "id": "Default", + "path": "IntegCanaryTest/DefaultTest/DeployAssert/AwsApiCallSyntheticsgetCanaryRuns4b48cf669b28df275fb8f9ab27c9d17e/Default", + "children": { + "Default": { + "id": "Default", + "path": "IntegCanaryTest/DefaultTest/DeployAssert/AwsApiCallSyntheticsgetCanaryRuns4b48cf669b28df275fb8f9ab27c9d17e/Default/Default", + "constructInfo": { + "fqn": "aws-cdk-lib.CfnResource", + "version": "0.0.0" + } + } + }, + "constructInfo": { + "fqn": "aws-cdk-lib.CustomResource", + "version": "0.0.0" + } + }, + "WaitFor": { + "id": "WaitFor", + "path": "IntegCanaryTest/DefaultTest/DeployAssert/AwsApiCallSyntheticsgetCanaryRuns4b48cf669b28df275fb8f9ab27c9d17e/WaitFor", + "children": { + "IsCompleteProvider": { + "id": "IsCompleteProvider", + "path": "IntegCanaryTest/DefaultTest/DeployAssert/AwsApiCallSyntheticsgetCanaryRuns4b48cf669b28df275fb8f9ab27c9d17e/WaitFor/IsCompleteProvider", + "children": { + "AssertionsProvider": { + "id": "AssertionsProvider", + "path": "IntegCanaryTest/DefaultTest/DeployAssert/AwsApiCallSyntheticsgetCanaryRuns4b48cf669b28df275fb8f9ab27c9d17e/WaitFor/IsCompleteProvider/AssertionsProvider", + "constructInfo": { + "fqn": "constructs.Construct", + "version": "10.3.0" + } + }, + "Invoke": { + "id": "Invoke", + "path": "IntegCanaryTest/DefaultTest/DeployAssert/AwsApiCallSyntheticsgetCanaryRuns4b48cf669b28df275fb8f9ab27c9d17e/WaitFor/IsCompleteProvider/Invoke", + "constructInfo": { + "fqn": "aws-cdk-lib.CfnResource", + "version": "0.0.0" + } + } + }, + "constructInfo": { + "fqn": "@aws-cdk/integ-tests-alpha.AssertionsProvider", + "version": "0.0.0" + } + }, + "TimeoutProvider": { + "id": "TimeoutProvider", + "path": "IntegCanaryTest/DefaultTest/DeployAssert/AwsApiCallSyntheticsgetCanaryRuns4b48cf669b28df275fb8f9ab27c9d17e/WaitFor/TimeoutProvider", + "children": { + "AssertionsProvider": { + "id": "AssertionsProvider", + "path": "IntegCanaryTest/DefaultTest/DeployAssert/AwsApiCallSyntheticsgetCanaryRuns4b48cf669b28df275fb8f9ab27c9d17e/WaitFor/TimeoutProvider/AssertionsProvider", + "constructInfo": { + "fqn": "constructs.Construct", + "version": "10.3.0" + } + }, + "Invoke": { + "id": "Invoke", + "path": "IntegCanaryTest/DefaultTest/DeployAssert/AwsApiCallSyntheticsgetCanaryRuns4b48cf669b28df275fb8f9ab27c9d17e/WaitFor/TimeoutProvider/Invoke", + "constructInfo": { + "fqn": "aws-cdk-lib.CfnResource", + "version": "0.0.0" + } + } + }, + "constructInfo": { + "fqn": "@aws-cdk/integ-tests-alpha.AssertionsProvider", + "version": "0.0.0" + } + }, + "Role": { + "id": "Role", + "path": "IntegCanaryTest/DefaultTest/DeployAssert/AwsApiCallSyntheticsgetCanaryRuns4b48cf669b28df275fb8f9ab27c9d17e/WaitFor/Role", + "constructInfo": { + "fqn": "aws-cdk-lib.CfnResource", + "version": "0.0.0" + } + }, + "Resource": { + "id": "Resource", + "path": "IntegCanaryTest/DefaultTest/DeployAssert/AwsApiCallSyntheticsgetCanaryRuns4b48cf669b28df275fb8f9ab27c9d17e/WaitFor/Resource", + "constructInfo": { + "fqn": "aws-cdk-lib.CfnResource", + "version": "0.0.0" + } + } + }, + "constructInfo": { + "fqn": "@aws-cdk/integ-tests-alpha.WaiterStateMachine", + "version": "0.0.0" + } + }, + "AssertionResults": { + "id": "AssertionResults", + "path": "IntegCanaryTest/DefaultTest/DeployAssert/AwsApiCallSyntheticsgetCanaryRuns4b48cf669b28df275fb8f9ab27c9d17e/AssertionResults", + "constructInfo": { + "fqn": "aws-cdk-lib.CfnOutput", + "version": "0.0.0" + } + } + }, + "constructInfo": { + "fqn": "@aws-cdk/integ-tests-alpha.AwsApiCall", + "version": "0.0.0" + } + }, "AwsApiCallSyntheticsgetCanaryRunsf99e1fdf6a0501dc2db966a65404911a": { "id": "AwsApiCallSyntheticsgetCanaryRunsf99e1fdf6a0501dc2db966a65404911a", "path": "IntegCanaryTest/DefaultTest/DeployAssert/AwsApiCallSyntheticsgetCanaryRunsf99e1fdf6a0501dc2db966a65404911a", diff --git a/packages/@aws-cdk-testing/framework-integ/test/aws-synthetics/test/integ.canary.ts b/packages/@aws-cdk-testing/framework-integ/test/aws-synthetics/test/integ.canary.ts index f5160e173e0c6..d10d15bbafa2a 100644 --- a/packages/@aws-cdk-testing/framework-integ/test/aws-synthetics/test/integ.canary.ts +++ b/packages/@aws-cdk-testing/framework-integ/test/aws-synthetics/test/integ.canary.ts @@ -99,6 +99,7 @@ const createCanaryByRuntimes = (runtime: Runtime) => const puppeteer52 = createCanaryByRuntimes(Runtime.SYNTHETICS_NODEJS_PUPPETEER_5_2); const puppeteer62 = createCanaryByRuntimes(Runtime.SYNTHETICS_NODEJS_PUPPETEER_6_2); const puppeteer70 = createCanaryByRuntimes(Runtime.SYNTHETICS_NODEJS_PUPPETEER_7_0); +const puppeteer80 = createCanaryByRuntimes(Runtime.SYNTHETICS_NODEJS_PUPPETEER_8_0); const selenium21 = createCanaryByRuntimes(Runtime.SYNTHETICS_PYTHON_SELENIUM_2_1); const selenium30 = createCanaryByRuntimes(Runtime.SYNTHETICS_PYTHON_SELENIUM_3_0); @@ -116,6 +117,7 @@ const test = new IntegTest(app, 'IntegCanaryTest', { puppeteer52, puppeteer62, puppeteer70, + puppeteer80, selenium21, selenium30, ].forEach((canary) => test.assertions diff --git a/packages/aws-cdk-lib/aws-synthetics/lib/runtime.ts b/packages/aws-cdk-lib/aws-synthetics/lib/runtime.ts index 1a766dd16bb5a..349e2db317851 100644 --- a/packages/aws-cdk-lib/aws-synthetics/lib/runtime.ts +++ b/packages/aws-cdk-lib/aws-synthetics/lib/runtime.ts @@ -207,6 +207,20 @@ export class Runtime { */ public static readonly SYNTHETICS_NODEJS_PUPPETEER_7_0 = new Runtime('syn-nodejs-puppeteer-7.0', RuntimeFamily.NODEJS); + /** + * `syn-nodejs-puppeteer-8.0` includes the following: + * - Lambda runtime Node.js 20.x + * - Puppeteer-core version 22.10.0 + * - Chromium version 125.0.6422.112 + * + * New Features: + * - **Support for two-factor authentication** + * - **Bug fixes** for situations where some service clients were losing data in Node.js SDK V3 responses. + * + * @see https://docs.aws.amazon.com/AmazonCloudWatch/latest/monitoring/CloudWatch_Synthetics_Library_nodejs_puppeteer.html#CloudWatch_Synthetics_runtimeversion-nodejs-puppeteer-8.0 + */ + public static readonly SYNTHETICS_NODEJS_PUPPETEER_8_0 = new Runtime('syn-nodejs-puppeteer-8.0', RuntimeFamily.NODEJS); + /** * `syn-python-selenium-1.0` includes the following: * - Lambda runtime Python 3.8 diff --git a/packages/aws-cdk-lib/aws-synthetics/test/canary.test.ts b/packages/aws-cdk-lib/aws-synthetics/test/canary.test.ts index 5481002b9d579..0cef6416b66fa 100644 --- a/packages/aws-cdk-lib/aws-synthetics/test/canary.test.ts +++ b/packages/aws-cdk-lib/aws-synthetics/test/canary.test.ts @@ -21,7 +21,7 @@ test('Basic canary properties work', () => { failureRetentionPeriod: Duration.days(10), startAfterCreation: false, timeToLive: Duration.minutes(30), - runtime: synthetics.Runtime.SYNTHETICS_NODEJS_PUPPETEER_3_8, + runtime: synthetics.Runtime.SYNTHETICS_NODEJS_PUPPETEER_8_0, }); // THEN @@ -31,7 +31,7 @@ test('Basic canary properties work', () => { FailureRetentionPeriod: 10, StartCanaryAfterCreation: false, Schedule: Match.objectLike({ DurationInSeconds: '1800' }), - RuntimeVersion: 'syn-nodejs-puppeteer-3.8', + RuntimeVersion: 'syn-nodejs-puppeteer-8.0', }); }); @@ -46,7 +46,7 @@ test('cleanup.LAMBDA introduces custom resource to delete lambda', () => { code: synthetics.Code.fromInline('/* Synthetics handler code'), }), cleanup: synthetics.Cleanup.LAMBDA, - runtime: synthetics.Runtime.SYNTHETICS_NODEJS_PUPPETEER_3_8, + runtime: synthetics.Runtime.SYNTHETICS_NODEJS_PUPPETEER_8_0, }); // THEN @@ -63,7 +63,7 @@ test('Canary can have generated name', () => { handler: 'index.handler', code: synthetics.Code.fromInline('/* Synthetics handler code */'), }), - runtime: synthetics.Runtime.SYNTHETICS_NODEJS_PUPPETEER_3_8, + runtime: synthetics.Runtime.SYNTHETICS_NODEJS_PUPPETEER_8_0, }); // THEN @@ -83,7 +83,7 @@ test('Name validation does not fail when using Tokens', () => { handler: 'index.handler', code: synthetics.Code.fromInline('/* Synthetics handler code */'), }), - runtime: synthetics.Runtime.SYNTHETICS_NODEJS_PUPPETEER_3_8, + runtime: synthetics.Runtime.SYNTHETICS_NODEJS_PUPPETEER_8_0, }); // THEN: no exception @@ -101,7 +101,7 @@ test('Throws when name is specified incorrectly', () => { handler: 'index.handler', code: synthetics.Code.fromInline('/* Synthetics handler code */'), }), - runtime: synthetics.Runtime.SYNTHETICS_NODEJS_PUPPETEER_3_8, + runtime: synthetics.Runtime.SYNTHETICS_NODEJS_PUPPETEER_8_0, })) .toThrowError('Canary name must be lowercase, numbers, hyphens, or underscores (got "My Canary")'); }); @@ -117,7 +117,7 @@ test('Throws when name has more than 21 characters', () => { handler: 'index.handler', code: synthetics.Code.fromInline('/* Synthetics handler code */'), }), - runtime: synthetics.Runtime.SYNTHETICS_NODEJS_PUPPETEER_3_8, + runtime: synthetics.Runtime.SYNTHETICS_NODEJS_PUPPETEER_8_0, })) .toThrowError(`Canary name is too large, must be between 1 and 21 characters, but is 22 (got "${'a'.repeat(22)}")`); }); @@ -139,7 +139,7 @@ test('An existing role can be specified instead of auto-created', () => { handler: 'index.handler', code: synthetics.Code.fromInline('/* Synthetics handler code */'), }), - runtime: synthetics.Runtime.SYNTHETICS_NODEJS_PUPPETEER_3_8, + runtime: synthetics.Runtime.SYNTHETICS_NODEJS_PUPPETEER_8_0, }); // THEN @@ -162,7 +162,7 @@ test('An auto-generated bucket can have lifecycle rules', () => { handler: 'index.handler', code: synthetics.Code.fromInline('/* Synthetics handler code */'), }), - runtime: synthetics.Runtime.SYNTHETICS_NODEJS_PUPPETEER_3_8, + runtime: synthetics.Runtime.SYNTHETICS_NODEJS_PUPPETEER_8_0, }); // THEN @@ -190,7 +190,7 @@ test('An existing bucket and prefix can be specified instead of auto-created', ( handler: 'index.handler', code: synthetics.Code.fromInline('/* Synthetics handler code */'), }), - runtime: synthetics.Runtime.SYNTHETICS_NODEJS_PUPPETEER_3_8, + runtime: synthetics.Runtime.SYNTHETICS_NODEJS_PUPPETEER_8_0, }); // THEN @@ -205,7 +205,7 @@ test('Runtime can be specified', () => { // WHEN new synthetics.Canary(stack, 'Canary', { - runtime: synthetics.Runtime.SYNTHETICS_NODEJS_PUPPETEER_3_8, + runtime: synthetics.Runtime.SYNTHETICS_NODEJS_PUPPETEER_8_0, test: synthetics.Test.custom({ handler: 'index.handler', code: synthetics.Code.fromInline('/* Synthetics handler code */'), @@ -214,7 +214,7 @@ test('Runtime can be specified', () => { // THEN Template.fromStack(stack).hasResourceProperties('AWS::Synthetics::Canary', { - RuntimeVersion: 'syn-nodejs-puppeteer-3.8', + RuntimeVersion: 'syn-nodejs-puppeteer-8.0', }); }); @@ -247,7 +247,7 @@ test('environment variables can be specified', () => { // WHEN new synthetics.Canary(stack, 'Canary', { - runtime: synthetics.Runtime.SYNTHETICS_NODEJS_PUPPETEER_3_8, + runtime: synthetics.Runtime.SYNTHETICS_NODEJS_PUPPETEER_8_0, test: synthetics.Test.custom({ handler: 'index.handler', code: synthetics.Code.fromInline('/* Synthetics handler code */'), @@ -269,7 +269,7 @@ test('environment variables are skipped if not provided', () => { // WHEN new synthetics.Canary(stack, 'Canary', { - runtime: synthetics.Runtime.SYNTHETICS_NODEJS_PUPPETEER_3_8, + runtime: synthetics.Runtime.SYNTHETICS_NODEJS_PUPPETEER_8_0, test: synthetics.Test.custom({ handler: 'index.handler', code: synthetics.Code.fromInline('/* Synthetics handler code */'), @@ -312,7 +312,7 @@ test('Schedule can be set with Rate', () => { handler: 'index.handler', code: synthetics.Code.fromInline('/* Synthetics handler code */'), }), - runtime: synthetics.Runtime.SYNTHETICS_NODEJS_PUPPETEER_3_8, + runtime: synthetics.Runtime.SYNTHETICS_NODEJS_PUPPETEER_8_0, }); // THEN @@ -332,7 +332,7 @@ test('Schedule can be set to 1 minute', () => { handler: 'index.handler', code: synthetics.Code.fromInline('/* Synthetics handler code */'), }), - runtime: synthetics.Runtime.SYNTHETICS_NODEJS_PUPPETEER_3_8, + runtime: synthetics.Runtime.SYNTHETICS_NODEJS_PUPPETEER_8_0, }); // THEN @@ -352,7 +352,7 @@ test('Schedule can be set with Cron', () => { handler: 'index.handler', code: synthetics.Code.fromInline('/* Synthetics handler code */'), }), - runtime: synthetics.Runtime.SYNTHETICS_NODEJS_PUPPETEER_3_8, + runtime: synthetics.Runtime.SYNTHETICS_NODEJS_PUPPETEER_8_0, }); // THEN @@ -372,7 +372,7 @@ test('Schedule can be set with Expression', () => { handler: 'index.handler', code: synthetics.Code.fromInline('/* Synthetics handler code */'), }), - runtime: synthetics.Runtime.SYNTHETICS_NODEJS_PUPPETEER_3_8, + runtime: synthetics.Runtime.SYNTHETICS_NODEJS_PUPPETEER_8_0, }); // THEN @@ -392,7 +392,7 @@ test('Schedule can be set to run once', () => { handler: 'index.handler', code: synthetics.Code.fromInline('/* Synthetics handler code */'), }), - runtime: synthetics.Runtime.SYNTHETICS_NODEJS_PUPPETEER_3_8, + runtime: synthetics.Runtime.SYNTHETICS_NODEJS_PUPPETEER_8_0, }); // THEN @@ -412,7 +412,7 @@ test('Throws when rate above 60 minutes', () => { handler: 'index.handler', code: synthetics.Code.fromInline('/* Synthetics handler code */'), }), - runtime: synthetics.Runtime.SYNTHETICS_NODEJS_PUPPETEER_3_8, + runtime: synthetics.Runtime.SYNTHETICS_NODEJS_PUPPETEER_8_0, })) .toThrowError('Schedule duration must be between 1 and 60 minutes'); }); @@ -428,7 +428,7 @@ test('Throws when rate above is not a whole number of minutes', () => { handler: 'index.handler', code: synthetics.Code.fromInline('/* Synthetics handler code */'), }), - runtime: synthetics.Runtime.SYNTHETICS_NODEJS_PUPPETEER_3_8, + runtime: synthetics.Runtime.SYNTHETICS_NODEJS_PUPPETEER_8_0, })) .toThrowError('\'59 seconds\' cannot be converted into a whole number of minutes.'); }); @@ -444,7 +444,7 @@ test('Can share artifacts bucket between canaries', () => { handler: 'index.handler', code: synthetics.Code.fromInline('/* Synthetics handler code */'), }), - runtime: synthetics.Runtime.SYNTHETICS_NODEJS_PUPPETEER_3_8, + runtime: synthetics.Runtime.SYNTHETICS_NODEJS_PUPPETEER_8_0, }); const canary2 = new synthetics.Canary(stack, 'Canary2', { @@ -454,7 +454,7 @@ test('Can share artifacts bucket between canaries', () => { code: synthetics.Code.fromInline('/* Synthetics handler code */'), }), artifactsBucketLocation: { bucket: canary1.artifactsBucket }, - runtime: synthetics.Runtime.SYNTHETICS_NODEJS_PUPPETEER_3_8, + runtime: synthetics.Runtime.SYNTHETICS_NODEJS_PUPPETEER_8_0, }); // THEN @@ -474,7 +474,7 @@ test('can specify custom test', () => { console.log(\'hello world\'); };`), }), - runtime: synthetics.Runtime.SYNTHETICS_NODEJS_PUPPETEER_3_8, + runtime: synthetics.Runtime.SYNTHETICS_NODEJS_PUPPETEER_8_0, }); // THEN @@ -504,7 +504,7 @@ describe('canary in a vpc', () => { console.log(\'hello world\'); };`), }), - runtime: synthetics.Runtime.SYNTHETICS_NODEJS_PUPPETEER_3_8, + runtime: synthetics.Runtime.SYNTHETICS_NODEJS_PUPPETEER_8_0, vpc, }); @@ -539,7 +539,7 @@ describe('canary in a vpc', () => { console.log(\'hello world\'); };`), }), - runtime: synthetics.Runtime.SYNTHETICS_NODEJS_PUPPETEER_3_8, + runtime: synthetics.Runtime.SYNTHETICS_NODEJS_PUPPETEER_8_0, vpc, }); @@ -577,7 +577,7 @@ describe('canary in a vpc', () => { console.log(\'hello world\'); };`), }), - runtime: synthetics.Runtime.SYNTHETICS_NODEJS_PUPPETEER_3_8, + runtime: synthetics.Runtime.SYNTHETICS_NODEJS_PUPPETEER_8_0, vpc, securityGroups: [sg], }); @@ -617,7 +617,7 @@ test('Role policy generated as expected', () => { handler: 'index.handler', code: synthetics.Code.fromInline('/* Synthetics handler code */'), }), - runtime: synthetics.Runtime.SYNTHETICS_NODEJS_PUPPETEER_3_8, + runtime: synthetics.Runtime.SYNTHETICS_NODEJS_PUPPETEER_8_0, }); // THEN @@ -713,7 +713,7 @@ test('Should create handler with path for recent runtimes', () => { handler: 'folder/canary.functionName', code: synthetics.Code.fromAsset(path.join(__dirname, 'canaries')), }), - runtime: synthetics.Runtime.SYNTHETICS_NODEJS_PUPPETEER_3_8, + runtime: synthetics.Runtime.SYNTHETICS_NODEJS_PUPPETEER_8_0, }); // THEN @@ -722,7 +722,7 @@ test('Should create handler with path for recent runtimes', () => { Code: { Handler: 'folder/canary.functionName', }, - RuntimeVersion: 'syn-nodejs-puppeteer-3.8', + RuntimeVersion: 'syn-nodejs-puppeteer-8.0', }); });