Class CfnCanaryProps.Builder

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

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

    • Builder

      public Builder()
  • Method Details

    • artifactS3Location

      @Stability(Stable) public CfnCanaryProps.Builder artifactS3Location(String artifactS3Location)
      Parameters:
      artifactS3Location - The location in Amazon S3 where Synthetics stores artifacts from the runs of this canary. This parameter is required. Artifacts include the log file, screenshots, and HAR files. Specify the full location path, including s3:// at the beginning of the path.
      Returns:
      this
    • code

      @Stability(Stable) public CfnCanaryProps.Builder code(IResolvable code)
      Sets the value of CfnCanaryProps.getCode()
      Parameters:
      code - Use this structure to input your script code for the canary. This parameter is required. 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 .
      Returns:
      this
    • code

      @Stability(Stable) public CfnCanaryProps.Builder code(CfnCanary.CodeProperty code)
      Sets the value of CfnCanaryProps.getCode()
      Parameters:
      code - Use this structure to input your script code for the canary. This parameter is required. 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 .
      Returns:
      this
    • executionRoleArn

      @Stability(Stable) public CfnCanaryProps.Builder executionRoleArn(String executionRoleArn)
      Parameters:
      executionRoleArn - The ARN of the IAM role to be used to run the canary. This parameter is required. 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
      Returns:
      this
    • name

      @Stability(Stable) public CfnCanaryProps.Builder name(String name)
      Sets the value of CfnCanaryProps.getName()
      Parameters:
      name - The name for this canary. This parameter is required. 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 .

      Returns:
      this
    • runtimeVersion

      @Stability(Stable) public CfnCanaryProps.Builder runtimeVersion(String runtimeVersion)
      Parameters:
      runtimeVersion - Specifies the runtime version to use for the canary. This parameter is required. For more information about runtime versions, see Canary Runtime Versions .
      Returns:
      this
    • schedule

      @Stability(Stable) public CfnCanaryProps.Builder schedule(IResolvable schedule)
      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 CfnCanaryProps.Builder schedule(CfnCanary.ScheduleProperty schedule)
      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 CfnCanaryProps.Builder artifactConfig(IResolvable artifactConfig)
      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.
      Returns:
      this
    • artifactConfig

      @Stability(Stable) public CfnCanaryProps.Builder artifactConfig(CfnCanary.ArtifactConfigProperty artifactConfig)
      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.
      Returns:
      this
    • deleteLambdaResourcesOnCanaryDeletion

      @Stability(Deprecated) @Deprecated public CfnCanaryProps.Builder deleteLambdaResourcesOnCanaryDeletion(Boolean deleteLambdaResourcesOnCanaryDeletion)
      Deprecated.
      this property has been deprecated
      Parameters:
      deleteLambdaResourcesOnCanaryDeletion - Deletes associated lambda resources created by Synthetics if set to True. Default is False
      Returns:
      this
    • deleteLambdaResourcesOnCanaryDeletion

      @Stability(Deprecated) @Deprecated public CfnCanaryProps.Builder deleteLambdaResourcesOnCanaryDeletion(IResolvable deleteLambdaResourcesOnCanaryDeletion)
      Deprecated.
      this property has been deprecated
      Parameters:
      deleteLambdaResourcesOnCanaryDeletion - Deletes associated lambda resources created by Synthetics if set to True. Default is False
      Returns:
      this
    • failureRetentionPeriod

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

      This setting affects the range of information returned by GetCanaryRuns , as well as the range of information displayed in the Synthetics console.

      Returns:
      this
    • provisionedResourceCleanup

      @Stability(Stable) public CfnCanaryProps.Builder provisionedResourceCleanup(String provisionedResourceCleanup)
      Parameters:
      provisionedResourceCleanup - Specifies whether to also delete the Lambda functions and layers used by this canary when the canary is deleted. 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.

      Returns:
      this
    • resourcesToReplicateTags

      @Stability(Stable) public CfnCanaryProps.Builder resourcesToReplicateTags(List<String> resourcesToReplicateTags)
      Parameters:
      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 . 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.
      Returns:
      this
    • runConfig

      @Stability(Stable) public CfnCanaryProps.Builder runConfig(IResolvable runConfig)
      Parameters:
      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.
      Returns:
      this
    • runConfig

      @Stability(Stable) public CfnCanaryProps.Builder runConfig(CfnCanary.RunConfigProperty runConfig)
      Parameters:
      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.
      Returns:
      this
    • startCanaryAfterCreation

      @Stability(Stable) public CfnCanaryProps.Builder startCanaryAfterCreation(Boolean startCanaryAfterCreation)
      Parameters:
      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.
      Returns:
      this
    • startCanaryAfterCreation

      @Stability(Stable) public CfnCanaryProps.Builder startCanaryAfterCreation(IResolvable startCanaryAfterCreation)
      Parameters:
      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.
      Returns:
      this
    • successRetentionPeriod

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

      This setting affects the range of information returned by GetCanaryRuns , as well as the range of information displayed in the Synthetics console.

      Returns:
      this
    • tags

      @Stability(Stable) public CfnCanaryProps.Builder tags(List<? extends CfnTag> tags)
      Sets the value of CfnCanaryProps.getTags()
      Parameters:
      tags - The list of key-value pairs that are associated with the canary.
      Returns:
      this
    • visualReference

      @Stability(Stable) public CfnCanaryProps.Builder visualReference(IResolvable visualReference)
      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.
      Returns:
      this
    • visualReference

      @Stability(Stable) public CfnCanaryProps.Builder visualReference(CfnCanary.VisualReferenceProperty visualReference)
      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.
      Returns:
      this
    • vpcConfig

      @Stability(Stable) public CfnCanaryProps.Builder vpcConfig(IResolvable vpcConfig)
      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. For more information, see Running a Canary in a VPC .
      Returns:
      this
    • vpcConfig

      @Stability(Stable) public CfnCanaryProps.Builder vpcConfig(CfnCanary.VPCConfigProperty vpcConfig)
      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. For more information, see Running a Canary in a VPC .
      Returns:
      this
    • build

      @Stability(Stable) public CfnCanaryProps build()
      Builds the configured instance.
      Specified by:
      build in interface software.amazon.jsii.Builder<CfnCanaryProps>
      Returns:
      a new instance of CfnCanaryProps
      Throws:
      NullPointerException - if any required attribute was not provided