CfnCanaryProps
- class aws_cdk.aws_synthetics.CfnCanaryProps(*, artifact_s3_location, code, execution_role_arn, name, runtime_version, schedule, artifact_config=None, delete_lambda_resources_on_canary_deletion=None, failure_retention_period=None, run_config=None, start_canary_after_creation=None, success_retention_period=None, tags=None, visual_reference=None, vpc_config=None)
Bases:
object
Properties for defining a
CfnCanary
.- Parameters:
artifact_s3_location (
str
) – 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, includings3://
at the beginning of the path.code (
Union
[CodeProperty
,Dict
[str
,Any
],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 ofScript
.execution_role_arn (
str
) – The ARN of the IAM role to be used to run the canary. This role must already exist, and must includelambda.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 (
str
) – 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 .runtime_version (
str
) – Specifies the runtime version to use for the canary. For more information about runtime versions, see Canary Runtime Versions .schedule (
Union
[IResolvable
,ScheduleProperty
,Dict
[str
,Any
]]) – A structure that contains information about how often the canary is to run, and when these runs are to stop.artifact_config (
Union
[IResolvable
,ArtifactConfigProperty
,Dict
[str
,Any
],None
]) – 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_lambda_resources_on_canary_deletion (
Union
[bool
,IResolvable
,None
]) –AWS::Synthetics::Canary.DeleteLambdaResourcesOnCanaryDeletion
.failure_retention_period (
Union
[int
,float
,None
]) – 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.run_config (
Union
[IResolvable
,RunConfigProperty
,Dict
[str
,Any
],None
]) – 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.start_canary_after_creation (
Union
[bool
,IResolvable
,None
]) – 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.success_retention_period (
Union
[int
,float
,None
]) – 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 (
Optional
[Sequence
[Union
[CfnTag
,Dict
[str
,Any
]]]]) – The list of key-value pairs that are associated with the canary.visual_reference (
Union
[IResolvable
,VisualReferenceProperty
,Dict
[str
,Any
],None
]) – 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_config (
Union
[IResolvable
,VPCConfigProperty
,Dict
[str
,Any
],None
]) – 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 .
- Link:
http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-synthetics-canary.html
- ExampleMetadata:
fixture=_generated
Example:
# The code below shows an example of how to instantiate this type. # The values are placeholders you should change. import aws_cdk.aws_synthetics as synthetics cfn_canary_props = synthetics.CfnCanaryProps( artifact_s3_location="artifactS3Location", code=synthetics.CfnCanary.CodeProperty( handler="handler", # the properties below are optional s3_bucket="s3Bucket", s3_key="s3Key", s3_object_version="s3ObjectVersion", script="script", source_location_arn="sourceLocationArn" ), execution_role_arn="executionRoleArn", name="name", runtime_version="runtimeVersion", schedule=synthetics.CfnCanary.ScheduleProperty( expression="expression", # the properties below are optional duration_in_seconds="durationInSeconds" ), # the properties below are optional artifact_config=synthetics.CfnCanary.ArtifactConfigProperty( s3_encryption=synthetics.CfnCanary.S3EncryptionProperty( encryption_mode="encryptionMode", kms_key_arn="kmsKeyArn" ) ), delete_lambda_resources_on_canary_deletion=False, failure_retention_period=123, run_config=synthetics.CfnCanary.RunConfigProperty( active_tracing=False, environment_variables={ "environment_variables_key": "environmentVariables" }, memory_in_mb=123, timeout_in_seconds=123 ), start_canary_after_creation=False, success_retention_period=123, tags=[CfnTag( key="key", value="value" )], visual_reference=synthetics.CfnCanary.VisualReferenceProperty( base_canary_run_id="baseCanaryRunId", # the properties below are optional base_screenshots=[synthetics.CfnCanary.BaseScreenshotProperty( screenshot_name="screenshotName", # the properties below are optional ignore_coordinates=["ignoreCoordinates"] )] ), vpc_config=synthetics.CfnCanary.VPCConfigProperty( security_group_ids=["securityGroupIds"], subnet_ids=["subnetIds"], # the properties below are optional vpc_id="vpcId" ) )
Attributes
- artifact_config
A structure that contains the configuration for canary artifacts, including the encryption-at-rest settings for artifacts that the canary uploads to Amazon S3.
- artifact_s3_location
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
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
.
- delete_lambda_resources_on_canary_deletion
AWS::Synthetics::Canary.DeleteLambdaResourcesOnCanaryDeletion
.
- execution_role_arn
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
- failure_retention_period
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.
- name
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 .
- run_config
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.
- runtime_version
Specifies the runtime version to use for the canary.
For more information about runtime versions, see Canary Runtime Versions .
- schedule
A structure that contains information about how often the canary is to run, and when these runs are to stop.
- start_canary_after_creation
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.
- success_retention_period
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
The list of key-value pairs that are associated with the canary.
- visual_reference
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_config
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 .