[ aws . ec2 ]

describe-launch-template-versions

Description

Describes one or more versions of a specified launch template. You can describe all versions, individual versions, or a range of versions. You can also describe all the latest versions or all the default versions of all the launch templates in your account.

See also: AWS API Documentation

See ‘aws help’ for descriptions of global parameters.

describe-launch-template-versions is a paginated operation. Multiple API calls may be issued in order to retrieve the entire data set of results. You can disable pagination by providing the --no-paginate argument. When using --output text and the --query argument on a paginated response, the --query argument must extract data from the results of the following query expressions: LaunchTemplateVersions

Synopsis

  describe-launch-template-versions
[--dry-run | --no-dry-run]
[--launch-template-id <value>]
[--launch-template-name <value>]
[--versions <value>]
[--min-version <value>]
[--max-version <value>]
[--filters <value>]
[--cli-input-json | --cli-input-yaml]
[--starting-token <value>]
[--page-size <value>]
[--max-items <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. To describe one or more versions of a specified launch template, you must specify either the launch template ID or the launch template name in the request. To describe all the latest or default launch template versions in your account, you must omit this parameter.

--launch-template-name (string)

The name of the launch template. To describe one or more versions of a specified launch template, you must specify either the launch template ID or the launch template name in the request. To describe all the latest or default launch template versions in your account, you must omit this parameter.

--versions (list)

One or more versions of the launch template. Valid values depend on whether you are describing a specified launch template (by ID or name) or all launch templates in your account.

To describe one or more versions of a specified launch template, valid values are $Latest , $Default , and numbers.

To describe all launch templates in your account that are defined as the latest version, the valid value is $Latest . To describe all launch templates in your account that are defined as the default version, the valid value is $Default . You can specify $Latest and $Default in the same call. You cannot specify numbers.

(string)

Syntax:

"string" "string" ...

--min-version (string)

The version number after which to describe launch template versions.

--max-version (string)

The version number up to which to describe launch template versions.

--filters (list)

One or more filters.

  • create-time - The time the launch template version was created.

  • ebs-optimized - A boolean that indicates whether the instance is optimized for Amazon EBS I/O.

  • iam-instance-profile - The ARN of the IAM instance profile.

  • image-id - The ID of the AMI.

  • instance-type - The instance type.

  • is-default-version - A boolean that indicates whether the launch template version is the default version.

  • kernel-id - The kernel ID.

  • ram-disk-id - The RAM disk ID.

(structure)

A filter name and value pair that is used to return a more specific list of results from a describe operation. Filters can be used to match a set of resources by specific criteria, such as tags, attributes, or IDs.

Name -> (string)

The name of the filter. Filter names are case-sensitive.

Values -> (list)

The filter values. Filter values are case-sensitive.

(string)

Shorthand Syntax:

Name=string,Values=string,string ...

JSON Syntax:

[
  {
    "Name": "string",
    "Values": ["string", ...]
  }
  ...
]

--cli-input-json | --cli-input-yaml (string) Reads arguments from the JSON string provided. The JSON string follows the format provided by --generate-cli-skeleton. If other arguments are provided on the command line, those 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. This may not be specified along with --cli-input-yaml.

--starting-token (string)

A token to specify where to start paginating. This is the NextToken from a previously truncated response.

For usage examples, see Pagination in the AWS Command Line Interface User Guide .

--page-size (integer)

The size of each page to get in the AWS service call. This does not affect the number of items returned in the command’s output. Setting a smaller page size results in more calls to the AWS service, retrieving fewer items in each call. This can help prevent the AWS service calls from timing out.

For usage examples, see Pagination in the AWS Command Line Interface User Guide .

--max-items (integer)

The total number of items to return in the command’s output. If the total number of items available is more than the value specified, a NextToken is provided in the command’s output. To resume pagination, provide the NextToken value in the starting-token argument of a subsequent command. Do not use the NextToken response element directly outside of the AWS CLI.

For usage examples, see Pagination in the AWS Command Line Interface User Guide .

--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. Similarly, if provided yaml-input it will print a sample input YAML that can be used with --cli-input-yaml. 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 describe launch template versions

This example describes the versions of the specified launch template.

Command:

aws ec2 describe-launch-template-versions --launch-template-id lt-068f72b72934aff71

Output:

{
  "LaunchTemplateVersions": [
      {
          "LaunchTemplateId": "lt-068f72b72934aff71",
          "LaunchTemplateName": "Webservers",
          "VersionNumber": 3,
          "CreatedBy": "arn:aws:iam::123456789102:root",
          "LaunchTemplateData": {
              "KeyName": "kp-us-east",
              "ImageId": "ami-6057e21a",
              "InstanceType": "t2.small",
              "NetworkInterfaces": [
                  {
                      "SubnetId": "subnet-7b16de0c",
                      "DeviceIndex": 0,
                      "Groups": [
                          "sg-7c227019"
                      ]
                  }
              ]
          },
          "DefaultVersion": false,
          "CreateTime": "2017-11-20T13:19:54.000Z"
      },
      {
          "LaunchTemplateId": "lt-068f72b72934aff71",
          "LaunchTemplateName": "Webservers",
          "VersionNumber": 2,
          "CreatedBy": "arn:aws:iam::123456789102:root",
          "LaunchTemplateData": {
              "KeyName": "kp-us-east",
              "ImageId": "ami-6057e21a",
              "InstanceType": "t2.medium",
              "NetworkInterfaces": [
                  {
                      "SubnetId": "subnet-1a2b3c4d",
                      "DeviceIndex": 0,
                      "Groups": [
                          "sg-7c227019"
                      ]
                  }
              ]
          },
          "DefaultVersion": false,
          "CreateTime": "2017-11-20T13:12:32.000Z"
      },
      {
          "LaunchTemplateId": "lt-068f72b72934aff71",
          "LaunchTemplateName": "Webservers",
          "VersionNumber": 1,
          "CreatedBy": "arn:aws:iam::123456789102:root",
          "LaunchTemplateData": {
              "UserData": "",
              "KeyName": "kp-us-east",
              "ImageId": "ami-aabbcc11",
              "InstanceType": "t2.medium",
              "NetworkInterfaces": [
                  {
                      "SubnetId": "subnet-7b16de0c",
                      "DeviceIndex": 0,
                      "DeleteOnTermination": false,
                      "Groups": [
                          "sg-7c227019"
                      ],
                      "AssociatePublicIpAddress": true
                  }
              ]
          },
          "DefaultVersion": true,
          "CreateTime": "2017-11-20T12:52:33.000Z"
      }
  ]
}

Output

LaunchTemplateVersions -> (list)

Information about the launch template versions.

(structure)

Describes a launch template version.

LaunchTemplateId -> (string)

The ID of the launch template.

LaunchTemplateName -> (string)

The name of the launch template.

VersionNumber -> (long)

The version number.

VersionDescription -> (string)

The description for the version.

CreateTime -> (timestamp)

The time the version was created.

CreatedBy -> (string)

The principal that created the version.

DefaultVersion -> (boolean)

Indicates whether the version is the default version.

LaunchTemplateData -> (structure)

Information about the launch template.

KernelId -> (string)

The ID of the kernel, if applicable.

EbsOptimized -> (boolean)

Indicates whether the instance is optimized for Amazon EBS I/O.

IamInstanceProfile -> (structure)

The IAM instance profile.

Arn -> (string)

The Amazon Resource Name (ARN) of the instance profile.

Name -> (string)

The name of the instance profile.

BlockDeviceMappings -> (list)

The block device mappings.

(structure)

Describes a block device mapping.

DeviceName -> (string)

The device name.

VirtualName -> (string)

The virtual device name (ephemeralN).

Ebs -> (structure)

Information about the block device for an EBS volume.

Encrypted -> (boolean)

Indicates whether the EBS volume is encrypted.

DeleteOnTermination -> (boolean)

Indicates whether the EBS volume is deleted on instance termination.

Iops -> (integer)

The number of I/O operations per second (IOPS) that the volume supports.

KmsKeyId -> (string)

The ARN of the AWS Key Management Service (AWS KMS) CMK used for encryption.

SnapshotId -> (string)

The ID of the snapshot.

VolumeSize -> (integer)

The size of the volume, in GiB.

VolumeType -> (string)

The volume type.

Throughput -> (integer)

The throughput that the volume supports, in MiB/s.

NoDevice -> (string)

To omit the device from the block device mapping, specify an empty string.

NetworkInterfaces -> (list)

The network interfaces.

(structure)

Describes a network interface.

AssociateCarrierIpAddress -> (boolean)

Indicates whether to associate a Carrier IP address with eth0 for a new network interface.

Use this option when you launch an instance in a Wavelength Zone and want to associate a Carrier IP address with the network interface. For more information about Carrier IP addresses, see Carrier IP addresses in the AWS Wavelength Developer Guide .

AssociatePublicIpAddress -> (boolean)

Indicates whether to associate a public IPv4 address with eth0 for a new network interface.

DeleteOnTermination -> (boolean)

Indicates whether the network interface is deleted when the instance is terminated.

Description -> (string)

A description for the network interface.

DeviceIndex -> (integer)

The device index for the network interface attachment.

Groups -> (list)

The IDs of one or more security groups.

(string)

InterfaceType -> (string)

The type of network interface.

Ipv6AddressCount -> (integer)

The number of IPv6 addresses for the network interface.

Ipv6Addresses -> (list)

The IPv6 addresses for the network interface.

(structure)

Describes an IPv6 address.

Ipv6Address -> (string)

The IPv6 address.

NetworkInterfaceId -> (string)

The ID of the network interface.

PrivateIpAddress -> (string)

The primary private IPv4 address of the network interface.

PrivateIpAddresses -> (list)

One or more private IPv4 addresses.

(structure)

Describes a secondary private IPv4 address for a network interface.

Primary -> (boolean)

Indicates whether the private IPv4 address is the primary private IPv4 address. Only one IPv4 address can be designated as primary.

PrivateIpAddress -> (string)

The private IPv4 addresses.

SecondaryPrivateIpAddressCount -> (integer)

The number of secondary private IPv4 addresses for the network interface.

SubnetId -> (string)

The ID of the subnet for the network interface.

NetworkCardIndex -> (integer)

The index of the network card.

ImageId -> (string)

The ID of the AMI that was used to launch the instance.

InstanceType -> (string)

The instance type.

KeyName -> (string)

The name of the key pair.

Monitoring -> (structure)

The monitoring for the instance.

Enabled -> (boolean)

Indicates whether detailed monitoring is enabled. Otherwise, basic monitoring is enabled.

Placement -> (structure)

The placement of the instance.

AvailabilityZone -> (string)

The Availability Zone of the instance.

Affinity -> (string)

The affinity setting for the instance on the Dedicated Host.

GroupName -> (string)

The name of the placement group for the instance.

HostId -> (string)

The ID of the Dedicated Host for the instance.

Tenancy -> (string)

The tenancy of the instance (if the instance is running in a VPC). An instance with a tenancy of dedicated runs on single-tenant hardware.

SpreadDomain -> (string)

Reserved for future use.

HostResourceGroupArn -> (string)

The ARN of the host resource group in which to launch the instances.

PartitionNumber -> (integer)

The number of the partition the instance should launch in. Valid only if the placement group strategy is set to partition .

RamDiskId -> (string)

The ID of the RAM disk, if applicable.

DisableApiTermination -> (boolean)

If set to true , indicates that the instance cannot be terminated using the Amazon EC2 console, command line tool, or API.

InstanceInitiatedShutdownBehavior -> (string)

Indicates whether an instance stops or terminates when you initiate shutdown from the instance (using the operating system command for system shutdown).

UserData -> (string)

The user data for the instance.

TagSpecifications -> (list)

The tags.

(structure)

The tag specification for the launch template.

ResourceType -> (string)

The type of resource.

Tags -> (list)

The tags for the resource.

(structure)

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 255 Unicode characters.

ElasticGpuSpecifications -> (list)

The elastic GPU specification.

(structure)

Describes an elastic GPU.

Type -> (string)

The elastic GPU type.

ElasticInferenceAccelerators -> (list)

The elastic inference accelerator for the instance.

(structure)

Describes an elastic inference accelerator.

Type -> (string)

The type of elastic inference accelerator. The possible values are eia1.medium, eia1.large, and eia1.xlarge.

Count -> (integer)

The number of elastic inference accelerators to attach to the instance.

Default: 1

SecurityGroupIds -> (list)

The security group IDs.

(string)

SecurityGroups -> (list)

The security group names.

(string)

InstanceMarketOptions -> (structure)

The market (purchasing) option for the instances.

MarketType -> (string)

The market type.

SpotOptions -> (structure)

The options for Spot Instances.

MaxPrice -> (string)

The maximum hourly price you’re willing to pay for the Spot Instances.

SpotInstanceType -> (string)

The Spot Instance request type.

BlockDurationMinutes -> (integer)

The required duration for the Spot Instances (also known as Spot blocks), in minutes. This value must be a multiple of 60 (60, 120, 180, 240, 300, or 360).

ValidUntil -> (timestamp)

The end date of the request. For a one-time request, the request remains active until all instances launch, the request is canceled, or this date is reached. If the request is persistent, it remains active until it is canceled or this date and time is reached.

InstanceInterruptionBehavior -> (string)

The behavior when a Spot Instance is interrupted.

CreditSpecification -> (structure)

The credit option for CPU usage of the instance.

CpuCredits -> (string)

The credit option for CPU usage of a T2, T3, or T3a instance. Valid values are standard and unlimited .

CpuOptions -> (structure)

The CPU options for the instance. For more information, see Optimizing CPU Options in the Amazon Elastic Compute Cloud User Guide .

CoreCount -> (integer)

The number of CPU cores for the instance.

ThreadsPerCore -> (integer)

The number of threads per CPU core.

CapacityReservationSpecification -> (structure)

Information about the Capacity Reservation targeting option.

CapacityReservationPreference -> (string)

Indicates the instance’s Capacity Reservation preferences. Possible preferences include:

  • open - The instance can run in any open Capacity Reservation that has matching attributes (instance type, platform, Availability Zone).

  • none - The instance avoids running in a Capacity Reservation even if one is available. The instance runs in On-Demand capacity.

CapacityReservationTarget -> (structure)

Information about the target Capacity Reservation or Capacity Reservation group.

CapacityReservationId -> (string)

The ID of the targeted Capacity Reservation.

CapacityReservationResourceGroupArn -> (string)

The ARN of the targeted Capacity Reservation group.

LicenseSpecifications -> (list)

The license configurations.

(structure)

Describes a license configuration.

LicenseConfigurationArn -> (string)

The Amazon Resource Name (ARN) of the license configuration.

HibernationOptions -> (structure)

Indicates whether an instance is configured for hibernation. For more information, see Hibernate Your Instance in the Amazon Elastic Compute Cloud User Guide .

Configured -> (boolean)

If this parameter is set to true , the instance is enabled for hibernation; otherwise, it is not enabled for hibernation.

MetadataOptions -> (structure)

The metadata options for the instance. For more information, see Instance Metadata and User Data in the Amazon Elastic Compute Cloud User Guide .

State -> (string)

The state of the metadata option changes.

pending - The metadata options are being updated and the instance is not ready to process metadata traffic with the new selection.

applied - The metadata options have been successfully applied on the instance.

HttpTokens -> (string)

The state of token usage for your instance metadata requests. If the parameter is not specified in the request, the default state is optional .

If the state is optional , you can choose to retrieve instance metadata with or without a signed token header on your request. If you retrieve the IAM role credentials without a token, the version 1.0 role credentials are returned. If you retrieve the IAM role credentials using a valid signed token, the version 2.0 role credentials are returned.

If the state is required , you must send a signed token header with any instance metadata retrieval requests. In this state, retrieving the IAM role credentials always returns the version 2.0 credentials; the version 1.0 credentials are not available.

HttpPutResponseHopLimit -> (integer)

The desired HTTP PUT response hop limit for instance metadata requests. The larger the number, the further instance metadata requests can travel.

Default: 1

Possible values: Integers from 1 to 64

HttpEndpoint -> (string)

This parameter enables or disables the HTTP metadata endpoint on your instances. If the parameter is not specified, the default state is enabled .

Note

If you specify a value of disabled , you will not be able to access your instance metadata.

EnclaveOptions -> (structure)

Indicates whether the instance is enabled for AWS Nitro Enclaves.

Enabled -> (boolean)

If this parameter is set to true , the instance is enabled for AWS Nitro Enclaves; otherwise, it is not enabled for AWS Nitro Enclaves.

NextToken -> (string)

The token to use to retrieve the next page of results. This value is null when there are no more results to return.