Enable checkpoints using the using the Amazon Web Services Management Console or Amazon CLI - Amazon EC2 Auto Scaling
Services or capabilities described in Amazon Web Services documentation might vary by Region. To see the differences applicable to the China Regions, see Getting Started with Amazon Web Services in China (PDF).

Enable checkpoints using the using the Amazon Web Services Management Console or Amazon CLI

You can use the Amazon Web Services Management Console or Amazon CLI to enable checkpoints.

Enable checkpoints (console)

You can enable checkpoints before starting an instance refresh to replace instances using an incremental or phased approach. This provides additional time for verification.

To start an instance refresh that uses checkpoints
  1. Open the Amazon EC2 console at https://console.amazonaws.cn/ec2/, and choose Auto Scaling Groups from the navigation pane.

  2. Select the check box next to your Auto Scaling group.

    A split pane opens up at the bottom of the Auto Scaling groups page.

  3. On the Instance refresh tab, in Active instance refresh, choose Start instance refresh.

  4. On the Start instance refresh page, enter the values for Minimum healthy percentage and Instance warmup.

  5. Select the Enable checkpoints check box.

    This displays a box where you can define the percentage threshold for the first checkpoint.

  6. For Proceed until ____ % of the group is refreshed, enter a number (1–100). This sets the percentage for the first checkpoint.

  7. To add another checkpoint, choose Add checkpoint and then define the percentage for the next checkpoint.

  8. To specify how long Amazon EC2 Auto Scaling waits after a checkpoint is reached, update the fields in Wait for 1 hour between checkpoints. The time unit can be hours, minutes, or seconds.

  9. If you are finished with your instance refresh selections, choose Start instance refresh.

Enable checkpoints (Amazon CLI)

To start an instance refresh with checkpoints enabled using the Amazon CLI, you need a configuration file that defines the following parameters:

  • CheckpointPercentages: Specifies threshold values for the percentage of instances to be replaced. These threshold values provide the checkpoints. When the percentage of instances that are replaced and warmed up reaches one of the specified thresholds, the operation waits for a specified period of time. You specify the number of seconds to wait in CheckpointDelay. When the specified period of time has passed, the instance refresh continues until it reaches the next checkpoint (if applicable).

  • CheckpointDelay: Specifies the amount of time, in seconds, to wait after a checkpoint is reached before continuing. Choose a time period that provides enough time to perform your verifications.

The last value shown in the CheckpointPercentages array describes the percentage of the Auto Scaling group that needs to be successfully replaced. The operation transitions to Successful after this percentage is successfully replaced and each instance is considered to have finished initializing.

To create multiple checkpoints

To create multiple checkpoints, use the following example start-instance-refresh command. This example configures an instance refresh that initially refreshes one percent of the Auto Scaling group. After waiting 10 minutes, it then refreshes the next 19 percent and waits another 10 minutes. Finally, it refreshes the rest of the group before concluding the operation.

aws autoscaling start-instance-refresh --cli-input-json file://config.json

Contents of config.json:

{ "AutoScalingGroupName": "my-asg", "Preferences": { "InstanceWarmup": 60, "MinHealthyPercentage": 80, "CheckpointPercentages": [1,20,100], "CheckpointDelay": 600 } }
To create a single checkpoint

To create a single checkpoint, use the following example start-instance-refresh command. This example configures an instance refresh that initially refreshes 20 percent of the Auto Scaling group. After waiting 10 minutes, it then refreshes the rest of the group before concluding the operation.

aws autoscaling start-instance-refresh --cli-input-json file://config.json

Contents of config.json:

{ "AutoScalingGroupName": "my-asg", "Preferences": { "InstanceWarmup": 60, "MinHealthyPercentage": 80, "CheckpointPercentages": [20,100], "CheckpointDelay": 600 } }
To partially refresh the Auto Scaling group

To replace only a portion of your Auto Scaling group and then stop completely, use the following example start-instance-refresh command. This example configures an instance refresh that initially refreshes one percent of the Auto Scaling group. After waiting 10 minutes, it then refreshes the next 19 percent before concluding the operation.

aws autoscaling start-instance-refresh --cli-input-json file://config.json

Contents of config.json:

{ "AutoScalingGroupName": "my-asg", "Preferences": { "InstanceWarmup": 60, "MinHealthyPercentage": 80, "CheckpointPercentages": [1,20], "CheckpointDelay": 600 } }