CanaryProps

class aws_cdk.aws_synthetics.CanaryProps(*, runtime, test, artifacts_bucket_location=None, canary_name=None, environment_variables=None, failure_retention_period=None, role=None, schedule=None, start_after_creation=None, success_retention_period=None, time_to_live=None)

Bases: object

(experimental) Properties for a canary.

Parameters
  • runtime (Runtime) – (experimental) Specify the runtime version to use for the canary.

  • test (Test) – (experimental) The type of test that you want your canary to run. Use Test.custom() to specify the test to run.

  • artifacts_bucket_location (Optional[ArtifactsBucketLocation]) – (experimental) The s3 location that stores the data of the canary runs. Default: - A new s3 bucket will be created without a prefix.

  • canary_name (Optional[str]) – (experimental) The name of the 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 name. The canary name makes up part of the canary ARN, which is included in outbound calls over the internet. Default: - A unique name will be generated from the construct ID

  • environment_variables (Optional[Mapping[str, str]]) – (experimental) Key-value pairs that the Synthetics caches and makes available for your canary scripts. Use environment variables to apply configuration changes, such as test and production environment configurations, without changing your Canary script source code. Default: - No environment variables.

  • failure_retention_period (Optional[Duration]) – (experimental) How many days should failed runs be retained. Default: Duration.days(31)

  • role (Optional[IRole]) – (experimental) Canary execution role. This is the role that will be assumed by the canary upon execution. It controls the permissions that the canary will have. The role must be assumable by the AWS Lambda service principal. If not supplied, a role will be created with all the required permissions. If you provide a Role, you must add the required permissions. Default: - A unique role will be generated for this canary. You can add permissions to roles by calling ‘addToRolePolicy’.

  • schedule (Optional[Schedule]) – (experimental) Specify the schedule for how often the canary runs. For example, if you set schedule to rate(10 minutes), then the canary will run every 10 minutes. You can set the schedule with Schedule.rate(Duration) (recommended) or you can specify an expression using Schedule.expression(). Default: ‘rate(5 minutes)’

  • start_after_creation (Optional[bool]) – (experimental) Whether or not the canary should start after creation. Default: true

  • success_retention_period (Optional[Duration]) – (experimental) How many days should successful runs be retained. Default: Duration.days(31)

  • time_to_live (Optional[Duration]) – (experimental) How long the canary will be in a ‘RUNNING’ state. For example, if you set timeToLive to be 1 hour and schedule to be rate(10 minutes), your canary will run at 10 minute intervals for an hour, for a total of 6 times. Default: - no limit

Stability

experimental

Attributes

artifacts_bucket_location

(experimental) The s3 location that stores the data of the canary runs.

Default
  • A new s3 bucket will be created without a prefix.

Stability

experimental

Return type

Optional[ArtifactsBucketLocation]

canary_name

(experimental) The name of the 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 name. The canary name makes up part of the canary ARN, which is included in outbound calls over the internet.

Default
  • A unique name will be generated from the construct ID

See

https://docs.aws.amazon.com/AmazonCloudWatch/latest/monitoring/servicelens_canaries_security.html

Stability

experimental

Return type

Optional[str]

environment_variables

(experimental) Key-value pairs that the Synthetics caches and makes available for your canary scripts.

Use environment variables to apply configuration changes, such as test and production environment configurations, without changing your Canary script source code.

Default
  • No environment variables.

Stability

experimental

Return type

Optional[Mapping[str, str]]

failure_retention_period

(experimental) How many days should failed runs be retained.

Default

Duration.days(31)

Stability

experimental

Return type

Optional[Duration]

role

(experimental) Canary execution role.

This is the role that will be assumed by the canary upon execution. It controls the permissions that the canary will have. The role must be assumable by the AWS Lambda service principal.

If not supplied, a role will be created with all the required permissions. If you provide a Role, you must add the required permissions.

Default

  • A unique role will be generated for this canary.

You can add permissions to roles by calling ‘addToRolePolicy’.

See

required permissions: https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-synthetics-canary.html#cfn-synthetics-canary-executionrolearn

Stability

experimental

Return type

Optional[IRole]

runtime

(experimental) Specify the runtime version to use for the canary.

See

https://docs.aws.amazon.com/AmazonCloudWatch/latest/monitoring/CloudWatch_Synthetics_Canaries_Library.html

Stability

experimental

Return type

Runtime

schedule

(experimental) Specify the schedule for how often the canary runs.

For example, if you set schedule to rate(10 minutes), then the canary will run every 10 minutes. You can set the schedule with Schedule.rate(Duration) (recommended) or you can specify an expression using Schedule.expression().

Default

‘rate(5 minutes)’

Stability

experimental

Return type

Optional[Schedule]

start_after_creation

(experimental) Whether or not the canary should start after creation.

Default

true

Stability

experimental

Return type

Optional[bool]

success_retention_period

(experimental) How many days should successful runs be retained.

Default

Duration.days(31)

Stability

experimental

Return type

Optional[Duration]

test

(experimental) The type of test that you want your canary to run.

Use Test.custom() to specify the test to run.

Stability

experimental

Return type

Test

time_to_live

(experimental) How long the canary will be in a ‘RUNNING’ state.

For example, if you set timeToLive to be 1 hour and schedule to be rate(10 minutes), your canary will run at 10 minute intervals for an hour, for a total of 6 times.

Default
  • no limit

Stability

experimental

Return type

Optional[Duration]