Skip to content
10 changes: 5 additions & 5 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_0,
runtime: synthetics.Runtime.SYNTHETICS_NODEJS_2_2,
});
```

Expand Down Expand Up @@ -84,7 +84,7 @@ The canary will automatically produce a CloudWatch Dashboard:

![UI Screenshot](images/ui-screenshot.png)

The Canary code will be executed in a lambda function created by Synthetics on your behalf. The Lambda function includes a custom [runtime](https://docs.aws.amazon.com/AmazonCloudWatch/latest/monitoring/CloudWatch_Synthetics_Canaries_Library.html) provided by Synthetics. The provided runtime includes a variety of handy tools such as [Puppeteer](https://www.npmjs.com/package/puppeteer-core) and Chromium. The default runtime is `syn-nodejs-2.0`.
The Canary code will be executed in a lambda function created by Synthetics on your behalf. The Lambda function includes a custom [runtime](https://docs.aws.amazon.com/AmazonCloudWatch/latest/monitoring/CloudWatch_Synthetics_Canaries_Library.html) provided by Synthetics. The provided runtime includes a variety of handy tools such as [Puppeteer](https://www.npmjs.com/package/puppeteer-core) (for nodejs based one) and Chromium.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This should have been removed when the runtime property was made a required property. Can you remove it (instead of fixing it)

Copy link
Contributor Author

@flochaz flochaz Jan 4, 2021

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I removed it, I just mentioned that pupetter is for nodejs runtime only since python one use selenium. But If you prefer I'll keep that for python PR.

To learn more about Synthetics capabilities, check out the [docs](https://docs.aws.amazon.com/AmazonCloudWatch/latest/monitoring/CloudWatch_Synthetics_Canaries.html).

Expand All @@ -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_0,
runtime: synthetics.Runtime.SYNTHETICS_NODEJS_2_2,
});

// 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_0,
runtime: synthetics.Runtime.SYNTHETICS_NODEJS_2_2,
});

// 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_0,
runtime: synthetics.Runtime.SYNTHETICS_NODEJS_2_2,
});
```

Expand Down
27 changes: 24 additions & 3 deletions packages/@aws-cdk/aws-synthetics/lib/canary.ts
Original file line number Diff line number Diff line change
Expand Up @@ -77,20 +77,41 @@ export class Runtime {
* - Puppeteer-core version 1.14.0
* - The Chromium version that matches Puppeteer-core 1.14.0
*
* @see https://docs.aws.amazon.com/AmazonCloudWatch/latest/monitoring/CloudWatch_Synthetics_Canaries_Library.html#CloudWatch_Synthetics_runtimeversion-1.0
* @see https://docs.aws.amazon.com/AmazonCloudWatch/latest/monitoring/CloudWatch_Synthetics_Library_nodejs_puppeteer.html#CloudWatch_Synthetics_runtimeversion-1.0
*/
public static readonly SYNTHETICS_1_0 = new Runtime('syn-1.0');

/**
* `syn-nodejs-2.0` includes the following:
* - Lambda runtime Node.js 10.x
* - Puppeteer-core version 3.3.0
* - Chromium version 81.0.4044.0
* - Chromium version 83.0.4103.0
*
* @see https://docs.aws.amazon.com/AmazonCloudWatch/latest/monitoring/CloudWatch_Synthetics_Canaries_Library.html#CloudWatch_Synthetics_runtimeversion-2.0
* @see https://docs.aws.amazon.com/AmazonCloudWatch/latest/monitoring/CloudWatch_Synthetics_Library_nodejs_puppeteer.html#CloudWatch_Synthetics_runtimeversion-2.0
*/
public static readonly SYNTHETICS_NODEJS_2_0 = new Runtime('syn-nodejs-2.0');


/**
* `syn-nodejs-2.1` includes the following:
* - Lambda runtime Node.js 10.x
* - Puppeteer-core version 3.3.0
* - Chromium version 83.0.4103.0
*
* @see https://docs.aws.amazon.com/AmazonCloudWatch/latest/monitoring/CloudWatch_Synthetics_Library_nodejs_puppeteer.html#CloudWatch_Synthetics_runtimeversion-2.1
*/
public static readonly SYNTHETICS_NODEJS_2_1 = new Runtime('syn-nodejs-2.1');

/**
* `syn-nodejs-2.2` includes the following:
* - Lambda runtime Node.js 10.x
* - Puppeteer-core version 3.3.0
* - Chromium version 83.0.4103.0
*
* @see https://docs.aws.amazon.com/AmazonCloudWatch/latest/monitoring/CloudWatch_Synthetics_Library_nodejs_puppeteer.html#CloudWatch_Synthetics_runtimeversion-2.2
*/
public static readonly SYNTHETICS_NODEJS_2_2 = new Runtime('syn-nodejs-2.2');

/**
* @param name The name of the runtime version
*/
Expand Down