class Test
Language | Type name |
---|---|
.NET | Amazon.CDK.AWS.Synthetics.Test |
Go | github.com/aws/aws-cdk-go/awscdk/v2/awssynthetics#Test |
Java | software.amazon.awscdk.services.synthetics.Test |
Python | aws_cdk.aws_synthetics.Test |
TypeScript (source) | aws-cdk-lib » aws_synthetics » Test |
Specify a test that the canary should run.
Example
import * as cdk from "aws-cdk-lib";
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_6_2,
memory: cdk.Size.mebibytes(1024), // 1024 MiB
});
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.