Create an Auto Scaling group using a launch template – Amazon EC2 Auto Scaling
Mục Lục
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.
To update the configuration of the EC2 instances after the group is created, you can
create a new version of the launch template. After you change the launch template for an
Auto Scaling group, any new instances are launched using the new configuration options, but existing
instances are not affected. To update the existing instances, terminate them so that they
are replaced by your Auto Scaling group, or allow auto scaling to gradually replace older instances
with newer instances based on your termination
policies.
Note
You can also replace all instances in the Auto Scaling group to launch new instances that use
the new launch template. For more information, see Replace Auto Scaling instances.
Prerequisites
-
You must have created a launch template. For more information, see Create a launch template for an Auto Scaling
group. -
You must have IAM permissions to create an Auto Scaling group using a launch template.
Yourec2:RunInstances
permissions are checked when use a launch
template. Youriam:PassRole
permissions are also checked if the launch
template specifies an IAM role. For more information, see Launch template
support.
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)