Class InstanceRefreshOptions.Builder
java.lang.Object
software.amazon.awscdk.services.autoscaling.InstanceRefreshOptions.Builder
- All Implemented Interfaces:
software.amazon.jsii.Builder<InstanceRefreshOptions>
- Enclosing interface:
InstanceRefreshOptions
@Stability(Stable)
public static final class InstanceRefreshOptions.Builder
extends Object
implements software.amazon.jsii.Builder<InstanceRefreshOptions>
A builder for
InstanceRefreshOptions-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionSets the value ofInstanceRefreshOptions.getAlarms()Sets the value ofInstanceRefreshOptions.getBakeTime()build()Builds the configured instance.checkpointDelay(Duration checkpointDelay) Sets the value ofInstanceRefreshOptions.getCheckpointDelay()checkpointPercentages(List<? extends Number> checkpointPercentages) Sets the value ofInstanceRefreshOptions.getCheckpointPercentages()instanceWarmup(Duration instanceWarmup) Sets the value ofInstanceRefreshOptions.getInstanceWarmup()maxHealthyPercentage(Number maxHealthyPercentage) Sets the value ofInstanceRefreshOptions.getMaxHealthyPercentage()minHealthyPercentage(Number minHealthyPercentage) Sets the value ofInstanceRefreshOptions.getMinHealthyPercentage()scaleInProtectedInstances(ScaleInProtectedInstances scaleInProtectedInstances) Sets the value ofInstanceRefreshOptions.getScaleInProtectedInstances()skipMatching(Boolean skipMatching) Sets the value ofInstanceRefreshOptions.getSkipMatching()standbyInstances(StandbyInstances standbyInstances) Sets the value ofInstanceRefreshOptions.getStandbyInstances()strategy(InstanceRefreshStrategy strategy) Sets the value ofInstanceRefreshOptions.getStrategy()
-
Constructor Details
-
Builder
public Builder()
-
-
Method Details
-
strategy
Sets the value ofInstanceRefreshOptions.getStrategy()- Parameters:
strategy- The strategy to use for the instance refresh. This parameter is required.- Returns:
this
-
alarms
Sets the value ofInstanceRefreshOptions.getAlarms()- Parameters:
alarms- The CloudWatch alarms to monitor during the instance refresh. If any of the alarms goes into ALARM state, the instance refresh fails. You can specify up to 10 alarms.- Returns:
this
-
bakeTime
Sets the value ofInstanceRefreshOptions.getBakeTime()- Parameters:
bakeTime- The amount of time after an instance refresh completes successfully before CloudFormation considers the update successful.- Returns:
this
-
checkpointDelay
Sets the value ofInstanceRefreshOptions.getCheckpointDelay()- Parameters:
checkpointDelay- The amount of time to wait after a checkpoint is reached before continuing.- Returns:
this
-
checkpointPercentages
@Stability(Stable) public InstanceRefreshOptions.Builder checkpointPercentages(List<? extends Number> checkpointPercentages) Sets the value ofInstanceRefreshOptions.getCheckpointPercentages()- Parameters:
checkpointPercentages- Threshold values for each checkpoint in ascending order. Each number must be unique. To replace all instances in the group, the last number in the array must be 100.- Returns:
this
-
instanceWarmup
Sets the value ofInstanceRefreshOptions.getInstanceWarmup()- Parameters:
instanceWarmup- The amount of time to wait after a new instance enters the InService state before moving on to refresh the next instance.- Returns:
this
-
maxHealthyPercentage
@Stability(Stable) public InstanceRefreshOptions.Builder maxHealthyPercentage(Number maxHealthyPercentage) Sets the value ofInstanceRefreshOptions.getMaxHealthyPercentage()- Parameters:
maxHealthyPercentage- The maximum percentage of the group that can be in service and healthy, or pending, to support your workload during the instance refresh. The difference betweenmaxHealthyPercentageandminHealthyPercentagecannot be greater than 100. A larger range increases the number of instances that can be replaced at the same time.- Returns:
this
-
minHealthyPercentage
@Stability(Stable) public InstanceRefreshOptions.Builder minHealthyPercentage(Number minHealthyPercentage) Sets the value ofInstanceRefreshOptions.getMinHealthyPercentage()- Parameters:
minHealthyPercentage- The minimum percentage of the group to keep in service, healthy, and ready to use to support your workload during the instance refresh, expressed as a percentage of the group's desired capacity.- Returns:
this
-
scaleInProtectedInstances
@Stability(Stable) public InstanceRefreshOptions.Builder scaleInProtectedInstances(ScaleInProtectedInstances scaleInProtectedInstances) Sets the value ofInstanceRefreshOptions.getScaleInProtectedInstances()- Parameters:
scaleInProtectedInstances- Specifies the behavior of instances that are protected from scale in during an instance refresh.- Returns:
this
-
skipMatching
Sets the value ofInstanceRefreshOptions.getSkipMatching()- Parameters:
skipMatching- Indicates whether skip matching is enabled.- Returns:
this
-
standbyInstances
@Stability(Stable) public InstanceRefreshOptions.Builder standbyInstances(StandbyInstances standbyInstances) Sets the value ofInstanceRefreshOptions.getStandbyInstances()- Parameters:
standbyInstances- Specifies the behavior of instances in standby during an instance refresh.- Returns:
this
-
build
Builds the configured instance.- Specified by:
buildin interfacesoftware.amazon.jsii.Builder<InstanceRefreshOptions>- Returns:
- a new instance of
InstanceRefreshOptions - Throws:
NullPointerException- if any required attribute was not provided
-