Skip to main content

instances_list_only

Lists instances in a region or regions, for all properties use instances

Overview

Nameinstances_list_only
TypeResource
DescriptionResource Type definition for AWS::EC2::Instance
Idaws.ec2.instances_list_only

Fields

NameDatatypeDescription
tenancystringThe tenancy of the instance (if the instance is running in a VPC). An instance with a tenancy of dedicated runs on single-tenant hardware.
security_groupsarraythe names of the security groups. For a nondefault VPC, you must use security group IDs instead.
private_dns_namestringThe private DNS name of the specified instance. For example: ip-10-24-34-0.ec2.internal.
private_ip_addressstring[EC2-VPC] The primary IPv4 address. You must specify a value from the IPv4 address range of the subnet.
user_datastringThe user data to make available to the instance.
block_device_mappingsarrayThe block device mapping entries that defines the block devices to attach to the instance at launch.
iam_instance_profilestringThe IAM instance profile.
ipv6_addressesarray[EC2-VPC] The IPv6 addresses from the range of the subnet to associate with the primary network interface.
kernel_idstringThe ID of the kernel.
subnet_idstring[EC2-VPC] The ID of the subnet to launch the instance into.
ebs_optimizedbooleanIndicates whether the instance is optimized for Amazon EBS I/O.
propagate_tags_to_volume_on_creationbooleanIndicates whether to assign the tags from the instance to all of the volumes attached to the instance at launch. If you specify true and you assign tags to the instance, those tags are automatically assigned to all of the volumes that you attach to the instance at launch. If you specify false, those tags are not assigned to the attached volumes.
elastic_gpu_specificationsarrayAn elastic GPU to associate with the instance.
elastic_inference_acceleratorsarrayAn elastic inference accelerator to associate with the instance.
volumesarrayThe volumes to attach to the instance.
private_ipstringThe private IP address of the specified instance. For example: 10.24.34.0.
ipv6_address_countinteger[EC2-VPC] The number of IPv6 addresses to associate with the primary network interface. Amazon EC2 chooses the IPv6 addresses from the range of your subnet.
launch_templateobjectThe launch template to use to launch the instances.
enclave_optionsobjectIndicates whether the instance is enabled for AWS Nitro Enclaves.
network_interfacesarrayThe network interfaces to associate with the instance.
image_idstringThe ID of the AMI. An AMI ID is required to launch an instance and must be specified here or in a launch template.
instance_typestringThe instance type.
monitoringbooleanSpecifies whether detailed monitoring is enabled for the instance.
tagsarrayThe tags to add to the instance.
additional_infostringThis property is reserved for internal use. If you use it, the stack fails with this error: Bad property set: [Testing this property] (Service: AmazonEC2; Status Code: 400; Error Code: InvalidParameterCombination; Request ID: 0XXXXXX-49c7-4b40-8bcc-76885dcXXXXX).
hibernation_optionsobjectIndicates whether an instance is enabled for hibernation.
license_specificationsarrayThe license configurations.
instance_idstringThe EC2 Instance ID.
public_ipstringThe public IP address of the specified instance. For example: 192.0.2.0.
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).
cpu_optionsobjectThe CPU options for the instance.
availability_zonestringThe Availability Zone of the instance.
private_dns_name_optionsobjectThe options for the instance hostname.
host_idstringIf you specify host for the Affinity property, the ID of a dedicated host that the instance is associated with. If you don't specify an ID, Amazon EC2 launches the instance onto any available, compatible dedicated host in your account.
host_resource_group_arnstringThe ARN of the host resource group in which to launch the instances. If you specify a host resource group ARN, omit the Tenancy parameter or set it to host.
public_dns_namestringThe public DNS name of the specified instance. For example: ec2-107-20-50-45.compute-1.amazonaws.com.
security_group_idsarrayThe IDs of the security groups.
disable_api_terminationbooleanIf you set this parameter to true, you can't terminate the instance using the Amazon EC2 console, CLI, or API; otherwise, you can.
key_namestringThe name of the key pair.
ramdisk_idstringThe ID of the RAM disk to select.
source_dest_checkbooleanSpecifies whether to enable an instance launched in a VPC to perform NAT.
placement_group_namestringThe name of an existing placement group that you want to launch the instance into (cluster | partition | spread).
ssm_associationsarrayThe SSM document and parameter values in AWS Systems Manager to associate with this instance.
vpc_idstringThe ID of the VPC that the instance is running in.
stateobjectThe current state of the instance.
affinitystringIndicates whether the instance is associated with a dedicated host. If you want the instance to always restart on the same host on which it was launched, specify host. If you want the instance to restart on any available host, but try to launch onto the last host it ran on (on a best-effort basis), specify default.
credit_specificationobjectThe credit option for CPU usage of the burstable performance instance. Valid values are standard and unlimited.
regionstringAWS region.

Methods

NameAccessible byRequired Params
list_resourcesSELECTregion

SELECT examples

Lists all instances in a region.

SELECT
region,
instance_id
FROM aws.ec2.instances_list_only
WHERE region = 'us-east-1';

Permissions

For permissions required to operate on the instances_list_only resource, see instances