All Products
Search
Document Center

Elastic Compute Service:Overview

Last Updated:Mar 31, 2026

Launch templates let you save ECS instance creation parameters—such as instance type, image, key pair, Resource Access Management (RAM) role, security group, and network settings—so you don't have to specify them every time you create an instance. After saving a template, you can launch instances in seconds with a single click or API call. You can also override any saved parameter at launch time, so templates stay flexible as your requirements change.

Launch templates do not store instance passwords.

Each template supports up to 30 versions. Because templates are immutable, you create a new version whenever you need to change parameters. When launching instances without specifying a version, ECS uses the template's default version—not necessarily the latest one.

Features and benefits

Launch templates provide the following features and benefits:

  • Preset parameters: Preset ECS instance creation parameters—such as instance type, operating system, hardware settings, network settings, security rules, and storage settings—in a launch template for reuse.

  • Standardization and consistency: Use a launch template to create instances with identical configurations and environments, reducing the risk of human error in configuration.

  • Quick deployment: Create ECS instances from a launch template without specifying instance parameters each time.

  • Version control and iteration: Create different versions of a launch template to iterate, optimize, or suit different projects.

Use cases

  • Consistent environments: Use one template to create development, testing, and production instances with identical configurations, reducing configuration drift.

  • Auto Scaling: Attach a template to a scaling group. Auto Scaling uses the template's parameters to provision instances automatically. Override specific parameters on the Create Scaling Group page if needed. For more information, see Create a scaling group based on an existing ECS instance.

  • Auto Provisioning: Auto provisioning groups use templates as configuration sources to provision and start an instance cluster at a specified time, improving large-scale provisioning efficiency. For more information, see Create an auto provisioning group.

  • CI/CD pipelines: Integrate templates with your continuous integration/continuous deployment (CI/CD) pipeline to deploy code to pre-configured environments rapidly.

  • Disaster recovery: Quickly replicate instance configurations when setting up disaster recovery plans.

Limits

ConstraintLimit
Launch templates per account per region30
Versions per launch template30
Template mutabilityImmutable — create a new version to change parameters
Required parametersAll parameters are optional in the template. If required parameters (such as instance type and image) are absent, specify them at instance creation time
Default versionCannot be deleted directly — change the default version first, then delete the old version

Billing

Launch templates are free. Charges apply to the ECS resources you create using a template. For details, see Billing overview.

Create a launch template

Store your instance configuration in a template so you can reuse it across projects, environments, or auto-scaling scenarios.

Use the ECS console

  1. Go to ECS console — Launch Template.

  2. In the top navigation bar, select the target region and resource group.

    地域

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

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

    All parameters are optional. If you have already created a template, select it in the Clone Template section to use it as a starting point. The Clone Template section is unavailable the first time you create a template. In the Instance Type section, use the Scenario-based Selection tab to filter instance types by your use case.
  5. In the Confirm Configurations step, configure the following settings, then click Create Launch Template.

    • Save As: Select how to save the current configuration.

      • Create Template: Saves the configuration as the default version of a new template.

      • Create Version: Saves the configuration as the latest version of an existing template.

    • Template Name and Version Description: Enter a name and description to facilitate future management.

    • Template Resource Group: Select a resource group to assign the template to. To create a new resource group, click here to open the Create Resource Group page. For more information, see Resource groups.

    Click the 修改 icon in the Basic Configurations or Advanced Configurations sections to modify parameters before saving.

    实例模板

  6. In the Success message, click View Template to confirm the template in the ECS console.

Call an API operation

Call CreateLaunchTemplate to create a launch template.

Use a launch template to create an ECS instance

Select any version of a template to create one or more instances without re-entering parameters. If a template omits required parameters, specify them at this step — the template's saved values are pre-loaded and can be overridden.

Prerequisites

Before you begin, ensure that you have an existing launch template or template version to use.

Use the ECS console

  1. On the Launch Templates page, find the template and click Create Instance in the Actions column. Alternatively, click a template ID to view its versions, then click Create Instance next to the version you want to use.

    新建版本

  2. On the Custom Launch tab, the selected template and version are automatically loaded. Review all configurations.

    To modify any parameter or add missing required values, click the 编辑 icon. You can override any template parameter at this step without changing the template itself.
  3. Create the instance based on your billing preference. After creation, go to the Instance page in the ECS console to view the new instance.

    • Subscription: Set the Duration, accept the ECS Terms of Service and Product Terms of Service, then click Create Order.

    • Pay-as-you-go: Accept the ECS Terms of Service and Product Terms of Service, then click Create Instance.

Call an API operation

Call RunInstances with the LaunchTemplateId and LaunchTemplateVersion parameters to batch create instances without specifying each parameter individually.

Manage launch template versions

Because templates are immutable, version management is how you iterate on configurations. You can create new versions, change which version is the default, and delete versions that are no longer needed.

When creating instances without specifying a version, ECS uses the default version — not the latest version.

Create a new version

Use the ECS console

  1. On the Launch Templates page, find the template and click New Version in the Actions column. Alternatively, click the template ID, then click New Version in the Version Information section.

    新建版本

  2. On the Launch Template page, configure parameters. In the Clone Template section, select an existing template and version as a base.

  3. In the Confirm Configurations step, select Create Version and select the template to add the new version to.

  4. Click Create Launch Template.

  5. In the message that appears, click View New Version to confirm the version in the ECS console.

    All created versions are also listed on the Launch Templates page.

Call an API operation

Call CreateLaunchTemplateVersion to create a new template version.

Change the default version

Set the most-used version as the default so it is automatically applied when no version is specified.

Use the ECS console

On the Launch Templates page, click the template ID. In the Version Information section, find the version to promote and click Set as Default in the Actions column.

默认版本

Call an API operation

Call ModifyLaunchTemplateDefaultVersion to set a version as the default.

Delete a version

Important

The default version cannot be deleted. Change the default version first, then delete the old version. For details, see Change the default version of a launch template. If you no longer need any version of a template, delete the entire template instead. For details, see Delete a launch template.

Use the ECS console

  1. On the Launch Templates page, select the template to expand its version information.

  2. 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 delete multiple versions: select the versions and click Delete above the Version column.

  3. In the confirmation dialog, click OK.

Call an API operation

Call DeleteLaunchTemplateVersion to delete a specific template version.

Delete a launch template

Deleting a template removes all of its versions. This does not affect instances that were already created from the template.

Important

Deletion is permanent and removes all versions. If you only need to remove a specific version, see Delete a version above.

Use the ECS console

  1. On the Launch Templates page, delete one or more templates.

    • To delete a single template: find the template and click Delete in the Actions column.

    • To delete multiple templates: select the templates and click Delete above the Template ID column.

  2. In the confirmation dialog, click OK.

Call an API operation

Call DeleteLaunchTemplate to delete a launch template and all its versions.

What's next

References