class Test
| Language | Type name |
|---|---|
.NET | Amazon.CDK.AWS.Synthetics.Test |
Java | software.amazon.awscdk.services.synthetics.Test |
Python | aws_cdk.aws_synthetics.Test |
TypeScript (source) | @aws-cdk/aws-synthetics » Test |
Specify a test that the canary should run.
Example
const canary = new synthetics.Canary(this, 'MyCanary', {
schedule: synthetics.Schedule.rate(Duration.minutes(5)),
test: synthetics.Test.custom({
code: synthetics.Code.fromAsset(path.join(__dirname, 'canary')),
handler: 'index.handler',
}),
runtime: synthetics.Runtime.SYNTHETICS_NODEJS_PUPPETEER_3_1,
environmentVariables: {
stage: 'prod',
},
});
Properties
| Name | Type | Description |
|---|---|---|
| code | Code | The code that the canary should run. |
| handler | string | The handler of the canary. |
code
Type:
Code
The code that the canary should run.
handler
Type:
string
The handler of the canary.
Methods
| Name | Description |
|---|---|
| static custom(options) | Specify a custom test with your own code. |
static custom(options)
public static custom(options: CustomTestOptions): Test
Parameters
- options
Custom— The configuration options.Test Options
Returns
Specify a custom test with your own code.

.NET
Java
Python
TypeScript (