Class ApiCanary.Builder
- java.lang.Object
-
- io.github.cdklabs.cdk.ecs.codedeploy.ApiCanary.Builder
-
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description ApiCanary.BuilderartifactsBucketLocation(software.amazon.awscdk.services.synthetics.ArtifactsBucketLocation artifactsBucketLocation)(experimental) The s3 location that stores the data of the canary runs.ApiCanary.BuilderbaseUrl(String baseUrl)(experimental) The base URL to use for tests.ApiCanarybuild()ApiCanary.BuildercanaryName(String canaryName)(experimental) The name of the canary.static ApiCanary.Buildercreate(software.constructs.Construct scope, String id)ApiCanary.BuilderdurationAlarmThreshold(software.amazon.awscdk.Duration durationAlarmThreshold)(experimental) The threshold for triggering an alarm on the test duration.ApiCanary.BuilderfailureRetentionPeriod(software.amazon.awscdk.Duration failureRetentionPeriod)(experimental) How many days should failed runs be retained.ApiCanary.Builderrole(software.amazon.awscdk.services.iam.IRole role)(experimental) Canary execution role.ApiCanary.Builderschedule(software.amazon.awscdk.services.synthetics.Schedule schedule)(experimental) Specify the schedule for how often the canary runs.ApiCanary.BuildersecurityGroups(List<? extends software.amazon.awscdk.services.ec2.ISecurityGroup> securityGroups)(experimental) The list of security groups to associate with the canary's network interfaces.ApiCanary.BuilderstartAfterCreation(Boolean startAfterCreation)(experimental) Whether or not the canary should start after creation.ApiCanary.Buildersteps(List<? extends ApiTestStep> steps)(experimental) The steps to perform in the synthetic test.ApiCanary.BuildersuccessRetentionPeriod(software.amazon.awscdk.Duration successRetentionPeriod)(experimental) How many days should successful runs be retained.ApiCanary.BuilderthreadCount(Number threadCount)(experimental) The number of threads to run concurrently for the synthetic test.ApiCanary.BuildertimeToLive(software.amazon.awscdk.Duration timeToLive)(experimental) How long the canary will be in a 'RUNNING' state.ApiCanary.Buildervpc(software.amazon.awscdk.services.ec2.IVpc vpc)(experimental) The VPC where this canary is run.ApiCanary.BuildervpcSubnets(software.amazon.awscdk.services.ec2.SubnetSelection vpcSubnets)(experimental) Where to place the network interfaces within the VPC.
-
-
-
Method Detail
-
create
@Stability(Experimental) public static ApiCanary.Builder create(software.constructs.Construct scope, String id)
- Parameters:
scope- This parameter is required.id- This parameter is required.- Returns:
- a new instance of
ApiCanary.Builder.
-
baseUrl
@Stability(Experimental) public ApiCanary.Builder baseUrl(String baseUrl)
(experimental) The base URL to use for tests.- Parameters:
baseUrl- The base URL to use for tests. This parameter is required.- Returns:
this
-
artifactsBucketLocation
@Stability(Experimental) public ApiCanary.Builder artifactsBucketLocation(software.amazon.awscdk.services.synthetics.ArtifactsBucketLocation artifactsBucketLocation)
(experimental) The s3 location that stores the data of the canary runs.Default: - A new s3 bucket will be created without a prefix.
- Parameters:
artifactsBucketLocation- The s3 location that stores the data of the canary runs. This parameter is required.- Returns:
this
-
canaryName
@Stability(Experimental) public ApiCanary.Builder canaryName(String canaryName)
(experimental) The name of the 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 name. The canary name makes up part of the canary ARN, which is included in outbound calls over the internet.
Default: - A unique name will be generated from the construct ID
- Parameters:
canaryName- The name of the canary. This parameter is required.- Returns:
this- See Also:
- https://docs.aws.amazon.com/AmazonCloudWatch/latest/monitoring/servicelens_canaries_security.html
-
durationAlarmThreshold
@Stability(Experimental) public ApiCanary.Builder durationAlarmThreshold(software.amazon.awscdk.Duration durationAlarmThreshold)
(experimental) The threshold for triggering an alarm on the test duration.Default: - no alarm is created for duration
- Parameters:
durationAlarmThreshold- The threshold for triggering an alarm on the test duration. This parameter is required.- Returns:
this
-
failureRetentionPeriod
@Stability(Experimental) public ApiCanary.Builder failureRetentionPeriod(software.amazon.awscdk.Duration failureRetentionPeriod)
(experimental) How many days should failed runs be retained.Default: Duration.days(31)
- Parameters:
failureRetentionPeriod- How many days should failed runs be retained. This parameter is required.- Returns:
this
-
role
@Stability(Experimental) public ApiCanary.Builder role(software.amazon.awscdk.services.iam.IRole role)
(experimental) Canary execution role.This is the role that will be assumed by the canary upon execution. It controls the permissions that the canary will have. The role must be assumable by the AWS Lambda service principal.
If not supplied, a role will be created with all the required permissions. If you provide a Role, you must add the required permissions.
Default: - A unique role will be generated for this canary. You can add permissions to roles by calling 'addToRolePolicy'.
- Parameters:
role- Canary execution role. This parameter is required.- Returns:
this- See Also:
- required permissions: https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-synthetics-canary.html#cfn-synthetics-canary-executionrolearn
-
schedule
@Stability(Experimental) public ApiCanary.Builder schedule(software.amazon.awscdk.services.synthetics.Schedule schedule)
(experimental) Specify the schedule for how often the canary runs.For example, if you set
scheduletorate(10 minutes), then the canary will run every 10 minutes. You can set the schedule withSchedule.rate(Duration)(recommended) or you can specify an expression usingSchedule.expression().Default: 'rate(5 minutes)'
- Parameters:
schedule- Specify the schedule for how often the canary runs. This parameter is required.- Returns:
this
-
securityGroups
@Stability(Experimental) public ApiCanary.Builder securityGroups(List<? extends software.amazon.awscdk.services.ec2.ISecurityGroup> securityGroups)
(experimental) The list of security groups to associate with the canary's network interfaces.You must provide
vpcwhen using this prop.Default: - If the canary is placed within a VPC and a security group is not specified a dedicated security group will be created for this canary.
- Parameters:
securityGroups- The list of security groups to associate with the canary's network interfaces. This parameter is required.- Returns:
this
-
startAfterCreation
@Stability(Experimental) public ApiCanary.Builder startAfterCreation(Boolean startAfterCreation)
(experimental) Whether or not the canary should start after creation.Default: true
- Parameters:
startAfterCreation- Whether or not the canary should start after creation. This parameter is required.- Returns:
this
-
steps
@Stability(Experimental) public ApiCanary.Builder steps(List<? extends ApiTestStep> steps)
(experimental) The steps to perform in the synthetic test.- Parameters:
steps- The steps to perform in the synthetic test. This parameter is required.- Returns:
this
-
successRetentionPeriod
@Stability(Experimental) public ApiCanary.Builder successRetentionPeriod(software.amazon.awscdk.Duration successRetentionPeriod)
(experimental) How many days should successful runs be retained.Default: Duration.days(31)
- Parameters:
successRetentionPeriod- How many days should successful runs be retained. This parameter is required.- Returns:
this
-
threadCount
@Stability(Experimental) public ApiCanary.Builder threadCount(Number threadCount)
(experimental) The number of threads to run concurrently for the synthetic test.Default: - 20
- Parameters:
threadCount- The number of threads to run concurrently for the synthetic test. This parameter is required.- Returns:
this
-
timeToLive
@Stability(Experimental) public ApiCanary.Builder timeToLive(software.amazon.awscdk.Duration timeToLive)
(experimental) How long the canary will be in a 'RUNNING' state.For example, if you set
timeToLiveto be 1 hour andscheduleto berate(10 minutes), your canary will run at 10 minute intervals for an hour, for a total of 6 times.Default: - no limit
- Parameters:
timeToLive- How long the canary will be in a 'RUNNING' state. This parameter is required.- Returns:
this
-
vpc
@Stability(Experimental) public ApiCanary.Builder vpc(software.amazon.awscdk.services.ec2.IVpc vpc)
(experimental) The VPC where this canary is run.Specify this if the canary needs to access resources in a VPC.
Default: - Not in VPC
- Parameters:
vpc- The VPC where this canary is run. This parameter is required.- Returns:
this
-
vpcSubnets
@Stability(Experimental) public ApiCanary.Builder vpcSubnets(software.amazon.awscdk.services.ec2.SubnetSelection vpcSubnets)
(experimental) Where to place the network interfaces within the VPC.You must provide
vpcwhen using this prop.Default: - the Vpc default strategy if not specified
- Parameters:
vpcSubnets- Where to place the network interfaces within the VPC. This parameter is required.- Returns:
this
-
-