Class RefreshPreferences
- All Implemented Interfaces:
Serializable
,SdkPojo
,ToCopyableBuilder<RefreshPreferences.Builder,
RefreshPreferences>
Describes the preferences for an instance refresh.
- See Also:
-
Nested Class Summary
-
Method Summary
Modifier and TypeMethodDescriptionfinal AlarmSpecification
(Optional) The CloudWatch alarm specification.final Boolean
(Optional) Indicates whether to roll back the Auto Scaling group to its previous configuration if the instance refresh fails or a CloudWatch alarm threshold is met.static RefreshPreferences.Builder
builder()
final Integer
(Optional) The amount of time, in seconds, to wait after a checkpoint before continuing.(Optional) Threshold values for each checkpoint in ascending order.final boolean
final boolean
equalsBySdkFields
(Object obj) Indicates whether some other object is "equal to" this one by SDK fields.final <T> Optional
<T> getValueForField
(String fieldName, Class<T> clazz) final boolean
For responses, this returns true if the service returned a value for the CheckpointPercentages property.final int
hashCode()
final Integer
A time period, in seconds, during which an instance refresh waits before moving on to replacing the next instance after a new instance enters theInService
state.final Integer
Specifies the maximum percentage of the group that can be in service and healthy, or pending, to support your workload when replacing instances.final Integer
Specifies the minimum percentage of the group to keep in service, healthy, and ready to use to support your workload to allow the operation to continue.Choose the behavior that you want Amazon EC2 Auto Scaling to use if instances protected from scale in are found.final String
Choose the behavior that you want Amazon EC2 Auto Scaling to use if instances protected from scale in are found.static Class
<? extends RefreshPreferences.Builder> final Boolean
(Optional) Indicates whether skip matching is enabled.final StandbyInstances
Choose the behavior that you want Amazon EC2 Auto Scaling to use if instances inStandby
state are found.final String
Choose the behavior that you want Amazon EC2 Auto Scaling to use if instances inStandby
state are found.Take this object and create a builder that contains all of the current property values of this object.final String
toString()
Returns a string representation of this object.Methods inherited from interface software.amazon.awssdk.utils.builder.ToCopyableBuilder
copy
-
Method Details
-
minHealthyPercentage
Specifies the minimum percentage of the group to keep in service, healthy, and ready to use to support your workload to allow the operation to continue. The value is expressed as a percentage of the desired capacity of the Auto Scaling group. Value range is 0 to 100.
If you do not specify this property, the default is 90 percent, or the percentage set in the instance maintenance policy for the Auto Scaling group, if defined.
- Returns:
- Specifies the minimum percentage of the group to keep in service, healthy, and ready to use to support
your workload to allow the operation to continue. The value is expressed as a percentage of the desired
capacity of the Auto Scaling group. Value range is 0 to 100.
If you do not specify this property, the default is 90 percent, or the percentage set in the instance maintenance policy for the Auto Scaling group, if defined.
-
instanceWarmup
A time period, in seconds, during which an instance refresh waits before moving on to replacing the next instance after a new instance enters the
InService
state.This property is not required for normal usage. Instead, use the
DefaultInstanceWarmup
property of the Auto Scaling group. TheInstanceWarmup
andDefaultInstanceWarmup
properties work the same way. Only specify this property if you must override theDefaultInstanceWarmup
property.If you do not specify this property, the instance warmup by default is the value of the
DefaultInstanceWarmup
property, if defined (which is recommended in all cases), or theHealthCheckGracePeriod
property otherwise.- Returns:
- A time period, in seconds, during which an instance refresh waits before moving on to replacing the next
instance after a new instance enters the
InService
state.This property is not required for normal usage. Instead, use the
DefaultInstanceWarmup
property of the Auto Scaling group. TheInstanceWarmup
andDefaultInstanceWarmup
properties work the same way. Only specify this property if you must override theDefaultInstanceWarmup
property.If you do not specify this property, the instance warmup by default is the value of the
DefaultInstanceWarmup
property, if defined (which is recommended in all cases), or theHealthCheckGracePeriod
property otherwise.
-
hasCheckpointPercentages
public final boolean hasCheckpointPercentages()For responses, this returns true if the service returned a value for the CheckpointPercentages property. This DOES NOT check that the value is non-empty (for which, you should check theisEmpty()
method on the property). This is useful because the SDK will never return a null collection or map, but you may need to differentiate between the service returning nothing (or null) and the service returning an empty collection or map. For requests, this returns true if a value for the property was specified in the request builder, and false if a value was not specified. -
checkpointPercentages
(Optional) Threshold values for each checkpoint in ascending order. Each number must be unique. To replace all instances in the Auto Scaling group, the last number in the array must be
100
.For usage examples, see Adding checkpoints to an instance refresh in the Amazon EC2 Auto Scaling User Guide.
Attempts to modify the collection returned by this method will result in an UnsupportedOperationException.
This method will never return null. If you would like to know whether the service returned this field (so that you can differentiate between null and empty), you can use the
hasCheckpointPercentages()
method.- Returns:
- (Optional) Threshold values for each checkpoint in ascending order. Each number must be unique. To
replace all instances in the Auto Scaling group, the last number in the array must be
100
.For usage examples, see Adding checkpoints to an instance refresh in the Amazon EC2 Auto Scaling User Guide.
-
checkpointDelay
(Optional) The amount of time, in seconds, to wait after a checkpoint before continuing. This property is optional, but if you specify a value for it, you must also specify a value for
CheckpointPercentages
. If you specify a value forCheckpointPercentages
and not forCheckpointDelay
, theCheckpointDelay
defaults to3600
(1 hour).- Returns:
- (Optional) The amount of time, in seconds, to wait after a checkpoint before continuing. This property is
optional, but if you specify a value for it, you must also specify a value for
CheckpointPercentages
. If you specify a value forCheckpointPercentages
and not forCheckpointDelay
, theCheckpointDelay
defaults to3600
(1 hour).
-
skipMatching
(Optional) Indicates whether skip matching is enabled. If enabled (
true
), then Amazon EC2 Auto Scaling skips replacing instances that match the desired configuration. If no desired configuration is specified, then it skips replacing instances that have the same launch template and instance types that the Auto Scaling group was using before the start of the instance refresh. The default isfalse
.For more information, see Use an instance refresh with skip matching in the Amazon EC2 Auto Scaling User Guide.
- Returns:
- (Optional) Indicates whether skip matching is enabled. If enabled (
true
), then Amazon EC2 Auto Scaling skips replacing instances that match the desired configuration. If no desired configuration is specified, then it skips replacing instances that have the same launch template and instance types that the Auto Scaling group was using before the start of the instance refresh. The default isfalse
.For more information, see Use an instance refresh with skip matching in the Amazon EC2 Auto Scaling User Guide.
-
autoRollback
(Optional) Indicates whether to roll back the Auto Scaling group to its previous configuration if the instance refresh fails or a CloudWatch alarm threshold is met. The default is
false
.A rollback is not supported in the following situations:
-
There is no desired configuration specified for the instance refresh.
-
The Auto Scaling group has a launch template that uses an Amazon Web Services Systems Manager parameter instead of an AMI ID for the
ImageId
property. -
The Auto Scaling group uses the launch template's
$Latest
or$Default
version.
For more information, see Undo changes with a rollback in the Amazon EC2 Auto Scaling User Guide.
- Returns:
- (Optional) Indicates whether to roll back the Auto Scaling group to its previous configuration if the
instance refresh fails or a CloudWatch alarm threshold is met. The default is
false
.A rollback is not supported in the following situations:
-
There is no desired configuration specified for the instance refresh.
-
The Auto Scaling group has a launch template that uses an Amazon Web Services Systems Manager parameter instead of an AMI ID for the
ImageId
property. -
The Auto Scaling group uses the launch template's
$Latest
or$Default
version.
For more information, see Undo changes with a rollback in the Amazon EC2 Auto Scaling User Guide.
-
-
-
scaleInProtectedInstances
Choose the behavior that you want Amazon EC2 Auto Scaling to use if instances protected from scale in are found.
The following lists the valid values:
- Refresh
-
Amazon EC2 Auto Scaling replaces instances that are protected from scale in.
- Ignore
-
Amazon EC2 Auto Scaling ignores instances that are protected from scale in and continues to replace instances that are not protected.
- Wait (default)
-
Amazon EC2 Auto Scaling waits one hour for you to remove scale-in protection. Otherwise, the instance refresh will fail.
If the service returns an enum value that is not available in the current SDK version,
scaleInProtectedInstances
will returnScaleInProtectedInstances.UNKNOWN_TO_SDK_VERSION
. The raw value returned by the service is available fromscaleInProtectedInstancesAsString()
.- Returns:
- Choose the behavior that you want Amazon EC2 Auto Scaling to use if instances protected from scale in are
found.
The following lists the valid values:
- Refresh
-
Amazon EC2 Auto Scaling replaces instances that are protected from scale in.
- Ignore
-
Amazon EC2 Auto Scaling ignores instances that are protected from scale in and continues to replace instances that are not protected.
- Wait (default)
-
Amazon EC2 Auto Scaling waits one hour for you to remove scale-in protection. Otherwise, the instance refresh will fail.
- See Also:
-
scaleInProtectedInstancesAsString
Choose the behavior that you want Amazon EC2 Auto Scaling to use if instances protected from scale in are found.
The following lists the valid values:
- Refresh
-
Amazon EC2 Auto Scaling replaces instances that are protected from scale in.
- Ignore
-
Amazon EC2 Auto Scaling ignores instances that are protected from scale in and continues to replace instances that are not protected.
- Wait (default)
-
Amazon EC2 Auto Scaling waits one hour for you to remove scale-in protection. Otherwise, the instance refresh will fail.
If the service returns an enum value that is not available in the current SDK version,
scaleInProtectedInstances
will returnScaleInProtectedInstances.UNKNOWN_TO_SDK_VERSION
. The raw value returned by the service is available fromscaleInProtectedInstancesAsString()
.- Returns:
- Choose the behavior that you want Amazon EC2 Auto Scaling to use if instances protected from scale in are
found.
The following lists the valid values:
- Refresh
-
Amazon EC2 Auto Scaling replaces instances that are protected from scale in.
- Ignore
-
Amazon EC2 Auto Scaling ignores instances that are protected from scale in and continues to replace instances that are not protected.
- Wait (default)
-
Amazon EC2 Auto Scaling waits one hour for you to remove scale-in protection. Otherwise, the instance refresh will fail.
- See Also:
-
standbyInstances
Choose the behavior that you want Amazon EC2 Auto Scaling to use if instances in
Standby
state are found.The following lists the valid values:
- Terminate
-
Amazon EC2 Auto Scaling terminates instances that are in
Standby
. - Ignore
-
Amazon EC2 Auto Scaling ignores instances that are in
Standby
and continues to replace instances that are in theInService
state. - Wait (default)
-
Amazon EC2 Auto Scaling waits one hour for you to return the instances to service. Otherwise, the instance refresh will fail.
If the service returns an enum value that is not available in the current SDK version,
standbyInstances
will returnStandbyInstances.UNKNOWN_TO_SDK_VERSION
. The raw value returned by the service is available fromstandbyInstancesAsString()
.- Returns:
- Choose the behavior that you want Amazon EC2 Auto Scaling to use if instances in
Standby
state are found.The following lists the valid values:
- Terminate
-
Amazon EC2 Auto Scaling terminates instances that are in
Standby
. - Ignore
-
Amazon EC2 Auto Scaling ignores instances that are in
Standby
and continues to replace instances that are in theInService
state. - Wait (default)
-
Amazon EC2 Auto Scaling waits one hour for you to return the instances to service. Otherwise, the instance refresh will fail.
- See Also:
-
standbyInstancesAsString
Choose the behavior that you want Amazon EC2 Auto Scaling to use if instances in
Standby
state are found.The following lists the valid values:
- Terminate
-
Amazon EC2 Auto Scaling terminates instances that are in
Standby
. - Ignore
-
Amazon EC2 Auto Scaling ignores instances that are in
Standby
and continues to replace instances that are in theInService
state. - Wait (default)
-
Amazon EC2 Auto Scaling waits one hour for you to return the instances to service. Otherwise, the instance refresh will fail.
If the service returns an enum value that is not available in the current SDK version,
standbyInstances
will returnStandbyInstances.UNKNOWN_TO_SDK_VERSION
. The raw value returned by the service is available fromstandbyInstancesAsString()
.- Returns:
- Choose the behavior that you want Amazon EC2 Auto Scaling to use if instances in
Standby
state are found.The following lists the valid values:
- Terminate
-
Amazon EC2 Auto Scaling terminates instances that are in
Standby
. - Ignore
-
Amazon EC2 Auto Scaling ignores instances that are in
Standby
and continues to replace instances that are in theInService
state. - Wait (default)
-
Amazon EC2 Auto Scaling waits one hour for you to return the instances to service. Otherwise, the instance refresh will fail.
- See Also:
-
alarmSpecification
(Optional) The CloudWatch alarm specification. CloudWatch alarms can be used to identify any issues and fail the operation if an alarm threshold is met.
- Returns:
- (Optional) The CloudWatch alarm specification. CloudWatch alarms can be used to identify any issues and fail the operation if an alarm threshold is met.
-
maxHealthyPercentage
Specifies the maximum percentage of the group that can be in service and healthy, or pending, to support your workload when replacing instances. The value is expressed as a percentage of the desired capacity of the Auto Scaling group. Value range is 100 to 200.
If you specify
MaxHealthyPercentage
, you must also specifyMinHealthyPercentage
, and the difference between them cannot be greater than 100. A larger range increases the number of instances that can be replaced at the same time.If you do not specify this property, the default is 100 percent, or the percentage set in the instance maintenance policy for the Auto Scaling group, if defined.
- Returns:
- Specifies the maximum percentage of the group that can be in service and healthy, or pending, to support
your workload when replacing instances. The value is expressed as a percentage of the desired capacity of
the Auto Scaling group. Value range is 100 to 200.
If you specify
MaxHealthyPercentage
, you must also specifyMinHealthyPercentage
, and the difference between them cannot be greater than 100. A larger range increases the number of instances that can be replaced at the same time.If you do not specify this property, the default is 100 percent, or the percentage set in the instance maintenance policy for the Auto Scaling group, if defined.
-
toBuilder
Description copied from interface:ToCopyableBuilder
Take this object and create a builder that contains all of the current property values of this object.- Specified by:
toBuilder
in interfaceToCopyableBuilder<RefreshPreferences.Builder,
RefreshPreferences> - Returns:
- a builder for type T
-
builder
-
serializableBuilderClass
-
hashCode
public final int hashCode() -
equals
-
equalsBySdkFields
Description copied from interface:SdkPojo
Indicates whether some other object is "equal to" this one by SDK fields. An SDK field is a modeled, non-inherited field in anSdkPojo
class, and is generated based on a service model.If an
SdkPojo
class does not have any inherited fields,equalsBySdkFields
andequals
are essentially the same.- Specified by:
equalsBySdkFields
in interfaceSdkPojo
- Parameters:
obj
- the object to be compared with- Returns:
- true if the other object equals to this object by sdk fields, false otherwise.
-
toString
Returns a string representation of this object. This is useful for testing and debugging. Sensitive data will be redacted from this string using a placeholder value. -
getValueForField
-
sdkFields
-