EC2 / Client / delete_launch_template

delete_launch_template#

EC2.Client.delete_launch_template(**kwargs)#

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

See also: AWS API Documentation

Request Syntax

response = client.delete_launch_template(
    DryRun=True|False,
    LaunchTemplateId='string',
    LaunchTemplateName='string'
)
Parameters:
  • DryRun (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.

  • LaunchTemplateId (string) –

    The ID of the launch template.

    You must specify either the LaunchTemplateId or the LaunchTemplateName, but not both.

  • LaunchTemplateName (string) –

    The name of the launch template.

    You must specify either the LaunchTemplateName or the LaunchTemplateId, but not both.

Return type:

dict

Returns:

Response Syntax

{
    'LaunchTemplate': {
        'LaunchTemplateId': 'string',
        'LaunchTemplateName': 'string',
        'CreateTime': datetime(2015, 1, 1),
        'CreatedBy': 'string',
        'DefaultVersionNumber': 123,
        'LatestVersionNumber': 123,
        'Tags': [
            {
                'Key': 'string',
                'Value': 'string'
            },
        ]
    }
}

Response Structure

  • (dict) –

    • LaunchTemplate (dict) –

      Information about the launch template.

      • LaunchTemplateId (string) –

        The ID of the launch template.

      • LaunchTemplateName (string) –

        The name of the launch template.

      • CreateTime (datetime) –

        The time launch template was created.

      • CreatedBy (string) –

        The principal that created the launch template.

      • DefaultVersionNumber (integer) –

        The version number of the default version of the launch template.

      • LatestVersionNumber (integer) –

        The version number of the latest version of the launch template.

      • Tags (list) –

        The tags for the launch template.

        • (dict) –

          Describes a tag.

          • Key (string) –

            The key of the tag.

            Constraints: Tag keys are case-sensitive and accept a maximum of 127 Unicode characters. May not begin with aws:.

          • Value (string) –

            The value of the tag.

            Constraints: Tag values are case-sensitive and accept a maximum of 256 Unicode characters.

Examples

This example deletes the specified launch template.

response = client.delete_launch_template(
    LaunchTemplateId='lt-0abcd290751193123',
)

print(response)

Expected Output:

{
    'LaunchTemplate': {
        'CreateTime': datetime(2017, 11, 23, 16, 46, 25, 3, 327, 0),
        'CreatedBy': 'arn:aws:iam::123456789012:root',
        'DefaultVersionNumber': 2,
        'LatestVersionNumber': 2,
        'LaunchTemplateId': 'lt-0abcd290751193123',
        'LaunchTemplateName': 'my-template',
    },
    'ResponseMetadata': {
        '...': '...',
    },
}