Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(synthetics): add syn-nodejs-puppeteer-3.3 runtime #17132

Merged
merged 4 commits into from
Oct 25, 2021
Merged
Show file tree
Hide file tree
Changes from 3 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions packages/@aws-cdk/aws-synthetics/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -127,7 +127,7 @@ new synthetics.Canary(this, 'Inline Canary', {
code: synthetics.Code.fromInline('/* Synthetics handler code */'),
handler: 'index.handler', // must be 'index.handler'
}),
runtime: synthetics.Runtime.SYNTHETICS_NODEJS_PUPPETEER_3_1,
runtime: synthetics.Runtime.SYNTHETICS_NODEJS_PUPPETEER_3_3,
});

// To supply the code from your local filesystem:
Expand All @@ -136,7 +136,7 @@ new synthetics.Canary(this, 'Asset Canary', {
code: synthetics.Code.fromAsset(path.join(__dirname, 'canary')),
handler: 'index.handler', // must end with '.handler'
}),
runtime: synthetics.Runtime.SYNTHETICS_NODEJS_PUPPETEER_3_1,
runtime: synthetics.Runtime.SYNTHETICS_NODEJS_PUPPETEER_3_3,
});

// To supply the code from a S3 bucket:
Expand All @@ -147,7 +147,7 @@ new synthetics.Canary(this, 'Bucket Canary', {
code: synthetics.Code.fromBucket(bucket, 'canary.zip'),
handler: 'index.handler', // must end with '.handler'
}),
runtime: synthetics.Runtime.SYNTHETICS_NODEJS_PUPPETEER_3_1,
runtime: synthetics.Runtime.SYNTHETICS_NODEJS_PUPPETEER_3_3,
});
```

Expand Down
10 changes: 10 additions & 0 deletions packages/@aws-cdk/aws-synthetics/lib/runtime.ts
Original file line number Diff line number Diff line change
Expand Up @@ -104,6 +104,16 @@ export class Runtime {
*/
public static readonly SYNTHETICS_NODEJS_PUPPETEER_3_2 = new Runtime('syn-nodejs-puppeteer-3.2', RuntimeFamily.NODEJS);

/**
* `syn-nodejs-puppeteer-3.3` includes the following:
* - Lambda runtime Node.js 12.x
* - Puppeteer-core version 5.5.0
* - Chromium version 88.0.4298.0
*
* @see https://docs.aws.amazon.com/AmazonCloudWatch/latest/monitoring/CloudWatch_Synthetics_Library_nodejs_puppeteer.html#CloudWatch_Synthetics_runtimeversion-nodejs-puppeteer-3.3
*/
public static readonly SYNTHETICS_NODEJS_PUPPETEER_3_3 = new Runtime('syn-nodejs-puppeteer-3.3', RuntimeFamily.NODEJS);

/**
* `syn-python-selenium-1.0` includes the following:
* - Lambda runtime Python 3.8
Expand Down
167 changes: 167 additions & 0 deletions packages/@aws-cdk/aws-synthetics/test/integ.canary.expected.json
Original file line number Diff line number Diff line change
Expand Up @@ -456,6 +456,173 @@
"StartCanaryAfterCreation": true
}
},
"MyCanaryThreeArtifactsBucket894E857E": {
"Type": "AWS::S3::Bucket",
"Properties": {
"BucketEncryption": {
"ServerSideEncryptionConfiguration": [
{
"ServerSideEncryptionByDefault": {
"SSEAlgorithm": "aws:kms"
}
}
]
}
},
"UpdateReplacePolicy": "Retain",
"DeletionPolicy": "Retain"
},
"MyCanaryThreeServiceRole68117E65": {
"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:PutObject",
"s3:GetBucketLocation"
],
"Effect": "Allow",
"Resource": {
"Fn::Join": [
"",
[
{
"Fn::GetAtt": [
"MyCanaryThreeArtifactsBucket894E857E",
"Arn"
]
},
"/*"
]
]
}
},
{
"Action": "cloudwatch:PutMetricData",
"Condition": {
"StringEquals": {
"cloudwatch:namespace": "CloudWatchSynthetics"
}
},
"Effect": "Allow",
"Resource": "*"
},
{
"Action": [
"logs:CreateLogStream",
"logs:CreateLogGroup",
"logs:PutLogEvents"
],
"Effect": "Allow",
"Resource": {
"Fn::Join": [
"",
[
"arn:",
{
"Ref": "AWS::Partition"
},
":logs:::*"
]
]
}
}
],
"Version": "2012-10-17"
},
"PolicyName": "canaryPolicy"
}
]
}
},
"MyCanaryThree968B1271": {
"Type": "AWS::Synthetics::Canary",
"Properties": {
"ArtifactS3Location": {
"Fn::Join": [
"",
[
"s3://",
{
"Ref": "MyCanaryThreeArtifactsBucket894E857E"
}
]
]
},
"Code": {
"Handler": "canary.handler",
"S3Bucket": {
"Ref": "AssetParametersb1b777dcb79a2fa2790059927207d10bf5f4747d6dd1516e2780726d9d6fa820S3Bucket705C3761"
},
"S3Key": {
"Fn::Join": [
"",
[
{
"Fn::Select": [
0,
{
"Fn::Split": [
"||",
{
"Ref": "AssetParametersb1b777dcb79a2fa2790059927207d10bf5f4747d6dd1516e2780726d9d6fa820S3VersionKeyE546342B"
}
]
}
]
},
{
"Fn::Select": [
1,
{
"Fn::Split": [
"||",
{
"Ref": "AssetParametersb1b777dcb79a2fa2790059927207d10bf5f4747d6dd1516e2780726d9d6fa820S3VersionKeyE546342B"
}
]
}
]
}
]
]
}
},
"ExecutionRoleArn": {
"Fn::GetAtt": [
"MyCanaryThreeServiceRole68117E65",
"Arn"
]
},
"Name": "assetcanary-three",
"RuntimeVersion": "syn-nodejs-puppeteer-3.3",
"Schedule": {
"DurationInSeconds": "0",
"Expression": "rate(5 minutes)"
},
"StartCanaryAfterCreation": true
}
},
"MyPythonCanaryArtifactsBucket7AE88133": {
"Type": "AWS::S3::Bucket",
"Properties": {
Expand Down
10 changes: 10 additions & 0 deletions packages/@aws-cdk/aws-synthetics/test/integ.canary.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ import * as synthetics from '../lib';
* -- aws synthetics get-canary --name canary-integ has a state of 'RUNNING'
* -- aws synthetics get-canary --name assetcanary-one has a state of 'RUNNING'
* -- aws synthetics get-canary --name assetcanary-two has a state of 'RUNNING'
* -- aws synthetics get-canary --name assetcanary-three has a state of 'RUNNING'
*/
const app = new cdk.App();
const stack = new cdk.Stack(app, 'canary-one');
Expand Down Expand Up @@ -50,6 +51,15 @@ new synthetics.Canary(stack, 'MyCanaryTwo', {
runtime: synthetics.Runtime.SYNTHETICS_NODEJS_PUPPETEER_3_2,
});

new synthetics.Canary(stack, 'MyCanaryThree', {
canaryName: 'assetcanary-three',
test: synthetics.Test.custom({
handler: 'canary.handler',
code: synthetics.Code.fromAsset(path.join(__dirname, 'canary.zip')),
}),
runtime: synthetics.Runtime.SYNTHETICS_NODEJS_PUPPETEER_3_3,
});

new synthetics.Canary(stack, 'MyPythonCanary', {
canaryName: 'py-canary-integ',
test: synthetics.Test.custom({
Expand Down