Instance refresh

Updated at:
Copy as MD

An instance refresh performs a rolling update in your scaling group by creating instances from an updated scaling configuration or image to replace existing ones, ensuring smooth service upgrades.

Features

After you start a refresh task, Auto Scaling creates new instances based on the expected configuration to replace existing ones. Key characteristics:

  • Rolling update: New instances are created and old instances are released in a rolling manner.

    Difference from a rolling upgrade: A rolling upgrade replaces instance images in batches without releasing instances.
  • Temporary capacity changes: The group's instance count can temporarily exceed or fall below the desired capacity. You control the percentage thresholds.

  • No impact on scaling activities: Scaling activities continue as normal. Scale-out events use the new configuration or image, keeping all instances consistent.

    Difference from a rolling upgrade: A rolling upgrade pauses all scaling processes.
  • No impact on in-service instances: Instances are not put into standby. Existing instances are released only after new ones are ready.

  • Automatic scaling configuration updates: After the refresh completes, Auto Scaling automatically sets the expected configuration as active or updates the image in the active configuration.

Limitations

  • Only ECS-type scaling groups support the instance refresh feature.

  • Not supported for scaling groups with an instance reclaim mode of Economical Mode or Force Economical Mode.

  • Not supported if Use vCPUs to calculate the capacity of the scaling group is enabled in the active scaling configuration. You also cannot enable Use vCPUs to calculate the capacity of the scaling group in the expected configuration.

Workflows

Scenario 1: Update only the instance image

Use this workflow to update your application or in-instance configurations.

  1. Prepare a new instance image.

    Prepare a new image that contains your changes. Create a custom image from an instance.

  2. Start an instance refresh.

    Specify the expected image and the rolling update method. Start an instance refresh.

  3. Monitor the instance refresh.

    Monitor the refresh status. Pause, cancel, or roll back if needed. Instance refresh operations.

Scenario 2: Update the scaling configuration

Use this workflow to update scaling configuration options and apply them to existing instances.

  1. Create a new scaling configuration.

    Prepare a new scaling configuration for the refresh. Create a scaling configuration (ECS instances).

    Why create a new scaling configuration? The refresh identifies and replaces instances not using the target configuration. Modifying the existing configuration may prevent identification of instances that need replacement. A separate version also enables quick rollback if issues occur.
  2. Start an instance refresh.

    Specify the expected scaling configuration and the rolling update method. Start an instance refresh.

  3. Monitor the instance refresh.

    Monitor the refresh status. Pause, cancel, or roll back if needed. Instance refresh operations.

Scenario 3: Update the launch template

If your scaling group uses a launch template, use this workflow to update the template and apply changes:

  1. Create a new launch template or a new version of an existing template.

    Create a new version of the current launch template or a new template with updated settings. Create a new version of a launch template and Create a launch template.

  2. Start an instance refresh.

    Specify the expected scaling configuration and the rolling update method. Start an instance refresh.

  3. Monitor the instance refresh.

    Monitor the refresh status. Pause, cancel, or roll back if needed. Instance refresh operations.

Instance refresh operations

Go to the instance refresh page

To access the Instance Refresh page for a scaling group:

Go to the Instance Refresh page

  1. Log on to the Auto Scaling console.

  2. In the navigation pane on the left, click Scaling Groups.

  3. In the top navigation bar, select a region.

  4. On the Scaling Groups page, find the scaling group that you want to manage and click its name.

  5. Click the Instance Refresh tab.

    image

Start an instance refresh

Important
  • A scaling group can have only one instance refresh running at a time.

  • You cannot modify the active scaling configuration of the scaling group while an instance refresh is in progress.

  1. On the Instance Refresh page, click Instance Refresh.

  2. On the configuration page, configure the Configure Capacity Policy and Expected Configuration sections.

    How do I configure the Configure Capacity Policy section?

    This policy has two main parameters:

    • Uptime Percentage > Min: The minimum percentage of the group's desired capacity that must remain available during the refresh.

    • Uptime Percentage > Max: The maximum percentage by which the group's capacity can be temporarily exceeded during the refresh.

    Configure these parameters based on the following scenarios.

    • Prioritize availability

      Select Create Before Release. With this option, new instances are launched and ready before existing instances are released. You can set the Max value to control the instance creation rate and batch size, which also helps manage extra costs.

      For example, to update instances in two batches, you can set the Max value to 150. This allows the total number of instances to temporarily exceed the desired capacity by 50%. After these new instances are ready, old instances are released until the group's instance count returns to the desired capacity. You can preview the temporary minimum and maximum number of healthy instances in the Estimated Group Capacity section.
    • Prioritize cost

      Select Create and Release At One Time. With this option, existing instances are released while new instances are created simultaneously. You can set the Min value to control the minimum number of available instances.

    • Balance availability and cost

      Select Custom Policy. This allows you to specify both the Min and Max values to balance cost and availability based on your requirements.

  3. After you review the configuration, click Start Refresh. The instance refresh begins.

Pause or resume an instance refresh

Pause a refresh to investigate problems, then resume when ready.

Important

Pausing a refresh does not stop the initialization or addition of an instance that has already begun.

Pause an instance refresh

image

Resume an instance refresh

image

Roll back an instance refresh

If a problem occurs during a refresh, immediately roll back to the previous configuration or image.

image

Cancel an instance refresh

You can also cancel a refresh in progress.

Important

Unlike a rollback, a cancellation does not remove new instances that were already replaced or added during a scale-out.

image