Skip to content

Commit

Permalink
feat(synthetics): Update CloudWatch Synthetics NodeJS runtimes (#12907)
Browse files Browse the repository at this point in the history
CloudWatch Synthetics recently released new NodeJS runtimes (https://docs.aws.amazon.com/AmazonCloudWatch/latest/monitoring/CloudWatch_Synthetics_Library_nodejs_puppeteer.html).

This PR is adding them and updating docs

Fixes #12906

----

*By submitting this pull request, I confirm that my contribution is made under the terms of the Apache-2.0 license*
  • Loading branch information
naamancampbell committed Feb 21, 2021
1 parent b1c0437 commit 6aac3b6
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 6 deletions.
8 changes: 4 additions & 4 deletions packages/@aws-cdk/aws-synthetics/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ const canary = new synthetics.Canary(this, 'MyCanary', {
code: synthetics.Code.fromAsset(path.join(__dirname, 'canary')),
handler: 'index.handler',
}),
runtime: synthetics.Runtime.SYNTHETICS_NODEJS_2_2,
runtime: synthetics.Runtime.SYNTHETICS_NODEJS_PUPPETEER_3_0,
});
```

Expand Down Expand Up @@ -107,7 +107,7 @@ const canary = new Canary(this, 'MyCanary', {
code: synthetics.Code.fromInline('/* Synthetics handler code */'),
handler: 'index.handler', // must be 'index.handler'
}),
runtime: synthetics.Runtime.SYNTHETICS_NODEJS_2_2,
runtime: synthetics.Runtime.SYNTHETICS_NODEJS_PUPPETEER_3_0,
});

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

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

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

/**
* `syn-nodejs-puppeteer-3.0` 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.0
*/
public static readonly SYNTHETICS_NODEJS_PUPPETEER_3_0 = new Runtime('syn-nodejs-puppeteer-3.0');

/**
* @param name The name of the runtime version
*/
Expand Down
4 changes: 2 additions & 2 deletions packages/@aws-cdk/aws-synthetics/test/canary.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ test('Canary can have generated name', () => {
handler: 'index.handler',
code: synthetics.Code.fromInline('/* Synthetics handler code */'),
}),
runtime: synthetics.Runtime.SYNTHETICS_NODEJS_2_0,
runtime: synthetics.Runtime.SYNTHETICS_NODEJS_PUPPETEER_3_0,
});

// THEN
Expand Down Expand Up @@ -355,4 +355,4 @@ test('can specify custom test', () => {
};`,
},
});
});
});

0 comments on commit 6aac3b6

Please sign in to comment.