All Products
Search
Document Center

Elastic Compute Service:Manage launch template versions

Last Updated:Jan 29, 2024

After you create a launch template, you cannot modify it. You can create a new version of the launch template and modify the parameters of the launch template in the new version. When you create Elastic Compute Service (ECS) instances by using a launch template, you can use any version of the launch template. If you do not specify a version, the default version is used. This topic describes how to create a new version of a launch template, set the version that is frequently used as the default version, and delete a version that is no longer needed.

Create a launch template version

Each launch template can have multiple versions, and each version can have different parameters. You can change the parameters in the launch template by creating a new version.

Prerequisites

A launch template is created. For more information, see Create a launch template.

Considerations

  • The default version number of a new launch template is 1. You can create a new version of this launch template.

    Important

    Version numbers are incremented in the order in which they are created. You cannot customize version numbers.

  • You can create up to 30 versions for each launch template.

  • 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 template versions after you create them.

Procedure

  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, find a launch template for which you want to create a version and click New Version in the Actions column.

    Alternatively, click the ID of the launch template for which you want to create a version to view the configurations, and click New Version in the Version Information section.新建版本

  5. On the Launch Template page, configure parameters.

    In the Clone Template section, you can select an existing template and version and configure the parameters based on the template. For information about parameter configurations and descriptions, see Create an instance by using the wizard.

  6. In the Confirm Configurations step, select Create Version and select the launch template for which you want to save the new version.

  7. Click Create Launch Template.

  8. In the message that appears, click View New Version to go to the ECS console and view the created version of the launch template.

    Note

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

Change the default version of a launch template

You can set a commonly used template version as the default version. If you do not specify a version when you use a launch template to create ECS instances, the system automatically uses the default version of the launch template to create ECS instances. This section describes how to change the default version.

  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. Select the ID of a launch template whose default version you want to change. In the Version Information section, find the version that you want to set as the default version and click Set as Default in the Actions column.

    默认版本

Delete a template version

You can perform the following operations to delete a non-default launch template version that is no longer needed.

Important
  • If the version that you want to delete is set as the default version, you cannot delete the version. In this case, you can change the default version and then delete the version. For more information about how to change the default version, see Change the default version of a launch template.

  • If you no longer need all versions of a launch template, you only need to delete the launch template. For more information, see Delete a launch template.

  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, select the launch template that you want to manage and expand the version information.

  5. In the Version Information section, delete one or more versions.

    • To delete a single version, find the version and click Delete in the Actions column.

    • To batch delete versions, select the versions and click Delete on top of the Version column.

  6. In the Delete Version message, click OK.

Related operations

  • You can manage launch template versions by calling the following API operations:

  • After you create a new version of a launch template, you can select a launch template version when you perform the operations that are described in the following table.

    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