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 launch template ID or the launch template name, but not both.

  • LaunchTemplateName (string) –

    The name of the launch template.

    You must specify either the launch template ID or the launch template name, 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'
            },
        ],
        'Operator': {
            'Managed': True|False,
            'Principal': '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.

      • Operator (dict) –

        The entity that manages the launch template.

        • Managed (boolean) –

          If true, the resource is managed by an entity.

        • Principal (string) –

          If managed is true, then the principal is returned. The principal is the entity that manages the resource.

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': {
        '...': '...',
    },
}