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 Summary
-
Method Summary
Modifier and TypeMethodDescriptionartifactConfig
(IResolvable artifactConfig) Sets the value ofCfnCanaryProps.getArtifactConfig()
artifactConfig
(CfnCanary.ArtifactConfigProperty artifactConfig) Sets the value ofCfnCanaryProps.getArtifactConfig()
artifactS3Location
(String artifactS3Location) Sets the value ofCfnCanaryProps.getArtifactS3Location()
build()
Builds the configured instance.code
(IResolvable code) Sets the value ofCfnCanaryProps.getCode()
code
(CfnCanary.CodeProperty code) Sets the value ofCfnCanaryProps.getCode()
deleteLambdaResourcesOnCanaryDeletion
(Boolean deleteLambdaResourcesOnCanaryDeletion) Sets the value ofCfnCanaryProps.getDeleteLambdaResourcesOnCanaryDeletion()
deleteLambdaResourcesOnCanaryDeletion
(IResolvable deleteLambdaResourcesOnCanaryDeletion) Sets the value ofCfnCanaryProps.getDeleteLambdaResourcesOnCanaryDeletion()
executionRoleArn
(String executionRoleArn) Sets the value ofCfnCanaryProps.getExecutionRoleArn()
failureRetentionPeriod
(Number failureRetentionPeriod) Sets the value ofCfnCanaryProps.getFailureRetentionPeriod()
Sets the value ofCfnCanaryProps.getName()
runConfig
(IResolvable runConfig) Sets the value ofCfnCanaryProps.getRunConfig()
runConfig
(CfnCanary.RunConfigProperty runConfig) Sets the value ofCfnCanaryProps.getRunConfig()
runtimeVersion
(String runtimeVersion) Sets the value ofCfnCanaryProps.getRuntimeVersion()
schedule
(IResolvable schedule) Sets the value ofCfnCanaryProps.getSchedule()
schedule
(CfnCanary.ScheduleProperty schedule) Sets the value ofCfnCanaryProps.getSchedule()
startCanaryAfterCreation
(Boolean startCanaryAfterCreation) Sets the value ofCfnCanaryProps.getStartCanaryAfterCreation()
startCanaryAfterCreation
(IResolvable startCanaryAfterCreation) Sets the value ofCfnCanaryProps.getStartCanaryAfterCreation()
successRetentionPeriod
(Number successRetentionPeriod) Sets the value ofCfnCanaryProps.getSuccessRetentionPeriod()
Sets the value ofCfnCanaryProps.getTags()
visualReference
(IResolvable visualReference) Sets the value ofCfnCanaryProps.getVisualReference()
visualReference
(CfnCanary.VisualReferenceProperty visualReference) Sets the value ofCfnCanaryProps.getVisualReference()
vpcConfig
(IResolvable vpcConfig) Sets the value ofCfnCanaryProps.getVpcConfig()
vpcConfig
(CfnCanary.VPCConfigProperty vpcConfig) Sets the value ofCfnCanaryProps.getVpcConfig()
-
Constructor Details
-
Builder
public Builder()
-
-
Method Details
-
artifactS3Location
Sets the value ofCfnCanaryProps.getArtifactS3Location()
- 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, includings3://
at the beginning of the path.- Returns:
this
-
code
Sets the value ofCfnCanaryProps.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 ofScript
.- Returns:
this
-
code
Sets the value ofCfnCanaryProps.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 ofScript
.- Returns:
this
-
executionRoleArn
Sets the value ofCfnCanaryProps.getExecutionRoleArn()
- 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 includelambda.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
Sets the value ofCfnCanaryProps.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
Sets the value ofCfnCanaryProps.getRuntimeVersion()
- 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
Sets the value ofCfnCanaryProps.getSchedule()
- 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
Sets the value ofCfnCanaryProps.getSchedule()
- 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
Sets the value ofCfnCanaryProps.getArtifactConfig()
- 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) Sets the value ofCfnCanaryProps.getArtifactConfig()
- 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(Stable) public CfnCanaryProps.Builder deleteLambdaResourcesOnCanaryDeletion(Boolean deleteLambdaResourcesOnCanaryDeletion) Sets the value ofCfnCanaryProps.getDeleteLambdaResourcesOnCanaryDeletion()
- Parameters:
deleteLambdaResourcesOnCanaryDeletion
-AWS::Synthetics::Canary.DeleteLambdaResourcesOnCanaryDeletion
.- Returns:
this
-
deleteLambdaResourcesOnCanaryDeletion
@Stability(Stable) public CfnCanaryProps.Builder deleteLambdaResourcesOnCanaryDeletion(IResolvable deleteLambdaResourcesOnCanaryDeletion) Sets the value ofCfnCanaryProps.getDeleteLambdaResourcesOnCanaryDeletion()
- Parameters:
deleteLambdaResourcesOnCanaryDeletion
-AWS::Synthetics::Canary.DeleteLambdaResourcesOnCanaryDeletion
.- Returns:
this
-
failureRetentionPeriod
@Stability(Stable) public CfnCanaryProps.Builder failureRetentionPeriod(Number failureRetentionPeriod) Sets the value ofCfnCanaryProps.getFailureRetentionPeriod()
- 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.- Returns:
this
-
runConfig
Sets the value ofCfnCanaryProps.getRunConfig()
- 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
Sets the value ofCfnCanaryProps.getRunConfig()
- 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) Sets the value ofCfnCanaryProps.getStartCanaryAfterCreation()
- 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) Sets the value ofCfnCanaryProps.getStartCanaryAfterCreation()
- 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) Sets the value ofCfnCanaryProps.getSuccessRetentionPeriod()
- 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.- Returns:
this
-
tags
Sets the value ofCfnCanaryProps.getTags()
- Parameters:
tags
- The list of key-value pairs that are associated with the canary.- Returns:
this
-
visualReference
Sets the value ofCfnCanaryProps.getVisualReference()
- 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) Sets the value ofCfnCanaryProps.getVisualReference()
- 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
Sets the value ofCfnCanaryProps.getVpcConfig()
- 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
Sets the value ofCfnCanaryProps.getVpcConfig()
- 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
Builds the configured instance.- Specified by:
build
in interfacesoftware.amazon.jsii.Builder<CfnCanaryProps>
- Returns:
- a new instance of
CfnCanaryProps
- Throws:
NullPointerException
- if any required attribute was not provided
-