Class CfnCanary.Builder

java.lang.Object
software.amazon.awscdk.services.synthetics.CfnCanary.Builder
All Implemented Interfaces:
software.amazon.jsii.Builder<CfnCanary>
Enclosing class:
CfnCanary

@Stability(Stable) public static final class CfnCanary.Builder extends Object implements software.amazon.jsii.Builder<CfnCanary>
A fluent builder for CfnCanary.
  • Method Details

    • create

      @Stability(Stable) public static CfnCanary.Builder create(Construct scope, String id)
      Parameters:
      scope -
      • scope in which this resource is defined.
      This parameter is required.
      id -
      • scoped id of the resource.
      This parameter is required.
      Returns:
      a new instance of CfnCanary.Builder.
    • artifactS3Location

      @Stability(Stable) public CfnCanary.Builder artifactS3Location(String artifactS3Location)
      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.

      Parameters:
      artifactS3Location - The location in Amazon S3 where Synthetics stores artifacts from the runs of this canary. This parameter is required.
      Returns:
      this
    • code

      @Stability(Stable) public CfnCanary.Builder code(CfnCanary.CodeProperty 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 .

      Parameters:
      code - Use this structure to input your script code for the canary. This parameter is required.
      Returns:
      this
    • code

      @Stability(Stable) public CfnCanary.Builder code(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 .

      Parameters:
      code - Use this structure to input your script code for the canary. This parameter is required.
      Returns:
      this
    • executionRoleArn

      @Stability(Stable) public CfnCanary.Builder executionRoleArn(String executionRoleArn)
      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

      Parameters:
      executionRoleArn - The ARN of the IAM role to be used to run the canary. This parameter is required.
      Returns:
      this
    • name

      @Stability(Stable) public CfnCanary.Builder name(String 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 .

      Parameters:
      name - The name for this canary. This parameter is required.
      Returns:
      this
    • runtimeVersion

      @Stability(Stable) public CfnCanary.Builder runtimeVersion(String runtimeVersion)
      Specifies the runtime version to use for the canary.

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

      Parameters:
      runtimeVersion - Specifies the runtime version to use for the canary. This parameter is required.
      Returns:
      this
    • schedule

      @Stability(Stable) public CfnCanary.Builder schedule(IResolvable schedule)
      A structure that contains information about how often the canary is to run, and when these runs are to stop.

      Parameters:
      schedule - A structure that contains information about how often the canary is to run, and when these runs are to stop. This parameter is required.
      Returns:
      this
    • schedule

      @Stability(Stable) public CfnCanary.Builder schedule(CfnCanary.ScheduleProperty schedule)
      A structure that contains information about how often the canary is to run, and when these runs are to stop.

      Parameters:
      schedule - A structure that contains information about how often the canary is to run, and when these runs are to stop. This parameter is required.
      Returns:
      this
    • artifactConfig

      @Stability(Stable) public CfnCanary.Builder artifactConfig(IResolvable 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.

      Parameters:
      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. This parameter is required.
      Returns:
      this
    • artifactConfig

      @Stability(Stable) public CfnCanary.Builder artifactConfig(CfnCanary.ArtifactConfigProperty 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.

      Parameters:
      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. This parameter is required.
      Returns:
      this
    • deleteLambdaResourcesOnCanaryDeletion

      @Stability(Stable) public CfnCanary.Builder deleteLambdaResourcesOnCanaryDeletion(Boolean deleteLambdaResourcesOnCanaryDeletion)
      AWS::Synthetics::Canary.DeleteLambdaResourcesOnCanaryDeletion.

      Parameters:
      deleteLambdaResourcesOnCanaryDeletion - AWS::Synthetics::Canary.DeleteLambdaResourcesOnCanaryDeletion. This parameter is required.
      Returns:
      this
    • deleteLambdaResourcesOnCanaryDeletion

      @Stability(Stable) public CfnCanary.Builder deleteLambdaResourcesOnCanaryDeletion(IResolvable deleteLambdaResourcesOnCanaryDeletion)
      AWS::Synthetics::Canary.DeleteLambdaResourcesOnCanaryDeletion.

      Parameters:
      deleteLambdaResourcesOnCanaryDeletion - AWS::Synthetics::Canary.DeleteLambdaResourcesOnCanaryDeletion. This parameter is required.
      Returns:
      this
    • failureRetentionPeriod

      @Stability(Stable) public CfnCanary.Builder failureRetentionPeriod(Number failureRetentionPeriod)
      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.

      Parameters:
      failureRetentionPeriod - The number of days to retain data about failed runs of this canary. This parameter is required.
      Returns:
      this
    • runConfig

      @Stability(Stable) public CfnCanary.Builder runConfig(IResolvable runConfig)
      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.

      Parameters:
      runConfig - A structure that contains input information for a canary run. This parameter is required.
      Returns:
      this
    • runConfig

      @Stability(Stable) public CfnCanary.Builder runConfig(CfnCanary.RunConfigProperty runConfig)
      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.

      Parameters:
      runConfig - A structure that contains input information for a canary run. This parameter is required.
      Returns:
      this
    • startCanaryAfterCreation

      @Stability(Stable) public CfnCanary.Builder startCanaryAfterCreation(Boolean startCanaryAfterCreation)
      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.

      Parameters:
      startCanaryAfterCreation - Specify TRUE to have the canary start making runs immediately after it is created. This parameter is required.
      Returns:
      this
    • startCanaryAfterCreation

      @Stability(Stable) public CfnCanary.Builder startCanaryAfterCreation(IResolvable startCanaryAfterCreation)
      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.

      Parameters:
      startCanaryAfterCreation - Specify TRUE to have the canary start making runs immediately after it is created. This parameter is required.
      Returns:
      this
    • successRetentionPeriod

      @Stability(Stable) public CfnCanary.Builder successRetentionPeriod(Number successRetentionPeriod)
      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.

      Parameters:
      successRetentionPeriod - The number of days to retain data about successful runs of this canary. This parameter is required.
      Returns:
      this
    • tags

      @Stability(Stable) public CfnCanary.Builder tags(List<? extends CfnTag> tags)
      The list of key-value pairs that are associated with the canary.

      Parameters:
      tags - The list of key-value pairs that are associated with the canary. This parameter is required.
      Returns:
      this
    • visualReference

      @Stability(Stable) public CfnCanary.Builder visualReference(IResolvable 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.

      Parameters:
      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. This parameter is required.
      Returns:
      this
    • visualReference

      @Stability(Stable) public CfnCanary.Builder visualReference(CfnCanary.VisualReferenceProperty 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.

      Parameters:
      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. This parameter is required.
      Returns:
      this
    • vpcConfig

      @Stability(Stable) public CfnCanary.Builder vpcConfig(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.

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

      Parameters:
      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. This parameter is required.
      Returns:
      this
    • vpcConfig

      @Stability(Stable) public CfnCanary.Builder vpcConfig(CfnCanary.VPCConfigProperty 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.

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

      Parameters:
      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. This parameter is required.
      Returns:
      this
    • build

      @Stability(Stable) public CfnCanary build()
      Specified by:
      build in interface software.amazon.jsii.Builder<CfnCanary>
      Returns:
      a newly built instance of CfnCanary.