Menu
Amazon Elastic Compute Cloud
API Reference (API Version 2016-11-15)

DeleteLaunchTemplate

Deletes a launch template. Deleting a launch template deletes all of its versions.

Request Parameters

The following parameters are for this specific action. For more information about required and optional parameters that are common to all actions, see Common Query Parameters.

DryRun

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.

Type: Boolean

Required: No

LaunchTemplateId

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

Type: String

Required: No

LaunchTemplateName

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

Type: String

Length Constraints: Minimum length of 3. Maximum length of 128.

Pattern: [a-zA-Z0-9\(\)\.-/_]+

Required: No

Response Elements

The following elements are returned by the service.

launchTemplate

Information about the launch template.

Type: LaunchTemplate object

requestId

The ID of the request.

Type: String

Errors

For information about the errors that are common to all actions, see Common Client Errors.

Example

Example

This example deletes launch template lt-0a20c965061f64abc.

Sample Request

https://ec2.amazonaws.com/?Action=DeleteLaunchTemplate
&LaunchTemplateId=lt-0a20c965061f64abc
&AUTHPARAMS

Sample Response

<DeleteLaunchTemplateResponse xmlns="http://ec2.amazonaws.com/doc/2016-11-15/">
    <requestId>c12605de-c470-4eaa-a4d0-ab4dexample</requestId>
    <launchTemplate>
        <createTime>2017-10-31T11:38:52.000Z</createTime>
        <createdBy>arn:aws:iam::123456789012:root</createdBy>
        <defaultVersionNumber>2</defaultVersionNumber>
        <latestVersionNumber>2</latestVersionNumber>
        <launchTemplateId>lt-0a20c965061f64abc</launchTemplateId>
        <launchTemplateName>MyLaunchTemplate</launchTemplateName>
    </launchTemplate>
</DeleteLaunchTemplateResponse>

See Also

For more information about using this API in one of the language-specific AWS SDKs, see the following: