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 Availability Zones and VPC subnets for the instances, the desired capacity, and the minimum and maximum capacity limits.

Important

To configure the Amazon EC2 instances, you can specify a launch template or a launch configuration. 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 Creating an Auto Scaling group using a launch template.

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

You must have created a launch configuration. For more information, see Creating a launch configuration.

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

  1. Open the Amazon EC2 Auto Scaling console at https://console.aws.amazon.com/ec2autoscaling/.

  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. Choose Create an Auto Scaling group.

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

  5. 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.

  6. On the Configure instance launch options page, under Network, for VPC, choose a VPC. The Auto Scaling group must be created in the same VPC as the security group you specified in your launch configuration.

  7. For Availability Zones and subnets, choose one or more subnets in the specified VPC. Use subnets in multiple Availability Zones for high availability. For more information, see Considerations when choosing VPC subnets.

  8. Choose Next.

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

  9. (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 an existing load balancer or create a new one. For more information, see Elastic Load Balancing and Amazon EC2 Auto Scaling. To create a new load balancer, follow the procedure in Configure an Application Load Balancer or Network Load Balancer using the Amazon EC2 Auto Scaling console.

    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 new instances. 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. For more information, see Health check grace period.

    4. Under Additional settings, Monitoring, choose whether to enable CloudWatch group metrics collection. These metrics provide measurements that can be indicators of a potential issue, such as number of terminating instances or number of pending instances. For more information, see Monitoring CloudWatch metrics for your Auto Scaling groups and instances.

  10. (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 on 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 Using instance scale-in protection.

  11. (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.

  12. (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.

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

To create an Auto Scaling group using the command line

You can use one of the following commands: