CfnCanaryPropsMixin

class aws_cdk.mixins_preview.aws_synthetics.mixins.CfnCanaryPropsMixin(props, *, strategy=None)

Bases: Mixin

Creates or updates a canary.

Canaries are scripts that monitor your endpoints and APIs from the outside-in. Canaries help you check the availability and latency of your web services and troubleshoot anomalies by investigating load time data, screenshots of the UI, logs, and metrics. You can set up a canary to run continuously or just once.

Canaries are automated scripts that run at specified intervals against an endpoint. They include Python or Node.js code to create a Lambda function. This code needs to be packaged in a certain way, depending on the language. For more information, see Writing a canary script .

To create canaries, you must have the CloudWatchSyntheticsFullAccess policy. If you are creating a new IAM role for the canary, you also need the the iam:CreateRole , iam:CreatePolicy and iam:AttachRolePolicy permissions. For more information, see Necessary Roles and Permissions .

Do not include secrets or proprietary information in your canary names. The canary name makes up part of the Amazon Resource Name (ARN) for the canary, and the ARN is included in outbound calls over the internet. For more information, see Security Considerations for Synthetics Canaries .

See:

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-synthetics-canary.html

CloudformationResource:

AWS::Synthetics::Canary

Mixin:

true

ExampleMetadata:

fixture=_generated

Example:

# The code below shows an example of how to instantiate this type.
# The values are placeholders you should change.
from aws_cdk.mixins_preview import mixins
from aws_cdk.mixins_preview.aws_synthetics import mixins as synthetics_mixins

cfn_canary_props_mixin = synthetics_mixins.CfnCanaryPropsMixin(synthetics_mixins.CfnCanaryMixinProps(
    artifact_config=synthetics_mixins.CfnCanaryPropsMixin.ArtifactConfigProperty(
        s3_encryption=synthetics_mixins.CfnCanaryPropsMixin.S3EncryptionProperty(
            encryption_mode="encryptionMode",
            kms_key_arn="kmsKeyArn"
        )
    ),
    artifact_s3_location="artifactS3Location",
    browser_configs=[synthetics_mixins.CfnCanaryPropsMixin.BrowserConfigProperty(
        browser_type="browserType"
    )],
    code=synthetics_mixins.CfnCanaryPropsMixin.CodeProperty(
        blueprint_types=["blueprintTypes"],
        dependencies=[synthetics_mixins.CfnCanaryPropsMixin.DependencyProperty(
            reference="reference",
            type="type"
        )],
        handler="handler",
        s3_bucket="s3Bucket",
        s3_key="s3Key",
        s3_object_version="s3ObjectVersion",
        script="script",
        source_location_arn="sourceLocationArn"
    ),
    delete_lambda_resources_on_canary_deletion=False,
    dry_run_and_update=False,
    execution_role_arn="executionRoleArn",
    failure_retention_period=123,
    name="name",
    provisioned_resource_cleanup="provisionedResourceCleanup",
    resources_to_replicate_tags=["resourcesToReplicateTags"],
    run_config=synthetics_mixins.CfnCanaryPropsMixin.RunConfigProperty(
        active_tracing=False,
        environment_variables={
            "environment_variables_key": "environmentVariables"
        },
        ephemeral_storage=123,
        memory_in_mb=123,
        timeout_in_seconds=123
    ),
    runtime_version="runtimeVersion",
    schedule=synthetics_mixins.CfnCanaryPropsMixin.ScheduleProperty(
        duration_in_seconds="durationInSeconds",
        expression="expression",
        retry_config=synthetics_mixins.CfnCanaryPropsMixin.RetryConfigProperty(
            max_retries=123
        )
    ),
    start_canary_after_creation=False,
    success_retention_period=123,
    tags=[CfnTag(
        key="key",
        value="value"
    )],
    visual_reference=synthetics_mixins.CfnCanaryPropsMixin.VisualReferenceProperty(
        base_canary_run_id="baseCanaryRunId",
        base_screenshots=[synthetics_mixins.CfnCanaryPropsMixin.BaseScreenshotProperty(
            ignore_coordinates=["ignoreCoordinates"],
            screenshot_name="screenshotName"
        )],
        browser_type="browserType"
    ),
    visual_references=[synthetics_mixins.CfnCanaryPropsMixin.VisualReferenceProperty(
        base_canary_run_id="baseCanaryRunId",
        base_screenshots=[synthetics_mixins.CfnCanaryPropsMixin.BaseScreenshotProperty(
            ignore_coordinates=["ignoreCoordinates"],
            screenshot_name="screenshotName"
        )],
        browser_type="browserType"
    )],
    vpc_config=synthetics_mixins.CfnCanaryPropsMixin.VPCConfigProperty(
        ipv6_allowed_for_dual_stack=False,
        security_group_ids=["securityGroupIds"],
        subnet_ids=["subnetIds"],
        vpc_id="vpcId"
    )
),
    strategy=mixins.PropertyMergeStrategy.OVERRIDE
)

Create a mixin to apply properties to AWS::Synthetics::Canary.

Parameters:
  • props (Union[CfnCanaryMixinProps, Dict[str, Any]]) – L1 properties to apply.

  • strategy (Optional[PropertyMergeStrategy]) – (experimental) Strategy for merging nested properties. Default: - PropertyMergeStrategy.MERGE

Methods

apply_to(construct)

Apply the mixin properties to the construct.

Parameters:

construct (IConstruct)

Return type:

IConstruct

supports(construct)

Check if this mixin supports the given construct.

Parameters:

construct (IConstruct)

Return type:

bool

Attributes

CFN_PROPERTY_KEYS = ['artifactConfig', 'artifactS3Location', 'browserConfigs', 'code', 'deleteLambdaResourcesOnCanaryDeletion', 'dryRunAndUpdate', 'executionRoleArn', 'failureRetentionPeriod', 'name', 'provisionedResourceCleanup', 'resourcesToReplicateTags', 'runConfig', 'runtimeVersion', 'schedule', 'startCanaryAfterCreation', 'successRetentionPeriod', 'tags', 'visualReference', 'visualReferences', 'vpcConfig']

Static Methods

classmethod is_mixin(x)

(experimental) Checks if x is a Mixin.

Parameters:

x (Any) – Any object.

Return type:

bool

Returns:

true if x is an object created from a class which extends Mixin.

Stability:

experimental

ArtifactConfigProperty

class CfnCanaryPropsMixin.ArtifactConfigProperty(*, s3_encryption=None)

Bases: object

A structure that contains the configuration for canary artifacts, including the encryption-at-rest settings for artifacts that the canary uploads to Amazon S3 .

Parameters:

s3_encryption (Union[IResolvable, S3EncryptionProperty, Dict[str, Any], None]) – A structure that contains the configuration of the encryption-at-rest settings for artifacts that the canary uploads to Amazon S3 . Artifact encryption functionality is available only for canaries that use Synthetics runtime version syn-nodejs-puppeteer-3.3 or later. For more information, see Encrypting canary artifacts .

See:

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-synthetics-canary-artifactconfig.html

ExampleMetadata:

fixture=_generated

Example:

# The code below shows an example of how to instantiate this type.
# The values are placeholders you should change.
from aws_cdk.mixins_preview.aws_synthetics import mixins as synthetics_mixins

artifact_config_property = synthetics_mixins.CfnCanaryPropsMixin.ArtifactConfigProperty(
    s3_encryption=synthetics_mixins.CfnCanaryPropsMixin.S3EncryptionProperty(
        encryption_mode="encryptionMode",
        kms_key_arn="kmsKeyArn"
    )
)

Attributes

s3_encryption

A structure that contains the configuration of the encryption-at-rest settings for artifacts that the canary uploads to Amazon S3 .

Artifact encryption functionality is available only for canaries that use Synthetics runtime version syn-nodejs-puppeteer-3.3 or later. For more information, see Encrypting canary artifacts .

See:

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-synthetics-canary-artifactconfig.html#cfn-synthetics-canary-artifactconfig-s3encryption

BaseScreenshotProperty

class CfnCanaryPropsMixin.BaseScreenshotProperty(*, ignore_coordinates=None, screenshot_name=None)

Bases: object

A structure representing a screenshot that is used as a baseline during visual monitoring comparisons made by the canary.

Parameters:
  • ignore_coordinates (Optional[Sequence[str]]) – Coordinates that define the part of a screen to ignore during screenshot comparisons. To obtain the coordinates to use here, use the CloudWatch console to draw the boundaries on the screen. For more information, see Edit or delete a canary .

  • screenshot_name (Optional[str]) – The name of the screenshot. This is generated the first time the canary is run after the UpdateCanary operation that specified for this canary to perform visual monitoring.

See:

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-synthetics-canary-basescreenshot.html

ExampleMetadata:

fixture=_generated

Example:

# The code below shows an example of how to instantiate this type.
# The values are placeholders you should change.
from aws_cdk.mixins_preview.aws_synthetics import mixins as synthetics_mixins

base_screenshot_property = synthetics_mixins.CfnCanaryPropsMixin.BaseScreenshotProperty(
    ignore_coordinates=["ignoreCoordinates"],
    screenshot_name="screenshotName"
)

Attributes

ignore_coordinates

Coordinates that define the part of a screen to ignore during screenshot comparisons.

To obtain the coordinates to use here, use the CloudWatch console to draw the boundaries on the screen. For more information, see Edit or delete a canary .

See:

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-synthetics-canary-basescreenshot.html#cfn-synthetics-canary-basescreenshot-ignorecoordinates

screenshot_name

The name of the screenshot.

This is generated the first time the canary is run after the UpdateCanary operation that specified for this canary to perform visual monitoring.

See:

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-synthetics-canary-basescreenshot.html#cfn-synthetics-canary-basescreenshot-screenshotname

BrowserConfigProperty

class CfnCanaryPropsMixin.BrowserConfigProperty(*, browser_type=None)

Bases: object

A structure that specifies the browser type to use for a canary run.

Parameters:

browser_type (Optional[str]) – The browser type associated with this browser configuration.

See:

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-synthetics-canary-browserconfig.html

ExampleMetadata:

fixture=_generated

Example:

# The code below shows an example of how to instantiate this type.
# The values are placeholders you should change.
from aws_cdk.mixins_preview.aws_synthetics import mixins as synthetics_mixins

browser_config_property = synthetics_mixins.CfnCanaryPropsMixin.BrowserConfigProperty(
    browser_type="browserType"
)

Attributes

browser_type

The browser type associated with this browser configuration.

See:

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-synthetics-canary-browserconfig.html#cfn-synthetics-canary-browserconfig-browsertype

CodeProperty

class CfnCanaryPropsMixin.CodeProperty(*, blueprint_types=None, dependencies=None, handler=None, s3_bucket=None, s3_key=None, s3_object_version=None, script=None, source_location_arn=None)

Bases: object

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 .

Parameters:
  • blueprint_types (Optional[Sequence[str]]) – BlueprintTypes are a list of templates that enable simplified canary creation. You can create canaries for common monitoring scenarios by providing only a JSON configuration file instead of writing custom scripts. multi-checks is the only supported value. When you specify BlueprintTypes , the Handler field cannot be specified since the blueprint provides a pre-defined entry point.

  • dependencies (Union[IResolvable, Sequence[Union[IResolvable, DependencyProperty, Dict[str, Any]]], None]) – List of Lambda layers to attach to the canary.

  • handler (Optional[str]) – The entry point to use for the source code when running the canary. For canaries that use the syn-python-selenium-1.0 runtime or a syn-nodejs.puppeteer runtime earlier than syn-nodejs.puppeteer-3.4 , the handler must be specified as *fileName* .handler . For syn-python-selenium-1.1 , syn-nodejs.puppeteer-3.4 , and later runtimes, the handler can be specified as *fileName* . *functionName* , or you can specify a folder where canary scripts reside as *folder* / *fileName* . *functionName* . This field is required when you don’t specify BlueprintTypes and is not allowed when you specify BlueprintTypes .

  • s3_bucket (Optional[str]) – If your canary script is located in S3, specify the bucket name here. The bucket must already exist.

  • s3_key (Optional[str]) – The Amazon S3 key of your script. For more information, see Working with Amazon S3 Objects .

  • s3_object_version (Optional[str]) – The Amazon S3 version ID of your script.

  • script (Optional[str]) – If you input your canary script directly into the canary instead of referring to an S3 location, the value of this parameter is the script in plain text. It can be up to 5 MB.

  • source_location_arn (Optional[str]) – The ARN of the Lambda layer where Synthetics stores the canary script code.

See:

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-synthetics-canary-code.html

ExampleMetadata:

fixture=_generated

Example:

# The code below shows an example of how to instantiate this type.
# The values are placeholders you should change.
from aws_cdk.mixins_preview.aws_synthetics import mixins as synthetics_mixins

code_property = synthetics_mixins.CfnCanaryPropsMixin.CodeProperty(
    blueprint_types=["blueprintTypes"],
    dependencies=[synthetics_mixins.CfnCanaryPropsMixin.DependencyProperty(
        reference="reference",
        type="type"
    )],
    handler="handler",
    s3_bucket="s3Bucket",
    s3_key="s3Key",
    s3_object_version="s3ObjectVersion",
    script="script",
    source_location_arn="sourceLocationArn"
)

Attributes

blueprint_types

BlueprintTypes are a list of templates that enable simplified canary creation.

You can create canaries for common monitoring scenarios by providing only a JSON configuration file instead of writing custom scripts. multi-checks is the only supported value.

When you specify BlueprintTypes , the Handler field cannot be specified since the blueprint provides a pre-defined entry point.

See:

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-synthetics-canary-code.html#cfn-synthetics-canary-code-blueprinttypes

dependencies

List of Lambda layers to attach to the canary.

See:

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-synthetics-canary-code.html#cfn-synthetics-canary-code-dependencies

handler

The entry point to use for the source code when running the canary.

For canaries that use the syn-python-selenium-1.0 runtime or a syn-nodejs.puppeteer runtime earlier than syn-nodejs.puppeteer-3.4 , the handler must be specified as *fileName* .handler . For syn-python-selenium-1.1 , syn-nodejs.puppeteer-3.4 , and later runtimes, the handler can be specified as *fileName* . *functionName* , or you can specify a folder where canary scripts reside as *folder* / *fileName* . *functionName* .

This field is required when you don’t specify BlueprintTypes and is not allowed when you specify BlueprintTypes .

See:

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-synthetics-canary-code.html#cfn-synthetics-canary-code-handler

s3_bucket

If your canary script is located in S3, specify the bucket name here.

The bucket must already exist.

See:

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-synthetics-canary-code.html#cfn-synthetics-canary-code-s3bucket

s3_key

The Amazon S3 key of your script.

For more information, see Working with Amazon S3 Objects .

See:

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-synthetics-canary-code.html#cfn-synthetics-canary-code-s3key

s3_object_version

The Amazon S3 version ID of your script.

See:

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-synthetics-canary-code.html#cfn-synthetics-canary-code-s3objectversion

script

If you input your canary script directly into the canary instead of referring to an S3 location, the value of this parameter is the script in plain text.

It can be up to 5 MB.

See:

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-synthetics-canary-code.html#cfn-synthetics-canary-code-script

source_location_arn

The ARN of the Lambda layer where Synthetics stores the canary script code.

See:

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-synthetics-canary-code.html#cfn-synthetics-canary-code-sourcelocationarn

DependencyProperty

class CfnCanaryPropsMixin.DependencyProperty(*, reference=None, type=None)

Bases: object

A structure that contains information about a dependency for a canary.

Parameters:
  • reference (Optional[str]) – The dependency reference. For Lambda layers, this is the ARN of the Lambda layer. For more information about Lambda ARN format, see Lambda .

  • type (Optional[str]) – The type of dependency. Valid value is LambdaLayer .

See:

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-synthetics-canary-dependency.html

ExampleMetadata:

fixture=_generated

Example:

# The code below shows an example of how to instantiate this type.
# The values are placeholders you should change.
from aws_cdk.mixins_preview.aws_synthetics import mixins as synthetics_mixins

dependency_property = synthetics_mixins.CfnCanaryPropsMixin.DependencyProperty(
    reference="reference",
    type="type"
)

Attributes

reference

The dependency reference.

For Lambda layers, this is the ARN of the Lambda layer. For more information about Lambda ARN format, see Lambda .

See:

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-synthetics-canary-dependency.html#cfn-synthetics-canary-dependency-reference

type

The type of dependency.

Valid value is LambdaLayer .

See:

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-synthetics-canary-dependency.html#cfn-synthetics-canary-dependency-type

RetryConfigProperty

class CfnCanaryPropsMixin.RetryConfigProperty(*, max_retries=None)

Bases: object

The canary’s retry configuration information.

Parameters:

max_retries (Union[int, float, None]) – The maximum number of retries. The value must be less than or equal to two.

See:

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-synthetics-canary-retryconfig.html

ExampleMetadata:

fixture=_generated

Example:

# The code below shows an example of how to instantiate this type.
# The values are placeholders you should change.
from aws_cdk.mixins_preview.aws_synthetics import mixins as synthetics_mixins

retry_config_property = synthetics_mixins.CfnCanaryPropsMixin.RetryConfigProperty(
    max_retries=123
)

Attributes

max_retries

The maximum number of retries.

The value must be less than or equal to two.

See:

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-synthetics-canary-retryconfig.html#cfn-synthetics-canary-retryconfig-maxretries

RunConfigProperty

class CfnCanaryPropsMixin.RunConfigProperty(*, active_tracing=None, environment_variables=None, ephemeral_storage=None, memory_in_mb=None, timeout_in_seconds=None)

Bases: object

A structure that contains input information for a canary run.

This structure is required.

Parameters:
  • active_tracing (Union[bool, IResolvable, None]) – Specifies whether this canary is to use active AWS X-Ray tracing when it runs. Active tracing enables this canary run to be displayed in the ServiceLens and X-Ray service maps even if the canary does not hit an endpoint that has X-Ray tracing enabled. Using X-Ray tracing incurs charges. For more information, see Canaries and X-Ray tracing . You can enable active tracing only for canaries that use version syn-nodejs-2.0 or later for their canary runtime.

  • environment_variables (Union[Mapping[str, str], IResolvable, None]) – Specifies the keys and values to use for any environment variables used in the canary script. Use the following format: { “key1” : “value1”, “key2” : “value2”, …} Keys must start with a letter and be at least two characters. The total size of your environment variables cannot exceed 4 KB. You can’t specify any Lambda reserved environment variables as the keys for your environment variables. For more information about reserved keys, see Runtime environment variables .

  • ephemeral_storage (Union[int, float, None]) – Specifies the amount of ephemeral storage (in MB) to allocate for the canary run during execution. This temporary storage is used for storing canary run artifacts (which are uploaded to an Amazon S3 bucket at the end of the run), and any canary browser operations. This temporary storage is cleared after the run is completed. Default storage value is 1024 MB.

  • memory_in_mb (Union[int, float, None]) – The maximum amount of memory that the canary can use while running. This value must be a multiple of 64. The range is 960 to 3008.

  • timeout_in_seconds (Union[int, float, None]) – How long the canary is allowed to run before it must stop. You can’t set this time to be longer than the frequency of the runs of this canary. If you omit this field, the frequency of the canary is used as this value, up to a maximum of 900 seconds.

See:

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-synthetics-canary-runconfig.html

ExampleMetadata:

fixture=_generated

Example:

# The code below shows an example of how to instantiate this type.
# The values are placeholders you should change.
from aws_cdk.mixins_preview.aws_synthetics import mixins as synthetics_mixins

run_config_property = synthetics_mixins.CfnCanaryPropsMixin.RunConfigProperty(
    active_tracing=False,
    environment_variables={
        "environment_variables_key": "environmentVariables"
    },
    ephemeral_storage=123,
    memory_in_mb=123,
    timeout_in_seconds=123
)

Attributes

active_tracing

Specifies whether this canary is to use active AWS X-Ray tracing when it runs.

Active tracing enables this canary run to be displayed in the ServiceLens and X-Ray service maps even if the canary does not hit an endpoint that has X-Ray tracing enabled. Using X-Ray tracing incurs charges. For more information, see Canaries and X-Ray tracing .

You can enable active tracing only for canaries that use version syn-nodejs-2.0 or later for their canary runtime.

See:

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-synthetics-canary-runconfig.html#cfn-synthetics-canary-runconfig-activetracing

environment_variables

Specifies the keys and values to use for any environment variables used in the canary script.

Use the following format:

{ “key1” : “value1”, “key2” : “value2”, …}

Keys must start with a letter and be at least two characters. The total size of your environment variables cannot exceed 4 KB. You can’t specify any Lambda reserved environment variables as the keys for your environment variables. For more information about reserved keys, see Runtime environment variables .

See:

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-synthetics-canary-runconfig.html#cfn-synthetics-canary-runconfig-environmentvariables

ephemeral_storage

Specifies the amount of ephemeral storage (in MB) to allocate for the canary run during execution.

This temporary storage is used for storing canary run artifacts (which are uploaded to an Amazon S3 bucket at the end of the run), and any canary browser operations. This temporary storage is cleared after the run is completed. Default storage value is 1024 MB.

See:

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-synthetics-canary-runconfig.html#cfn-synthetics-canary-runconfig-ephemeralstorage

memory_in_mb

The maximum amount of memory that the canary can use while running.

This value must be a multiple of 64. The range is 960 to 3008.

See:

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-synthetics-canary-runconfig.html#cfn-synthetics-canary-runconfig-memoryinmb

timeout_in_seconds

How long the canary is allowed to run before it must stop.

You can’t set this time to be longer than the frequency of the runs of this canary.

If you omit this field, the frequency of the canary is used as this value, up to a maximum of 900 seconds.

See:

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-synthetics-canary-runconfig.html#cfn-synthetics-canary-runconfig-timeoutinseconds

S3EncryptionProperty

class CfnCanaryPropsMixin.S3EncryptionProperty(*, encryption_mode=None, kms_key_arn=None)

Bases: object

A structure that contains the configuration of the encryption-at-rest settings for artifacts that the canary uploads to Amazon S3 .

Artifact encryption functionality is available only for canaries that use Synthetics runtime version syn-nodejs-puppeteer-3.3 or later. For more information, see Encrypting canary artifacts .

Parameters:
  • encryption_mode (Optional[str]) – The encryption method to use for artifacts created by this canary. Specify SSE_S3 to use server-side encryption (SSE) with an Amazon S3-managed key. Specify SSE-KMS to use server-side encryption with a customer-managed AWS key. If you omit this parameter, an AWS -managed AWS key is used.

  • kms_key_arn (Optional[str]) – The ARN of the customer-managed AWS key to use, if you specify SSE-KMS for EncryptionMode.

See:

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-synthetics-canary-s3encryption.html

ExampleMetadata:

fixture=_generated

Example:

# The code below shows an example of how to instantiate this type.
# The values are placeholders you should change.
from aws_cdk.mixins_preview.aws_synthetics import mixins as synthetics_mixins

s3_encryption_property = synthetics_mixins.CfnCanaryPropsMixin.S3EncryptionProperty(
    encryption_mode="encryptionMode",
    kms_key_arn="kmsKeyArn"
)

Attributes

encryption_mode

The encryption method to use for artifacts created by this canary.

Specify SSE_S3 to use server-side encryption (SSE) with an Amazon S3-managed key. Specify SSE-KMS to use server-side encryption with a customer-managed AWS key.

If you omit this parameter, an AWS -managed AWS key is used.

See:

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-synthetics-canary-s3encryption.html#cfn-synthetics-canary-s3encryption-encryptionmode

kms_key_arn

The ARN of the customer-managed AWS key to use, if you specify SSE-KMS for EncryptionMode.

See:

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-synthetics-canary-s3encryption.html#cfn-synthetics-canary-s3encryption-kmskeyarn

ScheduleProperty

class CfnCanaryPropsMixin.ScheduleProperty(*, duration_in_seconds=None, expression=None, retry_config=None)

Bases: object

This structure specifies how often a canary is to make runs and the date and time when it should stop making runs.

Parameters:
  • duration_in_seconds (Optional[str]) – How long, in seconds, for the canary to continue making regular runs according to the schedule in the Expression value. If you specify 0, the canary continues making runs until you stop it. If you omit this field, the default of 0 is used.

  • expression (Optional[str]) – A rate expression or a cron expression that defines how often the canary is to run. For a rate expression, The syntax is rate( *number unit* ) . unit can be minute , minutes , or hour . For example, rate(1 minute) runs the canary once a minute, rate(10 minutes) runs it once every 10 minutes, and rate(1 hour) runs it once every hour. You can specify a frequency between rate(1 minute) and rate(1 hour) . Specifying rate(0 minute) or rate(0 hour) is a special value that causes the canary to run only once when it is started. Use cron( *expression* ) to specify a cron expression. You can’t schedule a canary to wait for more than a year before running. For information about the syntax for cron expressions, see Scheduling canary runs using cron .

  • retry_config (Union[IResolvable, RetryConfigProperty, Dict[str, Any], None]) – The canary’s retry configuration information.

See:

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-synthetics-canary-schedule.html

ExampleMetadata:

fixture=_generated

Example:

# The code below shows an example of how to instantiate this type.
# The values are placeholders you should change.
from aws_cdk.mixins_preview.aws_synthetics import mixins as synthetics_mixins

schedule_property = synthetics_mixins.CfnCanaryPropsMixin.ScheduleProperty(
    duration_in_seconds="durationInSeconds",
    expression="expression",
    retry_config=synthetics_mixins.CfnCanaryPropsMixin.RetryConfigProperty(
        max_retries=123
    )
)

Attributes

duration_in_seconds

How long, in seconds, for the canary to continue making regular runs according to the schedule in the Expression value.

If you specify 0, the canary continues making runs until you stop it. If you omit this field, the default of 0 is used.

See:

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-synthetics-canary-schedule.html#cfn-synthetics-canary-schedule-durationinseconds

expression

A rate expression or a cron expression that defines how often the canary is to run.

For a rate expression, The syntax is rate( *number unit* ) . unit can be minute , minutes , or hour .

For example, rate(1 minute) runs the canary once a minute, rate(10 minutes) runs it once every 10 minutes, and rate(1 hour) runs it once every hour. You can specify a frequency between rate(1 minute) and rate(1 hour) .

Specifying rate(0 minute) or rate(0 hour) is a special value that causes the canary to run only once when it is started.

Use cron( *expression* ) to specify a cron expression. You can’t schedule a canary to wait for more than a year before running. For information about the syntax for cron expressions, see Scheduling canary runs using cron .

See:

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-synthetics-canary-schedule.html#cfn-synthetics-canary-schedule-expression

retry_config

The canary’s retry configuration information.

See:

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-synthetics-canary-schedule.html#cfn-synthetics-canary-schedule-retryconfig

VPCConfigProperty

class CfnCanaryPropsMixin.VPCConfigProperty(*, ipv6_allowed_for_dual_stack=None, security_group_ids=None, subnet_ids=None, vpc_id=None)

Bases: object

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 .

Parameters:
  • ipv6_allowed_for_dual_stack (Union[bool, IResolvable, None]) – Set this to true to allow outbound IPv6 traffic on VPC canaries that are connected to dual-stack subnets. The default is false .

  • security_group_ids (Optional[Sequence[str]]) – The IDs of the security groups for this canary.

  • subnet_ids (Optional[Sequence[str]]) – The IDs of the subnets where this canary is to run.

  • vpc_id (Optional[str]) – The ID of the VPC where this canary is to run.

See:

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-synthetics-canary-vpcconfig.html

ExampleMetadata:

fixture=_generated

Example:

# The code below shows an example of how to instantiate this type.
# The values are placeholders you should change.
from aws_cdk.mixins_preview.aws_synthetics import mixins as synthetics_mixins

v_pCConfig_property = synthetics_mixins.CfnCanaryPropsMixin.VPCConfigProperty(
    ipv6_allowed_for_dual_stack=False,
    security_group_ids=["securityGroupIds"],
    subnet_ids=["subnetIds"],
    vpc_id="vpcId"
)

Attributes

ipv6_allowed_for_dual_stack

Set this to true to allow outbound IPv6 traffic on VPC canaries that are connected to dual-stack subnets.

The default is false .

See:

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-synthetics-canary-vpcconfig.html#cfn-synthetics-canary-vpcconfig-ipv6allowedfordualstack

security_group_ids

The IDs of the security groups for this canary.

See:

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-synthetics-canary-vpcconfig.html#cfn-synthetics-canary-vpcconfig-securitygroupids

subnet_ids

The IDs of the subnets where this canary is to run.

See:

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-synthetics-canary-vpcconfig.html#cfn-synthetics-canary-vpcconfig-subnetids

vpc_id

The ID of the VPC where this canary is to run.

See:

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-synthetics-canary-vpcconfig.html#cfn-synthetics-canary-vpcconfig-vpcid

VisualReferenceProperty

class CfnCanaryPropsMixin.VisualReferenceProperty(*, base_canary_run_id=None, base_screenshots=None, browser_type=None)

Bases: object

Defines the screenshots to use as the baseline for comparisons during visual monitoring comparisons during future runs of this canary.

If you omit this parameter, no changes are made to any baseline screenshots that the canary might be using already.

Visual monitoring is supported only on canaries running the syn-puppeteer-node-3.2 runtime or later. For more information, see Visual monitoring and Visual monitoring blueprint

Parameters:
  • base_canary_run_id (Optional[str]) – Specifies which canary run to use the screenshots from as the baseline for future visual monitoring with this canary. Valid values are nextrun to use the screenshots from the next run after this update is made, lastrun to use the screenshots from the most recent run before this update was made, or the value of Id in the CanaryRun from any past run of this canary.

  • base_screenshots (Union[IResolvable, Sequence[Union[IResolvable, BaseScreenshotProperty, Dict[str, Any]]], None]) – An array of screenshots that are used as the baseline for comparisons during visual monitoring.

  • browser_type (Optional[str]) – The browser type associated with this visual reference configuration. Valid values are CHROME and FIREFOX .

See:

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-synthetics-canary-visualreference.html

ExampleMetadata:

fixture=_generated

Example:

# The code below shows an example of how to instantiate this type.
# The values are placeholders you should change.
from aws_cdk.mixins_preview.aws_synthetics import mixins as synthetics_mixins

visual_reference_property = synthetics_mixins.CfnCanaryPropsMixin.VisualReferenceProperty(
    base_canary_run_id="baseCanaryRunId",
    base_screenshots=[synthetics_mixins.CfnCanaryPropsMixin.BaseScreenshotProperty(
        ignore_coordinates=["ignoreCoordinates"],
        screenshot_name="screenshotName"
    )],
    browser_type="browserType"
)

Attributes

base_canary_run_id

Specifies which canary run to use the screenshots from as the baseline for future visual monitoring with this canary.

Valid values are nextrun to use the screenshots from the next run after this update is made, lastrun to use the screenshots from the most recent run before this update was made, or the value of Id in the CanaryRun from any past run of this canary.

See:

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-synthetics-canary-visualreference.html#cfn-synthetics-canary-visualreference-basecanaryrunid

base_screenshots

An array of screenshots that are used as the baseline for comparisons during visual monitoring.

See:

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-synthetics-canary-visualreference.html#cfn-synthetics-canary-visualreference-basescreenshots

browser_type

The browser type associated with this visual reference configuration.

Valid values are CHROME and FIREFOX .

See:

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-synthetics-canary-visualreference.html#cfn-synthetics-canary-visualreference-browsertype