/** * Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. * SPDX-License-Identifier: Apache-2.0. */ #pragma once #include #include #include #include #include #include namespace Aws { namespace Utils { namespace Xml { class XmlNode; } // namespace Xml } // namespace Utils namespace AutoScaling { namespace Model { /** *

Describes the preferences for an instance refresh.

See Also:

* AWS * API Reference

*/ class RefreshPreferences { public: AWS_AUTOSCALING_API RefreshPreferences(); AWS_AUTOSCALING_API RefreshPreferences(const Aws::Utils::Xml::XmlNode& xmlNode); AWS_AUTOSCALING_API RefreshPreferences& operator=(const Aws::Utils::Xml::XmlNode& xmlNode); AWS_AUTOSCALING_API void OutputToStream(Aws::OStream& ostream, const char* location, unsigned index, const char* locationValue) const; AWS_AUTOSCALING_API void OutputToStream(Aws::OStream& oStream, const char* location) const; /** *

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.

*/ inline int GetMinHealthyPercentage() const{ return m_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.

*/ inline bool MinHealthyPercentageHasBeenSet() const { return m_minHealthyPercentageHasBeenSet; } /** *

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.

*/ inline void SetMinHealthyPercentage(int value) { m_minHealthyPercentageHasBeenSet = true; m_minHealthyPercentage = value; } /** *

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.

*/ inline RefreshPreferences& WithMinHealthyPercentage(int value) { SetMinHealthyPercentage(value); 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.

*/ inline int GetInstanceWarmup() const{ return m_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.

*/ inline bool InstanceWarmupHasBeenSet() const { return m_instanceWarmupHasBeenSet; } /** *

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.

*/ inline void SetInstanceWarmup(int value) { m_instanceWarmupHasBeenSet = true; m_instanceWarmup = value; } /** *

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.

*/ inline RefreshPreferences& WithInstanceWarmup(int value) { SetInstanceWarmup(value); 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.

*/ inline const Aws::Vector& GetCheckpointPercentages() const{ return m_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.

*/ inline bool CheckpointPercentagesHasBeenSet() const { return m_checkpointPercentagesHasBeenSet; } /** *

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

*/ inline void SetCheckpointPercentages(const Aws::Vector& value) { m_checkpointPercentagesHasBeenSet = true; m_checkpointPercentages = value; } /** *

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

*/ inline void SetCheckpointPercentages(Aws::Vector&& value) { m_checkpointPercentagesHasBeenSet = true; m_checkpointPercentages = std::move(value); } /** *

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

*/ inline RefreshPreferences& WithCheckpointPercentages(const Aws::Vector& value) { SetCheckpointPercentages(value); 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.

*/ inline RefreshPreferences& WithCheckpointPercentages(Aws::Vector&& value) { SetCheckpointPercentages(std::move(value)); 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.

*/ inline RefreshPreferences& AddCheckpointPercentages(int value) { m_checkpointPercentagesHasBeenSet = true; m_checkpointPercentages.push_back(value); 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).

*/ inline int GetCheckpointDelay() const{ return m_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).

*/ inline bool CheckpointDelayHasBeenSet() const { return m_checkpointDelayHasBeenSet; } /** *

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

*/ inline void SetCheckpointDelay(int value) { m_checkpointDelayHasBeenSet = true; m_checkpointDelay = value; } /** *

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

*/ inline RefreshPreferences& WithCheckpointDelay(int value) { SetCheckpointDelay(value); 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.

*/ inline bool GetSkipMatching() const{ return m_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.

*/ inline bool SkipMatchingHasBeenSet() const { return m_skipMatchingHasBeenSet; } /** *

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

*/ inline void SetSkipMatching(bool value) { m_skipMatchingHasBeenSet = true; m_skipMatching = value; } /** *

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

*/ inline RefreshPreferences& WithSkipMatching(bool value) { SetSkipMatching(value); return *this;} /** *

(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:

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

*/ inline bool GetAutoRollback() const{ return m_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:

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

*/ inline bool AutoRollbackHasBeenSet() const { return m_autoRollbackHasBeenSet; } /** *

(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:

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

*/ inline void SetAutoRollback(bool value) { m_autoRollbackHasBeenSet = true; m_autoRollback = value; } /** *

(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:

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

*/ inline RefreshPreferences& WithAutoRollback(bool value) { SetAutoRollback(value); return *this;} /** *

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.

*/ inline const ScaleInProtectedInstances& GetScaleInProtectedInstances() const{ return m_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.

*/ inline bool ScaleInProtectedInstancesHasBeenSet() const { return m_scaleInProtectedInstancesHasBeenSet; } /** *

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.

*/ inline void SetScaleInProtectedInstances(const ScaleInProtectedInstances& value) { m_scaleInProtectedInstancesHasBeenSet = true; m_scaleInProtectedInstances = value; } /** *

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.

*/ inline void SetScaleInProtectedInstances(ScaleInProtectedInstances&& value) { m_scaleInProtectedInstancesHasBeenSet = true; m_scaleInProtectedInstances = std::move(value); } /** *

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.

*/ inline RefreshPreferences& WithScaleInProtectedInstances(const ScaleInProtectedInstances& value) { SetScaleInProtectedInstances(value); return *this;} /** *

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.

*/ inline RefreshPreferences& WithScaleInProtectedInstances(ScaleInProtectedInstances&& value) { SetScaleInProtectedInstances(std::move(value)); return *this;} /** *

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.

*/ inline const StandbyInstances& GetStandbyInstances() const{ return m_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 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.

*/ inline bool StandbyInstancesHasBeenSet() const { return m_standbyInstancesHasBeenSet; } /** *

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.

*/ inline void SetStandbyInstances(const StandbyInstances& value) { m_standbyInstancesHasBeenSet = true; m_standbyInstances = value; } /** *

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.

*/ inline void SetStandbyInstances(StandbyInstances&& value) { m_standbyInstancesHasBeenSet = true; m_standbyInstances = std::move(value); } /** *

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.

*/ inline RefreshPreferences& WithStandbyInstances(const StandbyInstances& value) { SetStandbyInstances(value); return *this;} /** *

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.

*/ inline RefreshPreferences& WithStandbyInstances(StandbyInstances&& value) { SetStandbyInstances(std::move(value)); return *this;} private: int m_minHealthyPercentage; bool m_minHealthyPercentageHasBeenSet = false; int m_instanceWarmup; bool m_instanceWarmupHasBeenSet = false; Aws::Vector m_checkpointPercentages; bool m_checkpointPercentagesHasBeenSet = false; int m_checkpointDelay; bool m_checkpointDelayHasBeenSet = false; bool m_skipMatching; bool m_skipMatchingHasBeenSet = false; bool m_autoRollback; bool m_autoRollbackHasBeenSet = false; ScaleInProtectedInstances m_scaleInProtectedInstances; bool m_scaleInProtectedInstancesHasBeenSet = false; StandbyInstances m_standbyInstances; bool m_standbyInstancesHasBeenSet = false; }; } // namespace Model } // namespace AutoScaling } // namespace Aws