/* * Copyright 2018-2023 Amazon.com, Inc. or its affiliates. All Rights Reserved. * * Licensed under the Apache License, Version 2.0 (the "License"). You may not use this file except in compliance with * the License. A copy of the License is located at * * http://aws.amazon.com/apache2.0 * * or in the "license" file accompanying this file. This file is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR * CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions * and limitations under the License. */ package com.amazonaws.services.autoscaling.model; import java.io.Serializable; import javax.annotation.Generated; /** *

* Describes the preferences for an instance refresh. *

* * @see AWS API * Documentation */ @Generated("com.amazonaws:aws-java-sdk-code-generator") public class RefreshPreferences implements Serializable, Cloneable { /** *

* The amount of capacity in the Auto Scaling group that must pass your group's health checks to allow the operation * to continue. The value is expressed as a percentage of the desired capacity of the Auto Scaling group (rounded up * to the nearest integer). The default is 90. *

*

* Setting the minimum healthy percentage to 100 percent limits the rate of replacement to one instance at a time. * In contrast, setting it to 0 percent has the effect of replacing all instances at the same time. *

*/ private Integer minHealthyPercentage; /** *

* 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. The InstanceWarmup and DefaultInstanceWarmup properties work * the same way. Only specify this property if you must override the DefaultInstanceWarmup 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 the * HealthCheckGracePeriod property otherwise. *

*/ private Integer instanceWarmup; /** *

* (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. *

*/ private com.amazonaws.internal.SdkInternalList checkpointPercentages; /** *

* (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 for CheckpointPercentages and not for CheckpointDelay, the * CheckpointDelay defaults to 3600 (1 hour). *

*/ private Integer checkpointDelay; /** *

* (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 is false. *

*

* For more information, see Use an * instance refresh with skip matching in the Amazon EC2 Auto Scaling User Guide. *

*/ private Boolean skipMatching; /** *

* (Optional) Indicates whether to roll back the Auto Scaling group to its previous configuration if the instance * refresh fails. The default is false. *

*

* A rollback is not supported in the following situations: *

* */ private Boolean autoRollback; /** *

* 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. *

*
*
*/ private String scaleInProtectedInstances; /** *

* 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 the InService state. *

*
*
Wait (default)
*
*

* Amazon EC2 Auto Scaling waits one hour for you to return the instances to service. Otherwise, the instance * refresh will fail. *

*
*
*/ private String standbyInstances; /** *

* The amount of capacity in the Auto Scaling group that must pass your group's health checks to allow the operation * to continue. The value is expressed as a percentage of the desired capacity of the Auto Scaling group (rounded up * to the nearest integer). The default is 90. *

*

* Setting the minimum healthy percentage to 100 percent limits the rate of replacement to one instance at a time. * In contrast, setting it to 0 percent has the effect of replacing all instances at the same time. *

* * @param minHealthyPercentage * The amount of capacity in the Auto Scaling group that must pass your group's health checks to allow the * operation to continue. The value is expressed as a percentage of the desired capacity of the Auto Scaling * group (rounded up to the nearest integer). The default is 90.

*

* Setting the minimum healthy percentage to 100 percent limits the rate of replacement to one instance at a * time. In contrast, setting it to 0 percent has the effect of replacing all instances at the same time. */ public void setMinHealthyPercentage(Integer minHealthyPercentage) { this.minHealthyPercentage = minHealthyPercentage; } /** *

* The amount of capacity in the Auto Scaling group that must pass your group's health checks to allow the operation * to continue. The value is expressed as a percentage of the desired capacity of the Auto Scaling group (rounded up * to the nearest integer). The default is 90. *

*

* Setting the minimum healthy percentage to 100 percent limits the rate of replacement to one instance at a time. * In contrast, setting it to 0 percent has the effect of replacing all instances at the same time. *

* * @return The amount of capacity in the Auto Scaling group that must pass your group's health checks to allow the * operation to continue. The value is expressed as a percentage of the desired capacity of the Auto Scaling * group (rounded up to the nearest integer). The default is 90.

*

* Setting the minimum healthy percentage to 100 percent limits the rate of replacement to one instance at a * time. In contrast, setting it to 0 percent has the effect of replacing all instances at the same time. */ public Integer getMinHealthyPercentage() { return this.minHealthyPercentage; } /** *

* The amount of capacity in the Auto Scaling group that must pass your group's health checks to allow the operation * to continue. The value is expressed as a percentage of the desired capacity of the Auto Scaling group (rounded up * to the nearest integer). The default is 90. *

*

* Setting the minimum healthy percentage to 100 percent limits the rate of replacement to one instance at a time. * In contrast, setting it to 0 percent has the effect of replacing all instances at the same time. *

* * @param minHealthyPercentage * The amount of capacity in the Auto Scaling group that must pass your group's health checks to allow the * operation to continue. The value is expressed as a percentage of the desired capacity of the Auto Scaling * group (rounded up to the nearest integer). The default is 90.

*

* Setting the minimum healthy percentage to 100 percent limits the rate of replacement to one instance at a * time. In contrast, setting it to 0 percent has the effect of replacing all instances at the same time. * @return Returns a reference to this object so that method calls can be chained together. */ public RefreshPreferences withMinHealthyPercentage(Integer minHealthyPercentage) { setMinHealthyPercentage(minHealthyPercentage); return this; } /** *

* 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. The InstanceWarmup and DefaultInstanceWarmup properties work * the same way. Only specify this property if you must override the DefaultInstanceWarmup 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 the * HealthCheckGracePeriod property otherwise. *

* * @param 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. The InstanceWarmup and DefaultInstanceWarmup * properties work the same way. Only specify this property if you must override the * DefaultInstanceWarmup 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 the * HealthCheckGracePeriod property otherwise. */ public void setInstanceWarmup(Integer instanceWarmup) { this.instanceWarmup = 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. The InstanceWarmup and DefaultInstanceWarmup properties work * the same way. Only specify this property if you must override the DefaultInstanceWarmup 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 the * HealthCheckGracePeriod property otherwise. *

* * @return 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. The InstanceWarmup and * DefaultInstanceWarmup properties work the same way. Only specify this property if you must * override the DefaultInstanceWarmup 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 the * HealthCheckGracePeriod property otherwise. */ public Integer getInstanceWarmup() { return this.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. The InstanceWarmup and DefaultInstanceWarmup properties work * the same way. Only specify this property if you must override the DefaultInstanceWarmup 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 the * HealthCheckGracePeriod property otherwise. *

* * @param 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. The InstanceWarmup and DefaultInstanceWarmup * properties work the same way. Only specify this property if you must override the * DefaultInstanceWarmup 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 the * HealthCheckGracePeriod property otherwise. * @return Returns a reference to this object so that method calls can be chained together. */ public RefreshPreferences withInstanceWarmup(Integer instanceWarmup) { setInstanceWarmup(instanceWarmup); return this; } /** *

* (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. *

* * @return (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. */ public java.util.List getCheckpointPercentages() { if (checkpointPercentages == null) { checkpointPercentages = new com.amazonaws.internal.SdkInternalList(); } return 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. *

* * @param 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. */ public void setCheckpointPercentages(java.util.Collection checkpointPercentages) { if (checkpointPercentages == null) { this.checkpointPercentages = null; return; } this.checkpointPercentages = new com.amazonaws.internal.SdkInternalList(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. *

*

* NOTE: This method appends the values to the existing list (if any). Use * {@link #setCheckpointPercentages(java.util.Collection)} or * {@link #withCheckpointPercentages(java.util.Collection)} if you want to override the existing values. *

* * @param 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. * @return Returns a reference to this object so that method calls can be chained together. */ public RefreshPreferences withCheckpointPercentages(Integer... checkpointPercentages) { if (this.checkpointPercentages == null) { setCheckpointPercentages(new com.amazonaws.internal.SdkInternalList(checkpointPercentages.length)); } for (Integer ele : checkpointPercentages) { this.checkpointPercentages.add(ele); } return this; } /** *

* (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. *

* * @param 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. * @return Returns a reference to this object so that method calls can be chained together. */ public RefreshPreferences withCheckpointPercentages(java.util.Collection checkpointPercentages) { setCheckpointPercentages(checkpointPercentages); return this; } /** *

* (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 for CheckpointPercentages and not for CheckpointDelay, the * CheckpointDelay defaults to 3600 (1 hour). *

* * @param 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 for CheckpointPercentages and not * for CheckpointDelay, the CheckpointDelay defaults to 3600 (1 hour). */ public void setCheckpointDelay(Integer checkpointDelay) { this.checkpointDelay = 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 for CheckpointPercentages and not for CheckpointDelay, the * CheckpointDelay defaults to 3600 (1 hour). *

* * @return (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 for CheckpointPercentages and not * for CheckpointDelay, the CheckpointDelay defaults to 3600 (1 * hour). */ public Integer getCheckpointDelay() { return this.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 for CheckpointPercentages and not for CheckpointDelay, the * CheckpointDelay defaults to 3600 (1 hour). *

* * @param 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 for CheckpointPercentages and not * for CheckpointDelay, the CheckpointDelay defaults to 3600 (1 hour). * @return Returns a reference to this object so that method calls can be chained together. */ public RefreshPreferences withCheckpointDelay(Integer checkpointDelay) { setCheckpointDelay(checkpointDelay); return this; } /** *

* (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 is false. *

*

* For more information, see Use an * instance refresh with skip matching in the Amazon EC2 Auto Scaling User Guide. *

* * @param 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 is * false.

*

* For more information, see Use * an instance refresh with skip matching in the Amazon EC2 Auto Scaling User Guide. */ public void setSkipMatching(Boolean skipMatching) { this.skipMatching = 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 is false. *

*

* For more information, see Use an * instance refresh with skip matching in the Amazon EC2 Auto Scaling User Guide. *

* * @return (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 is * false.

*

* For more information, see Use * an instance refresh with skip matching in the Amazon EC2 Auto Scaling User Guide. */ public Boolean getSkipMatching() { return this.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 is false. *

*

* For more information, see Use an * instance refresh with skip matching in the Amazon EC2 Auto Scaling User Guide. *

* * @param 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 is * false.

*

* For more information, see Use * an instance refresh with skip matching in the Amazon EC2 Auto Scaling User Guide. * @return Returns a reference to this object so that method calls can be chained together. */ public RefreshPreferences withSkipMatching(Boolean skipMatching) { setSkipMatching(skipMatching); return this; } /** *

* (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 is false. *

*

* For more information, see Use an * instance refresh with skip matching in the Amazon EC2 Auto Scaling User Guide. *

* * @return (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 is * false.

*

* For more information, see Use * an instance refresh with skip matching in the Amazon EC2 Auto Scaling User Guide. */ public Boolean isSkipMatching() { return this.skipMatching; } /** *

* (Optional) Indicates whether to roll back the Auto Scaling group to its previous configuration if the instance * refresh fails. The default is false. *

*

* A rollback is not supported in the following situations: *

* * * @param autoRollback * (Optional) Indicates whether to roll back the Auto Scaling group to its previous configuration if the * instance refresh fails. The default is false.

*

* A rollback is not supported in the following situations: *

*