Skip to content

RefreshPreferences

Source code in docs_src/capo_auto_scaling/types/refresh_preferences.py
class RefreshPreferences(TypedDict, closed=True):
    min_healthy_percentage: NotRequired[
        "capo_auto_scaling.types.int_percent.IntPercent"
    ]
    """<p>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.</p> <p>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.</p>"""
    instance_warmup: NotRequired[
        "capo_auto_scaling.types.refresh_instance_warmup.RefreshInstanceWarmup"
    ]
    """<p>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 <code>InService</code> state.</p> <p>This property is not required for normal usage. Instead, use the <code>DefaultInstanceWarmup</code> property of the Auto Scaling group. The <code>InstanceWarmup</code> and <code>DefaultInstanceWarmup</code> properties work the same way. Only specify this property if you must override the <code>DefaultInstanceWarmup</code> property. </p> <p> If you do not specify this property, the instance warmup by default is the value of the <code>DefaultInstanceWarmup</code> property, if defined (which is recommended in all cases), or the <code>HealthCheckGracePeriod</code> property otherwise.</p>"""
    checkpoint_percentages: NotRequired[
        "capo_auto_scaling.types.checkpoint_percentages.CheckpointPercentages"
    ]
    """<p>(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 <code>100</code>.</p> <p>For usage examples, see <a href="https://docs.aws.amazon.com/autoscaling/ec2/userguide/asg-adding-checkpoints-instance-refresh.html">Add checkpoints to an instance refresh</a> in the <i>Amazon EC2 Auto Scaling User Guide</i>.</p>"""
    checkpoint_delay: NotRequired[
        "capo_auto_scaling.types.checkpoint_delay.CheckpointDelay"
    ]
    """<p>(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 <code>CheckpointPercentages</code>. If you specify a value for <code>CheckpointPercentages</code> and not for <code>CheckpointDelay</code>, the <code>CheckpointDelay</code> defaults to <code>3600</code> (1 hour). </p>"""
    skip_matching: NotRequired["capo_auto_scaling.types.skip_matching.SkipMatching"]
    """<p>(Optional) Indicates whether skip matching is enabled. If enabled (<code>true</code>), 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 <code>false</code>.</p> <p>For more information, see <a href="https://docs.aws.amazon.com/autoscaling/ec2/userguide/asg-instance-refresh-skip-matching.html">Use an instance refresh with skip matching</a> in the <i>Amazon EC2 Auto Scaling User Guide</i>.</p>"""
    auto_rollback: NotRequired["capo_auto_scaling.types.auto_rollback.AutoRollback"]
    """<p>(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 <code>false</code>.</p> <p>A rollback is not supported in the following situations: </p> <ul> <li> <p>There is no desired configuration specified for the instance refresh.</p> </li> <li> <p>The Auto Scaling group has a launch template that uses an Amazon Web Services Systems Manager parameter instead of an AMI ID for the <code>ImageId</code> property.</p> </li> <li> <p>The Auto Scaling group uses the launch template's <code>$Latest</code> or <code>$Default</code> version.</p> </li> </ul> <p>For more information, see <a href="https://docs.aws.amazon.com/autoscaling/ec2/userguide/instance-refresh-rollback.html">Undo changes with a rollback</a> in the <i>Amazon EC2 Auto Scaling User Guide</i>.</p>"""
    scale_in_protected_instances: NotRequired[
        "capo_auto_scaling.types.scale_in_protected_instances.ScaleInProtectedInstances"
    ]
    """<p>Choose the behavior that you want Amazon EC2 Auto Scaling to use if instances protected from scale in are found. </p> <p>The following lists the valid values:</p> <dl> <dt>Refresh</dt> <dd> <p>Amazon EC2 Auto Scaling replaces instances that are protected from scale in.</p> </dd> <dt>Ignore</dt> <dd> <p>Amazon EC2 Auto Scaling ignores instances that are protected from scale in and continues to replace instances that are not protected.</p> </dd> <dt>Wait (default)</dt> <dd> <p>Amazon EC2 Auto Scaling waits one hour for you to remove scale-in protection. Otherwise, the instance refresh will fail.</p> </dd> </dl>"""
    standby_instances: NotRequired[
        "capo_auto_scaling.types.standby_instances.StandbyInstances"
    ]
    """<p>Choose the behavior that you want Amazon EC2 Auto Scaling to use if instances in <code>Standby</code> state are found.</p> <p>The following lists the valid values:</p> <dl> <dt>Terminate</dt> <dd> <p>Amazon EC2 Auto Scaling terminates instances that are in <code>Standby</code>.</p> </dd> <dt>Ignore</dt> <dd> <p>Amazon EC2 Auto Scaling ignores instances that are in <code>Standby</code> and continues to replace instances that are in the <code>InService</code> state.</p> </dd> <dt>Wait (default)</dt> <dd> <p>Amazon EC2 Auto Scaling waits one hour for you to return the instances to service. Otherwise, the instance refresh will fail.</p> </dd> </dl>"""
    alarm_specification: NotRequired[
        "capo_auto_scaling.types.alarm_specification.AlarmSpecification"
    ]
    """<p>(Optional) The CloudWatch alarm specification. CloudWatch alarms can be used to identify any issues and fail the operation if an alarm threshold is met.</p>"""
    max_healthy_percentage: NotRequired[
        "capo_auto_scaling.types.int_percent100_to200.IntPercent100To200"
    ]
    """<p>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.</p> <p>If you specify <code>MaxHealthyPercentage</code>, you must also specify <code>MinHealthyPercentage</code>, 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.</p> <p>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.</p> <important> <p>Explicitly setting <code>MaxHealthyPercentage</code> to 100 is not equivalent to omitting it. When <code>MaxHealthyPercentage</code> is explicitly set and it is mathematically impossible to replace instances while honoring both <code>MinHealthyPercentage</code> and <code>MaxHealthyPercentage</code> bounds simultaneously, Auto Scaling launches a new instance before terminating an old one (temporarily exceeding the desired capacity). When <code>MaxHealthyPercentage</code> is omitted, Auto Scaling terminates an instance and launches its replacement simultaneously. This behavioral difference can affect workflows that depend on instance replacement ordering.</p> </important>"""
    bake_time: NotRequired["capo_auto_scaling.types.bake_time.BakeTime"]
    """<p> The amount of time, in seconds, to wait at the end of an instance refresh before the instance refresh is considered complete. </p>"""

alarm_specification instance-attribute

alarm_specification: NotRequired[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.

auto_rollback instance-attribute

auto_rollback: NotRequired[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.

bake_time instance-attribute

bake_time: NotRequired[BakeTime]

The amount of time, in seconds, to wait at the end of an instance refresh before the instance refresh is considered complete.

checkpoint_delay instance-attribute

checkpoint_delay: NotRequired[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).

checkpoint_percentages instance-attribute

checkpoint_percentages: NotRequired[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 Add checkpoints to an instance refresh in the Amazon EC2 Auto Scaling User Guide.

instance_warmup instance-attribute

instance_warmup: NotRequired[RefreshInstanceWarmup]

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.

max_healthy_percentage instance-attribute

max_healthy_percentage: NotRequired[IntPercent100To200]

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 specify MinHealthyPercentage, 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.

Explicitly setting MaxHealthyPercentage to 100 is not equivalent to omitting it. When MaxHealthyPercentage is explicitly set and it is mathematically impossible to replace instances while honoring both MinHealthyPercentage and MaxHealthyPercentage bounds simultaneously, Auto Scaling launches a new instance before terminating an old one (temporarily exceeding the desired capacity). When MaxHealthyPercentage is omitted, Auto Scaling terminates an instance and launches its replacement simultaneously. This behavioral difference can affect workflows that depend on instance replacement ordering.

min_healthy_percentage instance-attribute

min_healthy_percentage: NotRequired[IntPercent]

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.

scale_in_protected_instances instance-attribute

scale_in_protected_instances: NotRequired[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.

skip_matching instance-attribute

skip_matching: NotRequired[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.

standby_instances instance-attribute

standby_instances: NotRequired[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.