Show / Hide Table of Contents

Class CfnCanaryProps

Properties for defining a CfnCanary.

Inheritance
object
CfnCanaryProps
Implements
ICfnCanaryProps
Inherited Members
object.GetType()
object.MemberwiseClone()
object.ToString()
object.Equals(object)
object.Equals(object, object)
object.ReferenceEquals(object, object)
object.GetHashCode()
Namespace: Amazon.CDK.AWS.Synthetics
Assembly: Amazon.CDK.Lib.dll
Syntax (csharp)
public class CfnCanaryProps : ICfnCanaryProps
Syntax (vb)
Public Class CfnCanaryProps Implements ICfnCanaryProps
Remarks

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

ExampleMetadata: fixture=_generated

Examples
// The code below shows an example of how to instantiate this type.
             // The values are placeholders you should change.
             using Amazon.CDK.AWS.Synthetics;

             var cfnCanaryProps = new CfnCanaryProps {
                 ArtifactS3Location = "artifactS3Location",
                 Code = new CodeProperty {
                     Handler = "handler",

                     // the properties below are optional
                     S3Bucket = "s3Bucket",
                     S3Key = "s3Key",
                     S3ObjectVersion = "s3ObjectVersion",
                     Script = "script",
                     SourceLocationArn = "sourceLocationArn"
                 },
                 ExecutionRoleArn = "executionRoleArn",
                 Name = "name",
                 RuntimeVersion = "runtimeVersion",
                 Schedule = new ScheduleProperty {
                     Expression = "expression",

                     // the properties below are optional
                     DurationInSeconds = "durationInSeconds",
                     RetryConfig = new RetryConfigProperty {
                         MaxRetries = 123
                     }
                 },

                 // the properties below are optional
                 ArtifactConfig = new ArtifactConfigProperty {
                     S3Encryption = new S3EncryptionProperty {
                         EncryptionMode = "encryptionMode",
                         KmsKeyArn = "kmsKeyArn"
                     }
                 },
                 DeleteLambdaResourcesOnCanaryDeletion = false,
                 DryRunAndUpdate = false,
                 FailureRetentionPeriod = 123,
                 ProvisionedResourceCleanup = "provisionedResourceCleanup",
                 ResourcesToReplicateTags = new [] { "resourcesToReplicateTags" },
                 RunConfig = new RunConfigProperty {
                     ActiveTracing = false,
                     EnvironmentVariables = new Dictionary<string, string> {
                         { "environmentVariablesKey", "environmentVariables" }
                     },
                     EphemeralStorage = 123,
                     MemoryInMb = 123,
                     TimeoutInSeconds = 123
                 },
                 StartCanaryAfterCreation = false,
                 SuccessRetentionPeriod = 123,
                 Tags = new [] { new CfnTag {
                     Key = "key",
                     Value = "value"
                 } },
                 VisualReference = new VisualReferenceProperty {
                     BaseCanaryRunId = "baseCanaryRunId",

                     // the properties below are optional
                     BaseScreenshots = new [] { new BaseScreenshotProperty {
                         ScreenshotName = "screenshotName",

                         // the properties below are optional
                         IgnoreCoordinates = new [] { "ignoreCoordinates" }
                     } }
                 },
                 VpcConfig = new VPCConfigProperty {
                     SecurityGroupIds = new [] { "securityGroupIds" },
                     SubnetIds = new [] { "subnetIds" },

                     // the properties below are optional
                     Ipv6AllowedForDualStack = false,
                     VpcId = "vpcId"
                 }
             };

Synopsis

Constructors

CfnCanaryProps()

Properties for defining a CfnCanary.

Properties

ArtifactConfig

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

ArtifactS3Location

The location in Amazon S3 where Synthetics stores artifacts from the runs of this canary.

Code

Use this structure to input your script code for the canary.

DeleteLambdaResourcesOnCanaryDeletion

(deprecated) Deletes associated lambda resources created by Synthetics if set to True.

DryRunAndUpdate

Specifies whether to perform a dry run before updating the canary.

ExecutionRoleArn

The ARN of the IAM role to be used to run the canary.

FailureRetentionPeriod

The number of days to retain data about failed runs of this canary.

Name

The name for this canary.

ProvisionedResourceCleanup

Specifies whether to also delete the Lambda functions and layers used by this canary when the canary is deleted.

ResourcesToReplicateTags

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 .

RunConfig

A structure that contains input information for a canary run.

RuntimeVersion

Specifies the runtime version to use for the canary.

Schedule

A structure that contains information about how often the canary is to run, and when these runs are to stop.

StartCanaryAfterCreation

Specify TRUE to have the canary start making runs immediately after it is created.

SuccessRetentionPeriod

The number of days to retain data about successful runs of this canary.

Tags

The list of key-value pairs that are associated with the canary.

VisualReference

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

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.

Constructors

CfnCanaryProps()

Properties for defining a CfnCanary.

public CfnCanaryProps()
Remarks

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

ExampleMetadata: fixture=_generated

Examples
// The code below shows an example of how to instantiate this type.
             // The values are placeholders you should change.
             using Amazon.CDK.AWS.Synthetics;

             var cfnCanaryProps = new CfnCanaryProps {
                 ArtifactS3Location = "artifactS3Location",
                 Code = new CodeProperty {
                     Handler = "handler",

                     // the properties below are optional
                     S3Bucket = "s3Bucket",
                     S3Key = "s3Key",
                     S3ObjectVersion = "s3ObjectVersion",
                     Script = "script",
                     SourceLocationArn = "sourceLocationArn"
                 },
                 ExecutionRoleArn = "executionRoleArn",
                 Name = "name",
                 RuntimeVersion = "runtimeVersion",
                 Schedule = new ScheduleProperty {
                     Expression = "expression",

                     // the properties below are optional
                     DurationInSeconds = "durationInSeconds",
                     RetryConfig = new RetryConfigProperty {
                         MaxRetries = 123
                     }
                 },

                 // the properties below are optional
                 ArtifactConfig = new ArtifactConfigProperty {
                     S3Encryption = new S3EncryptionProperty {
                         EncryptionMode = "encryptionMode",
                         KmsKeyArn = "kmsKeyArn"
                     }
                 },
                 DeleteLambdaResourcesOnCanaryDeletion = false,
                 DryRunAndUpdate = false,
                 FailureRetentionPeriod = 123,
                 ProvisionedResourceCleanup = "provisionedResourceCleanup",
                 ResourcesToReplicateTags = new [] { "resourcesToReplicateTags" },
                 RunConfig = new RunConfigProperty {
                     ActiveTracing = false,
                     EnvironmentVariables = new Dictionary<string, string> {
                         { "environmentVariablesKey", "environmentVariables" }
                     },
                     EphemeralStorage = 123,
                     MemoryInMb = 123,
                     TimeoutInSeconds = 123
                 },
                 StartCanaryAfterCreation = false,
                 SuccessRetentionPeriod = 123,
                 Tags = new [] { new CfnTag {
                     Key = "key",
                     Value = "value"
                 } },
                 VisualReference = new VisualReferenceProperty {
                     BaseCanaryRunId = "baseCanaryRunId",

                     // the properties below are optional
                     BaseScreenshots = new [] { new BaseScreenshotProperty {
                         ScreenshotName = "screenshotName",

                         // the properties below are optional
                         IgnoreCoordinates = new [] { "ignoreCoordinates" }
                     } }
                 },
                 VpcConfig = new VPCConfigProperty {
                     SecurityGroupIds = new [] { "securityGroupIds" },
                     SubnetIds = new [] { "subnetIds" },

                     // the properties below are optional
                     Ipv6AllowedForDualStack = false,
                     VpcId = "vpcId"
                 }
             };

Properties

ArtifactConfig

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

public object? ArtifactConfig { get; set; }
Property Value

object

Remarks

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

ArtifactS3Location

The location in Amazon S3 where Synthetics stores artifacts from the runs of this canary.

public string ArtifactS3Location { get; set; }
Property Value

string

Remarks

Artifacts include the log file, screenshots, and HAR files. Specify the full location path, including s3:// at the beginning of the path.

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

Code

Use this structure to input your script code for the canary.

public object Code { get; set; }
Property Value

object

Remarks

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 .

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

DeleteLambdaResourcesOnCanaryDeletion

(deprecated) Deletes associated lambda resources created by Synthetics if set to True.

[Obsolete("this property has been deprecated")]
public object? DeleteLambdaResourcesOnCanaryDeletion { get; set; }
Property Value

object

Remarks

Default is False

Stability: Deprecated

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

DryRunAndUpdate

Specifies whether to perform a dry run before updating the canary.

public object? DryRunAndUpdate { get; set; }
Property Value

object

Remarks

If set to true , CloudFormation will execute a dry run to validate the changes before applying them to the canary. If the dry run succeeds, the canary will be updated with the changes. If the dry run fails, the CloudFormation deployment will fail with the dry run’s failure reason.

If set to false or omitted, the canary will be updated directly without first performing a dry run. The default value is false .

For more information, see Performing safe canary updates .

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

ExecutionRoleArn

The ARN of the IAM role to be used to run the canary.

public string ExecutionRoleArn { get; set; }
Property Value

string

Remarks

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:

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

    FailureRetentionPeriod

    The number of days to retain data about failed runs of this canary.

    public double? FailureRetentionPeriod { get; set; }
    Property Value

    double?

    Remarks

    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.

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

    Name

    The name for this canary.

    public string Name { get; set; }
    Property Value

    string

    Remarks

    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 .

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

    ProvisionedResourceCleanup

    Specifies whether to also delete the Lambda functions and layers used by this canary when the canary is deleted.

    public string? ProvisionedResourceCleanup { get; set; }
    Property Value

    string

    Remarks

    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.

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

    ResourcesToReplicateTags

    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 .

    public string[]? ResourcesToReplicateTags { get; set; }
    Property Value

    string[]

    Remarks

    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.

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

    RunConfig

    A structure that contains input information for a canary run.

    public object? RunConfig { get; set; }
    Property Value

    object

    Remarks

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

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

    RuntimeVersion

    Specifies the runtime version to use for the canary.

    public string RuntimeVersion { get; set; }
    Property Value

    string

    Remarks

    For more information about runtime versions, see Canary Runtime Versions .

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

    Schedule

    A structure that contains information about how often the canary is to run, and when these runs are to stop.

    public object Schedule { get; set; }
    Property Value

    object

    Remarks

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

    StartCanaryAfterCreation

    Specify TRUE to have the canary start making runs immediately after it is created.

    public object? StartCanaryAfterCreation { get; set; }
    Property Value

    object

    Remarks

    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.

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

    SuccessRetentionPeriod

    The number of days to retain data about successful runs of this canary.

    public double? SuccessRetentionPeriod { get; set; }
    Property Value

    double?

    Remarks

    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.

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

    Tags

    The list of key-value pairs that are associated with the canary.

    public ICfnTag[]? Tags { get; set; }
    Property Value

    ICfnTag[]

    Remarks

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

    VisualReference

    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.

    public object? VisualReference { get; set; }
    Property Value

    object

    Remarks

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

    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.

    public object? VpcConfig { get; set; }
    Property Value

    object

    Remarks

    For more information, see Running a Canary in a VPC .

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

    Implements

    ICfnCanaryProps
    Back to top Generated by DocFX