All Products
Search
Document Center

Elastic Compute Service:Create a launch template

Last Updated:Oct 23, 2023

This topic describes the notes for creating launch templates, how to create launch templates, and operations that can be performed by using launch templates.

Usage notes

  • Up to 30 launch templates can be created per region within an account.

  • When you create a launch template, all parameters are optional. However, if a launch template does not contain required parameters such as the instance type or image, you must specify these parameters when you create an instance by using the launch template.

  • Launch templates cannot be modified after they are created. However, you can create versions for launch templates.

Procedure

Create a launch template in the ECS console

You can create launch templates beforehand to simplify the creation of Elastic Compute Service (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 upper-left corner of the top navigation bar, select a region. 地域

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

  5. On the Launch Template page, configure the 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 launch template and one of its versions 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 settings: You can click the 修改 icon in the Basic Configurations and Advanced Configurations sections to modify the basic and advanced parameter settings.

      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, a launch template will be created, and the current configurations will be saved as the default version of the launch template.

      • Create Version: If you select Create Version in the Save As section, a launch template version will be created, and the current configurations will be saved as the new version of the selected launch template.

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

    • Template Resource Group: You can select an existing resource group from the Template Resource Group drop-down list.

      If you want a new resource group, click here to go to the Resource Group page to 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 have created.

Create a launch template on the ECS instance buy page

If you want to save the configurations of an instance for simplifying subsequent instance creation, you can create a launch template when you create the instance.

  1. Go to the Elastic Compute Service product page and click Buy Now

  2. On the Custom Launch tab, configure parameters.

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

  3. In the Preview step, click Save as Launch Template.

  4. In the Save as Launch Template dialog box, click Create Template, enter a template name and a template version description, and then click Save.

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

Create a launch template by calling an API operation

Call the CreateLaunchTemplate operation to create a launch template.

What to do next

After you create launch templates, you can use them to perform the following operations.

Operation

Description

References

Create an ECS instance

You can use an existing launch template to quickly create an 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 call the RunInstances operation with a launch template configured to batch create multiple instances. Using a launch template eliminates the need to repeatedly configure 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 some of the configurations do not fulfill business requirements, you can modify these 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