InstanceRefreshStrategy

class aws_cdk.aws_autoscaling.InstanceRefreshStrategy(*values)

Bases: Enum

The strategy to use for the instance refresh.

ExampleMetadata:

infused

Example:

# vpc: ec2.Vpc
# instance_type: ec2.InstanceType
# machine_image: ec2.IMachineImage
# alarm: cloudwatch.Alarm


autoscaling.AutoScalingGroup(self, "ASG",
    vpc=vpc,
    instance_type=instance_type,
    machine_image=machine_image,

    update_policy=autoscaling.UpdatePolicy.instance_refresh(
        strategy=autoscaling.InstanceRefreshStrategy.ROLLING,
        min_healthy_percentage=90,
        max_healthy_percentage=100,
        instance_warmup=Duration.seconds(300),
        checkpoint_percentages=[50, 100],
        checkpoint_delay=Duration.minutes(10),
        alarms=[alarm]
    )
)

Attributes

REPLACE_ROOT_VOLUME

Replace the root volume of instances in place.

When this strategy is used, only ImageId changes within the launch template or mixed instances policy are allowed. Other property changes may cause the stack update to fail.

ROLLING

Terminate instances and launch new ones to replace them.