interface CfnCanaryProps
Language | Type name |
---|---|
![]() | Amazon.CDK.AWS.Synthetics.CfnCanaryProps |
![]() | software.amazon.awscdk.services.synthetics.CfnCanaryProps |
![]() | aws_cdk.aws_synthetics.CfnCanaryProps |
![]() | @aws-cdk/aws-synthetics » CfnCanaryProps |
Properties for defining a CfnCanary
.
Example
// The code below shows an example of how to instantiate this type.
// The values are placeholders you should change.
import * as synthetics from '@aws-cdk/aws-synthetics';
const cfnCanaryProps: synthetics.CfnCanaryProps = {
artifactS3Location: 'artifactS3Location',
code: {
handler: 'handler',
// the properties below are optional
s3Bucket: 's3Bucket',
s3Key: 's3Key',
s3ObjectVersion: 's3ObjectVersion',
script: 'script',
sourceLocationArn: 'sourceLocationArn',
},
executionRoleArn: 'executionRoleArn',
name: 'name',
runtimeVersion: 'runtimeVersion',
schedule: {
expression: 'expression',
// the properties below are optional
durationInSeconds: 'durationInSeconds',
},
// the properties below are optional
artifactConfig: {
s3Encryption: {
encryptionMode: 'encryptionMode',
kmsKeyArn: 'kmsKeyArn',
},
},
deleteLambdaResourcesOnCanaryDeletion: false,
failureRetentionPeriod: 123,
runConfig: {
activeTracing: false,
environmentVariables: {
environmentVariablesKey: 'environmentVariables',
},
memoryInMb: 123,
timeoutInSeconds: 123,
},
startCanaryAfterCreation: false,
successRetentionPeriod: 123,
tags: [{
key: 'key',
value: 'value',
}],
visualReference: {
baseCanaryRunId: 'baseCanaryRunId',
// the properties below are optional
baseScreenshots: [{
screenshotName: 'screenshotName',
// the properties below are optional
ignoreCoordinates: ['ignoreCoordinates'],
}],
},
vpcConfig: {
securityGroupIds: ['securityGroupIds'],
subnetIds: ['subnetIds'],
// the properties below are optional
vpcId: 'vpcId',
},
};
Properties
Name | Type | Description |
---|---|---|
artifact | string | The location in Amazon S3 where Synthetics stores artifacts from the runs of this canary. |
code | Code | IResolvable | Use this structure to input your script code for the canary. |
execution | string | The ARN of the IAM role to be used to run the canary. |
name | string | The name for this canary. |
runtime | string | Specifies the runtime version to use for the canary. |
schedule | IResolvable | Schedule | A structure that contains information about how often the canary is to run, and when these runs are to stop. |
artifact | IResolvable | Artifact | A structure that contains the configuration for canary artifacts, including the encryption-at-rest settings for artifacts that the canary uploads to Amazon S3. |
delete | boolean | IResolvable | AWS::Synthetics::Canary.DeleteLambdaResourcesOnCanaryDeletion . |
failure | number | The number of days to retain data about failed runs of this canary. |
run | IResolvable | Run | A structure that contains input information for a canary run. |
start | boolean | IResolvable | Specify TRUE to have the canary start making runs immediately after it is created. |
success | number | The number of days to retain data about successful runs of this canary. |
tags? | Cfn [] | The list of key-value pairs that are associated with the canary. |
visual | IResolvable | Visual | If this canary performs visual monitoring by comparing screenshots, this structure contains the ID of the canary run to use as the baseline for screenshots, and the coordinates of any parts of the screen to ignore during the visual monitoring comparison. |
vpc | IResolvable | VPCConfig | If this canary is to test an endpoint in a VPC, this structure contains information about the subnet and security groups of the VPC endpoint. |
artifactS3Location
Type:
string
The location in Amazon S3 where Synthetics stores artifacts from the runs of this canary.
Artifacts include the log file, screenshots, and HAR files. Specify the full location path, including s3://
at the beginning of the path.
code
Type:
Code
|
IResolvable
Use this structure to input your script code for the canary.
This structure contains the Lambda handler with the location where the canary should start running the script. If the script is stored in an S3 bucket, the bucket name, key, and version are also included. If the script is passed into the canary directly, the script code is contained in the value of Script
.
executionRoleArn
Type:
string
The ARN of the IAM role to be used to run the canary.
This role must already exist, and must include lambda.amazonaws.com
as a principal in the trust policy. The role must also have the following permissions:
s3:PutObject
s3:GetBucketLocation
s3:ListAllMyBuckets
cloudwatch:PutMetricData
logs:CreateLogGroup
logs:CreateLogStream
logs:PutLogEvents
name
Type:
string
The name for this canary.
Be sure to give it a descriptive name that distinguishes it from other canaries in your account.
Do not include secrets or proprietary information in your canary names. The canary name makes up part of the canary ARN, and the ARN is included in outbound calls over the internet. For more information, see Security Considerations for Synthetics Canaries .
runtimeVersion
Type:
string
Specifies the runtime version to use for the canary.
For more information about runtime versions, see Canary Runtime Versions .
schedule
Type:
IResolvable
|
Schedule
A structure that contains information about how often the canary is to run, and when these runs are to stop.
artifactConfig?
Type:
IResolvable
|
Artifact
(optional)
A structure that contains the configuration for canary artifacts, including the encryption-at-rest settings for artifacts that the canary uploads to Amazon S3.
deleteLambdaResourcesOnCanaryDeletion?
Type:
boolean |
IResolvable
(optional)
AWS::Synthetics::Canary.DeleteLambdaResourcesOnCanaryDeletion
.
failureRetentionPeriod?
Type:
number
(optional)
The number of days to retain data about failed runs of this canary.
If you omit this field, the default of 31 days is used. The valid range is 1 to 455 days.
runConfig?
Type:
IResolvable
|
Run
(optional)
A structure that contains input information for a canary run.
If you omit this structure, the frequency of the canary is used as canary's timeout value, up to a maximum of 900 seconds.
startCanaryAfterCreation?
Type:
boolean |
IResolvable
(optional)
Specify TRUE to have the canary start making runs immediately after it is created.
A canary that you create using CloudFormation can't be used to monitor the CloudFormation stack that creates the canary or to roll back that stack if there is a failure.
successRetentionPeriod?
Type:
number
(optional)
The number of days to retain data about successful runs of this canary.
If you omit this field, the default of 31 days is used. The valid range is 1 to 455 days.
tags?
Type:
Cfn
[]
(optional)
The list of key-value pairs that are associated with the canary.
visualReference?
Type:
IResolvable
|
Visual
(optional)
If this canary performs visual monitoring by comparing screenshots, this structure contains the ID of the canary run to use as the baseline for screenshots, and the coordinates of any parts of the screen to ignore during the visual monitoring comparison.
vpcConfig?
Type:
IResolvable
|
VPCConfig
(optional)
If this canary is to test an endpoint in a VPC, this structure contains information about the subnet and security groups of the VPC endpoint.
For more information, see Running a Canary in a VPC .