Create an Auto Scaling group using a launch template
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.
To configure Amazon EC2 instances that are launched by your Auto Scaling group, you can specify a launch template or a launch configuration. The following procedure demonstrates how to create an Auto Scaling group using a launch template.
Prerequisites
-
You must have created a launch template. For more information, see Create a launch template for an Auto Scaling group.
To create an Auto Scaling group using a launch template (console)
Open the Amazon EC2 console at https://console.aws.amazon.com/ec2/
, and choose Auto Scaling Groups from the navigation pane. -
On the navigation bar at the top of the screen, choose the same AWS Region that you used when you created the launch template.
-
Choose Create an Auto Scaling group.
-
On the Choose launch template or configuration page, do the following:
-
For Auto Scaling group name, enter a name for your Auto Scaling group.
-
For Launch template, choose an existing launch template.
-
For Launch template version, choose whether the Auto Scaling group uses the default, the latest, or a specific version of the launch template when scaling out.
-
Verify that your launch template supports all of the options that you are planning to use, and then choose Next.
-
-
On the Choose instance launch options page, if you're not using multiple instance types, you can skip the Instance type requirements section to use the EC2 instance type that is specified in the launch template.
To use multiple instance types, see Auto Scaling groups with multiple instance types and purchase options.
-
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 template.
-
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.
-
For Availability Zone distribution, select a distribution strategy. For more information, see Auto Scaling group Availability Zone distribution.
-
If you created a launch template with an instance type specified, then you can continue to the next step to create an Auto Scaling group that uses the instance type in the launch template.
Alternatively, you can choose the Override launch template option if no instance type is specified in your launch template or if you want to use multiple instance types for auto scaling. For more information, see Auto Scaling groups with multiple instance types and purchase options.
-
Choose Next to continue to the next step.
Or, you can accept the rest of the defaults, and choose Skip to review.
-
(Optional) On the Integrate with other services page, configure the following options, and then choose Next:
-
(Optional) For Amazon Application Recovery Controller (ARC) zonal shift, select Enable zonal shift.
-
For Health check behavior, select Ignore unhealthy or Replace unhealthy. For more information, see How zonal shift works for Auto Scaling groups.
-
(Optional) For Health checks, Additional health check types, select Turn on Amazon EBS health checks. For more information, see Monitor Auto Scaling instances with impaired Amazon EBS volumes using health checks.
-
(Optional) For Health check grace period, enter the amount of time, in seconds. This amount of time is how long Amazon EC2 Auto Scaling needs to wait before checking the health status of an instance after it enters the
InService
state. For more information, see Set the health check grace period for an Auto Scaling group. -
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 Monitor CloudWatch metrics for your Auto Scaling groups and instances.
-
For Enable default instance warmup, select this option and choose the warmup time for your application. If you are creating an Auto Scaling group that has a scaling policy, the default instance warmup feature improves the Amazon CloudWatch metrics used for dynamic scaling. For more information, see Set the default instance warmup for an Auto Scaling group.
-
-
(Optional) On the Configure group size and scaling policies page, configure the following options, and then choose Next:
-
Under Group size, for Desired capacity, enter the initial number of instances to launch.
-
In the Scaling section, under Scaling limits, if your new value for Desired capacity is greater than Min desired capacity and Max desired capacity, the Max desired capacity is automatically increased to the new desired capacity value. You can change these limits as needed. For more information, see Set scaling limits for your Auto Scaling group.
-
For Automatic scaling, choose whether you want to create a target tracking scaling policy. You can also create this policy after your create your Auto Scaling group.
If you choose Target tracking scaling policy, follow the directions in Create a target tracking scaling policy to create the policy.
-
For Instance maintenance policy, choose whether you want to create an instance maintenance policy. You can also create this policy after your create your Auto Scaling group. Follow the directions in Set an instance maintenance policy to create the policy.
-
Under Instance scale-in protection, choose whether to enable instance scale-in protection. For more information, see Use instance scale-in protection to control instance termination.
-
-
(Optional) To receive notifications, for Add notification, configure the notification, and then choose Next. For more information, see Amazon SNS notification options for Amazon EC2 Auto Scaling.
-
(Optional) To add tags, choose Add tag, provide a tag key and value for each tag, and then choose Next. For more information, see Tag Auto Scaling groups and instances.
-
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:
-
create-auto-scaling-group (AWS CLI)
-
New-ASAutoScalingGroup (AWS Tools for Windows PowerShell)