Skip to main content

launch_template_datas

Creates, updates, deletes, gets or lists a launch_template_datas resource.

Overview

Namelaunch_template_datas
TypeResource
Idaws.ec2.launch_template_datas

Fields

The following fields are returned by SELECT queries:

NameDatatypeDescription
block_device_mappingsstringThe block device mappings.
capacity_reservation_specificationstringInformation about the Capacity Reservation targeting option.
cpu_optionsstringThe CPU options for the instance. For more information, see CPU options for Amazon EC2 instances in the Amazon EC2 User Guide.
credit_specificationstringThe credit option for CPU usage of the instance.
disable_api_stopbooleanIndicates whether the instance is enabled for stop protection. For more information, see Enable stop protection for your EC2 instances in the Amazon EC2 User Guide.
disable_api_terminationbooleanIf set to true, indicates that the instance cannot be terminated using the Amazon EC2 console, command line tool, or API.
ebs_optimizedbooleanIndicates whether the instance is optimized for Amazon EBS I/O.
elastic_gpu_specificationsstringDeprecated. Amazon Elastic Graphics reached end of life on January 8, 2024.
elastic_inference_acceleratorsstringAmazon Elastic Inference is no longer available. An elastic inference accelerator to associate with the instance. Elastic inference accelerators are a resource you can attach to your Amazon EC2 instances to accelerate your Deep Learning (DL) inference workloads. You cannot specify accelerators from different generations in the same request.
enclave_optionsstringIndicates whether the instance is enabled for Amazon Web Services Nitro Enclaves.
hibernation_optionsstringIndicates whether an instance is configured for hibernation. For more information, see Hibernate your Amazon EC2 instance in the Amazon EC2 User Guide.
iam_instance_profilestringThe IAM instance profile.
image_idstringThe ID of the AMI or a Systems Manager parameter. The Systems Manager parameter will resolve to the ID of the AMI at instance launch. The value depends on what you specified in the request. The possible values are: If an AMI ID was specified in the request, then this is the AMI ID. If a Systems Manager parameter was specified in the request, and ResolveAlias was configured as true, then this is the AMI ID that the parameter is mapped to in the Parameter Store. If a Systems Manager parameter was specified in the request, and ResolveAlias was configured as false, then this is the parameter value. For more information, see Use a Systems Manager parameter instead of an AMI ID in the Amazon EC2 User Guide.
instance_initiated_shutdown_behaviorstringIndicates whether an instance stops or terminates when you initiate shutdown from the instance (using the operating system command for system shutdown).
instance_market_optionsstringThe market (purchasing) option for the instances.
instance_requirementsstringThe attributes for the instance types. When you specify instance attributes, Amazon EC2 will identify instance types with these attributes. If you specify InstanceRequirements, you can't specify InstanceTypes.
instance_typestringThe instance type.
kernel_idstringThe ID of the kernel, if applicable.
key_namestringThe name of the key pair.
license_specificationsstringThe license configurations.
maintenance_optionsstringThe maintenance options for your instance.
metadata_optionsstringThe metadata options for the instance. For more information, see Configure the Instance Metadata Service options in the Amazon EC2 User Guide.
monitoringstringThe monitoring for the instance.
network_interfacesstringThe network interfaces.
network_performance_optionsstringContains the launch template settings for network performance options for your instance.
operatorstringThe entity that manages the launch template.
placementstringThe placement of the instance.
private_dns_name_optionsstringThe options for the instance hostname.
ram_disk_idstringThe ID of the RAM disk, if applicable.
secondary_interfacesstringThe secondary interfaces associated with the launch template.
security_group_idsstringThe security group IDs.
security_groupsstringThe security group names.
tag_specificationsstringThe tags that are applied to the resources that are created during instance launch.
user_datastringThe user data for the instance.

Methods

The following methods are available for this resource:

NameAccessible byRequired ParamsOptional ParamsDescription
get_launch_template_dataselectInstanceId, regionDryRunRetrieves the configuration data of the specified instance. You can use this data to create a launch template. This action calls on other describe actions to get instance information. Depending on your instance configuration, you may need to allow the following actions in your IAM policy: DescribeSpotInstanceRequests, DescribeInstanceCreditSpecifications, DescribeVolumes, and DescribeInstanceAttribute. Or, you can allow describe* depending on your instance requirements.

Parameters

Parameters can be passed in the WHERE clause of a query. Check the Methods section to see which parameters are required or optional for each operation.

NameDatatypeDescription
InstanceIdstringThe ID of the instance.
regionstringAWS region (default: us-east-1)
DryRunbooleanChecks 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.

SELECT examples

Retrieves the configuration data of the specified instance. You can use this data to create a launch template. This action calls on other describe actions to get instance information. Depending on your instance configuration, you may need to allow the following actions in your IAM policy: DescribeSpotInstanceRequests, DescribeInstanceCreditSpecifications, DescribeVolumes, and DescribeInstanceAttribute. Or, you can allow describe* depending on your instance requirements.

SELECT
block_device_mappings,
capacity_reservation_specification,
cpu_options,
credit_specification,
disable_api_stop,
disable_api_termination,
ebs_optimized,
elastic_gpu_specifications,
elastic_inference_accelerators,
enclave_options,
hibernation_options,
iam_instance_profile,
image_id,
instance_initiated_shutdown_behavior,
instance_market_options,
instance_requirements,
instance_type,
kernel_id,
key_name,
license_specifications,
maintenance_options,
metadata_options,
monitoring,
network_interfaces,
network_performance_options,
operator,
placement,
private_dns_name_options,
ram_disk_id,
secondary_interfaces,
security_group_ids,
security_groups,
tag_specifications,
user_data
FROM aws.ec2.launch_template_datas
WHERE InstanceId = '{{ InstanceId }}' -- required
AND region = '{{ region }}' -- required
AND DryRun = '{{ DryRun }}'
;