All Products
Search
Document Center

Elastic Compute Service:Create a launch template

Last Updated:Jan 29, 2024

You can specify the configuration information that can be used to create Elastic Compute Service (ECS) instances in a launch template based on your needs, and then use the launch template as the basis for creating ECS instances. This topic describes the notes for creating launch templates, how to create a launch template, and operations that you can perform by using launch templates.

Considerations

  • You can create up to 30 launch templates in each region within an account.

  • When you create a launch template, all parameters are optional. However, if a launch template does not contain the required parameters, such as the instance type or image, you must add the parameters when you use the template to create instances.

  • You cannot modify launch templates after you create them. However, you can create new versions for launch templates.

Procedure

Create a launch template in the ECS console

You can create launch templates beforehand to simplify the creation of ECS instances, scaling groups, and auto provisioning groups.

  1. Log on to the ECS console.

  2. In the left-side navigation pane, choose Deployment & Elasticity > icon1 > Launch Templates.

  3. In the top navigation bar, select the region and resource group to which the resource belongs. 地域

  4. On the Launch Templates page, click Create Template.

  5. On the Launch Template page, specify parameters in the Basic Configurations (Optional) and Advanced Configurations (Optional) steps.

    For information about the parameter configurations and descriptions, see Create an instance by using the wizard.

    Note

    The first time you create a launch template, the Clone Template section is unavailable. If you have already created launch templates, you can select an existing template and a specific version and then modify the configurations.

  6. In the Confirm Configurations step, enter a template name and a template version description. Then, click Create Launch Template.

    • Selected Configurations: You can click the 修改 icon in the Basic Configurations and Advanced Configurations sections to modify the parameters.

      Note

      The parameters in the Basic Configurations and Advanced Configurations sections are required to create instances and simplify subsequent instance creation. These parameters are optional and can be configured as needed.

    • Save As: You can specify how to save the current configurations based on your needs.

      • Create Template: If you select Create Template in the Save As section, the current configurations are saved as the default version of a new launch template.

      • Create Version: You can select an existing template and save the current configurations as the latest version of the launch template.

    • Template Name and Version Description: You can enter a name for the launch template and a description for the template version for future management.

    • Template Resource Group: You can select an existing resource group to assign the launch template to the resource group.

      If you want to create a new resource group, click here to go to the Resource Group page and create a resource group. For more information, see Resource groups.

    实例模板

  7. In the Success message, click View Template to go to the ECS console and view the launch template that you created.

    Note

    You can view all created launch templates in the template list on the Launch Templates page.

Create a launch template by calling an API operation

Call the CreateLaunchTemplate operation to create a launch template.

Related operations

After you create a launch template, you can perform the operations that are described in the following table based on your business requirements.

Operation

Description

References

Create an ECS instance

You can use an existing launch template to quickly create an ECS instance. This eliminates the need to repeatedly configure parameters.

Create an instance by using a launch template

Create multiple ECS instances at a time

You can use a launch template together with the RunInstances operation to create multiple ECS instances. This eliminates the need to enter a large number of parameters each time you create instances.

You must specify the LaunchTemplateId and LaunchTemplateVersion parameters when you call the RunInstances operation.

RunInstances

Create a scaling group

You can use an existing launch template to quickly create a scaling group based on ECS instances. The system uses configurations defined in the launch template to create a scaling group. If specific configurations do not fulfill business requirements, you can modify the configurations when you create the scaling group. For example, you can modify the virtual private cloud (VPC) and vSwitch in the scaling configuration.

Create a scaling group based on an existing ECS instance

Create an auto provisioning group

Auto provisioning groups use specific versions of launch templates as instance configuration sources. Attributes such as instance images, security groups, and logon credentials from the launch templates are used by auto provisioning groups to create ECS instances. After an auto provisioning group is created, an ECS instance cluster is started and provisioned at the specified point in time, which improves the efficiency of offering a large number of ECS instances at a time.

Create an auto provisioning group