interface CfnCanaryProps
Language | Type name |
---|---|
![]() | Amazon.CDK.AWS.Synthetics.CfnCanaryProps |
![]() | github.com/aws/aws-cdk-go/awscdk/v2/awssynthetics#CfnCanaryProps |
![]() | software.amazon.awscdk.services.synthetics.CfnCanaryProps |
![]() | aws_cdk.aws_synthetics.CfnCanaryProps |
![]() | aws-cdk-lib » aws_synthetics » CfnCanaryProps |
Properties for defining a CfnCanary
.
See also: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-synthetics-canary.html
Example
// The code below shows an example of how to instantiate this type.
// The values are placeholders you should change.
import { aws_synthetics as synthetics } from 'aws-cdk-lib';
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,
provisionedResourceCleanup: 'provisionedResourceCleanup',
resourcesToReplicateTags: ['resourcesToReplicateTags'],
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
ipv6AllowedForDualStack: false,
vpcId: 'vpcId',
},
};
Properties
Name | Type | Description |
---|---|---|
artifact | string | The location in Amazon S3 where Synthetics stores artifacts from the runs of this canary. |
code | IResolvable | Code | 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 | Deletes associated lambda resources created by Synthetics if set to True. |
failure | number | The number of days to retain data about failed runs of this canary. |
provisioned | string | Specifies whether to also delete the Lambda functions and layers used by this canary when the canary is deleted. |
resources | string[] | To have the tags that you apply to this canary also be applied to the Lambda function that the canary uses, specify this property with the value lambda-function . |
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:
IResolvable
|
Code
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?
⚠️ Deprecated: this property has been deprecated
Type:
boolean |
IResolvable
(optional)
Deletes associated lambda resources created by Synthetics if set to True.
Default is False
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.
This setting affects the range of information returned by GetCanaryRuns , as well as the range of information displayed in the Synthetics console.
provisionedResourceCleanup?
Type:
string
(optional)
Specifies whether to also delete the Lambda functions and layers used by this canary when the canary is deleted.
If it is AUTOMATIC
, the Lambda functions and layers will be deleted when the canary is deleted.
If the value of this parameter is OFF
, then the value of the DeleteLambda
parameter of the DeleteCanary operation determines whether the Lambda functions and layers will be deleted.
resourcesToReplicateTags?
Type:
string[]
(optional)
To have the tags that you apply to this canary also be applied to the Lambda function that the canary uses, specify this property with the value lambda-function
.
If you do this, CloudWatch Synthetics will keep the tags of the canary and the Lambda function synchronized. Any future changes you make to the canary's tags will also be applied to the function.
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.
This setting affects the range of information returned by GetCanaryRuns , as well as the range of information displayed in the Synthetics console.
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 .