Creating an Auto Scaling Group Using a Launch Configuration - Amazon EC2 Auto Scaling

Creating an Auto Scaling Group Using a Launch Configuration

When you create an Auto Scaling group, you must specify the necessary information to configure the Amazon EC2 instances, the subnets for the instances, and the initial number of instances.

Important

To configure the Amazon EC2 instances, you can specify a launch template, a launch configuration, or an EC2 instance. We recommend that you use a launch template to make sure that you can use the latest features of Amazon EC2. For more information, see Launch Templates.

The following procedure demonstrates how to create an Auto Scaling group using a launch configuration. You cannot modify a launch configuration after it is created, but you can replace the launch configuration for an Auto Scaling group. For more information, see Changing the Launch Configuration for an Auto Scaling Group.

Prerequisites

Create a launch configuration. For more information, see Creating a Launch Configuration.

Amazon EC2 Auto Scaling has changed the user interface. By default, you're shown the new user interface, but you can choose to return to the old user interface. This topic contains steps for each.

To create an Auto Scaling group using a launch configuration (new console)

  1. Open the Amazon EC2 console at https://console.aws.amazon.com/ec2/.

  2. On the navigation bar at the top of the screen, choose the same AWS Region that you used when you created the launch template.

  3. On the navigation pane, under AUTO SCALING, choose Auto Scaling Groups.

  4. Choose Create an Auto Scaling group.

  5. On the Choose launch template or configuration page, for Auto Scaling group name, enter a name for your Auto Scaling group.

  6. To choose a launch configuration, do the following:

    1. For Launch Template, choose Switch to launch configuration.

    2. For Launch configuration, choose an existing launch configuration.

    3. Verify that your launch configuration supports all of the options that you are planning to use, and then choose Next.

  7. On the Configure settings page, under Network, for VPC, choose the VPC for the security groups that you specified in your launch configuration. Launching instances using a combination of instance types and purchase options is not supported in EC2-Classic.

  8. For Subnet, choose one or more subnets in the specified VPC. Use subnets in multiple Availability Zones for high availability. For more information about high availability with Amazon EC2 Auto Scaling, see Distributing Instances Across Availability Zones.

  9. Choose Next.

    Or, you can accept the rest of the defaults, and choose Skip to review.

  10. (Optional) On the Configure advanced options page, configure the following options, and then choose Next:

    1. To register your Amazon EC2 instances with a load balancer, choose Enable load balancing, and choose an existing load balancer or create a new one. If you use an Application Load Balancer or Network Load Balancer, choose a target group where you register targets by instance ID.

    2. To enable your Elastic Load Balancing (ELB) health checks, for Health checks, choose ELB under Health check type. These health checks are optional when you enable load balancing.

    3. Under Health check grace period, enter the amount of time until Amazon EC2 Auto Scaling checks the health of instances after they are put into service. The intention of this setting is to prevent Amazon EC2 Auto Scaling from marking instances as unhealthy and terminating them before they have time to come up. The default is 300 seconds.

  11. (Optional) On the Configure group size and scaling policies page, configure the following options, and then choose Next:

    1. For Desired capacity, enter the initial number of instances to launch. When you change this number to a value outside of the minimum or maximum capacity limits, you must update the values of Minimum capacity or Maximum capacity. For more information, see Setting Capacity Limits for Your Auto Scaling Group.

    2. To automatically scale the size of the Auto Scaling group, choose Target tracking scaling policy and follow the directions. For more information, see Target Tracking Scaling Policies.

    3. Under Instance scale-in protection, choose whether to enable instance scale-in protection. For more information, see Instance Scale-In Protection.

  12. (Optional) To receive notifications, for Add notification, configure the notification, and then choose Next. For more information, see Getting Amazon SNS Notifications When Your Auto Scaling Group Scales.

  13. (Optional) To add tags, choose Add tag, provide a tag key and value for each tag, and then choose Next. For more information, see Tagging Auto Scaling Groups and Instances.

  14. On the Review page, choose Create Auto Scaling group.

To create an Auto Scaling group using a launch configuration (old console)

  1. Open the Amazon EC2 console at https://console.aws.amazon.com/ec2/.

  2. On the navigation bar at the top of the screen, choose the same AWS Region that you used when you created the launch configuration.

  3. On the navigation pane, under AUTO SCALING, choose Auto Scaling Groups.

  4. Choose Create Auto Scaling group.

  5. On the Create Auto Scaling Group page, choose Launch Configuration, choose an existing launch configuration, and then choose Next Step.

    Note

    If you do not have any launch configurations, you're first prompted to create one before you can continue with the steps to create an Auto Scaling group.

  6. On the Configure Auto Scaling group details page, do the following:

    1. For Group name, enter a name for your Auto Scaling group.

    2. For Group size, enter the initial number of instances for your Auto Scaling group.

    3. For Network, choose a VPC for your Auto Scaling group.

    4. For Subnet, choose one or more subnets in your VPC. Use subnets in multiple Availability Zones for high availability. For more information about high availability with Amazon EC2 Auto Scaling, see Distributing Instances Across Availability Zones.

    5. (Optional) To register your Amazon EC2 instances with a load balancer, choose Advanced Details, choose Receive traffic from one or more load balancers, and choose one or more Classic Load Balancers or target groups.

    6. Choose Next: Configure scaling policies.

  7. On the Configure scaling policies page, choose one of the following options, and then choose Next: Configure Notifications:

    • To manually adjust the size of the Auto Scaling group as needed, choose Keep this group at its initial size. For more information, see Manual Scaling for Amazon EC2 Auto Scaling.

    • To automatically adjust the size of the Auto Scaling group based on criteria that you specify, choose Use scaling policies to adjust the capacity of this group and follow the directions. For more information, see Configure Scaling Policies.

  8. (Optional) To receive notifications, choose Add notification, configure the notification, and then choose Next: Configure Tags.

  9. (Optional) To add tags, choose Edit tags, provide a tag key and value for each tag, and then choose Review.

    Alternatively, you can add tags later on. For more information, see Tagging Auto Scaling Groups and Instances.

  10. On the Review page, choose Create Auto Scaling group.

  11. On the Auto Scaling group creation status page, choose Close.

To create an Auto Scaling group using the command line

You can use one of the following commands: