Menu
Auto Scaling
User Guide

Merging Your Auto Scaling Groups into a Single Multi-Zone Group

To merge separate single-zone Auto Scaling groups into a single Auto Scaling group spanning multiple Availability Zones, rezone one of the single-zone groups into a multi-zone group, and then delete the other groups. This process works for groups with or without a load balancer, as long as the new multi-zone group is in one of the same Availability Zones as the original single-zone groups.

The following examples assume that you have two identical groups in two different Availability Zones, us-west-2a and us-west-2c. These two groups share the following specifications:

  • Minimum size = 2

  • Maximum size = 5

  • Desired capacity = 3

Merge Zones Using the AWS CLI

Use the following procedure to merge my-group-a and my-group-c into a single group that covers both us-west-2a and us-west-2c.

To merge separate single-zone groups into a single multi-zone group

  1. Use the following update-auto-scaling-group command to add the us-west-2c Availability Zone to the supported Availability Zones for my-group-a and increase the maximum size of this group to allow for the instances from both single-zone groups:

    Copy
    aws autoscaling update-auto-scaling-group --auto-scaling-group-name my-group-a --availability-zones "us-west-2a" "us-west-2c" –-max-size 10 –-min-size 4
  2. Use the following set-desired-capacity command to increase the size of my-group-a:

    Copy
    aws autoscaling set-desired-capacity --auto-scaling-group-name my-group-a --desired-capacity 6
  3. (Optional) Use the following describe-auto-scaling-groups command to verify that my-group-a is at its new size:

    Copy
    aws autoscaling describe-auto-scaling-groups --auto-scaling-group-name my-group-a
  4. Use the following update-auto-scaling-group command to remove the instances from my-group-c:

    Copy
    aws autoscaling update-auto-scaling-group --auto-scaling-group-name my-group-c --min-size 0 --max-size 0
  5. (Optional) Use the following describe-auto-scaling-groups command to verify that no instances remain in my-group-c:

    Copy
    aws autoscaling describe-auto-scaling-groups --auto-scaling-group-name my-group-c

    The following is example output:

    Copy
    { "AutoScalingGroups": [ { "AutoScalingGroupARN": "arn", "HealthCheckGracePeriod": 300, "SuspendedProcesses": [], "DesiredCapacity": 0, "Tags": [], "EnabledMetrics": [], "LoadBalancerNames": [], "AutoScalingGroupName": "my-group-c", "DefaultCooldown": 300, "MinSize": 0, "Instances": [], "MaxSize": 0, "VPCZoneIdentifier": "null", "TerminationPolicies": [ "Default" ], "LaunchConfigurationName": "my-lc", "CreatedTime": "2015-02-26T18:24:14.449Z", "AvailabilityZones": [ "us-west-2c" ], "HealthCheckType": "EC2" } ] }
  6. Use the delete-auto-scaling-group command to delete my-group-c:

    Copy
    aws autoscaling delete-auto-scaling-group --auto-scaling-group-name my-group-c