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 0ebd84175d18e..48fb33a2c5970 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 @@ -14,7 +14,7 @@ } } }, - "8c0bb05c9b4d0f76f702a52227e1b8ee8733db1a5ec5642188fc88c634a57091": { + "bcff890e2c622fc43304e9895d19264d7efd1d511125fcbab04d4463cb503cb5": { "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": "8c0bb05c9b4d0f76f702a52227e1b8ee8733db1a5ec5642188fc88c634a57091.json", + "objectKey": "bcff890e2c622fc43304e9895d19264d7efd1d511125fcbab04d4463cb503cb5.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 d9f0cde1cecfc..dd9289e1c2ac4 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": "1721214952980" + "salt": "1723597538472" }, "UpdateReplacePolicy": "Delete", "DeletionPolicy": "Delete" @@ -353,6 +353,24 @@ "*" ] }, + { + "Action": [ + "states:StartExecution" + ], + "Effect": "Allow", + "Resource": [ + "*" + ] + }, + { + "Action": [ + "synthetics:GetCanaryRuns" + ], + "Effect": "Allow", + "Resource": [ + "*" + ] + }, { "Action": [ "states:StartExecution" @@ -503,6 +521,15 @@ "*" ] }, + { + "Action": [ + "synthetics:GetCanaryRuns" + ], + "Effect": "Allow", + "Resource": [ + "*" + ] + }, { "Action": [ "synthetics:GetCanaryRuns" @@ -630,7 +657,7 @@ "outputPaths": [ "CanaryRuns.0.Status.State" ], - "salt": "1721214952981" + "salt": "1723597538474" }, "UpdateReplacePolicy": "Delete", "DeletionPolicy": "Delete" @@ -786,7 +813,7 @@ "outputPaths": [ "CanaryRuns.0.Status.State" ], - "salt": "1721214952981" + "salt": "1723597538475" }, "UpdateReplacePolicy": "Delete", "DeletionPolicy": "Delete" @@ -942,7 +969,7 @@ "outputPaths": [ "CanaryRuns.0.Status.State" ], - "salt": "1721214952982" + "salt": "1723597538475" }, "UpdateReplacePolicy": "Delete", "DeletionPolicy": "Delete" @@ -1098,7 +1125,7 @@ "outputPaths": [ "CanaryRuns.0.Status.State" ], - "salt": "1721214952982" + "salt": "1723597538476" }, "UpdateReplacePolicy": "Delete", "DeletionPolicy": "Delete" @@ -1254,7 +1281,7 @@ "outputPaths": [ "CanaryRuns.0.Status.State" ], - "salt": "1721214952983" + "salt": "1723597538476" }, "UpdateReplacePolicy": "Delete", "DeletionPolicy": "Delete" @@ -1410,7 +1437,7 @@ "outputPaths": [ "CanaryRuns.0.Status.State" ], - "salt": "1721214952983" + "salt": "1723597538476" }, "UpdateReplacePolicy": "Delete", "DeletionPolicy": "Delete" @@ -1566,7 +1593,7 @@ "outputPaths": [ "CanaryRuns.0.Status.State" ], - "salt": "1721214952983" + "salt": "1723597538477" }, "UpdateReplacePolicy": "Delete", "DeletionPolicy": "Delete" @@ -1722,7 +1749,7 @@ "outputPaths": [ "CanaryRuns.0.Status.State" ], - "salt": "1721214952983" + "salt": "1723597538477" }, "UpdateReplacePolicy": "Delete", "DeletionPolicy": "Delete" @@ -1878,7 +1905,7 @@ "outputPaths": [ "CanaryRuns.0.Status.State" ], - "salt": "1721214952984" + "salt": "1723597538478" }, "UpdateReplacePolicy": "Delete", "DeletionPolicy": "Delete" @@ -1999,6 +2026,162 @@ "DependsOn": [ "AwsApiCallSyntheticsgetCanaryRunsf91ed1876add8c22a7b35f8a7e752983WaitForRoleC94CFFE2" ] + }, + "AwsApiCallSyntheticsgetCanaryRunsb217581b3c2b9adcdbff5018eb672c9c": { + "Type": "Custom::DeployAssert@SdkCallSyntheticsgetCanaryRuns", + "Properties": { + "ServiceToken": { + "Fn::GetAtt": [ + "SingletonFunction1488541a7b23466481b69b4408076b81HandlerCD40AE9F", + "Arn" + ] + }, + "service": "Synthetics", + "api": "getCanaryRuns", + "expected": "{\"$StringLike\":\"PASSED\"}", + "actualPath": "CanaryRuns.0.Status.State", + "stateMachineArn": { + "Ref": "AwsApiCallSyntheticsgetCanaryRunsb217581b3c2b9adcdbff5018eb672c9cWaitFor05E3431D" + }, + "parameters": { + "Name": { + "Fn::Join": [ + "", + [ + "\"", + { + "Fn::ImportValue": "canary-one:ExportsOutputRefSynPythonSelenium40B722B964C2C6F4B8" + }, + "\"" + ] + ] + } + }, + "flattenResponse": "true", + "outputPaths": [ + "CanaryRuns.0.Status.State" + ], + "salt": "1723597538478" + }, + "UpdateReplacePolicy": "Delete", + "DeletionPolicy": "Delete" + }, + "AwsApiCallSyntheticsgetCanaryRunsb217581b3c2b9adcdbff5018eb672c9cWaitForIsCompleteProviderInvoke01E7DCC8": { + "Type": "AWS::Lambda::Permission", + "Properties": { + "Action": "lambda:InvokeFunction", + "FunctionName": { + "Fn::GetAtt": [ + "SingletonFunction76b3e830a873425f8453eddd85c86925Handler81461ECE", + "Arn" + ] + }, + "Principal": { + "Fn::GetAtt": [ + "AwsApiCallSyntheticsgetCanaryRunsb217581b3c2b9adcdbff5018eb672c9cWaitForRole5879A1E5", + "Arn" + ] + } + } + }, + "AwsApiCallSyntheticsgetCanaryRunsb217581b3c2b9adcdbff5018eb672c9cWaitForTimeoutProviderInvoke75F47081": { + "Type": "AWS::Lambda::Permission", + "Properties": { + "Action": "lambda:InvokeFunction", + "FunctionName": { + "Fn::GetAtt": [ + "SingletonFunction5c1898e096fb4e3e95d5f6c67f3ce41aHandlerADF3E6EA", + "Arn" + ] + }, + "Principal": { + "Fn::GetAtt": [ + "AwsApiCallSyntheticsgetCanaryRunsb217581b3c2b9adcdbff5018eb672c9cWaitForRole5879A1E5", + "Arn" + ] + } + } + }, + "AwsApiCallSyntheticsgetCanaryRunsb217581b3c2b9adcdbff5018eb672c9cWaitForRole5879A1E5": { + "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" + ] + } + ] + } + ] + } + } + ] + } + }, + "AwsApiCallSyntheticsgetCanaryRunsb217581b3c2b9adcdbff5018eb672c9cWaitFor05E3431D": { + "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": [ + "AwsApiCallSyntheticsgetCanaryRunsb217581b3c2b9adcdbff5018eb672c9cWaitForRole5879A1E5", + "Arn" + ] + } + }, + "DependsOn": [ + "AwsApiCallSyntheticsgetCanaryRunsb217581b3c2b9adcdbff5018eb672c9cWaitForRole5879A1E5" + ] } }, "Outputs": { @@ -2081,6 +2264,14 @@ "assertion" ] } + }, + "AssertionResultsAwsApiCallSyntheticsgetCanaryRunsb217581b3c2b9adcdbff5018eb672c9c": { + "Value": { + "Fn::GetAtt": [ + "AwsApiCallSyntheticsgetCanaryRunsb217581b3c2b9adcdbff5018eb672c9c", + "assertion" + ] + } } }, "Mappings": { 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 c04d59b278548..a63bb80a2869c 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 @@ } } }, - "10bd361dd68440cb9e995cff511c50c3dedb3b1f8738d33d617124c232bfe370": { + "abbca33119998bb65d25c306135d90426911fa5590664eeecd4656429619259d": { "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": "10bd361dd68440cb9e995cff511c50c3dedb3b1f8738d33d617124c232bfe370.json", + "objectKey": "abbca33119998bb65d25c306135d90426911fa5590664eeecd4656429619259d.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 3a5ef9da098ef..89fb724f98900 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 @@ -2678,6 +2678,253 @@ }, "UpdateReplacePolicy": "Delete", "DeletionPolicy": "Delete" + }, + "SynPythonSelenium40ArtifactsBucketE0BB1A15": { + "Type": "AWS::S3::Bucket", + "Properties": { + "BucketEncryption": { + "ServerSideEncryptionConfiguration": [ + { + "ServerSideEncryptionByDefault": { + "SSEAlgorithm": "aws:kms" + } + } + ] + } + }, + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Retain" + }, + "SynPythonSelenium40ArtifactsBucketPolicy8A526829": { + "Type": "AWS::S3::BucketPolicy", + "Properties": { + "Bucket": { + "Ref": "SynPythonSelenium40ArtifactsBucketE0BB1A15" + }, + "PolicyDocument": { + "Statement": [ + { + "Action": "s3:*", + "Condition": { + "Bool": { + "aws:SecureTransport": "false" + } + }, + "Effect": "Deny", + "Principal": { + "AWS": "*" + }, + "Resource": [ + { + "Fn::GetAtt": [ + "SynPythonSelenium40ArtifactsBucketE0BB1A15", + "Arn" + ] + }, + { + "Fn::Join": [ + "", + [ + { + "Fn::GetAtt": [ + "SynPythonSelenium40ArtifactsBucketE0BB1A15", + "Arn" + ] + }, + "/*" + ] + ] + } + ] + } + ], + "Version": "2012-10-17" + } + } + }, + "SynPythonSelenium40ServiceRole48784551": { + "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": [ + "SynPythonSelenium40ArtifactsBucketE0BB1A15", + "Arn" + ] + } + }, + { + "Action": "s3:PutObject", + "Effect": "Allow", + "Resource": { + "Fn::Join": [ + "", + [ + { + "Fn::GetAtt": [ + "SynPythonSelenium40ArtifactsBucketE0BB1A15", + "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" + } + ] + } + }, + "SynPythonSelenium40B722B964": { + "Type": "AWS::Synthetics::Canary", + "Properties": { + "ArtifactS3Location": { + "Fn::Join": [ + "", + [ + "s3://", + { + "Ref": "SynPythonSelenium40ArtifactsBucketE0BB1A15" + } + ] + ] + }, + "Code": { + "Handler": "canary.handler", + "S3Bucket": { + "Fn::Sub": "cdk-hnb659fds-assets-${AWS::AccountId}-${AWS::Region}" + }, + "S3Key": "d6b51cbdd22d449b9e57c20ef9d0977e1cfbf06806f8008ce376101a2ad432a8.zip" + }, + "ExecutionRoleArn": { + "Fn::GetAtt": [ + "SynPythonSelenium40ServiceRole48784551", + "Arn" + ] + }, + "Name": "canaryonesynpyt322b51", + "RunConfig": { + "EnvironmentVariables": { + "URL": { + "Fn::Join": [ + "", + [ + "https://", + { + "Ref": "ApiGateway11E7F47B" + }, + ".execute-api.", + { + "Ref": "AWS::Region" + }, + ".", + { + "Ref": "AWS::URLSuffix" + }, + "/", + { + "Ref": "ApiGatewayDeploymentStageprod1C6D5CD6" + }, + "/" + ] + ] + } + } + }, + "RuntimeVersion": "syn-python-selenium-4.0", + "Schedule": { + "DurationInSeconds": "0", + "Expression": "rate(5 minutes)" + }, + "StartCanaryAfterCreation": true, + "Tags": [ + { + "Key": "aws-cdk:auto-delete-underlying-resources", + "Value": "true" + } + ] + } + }, + "SynPythonSelenium40AutoDeleteUnderlyingResourcesCustomResource69B197D0": { + "Type": "Custom::SyntheticsAutoDeleteUnderlyingResources", + "Properties": { + "ServiceToken": { + "Fn::GetAtt": [ + "CustomSyntheticsAutoDeleteUnderlyingResourcesCustomResourceProviderHandler26776D4E", + "Arn" + ] + }, + "CanaryName": { + "Ref": "SynPythonSelenium40B722B964" + } + }, + "UpdateReplacePolicy": "Delete", + "DeletionPolicy": "Delete" } }, "Mappings": { @@ -2910,6 +3157,14 @@ "Export": { "Name": "canary-one:ExportsOutputRefSynPythonSelenium30F6137007049602B8" } + }, + "ExportsOutputRefSynPythonSelenium40B722B964C2C6F4B8": { + "Value": { + "Ref": "SynPythonSelenium40B722B964" + }, + "Export": { + "Name": "canary-one:ExportsOutputRefSynPythonSelenium40B722B964C2C6F4B8" + } } }, "Parameters": { 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 fcfb869e2a222..17a715987ae7a 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}/10bd361dd68440cb9e995cff511c50c3dedb3b1f8738d33d617124c232bfe370.json", + "stackTemplateAssetObjectUrl": "s3://cdk-hnb659fds-assets-${AWS::AccountId}-${AWS::Region}/abbca33119998bb65d25c306135d90426911fa5590664eeecd4656429619259d.json", "requiresBootstrapStackVersion": 6, "bootstrapStackVersionSsmParameter": "/cdk-bootstrap/hnb659fds/version", "additionalDependencies": [ @@ -400,6 +400,36 @@ "data": "SynPythonSelenium30AutoDeleteUnderlyingResourcesCustomResource175FDAC3" } ], + "/canary-one/SynPythonSelenium40/ArtifactsBucket/Resource": [ + { + "type": "aws:cdk:logicalId", + "data": "SynPythonSelenium40ArtifactsBucketE0BB1A15" + } + ], + "/canary-one/SynPythonSelenium40/ArtifactsBucket/Policy/Resource": [ + { + "type": "aws:cdk:logicalId", + "data": "SynPythonSelenium40ArtifactsBucketPolicy8A526829" + } + ], + "/canary-one/SynPythonSelenium40/ServiceRole/Resource": [ + { + "type": "aws:cdk:logicalId", + "data": "SynPythonSelenium40ServiceRole48784551" + } + ], + "/canary-one/SynPythonSelenium40/Resource": [ + { + "type": "aws:cdk:logicalId", + "data": "SynPythonSelenium40B722B964" + } + ], + "/canary-one/SynPythonSelenium40/AutoDeleteUnderlyingResourcesCustomResource/Default": [ + { + "type": "aws:cdk:logicalId", + "data": "SynPythonSelenium40AutoDeleteUnderlyingResourcesCustomResource69B197D0" + } + ], "/canary-one/Exports/Output{\"Ref\":\"InlineAsset5EAEB9B5\"}": [ { "type": "aws:cdk:logicalId", @@ -460,6 +490,12 @@ "data": "ExportsOutputRefSynPythonSelenium30F6137007049602B8" } ], + "/canary-one/Exports/Output{\"Ref\":\"SynPythonSelenium40B722B964\"}": [ + { + "type": "aws:cdk:logicalId", + "data": "ExportsOutputRefSynPythonSelenium40B722B964C2C6F4B8" + } + ], "/canary-one/BootstrapVersion": [ { "type": "aws:cdk:logicalId", @@ -492,7 +528,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}/8c0bb05c9b4d0f76f702a52227e1b8ee8733db1a5ec5642188fc88c634a57091.json", + "stackTemplateAssetObjectUrl": "s3://cdk-hnb659fds-assets-${AWS::AccountId}-${AWS::Region}/bcff890e2c622fc43304e9895d19264d7efd1d511125fcbab04d4463cb503cb5.json", "requiresBootstrapStackVersion": 6, "bootstrapStackVersionSsmParameter": "/cdk-bootstrap/hnb659fds/version", "additionalDependencies": [ @@ -911,6 +947,42 @@ "data": "AssertionResultsAwsApiCallSyntheticsgetCanaryRunsf91ed1876add8c22a7b35f8a7e752983" } ], + "/IntegCanaryTest/DefaultTest/DeployAssert/AwsApiCallSyntheticsgetCanaryRunsb217581b3c2b9adcdbff5018eb672c9c/Default/Default": [ + { + "type": "aws:cdk:logicalId", + "data": "AwsApiCallSyntheticsgetCanaryRunsb217581b3c2b9adcdbff5018eb672c9c" + } + ], + "/IntegCanaryTest/DefaultTest/DeployAssert/AwsApiCallSyntheticsgetCanaryRunsb217581b3c2b9adcdbff5018eb672c9c/WaitFor/IsCompleteProvider/Invoke": [ + { + "type": "aws:cdk:logicalId", + "data": "AwsApiCallSyntheticsgetCanaryRunsb217581b3c2b9adcdbff5018eb672c9cWaitForIsCompleteProviderInvoke01E7DCC8" + } + ], + "/IntegCanaryTest/DefaultTest/DeployAssert/AwsApiCallSyntheticsgetCanaryRunsb217581b3c2b9adcdbff5018eb672c9c/WaitFor/TimeoutProvider/Invoke": [ + { + "type": "aws:cdk:logicalId", + "data": "AwsApiCallSyntheticsgetCanaryRunsb217581b3c2b9adcdbff5018eb672c9cWaitForTimeoutProviderInvoke75F47081" + } + ], + "/IntegCanaryTest/DefaultTest/DeployAssert/AwsApiCallSyntheticsgetCanaryRunsb217581b3c2b9adcdbff5018eb672c9c/WaitFor/Role": [ + { + "type": "aws:cdk:logicalId", + "data": "AwsApiCallSyntheticsgetCanaryRunsb217581b3c2b9adcdbff5018eb672c9cWaitForRole5879A1E5" + } + ], + "/IntegCanaryTest/DefaultTest/DeployAssert/AwsApiCallSyntheticsgetCanaryRunsb217581b3c2b9adcdbff5018eb672c9c/WaitFor/Resource": [ + { + "type": "aws:cdk:logicalId", + "data": "AwsApiCallSyntheticsgetCanaryRunsb217581b3c2b9adcdbff5018eb672c9cWaitFor05E3431D" + } + ], + "/IntegCanaryTest/DefaultTest/DeployAssert/AwsApiCallSyntheticsgetCanaryRunsb217581b3c2b9adcdbff5018eb672c9c/AssertionResults": [ + { + "type": "aws:cdk:logicalId", + "data": "AssertionResultsAwsApiCallSyntheticsgetCanaryRunsb217581b3c2b9adcdbff5018eb672c9c" + } + ], "/IntegCanaryTest/DefaultTest/DeployAssert/BootstrapVersion": [ { "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 9537bd9ea25e1..b88a48b7fd8bb 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 @@ -3708,6 +3708,359 @@ "version": "0.0.0" } }, + "SynPythonSelenium40": { + "id": "SynPythonSelenium40", + "path": "canary-one/SynPythonSelenium40", + "children": { + "ArtifactsBucket": { + "id": "ArtifactsBucket", + "path": "canary-one/SynPythonSelenium40/ArtifactsBucket", + "children": { + "Resource": { + "id": "Resource", + "path": "canary-one/SynPythonSelenium40/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/SynPythonSelenium40/ArtifactsBucket/Policy", + "children": { + "Resource": { + "id": "Resource", + "path": "canary-one/SynPythonSelenium40/ArtifactsBucket/Policy/Resource", + "attributes": { + "aws:cdk:cloudformation:type": "AWS::S3::BucketPolicy", + "aws:cdk:cloudformation:props": { + "bucket": { + "Ref": "SynPythonSelenium40ArtifactsBucketE0BB1A15" + }, + "policyDocument": { + "Statement": [ + { + "Action": "s3:*", + "Condition": { + "Bool": { + "aws:SecureTransport": "false" + } + }, + "Effect": "Deny", + "Principal": { + "AWS": "*" + }, + "Resource": [ + { + "Fn::GetAtt": [ + "SynPythonSelenium40ArtifactsBucketE0BB1A15", + "Arn" + ] + }, + { + "Fn::Join": [ + "", + [ + { + "Fn::GetAtt": [ + "SynPythonSelenium40ArtifactsBucketE0BB1A15", + "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/SynPythonSelenium40/ServiceRole", + "children": { + "ImportServiceRole": { + "id": "ImportServiceRole", + "path": "canary-one/SynPythonSelenium40/ServiceRole/ImportServiceRole", + "constructInfo": { + "fqn": "aws-cdk-lib.Resource", + "version": "0.0.0" + } + }, + "Resource": { + "id": "Resource", + "path": "canary-one/SynPythonSelenium40/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": [ + "SynPythonSelenium40ArtifactsBucketE0BB1A15", + "Arn" + ] + } + }, + { + "Action": "s3:PutObject", + "Effect": "Allow", + "Resource": { + "Fn::Join": [ + "", + [ + { + "Fn::GetAtt": [ + "SynPythonSelenium40ArtifactsBucketE0BB1A15", + "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/SynPythonSelenium40/Code", + "children": { + "Stage": { + "id": "Stage", + "path": "canary-one/SynPythonSelenium40/Code/Stage", + "constructInfo": { + "fqn": "aws-cdk-lib.AssetStaging", + "version": "0.0.0" + } + }, + "AssetBucket": { + "id": "AssetBucket", + "path": "canary-one/SynPythonSelenium40/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/SynPythonSelenium40/Resource", + "attributes": { + "aws:cdk:cloudformation:type": "AWS::Synthetics::Canary", + "aws:cdk:cloudformation:props": { + "artifactS3Location": { + "Fn::Join": [ + "", + [ + "s3://", + { + "Ref": "SynPythonSelenium40ArtifactsBucketE0BB1A15" + } + ] + ] + }, + "code": { + "handler": "canary.handler", + "s3Bucket": { + "Fn::Sub": "cdk-hnb659fds-assets-${AWS::AccountId}-${AWS::Region}" + }, + "s3Key": "d6b51cbdd22d449b9e57c20ef9d0977e1cfbf06806f8008ce376101a2ad432a8.zip" + }, + "executionRoleArn": { + "Fn::GetAtt": [ + "SynPythonSelenium40ServiceRole48784551", + "Arn" + ] + }, + "name": "canaryonesynpyt322b51", + "runConfig": { + "environmentVariables": { + "URL": { + "Fn::Join": [ + "", + [ + "https://", + { + "Ref": "ApiGateway11E7F47B" + }, + ".execute-api.", + { + "Ref": "AWS::Region" + }, + ".", + { + "Ref": "AWS::URLSuffix" + }, + "/", + { + "Ref": "ApiGatewayDeploymentStageprod1C6D5CD6" + }, + "/" + ] + ] + } + } + }, + "runtimeVersion": "syn-python-selenium-4.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/SynPythonSelenium40/AutoDeleteUnderlyingResourcesCustomResource", + "children": { + "Default": { + "id": "Default", + "path": "canary-one/SynPythonSelenium40/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" + } + }, "Exports": { "id": "Exports", "path": "canary-one/Exports", @@ -3791,6 +4144,14 @@ "fqn": "aws-cdk-lib.CfnOutput", "version": "0.0.0" } + }, + "Output{\"Ref\":\"SynPythonSelenium40B722B964\"}": { + "id": "Output{\"Ref\":\"SynPythonSelenium40B722B964\"}", + "path": "canary-one/Exports/Output{\"Ref\":\"SynPythonSelenium40B722B964\"}", + "constructInfo": { + "fqn": "aws-cdk-lib.CfnOutput", + "version": "0.0.0" + } } }, "constructInfo": { @@ -5270,6 +5631,138 @@ "version": "0.0.0" } }, + "AwsApiCallSyntheticsgetCanaryRunsb217581b3c2b9adcdbff5018eb672c9c": { + "id": "AwsApiCallSyntheticsgetCanaryRunsb217581b3c2b9adcdbff5018eb672c9c", + "path": "IntegCanaryTest/DefaultTest/DeployAssert/AwsApiCallSyntheticsgetCanaryRunsb217581b3c2b9adcdbff5018eb672c9c", + "children": { + "SdkProvider": { + "id": "SdkProvider", + "path": "IntegCanaryTest/DefaultTest/DeployAssert/AwsApiCallSyntheticsgetCanaryRunsb217581b3c2b9adcdbff5018eb672c9c/SdkProvider", + "children": { + "AssertionsProvider": { + "id": "AssertionsProvider", + "path": "IntegCanaryTest/DefaultTest/DeployAssert/AwsApiCallSyntheticsgetCanaryRunsb217581b3c2b9adcdbff5018eb672c9c/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/AwsApiCallSyntheticsgetCanaryRunsb217581b3c2b9adcdbff5018eb672c9c/Default", + "children": { + "Default": { + "id": "Default", + "path": "IntegCanaryTest/DefaultTest/DeployAssert/AwsApiCallSyntheticsgetCanaryRunsb217581b3c2b9adcdbff5018eb672c9c/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/AwsApiCallSyntheticsgetCanaryRunsb217581b3c2b9adcdbff5018eb672c9c/WaitFor", + "children": { + "IsCompleteProvider": { + "id": "IsCompleteProvider", + "path": "IntegCanaryTest/DefaultTest/DeployAssert/AwsApiCallSyntheticsgetCanaryRunsb217581b3c2b9adcdbff5018eb672c9c/WaitFor/IsCompleteProvider", + "children": { + "AssertionsProvider": { + "id": "AssertionsProvider", + "path": "IntegCanaryTest/DefaultTest/DeployAssert/AwsApiCallSyntheticsgetCanaryRunsb217581b3c2b9adcdbff5018eb672c9c/WaitFor/IsCompleteProvider/AssertionsProvider", + "constructInfo": { + "fqn": "constructs.Construct", + "version": "10.3.0" + } + }, + "Invoke": { + "id": "Invoke", + "path": "IntegCanaryTest/DefaultTest/DeployAssert/AwsApiCallSyntheticsgetCanaryRunsb217581b3c2b9adcdbff5018eb672c9c/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/AwsApiCallSyntheticsgetCanaryRunsb217581b3c2b9adcdbff5018eb672c9c/WaitFor/TimeoutProvider", + "children": { + "AssertionsProvider": { + "id": "AssertionsProvider", + "path": "IntegCanaryTest/DefaultTest/DeployAssert/AwsApiCallSyntheticsgetCanaryRunsb217581b3c2b9adcdbff5018eb672c9c/WaitFor/TimeoutProvider/AssertionsProvider", + "constructInfo": { + "fqn": "constructs.Construct", + "version": "10.3.0" + } + }, + "Invoke": { + "id": "Invoke", + "path": "IntegCanaryTest/DefaultTest/DeployAssert/AwsApiCallSyntheticsgetCanaryRunsb217581b3c2b9adcdbff5018eb672c9c/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/AwsApiCallSyntheticsgetCanaryRunsb217581b3c2b9adcdbff5018eb672c9c/WaitFor/Role", + "constructInfo": { + "fqn": "aws-cdk-lib.CfnResource", + "version": "0.0.0" + } + }, + "Resource": { + "id": "Resource", + "path": "IntegCanaryTest/DefaultTest/DeployAssert/AwsApiCallSyntheticsgetCanaryRunsb217581b3c2b9adcdbff5018eb672c9c/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/AwsApiCallSyntheticsgetCanaryRunsb217581b3c2b9adcdbff5018eb672c9c/AssertionResults", + "constructInfo": { + "fqn": "aws-cdk-lib.CfnOutput", + "version": "0.0.0" + } + } + }, + "constructInfo": { + "fqn": "@aws-cdk/integ-tests-alpha.AwsApiCall", + "version": "0.0.0" + } + }, "BootstrapVersion": { "id": "BootstrapVersion", "path": "IntegCanaryTest/DefaultTest/DeployAssert/BootstrapVersion", 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 d10d15bbafa2a..b42b2ed1a17be 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 @@ -103,6 +103,7 @@ const puppeteer80 = createCanaryByRuntimes(Runtime.SYNTHETICS_NODEJS_PUPPETEER_8 const selenium21 = createCanaryByRuntimes(Runtime.SYNTHETICS_PYTHON_SELENIUM_2_1); const selenium30 = createCanaryByRuntimes(Runtime.SYNTHETICS_PYTHON_SELENIUM_3_0); +const selenium40 = createCanaryByRuntimes(Runtime.SYNTHETICS_PYTHON_SELENIUM_4_0); const test = new IntegTest(app, 'IntegCanaryTest', { testCases: [stack], @@ -120,6 +121,7 @@ const test = new IntegTest(app, 'IntegCanaryTest', { puppeteer80, selenium21, selenium30, + selenium40, ].forEach((canary) => test.assertions .awsApiCall('Synthetics', 'getCanaryRuns', { Name: canary.canaryName, diff --git a/packages/aws-cdk-lib/aws-synthetics/lib/runtime.ts b/packages/aws-cdk-lib/aws-synthetics/lib/runtime.ts index 349e2db317851..836c60de52f2b 100644 --- a/packages/aws-cdk-lib/aws-synthetics/lib/runtime.ts +++ b/packages/aws-cdk-lib/aws-synthetics/lib/runtime.ts @@ -322,6 +322,19 @@ export class Runtime { */ public static readonly SYNTHETICS_PYTHON_SELENIUM_3_0 = new Runtime('syn-python-selenium-3.0', RuntimeFamily.PYTHON); + /** + * `syn-python-selenium-4.0` includes the following: + * - Lambda runtime Python 3.9 + * - Selenium version 4.15.1 + * - Chromium version 126.0.6478.126 + * + * New Features: + * - **Bug fixes** for errors in HAR parser logging. + * + * @see https://docs.aws.amazon.com/AmazonCloudWatch/latest/monitoring/CloudWatch_Synthetics_Library_python_selenium.html#CloudWatch_Synthetics_runtimeversion-syn-python-selenium-4.0 + */ + public static readonly SYNTHETICS_PYTHON_SELENIUM_4_0 = new Runtime('syn-python-selenium-4.0', RuntimeFamily.PYTHON); + /** * @param name The name of the runtime version * @param family The Lambda runtime family 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 f418ce6728b40..f11f08ebe02bd 100644 --- a/packages/aws-cdk-lib/aws-synthetics/test/canary.test.ts +++ b/packages/aws-cdk-lib/aws-synthetics/test/canary.test.ts @@ -224,7 +224,7 @@ test('Python runtime can be specified', () => { // WHEN new synthetics.Canary(stack, 'Canary', { - runtime: synthetics.Runtime.SYNTHETICS_PYTHON_SELENIUM_2_0, + runtime: synthetics.Runtime.SYNTHETICS_PYTHON_SELENIUM_4_0, test: synthetics.Test.custom({ handler: 'index.handler', code: synthetics.Code.fromInline('# Synthetics handler code'), @@ -233,7 +233,7 @@ test('Python runtime can be specified', () => { // THEN Template.fromStack(stack).hasResourceProperties('AWS::Synthetics::Canary', { - RuntimeVersion: 'syn-python-selenium-2.0', + RuntimeVersion: 'syn-python-selenium-4.0', }); });