Table Of Contents

Feedback

User Guide

First time using the AWS CLI? See the User Guide for help getting started.

[ aws . ec2 ]

delete-launch-template-versions

Description

Deletes one or more versions of a launch template. You cannot delete the default version of a launch template; you must first assign a different version as the default. If the default version is the only version for the launch template, you must delete the entire launch template using DeleteLaunchTemplate .

See also: AWS API Documentation

See 'aws help' for descriptions of global parameters.

Synopsis

  delete-launch-template-versions
[--dry-run | --no-dry-run]
[--launch-template-id <value>]
[--launch-template-name <value>]
--versions <value>
[--cli-input-json <value>]
[--generate-cli-skeleton <value>]

Options

--dry-run | --no-dry-run (boolean)

Checks whether you have the required permissions for the action, without actually making the request, and provides an error response. If you have the required permissions, the error response is DryRunOperation . Otherwise, it is UnauthorizedOperation .

--launch-template-id (string)

The ID of the launch template. You must specify either the launch template ID or launch template name in the request.

--launch-template-name (string)

The name of the launch template. You must specify either the launch template ID or launch template name in the request.

--versions (list)

The version numbers of one or more launch template versions to delete.

Syntax:

"string" "string" ...

--cli-input-json (string) Performs service operation based on the JSON string provided. The JSON string follows the format provided by --generate-cli-skeleton. If other arguments are provided on the command line, the CLI values will override the JSON-provided values. It is not possible to pass arbitrary binary values using a JSON-provided value as the string will be taken literally.

--generate-cli-skeleton (string) Prints a JSON skeleton to standard output without sending an API request. If provided with no value or the value input, prints a sample input JSON that can be used as an argument for --cli-input-json. If provided with the value output, it validates the command inputs and returns a sample output JSON for that command.

See 'aws help' for descriptions of global parameters.

Examples

To delete a launch template version

This example deletes the specified launch template version.

Command:

aws ec2 delete-launch-template-versions --launch-template-id lt-0abcd290751193123 --versions 1

Output:

{
  "UnsuccessfullyDeletedLaunchTemplateVersions": [],
  "SuccessfullyDeletedLaunchTemplateVersions": [
      {
          "LaunchTemplateName": "TestVersion",
          "VersionNumber": 1,
          "LaunchTemplateId": "lt-0abcd290751193123"
      }
  ]
}

Output

SuccessfullyDeletedLaunchTemplateVersions -> (list)

Information about the launch template versions that were successfully deleted.

(structure)

Describes a launch template version that was successfully deleted.

LaunchTemplateId -> (string)

The ID of the launch template.

LaunchTemplateName -> (string)

The name of the launch template.

VersionNumber -> (long)

The version number of the launch template.

UnsuccessfullyDeletedLaunchTemplateVersions -> (list)

Information about the launch template versions that could not be deleted.

(structure)

Describes a launch template version that could not be deleted.

LaunchTemplateId -> (string)

The ID of the launch template.

LaunchTemplateName -> (string)

The name of the launch template.

VersionNumber -> (long)

The version number of the launch template.

ResponseError -> (structure)

Information about the error.

Code -> (string)

The error code.

Message -> (string)

The error message, if applicable.