Skip to content

aws.lightsail.get_instances

Example SQL Queries

SELECT * FROM
aws.lightsail.get_instances;

Description

Returns information about all Amazon Lightsail virtual private servers, or instances.

Table Definition

Column NameColumn Data Type
_aws_profile Input Column

The AWS profile defines the AWS identity used. It can be defined via credentials or by assuming a IAM role.

STRUCT(
"type" VARCHAR,
"name" VARCHAR,
"account_id" VARCHAR,
"via_profile_name" VARCHAR,
"assumed_role_arn" VARCHAR,
"organization" STRUCT(
"account_name" VARCHAR,
"id" VARCHAR,
"tags" STRUCT(
"key" VARCHAR,
"value" VARCHAR
)[],
"master_account" STRUCT(
"id" VARCHAR,
"email" VARCHAR
),
"parents" STRUCT(
"type" VARCHAR,
"id" VARCHAR,
"name" VARCHAR,
"tags" STRUCT(
"key" VARCHAR,
"value" VARCHAR
)[]
)[]
)
)
Show child fields
_aws_profile.account_id

The AWS account id

_aws_profile.assumed_role_arn

The ARN of the assumed role

_aws_profile.name

The unique name of the profile.

_aws_profile.organization

Information about this profile's membership in the AWS organization.

Show child fields
_aws_profile.organization.account_name

The name of account speciifed by the organization

_aws_profile.organization.id

The organization id

_aws_profile.organization.master_account
Show child fields
_aws_profile.organization.master_account.email

The organization master account email address

_aws_profile.organization.master_account.id

The organization master account id

_aws_profile.organization.parents[]
Show child fields
_aws_profile.organization.parents[].id

The id of the parent

_aws_profile.organization.parents[].name

The name of the parent

_aws_profile.organization.parents[].tags[]
Show child fields
_aws_profile.organization.parents[].tags[].key
_aws_profile.organization.parents[].tags[].value
_aws_profile.organization.parents[].type

The type of parent can be an organization unit or a root

_aws_profile.organization.tags[]
Show child fields
_aws_profile.organization.tags[].key
_aws_profile.organization.tags[].value
_aws_profile.type

The type of profile, either 'credentials' or 'assumed_role'

_aws_profile.via_profile_name

This IAM role for this profile is assumed by first utilizing another profile with this name to obtain credentials.

_aws_region Input Column

The AWS region to use.

VARCHAR
add_ons

An array of objects representing the add-ons enabled on the instance.

STRUCT(
"name" VARCHAR,
"status" VARCHAR,
"snapshot_time_of_day" VARCHAR,
"next_snapshot_time_of_day" VARCHAR,
"threshold" VARCHAR,
"duration" VARCHAR
)[]
Show child fields
add_ons[]
Show child fields
add_ons[].duration

The amount of idle time in minutes after which your virtual computer will automatically stop.

This add-on only applies to Lightsail for Research resources.

add_ons[].name

The name of the add-on.

add_ons[].next_snapshot_time_of_day

The next daily time an automatic snapshot will be created.

The time shown is in HH:00 format, and in Coordinated Universal Time (UTC).

The snapshot is automatically created between the time shown and up to 45 minutes after.

add_ons[].snapshot_time_of_day

The daily time when an automatic snapshot is created.

The time shown is in HH:00 format, and in Coordinated Universal Time (UTC).

The snapshot is automatically created between the time shown and up to 45 minutes after.

add_ons[].status

The status of the add-on.

add_ons[].threshold

The trigger threshold of the action.

This add-on only applies to Lightsail for Research resources.

arn

The Amazon Resource Name (ARN) of the instance (arn:aws:lightsail:us-east-2:123456789101:Instance/244ad76f-8aad-4741-809f-12345EXAMPLE).

VARCHAR
blueprint_id

The blueprint ID (amazon_linux_2023).

VARCHAR
blueprint_name

The friendly name of the blueprint (Amazon Linux 2023).

VARCHAR
bundle_id

The bundle for the instance (micro_x_x).

VARCHAR
created_at

The timestamp when the instance was created (1479734909.17) in Unix time format.

TIMESTAMP_S
hardware

The size of the vCPU and the amount of RAM for the instance.

STRUCT(
"cpu_count" BIGINT,
"disks" STRUCT(
"name" VARCHAR,
"arn" VARCHAR,
"support_code" VARCHAR,
"created_at" TIMESTAMP_S,
"location" STRUCT(
"availability_zone" VARCHAR,
"region_name" VARCHAR
),
"resource_type" VARCHAR,
"tags" STRUCT(
"key" VARCHAR,
"value" VARCHAR
)[],
"add_ons" STRUCT(
"name" VARCHAR,
"status" VARCHAR,
"snapshot_time_of_day" VARCHAR,
"next_snapshot_time_of_day" VARCHAR,
"threshold" VARCHAR,
"duration" VARCHAR
)[],
"size_in_gb" BIGINT,
"is_system_disk" BOOLEAN,
"iops" BIGINT,
"path" VARCHAR,
"state" VARCHAR,
"attached_to" VARCHAR,
"is_attached" BOOLEAN,
"attachment_state" VARCHAR,
"gb_in_use" BIGINT,
"auto_mount_status" VARCHAR
)[],
"ram_size_in_gb" DOUBLE
)
Show child fields
hardware.cpu_count

The number of vCPUs the instance has.

hardware.disks[]
Show child fields
hardware.disks[].add_ons[]
Show child fields
hardware.disks[].add_ons[].duration

The amount of idle time in minutes after which your virtual computer will automatically stop.

This add-on only applies to Lightsail for Research resources.

hardware.disks[].add_ons[].name

The name of the add-on.

hardware.disks[].add_ons[].next_snapshot_time_of_day

The next daily time an automatic snapshot will be created.

The time shown is in HH:00 format, and in Coordinated Universal Time (UTC).

The snapshot is automatically created between the time shown and up to 45 minutes after.

hardware.disks[].add_ons[].snapshot_time_of_day

The daily time when an automatic snapshot is created.

The time shown is in HH:00 format, and in Coordinated Universal Time (UTC).

The snapshot is automatically created between the time shown and up to 45 minutes after.

hardware.disks[].add_ons[].status

The status of the add-on.

hardware.disks[].add_ons[].threshold

The trigger threshold of the action.

This add-on only applies to Lightsail for Research resources.

hardware.disks[].arn

The Amazon Resource Name (ARN) of the disk.

hardware.disks[].attached_to

The resources to which the disk is attached.

hardware.disks[].attachment_state

(Discontinued) The attachment state of the disk.

In releases prior to November 14, 2017, this parameter returned attached for system disks in the API response. It is now discontinued, but still included in the response. Use isAttached instead.

hardware.disks[].auto_mount_status

The status of automatically mounting a storage disk to a virtual computer.

This parameter only applies to Lightsail for Research resources.

hardware.disks[].created_at

The date when the disk was created.

hardware.disks[].gb_in_use

(Discontinued) The number of GB in use by the disk.

In releases prior to November 14, 2017, this parameter was not included in the API response. It is now discontinued.

hardware.disks[].iops

The input/output operations per second (IOPS) of the disk.

hardware.disks[].is_attached

A Boolean value indicating whether the disk is attached.

hardware.disks[].is_system_disk

A Boolean value indicating whether this disk is a system disk (has an operating system loaded on it).

hardware.disks[].location

The AWS Region and Availability Zone where the disk is located.

Show child fields
hardware.disks[].location.availability_zone

The Availability Zone. Follows the format us-east-2a (case-sensitive).

hardware.disks[].location.region_name

The Amazon Web Services Region name.

hardware.disks[].name

The unique name of the disk.

hardware.disks[].path

The disk path.

hardware.disks[].resource_type

The Lightsail resource type (Disk).

hardware.disks[].size_in_gb

The size of the disk in GB.

hardware.disks[].state

Describes the status of the disk.

hardware.disks[].support_code

The support code. Include this code in your email to support when you have questions about an instance or another resource in Lightsail. This code enables our support team to look up your Lightsail information more easily.

hardware.disks[].tags[]
Show child fields
hardware.disks[].tags[].key

The key of the tag.

Constraints: Tag keys accept a maximum of 128 letters, numbers, spaces in UTF-8, or the following characters: + - = . _ :/@

hardware.disks[].tags[].value

The value of the tag.

Constraints: Tag values accept a maximum of 256 letters, numbers, spaces in UTF-8, or the following characters: + - = . _ :/@

hardware.ram_size_in_gb

The amount of RAM in GB on the instance (1.0).

ip_address_type

The IP address type of the instance.

The possible values are ipv4 for IPv4 only, ipv6 for IPv6 only, and dualstack for IPv4 and IPv6.

VARCHAR
ipv6_addresses

The IPv6 addresses of the instance.

VARCHAR[]
Show child fields
ipv6_addresses[]
is_static_ip

A Boolean value indicating whether this instance has a static IP assigned to it.

BOOLEAN
location

The region name and Availability Zone where the instance is located.

STRUCT(
"availability_zone" VARCHAR,
"region_name" VARCHAR
)
Show child fields
location.availability_zone

The Availability Zone. Follows the format us-east-2a (case-sensitive).

location.region_name

The Amazon Web Services Region name.

metadata_options

The metadata options for the Amazon Lightsail instance.

STRUCT(
"state" VARCHAR,
"http_tokens" VARCHAR,
"http_endpoint" VARCHAR,
"http_put_response_hop_limit" BIGINT,
"http_protocol_ipv6" VARCHAR
)
Show child fields
metadata_options.http_endpoint

Indicates whether the HTTP metadata endpoint on your instances is enabled or disabled.

If the value is disabled, you cannot access your instance metadata.

metadata_options.http_protocol_ipv6

Indicates whether the IPv6 endpoint for the instance metadata service is enabled or disabled.

metadata_options.http_put_response_hop_limit

The desired HTTP PUT response hop limit for instance metadata requests. A larger number means that the instance metadata requests can travel farther.

metadata_options.http_tokens

The state of token usage for your instance metadata requests.

If the state is optional, you can choose whether to retrieve instance metadata with 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 by 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 all instance metadata retrieval requests. In this state, retrieving the IAM role credential always returns the version 2.0 credentials. The version 1.0 credentials are not available.

Not all instance blueprints in Lightsail support version 2.0 credentials. Use the MetadataNoToken instance metric to track the number of calls to the instance metadata service that are using version 1.0 credentials. For more information, see Viewing instance metrics in Amazon Lightsail in the Amazon Lightsail Developer Guide.

metadata_options.state

The state of the metadata option changes.

The following states are possible:

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

  • applied - The metadata options have been successfully applied to the instance.

name

The name the user gave the instance (Amazon_Linux_2023-1).

VARCHAR
networking

Information about the public ports and monthly data transfer rates for the instance.

STRUCT(
"monthly_transfer" STRUCT(
"gb_per_month_allocated" BIGINT
),
"ports" STRUCT(
"from_port" BIGINT,
"to_port" BIGINT,
"protocol" VARCHAR,
"access_from" VARCHAR,
"access_type" VARCHAR,
"common_name" VARCHAR,
"access_direction" VARCHAR,
"cidrs" VARCHAR[],
"ipv6_cidrs" VARCHAR[],
"cidr_list_aliases" VARCHAR[]
)[]
)
Show child fields
networking.monthly_transfer

The amount of data in GB allocated for monthly data transfers.

Show child fields
networking.monthly_transfer.gb_per_month_allocated

The amount allocated per month (in GB).

networking.ports[]
Show child fields
networking.ports[].access_direction

The access direction (inbound or outbound).

Lightsail currently supports only inbound access direction.

networking.ports[].access_from

The location from which access is allowed. For example, Anywhere (0.0.0.0/0), or Custom if a specific IP address or range of IP addresses is allowed.

networking.ports[].access_type

The type of access (Public or Private).

networking.ports[].cidr_list_aliases[]
networking.ports[].cidrs[]
networking.ports[].common_name

The common name of the port information.

networking.ports[].from_port

The first port in a range of open ports on an instance.

Allowed ports:

  • TCP and UDP - 0 to 65535

  • ICMP - The ICMP type for IPv4 addresses. For example, specify 8 as the fromPort (ICMP type), and -1 as the toPort (ICMP code), to enable ICMP Ping. For more information, see Control Messages on Wikipedia.

  • ICMPv6 - The ICMP type for IPv6 addresses. For example, specify 128 as the fromPort (ICMPv6 type), and 0 as toPort (ICMPv6 code). For more information, see Internet Control Message Protocol for IPv6.

networking.ports[].ipv6_cidrs[]
networking.ports[].protocol

The IP protocol name.

The name can be one of the following:

  • tcp - Transmission Control Protocol (TCP) provides reliable, ordered, and error-checked delivery of streamed data between applications running on hosts communicating by an IP network. If you have an application that doesn't require reliable data stream service, use UDP instead.

  • all - All transport layer protocol types. For more general information, see Transport layer on Wikipedia.

  • udp - With User Datagram Protocol (UDP), computer applications can send messages (or datagrams) to other hosts on an Internet Protocol (IP) network. Prior communications are not required to set up transmission channels or data paths. Applications that don't require reliable data stream service can use UDP, which provides a connectionless datagram service that emphasizes reduced latency over reliability. If you do require reliable data stream service, use TCP instead.

  • icmp - Internet Control Message Protocol (ICMP) is used to send error messages and operational information indicating success or failure when communicating with an instance. For example, an error is indicated when an instance could not be reached. When you specify icmp as the protocol, you must specify the ICMP type using the fromPort parameter, and ICMP code using the toPort parameter.

  • icmp6 - Internet Control Message Protocol (ICMP) for IPv6. When you specify icmp6 as the protocol, you must specify the ICMP type using the fromPort parameter, and ICMP code using the toPort parameter.

networking.ports[].to_port

The last port in a range of open ports on an instance.

Allowed ports:

  • TCP and UDP - 0 to 65535

  • ICMP - The ICMP code for IPv4 addresses. For example, specify 8 as the fromPort (ICMP type), and -1 as the toPort (ICMP code), to enable ICMP Ping. For more information, see Control Messages on Wikipedia.

  • ICMPv6 - The ICMP code for IPv6 addresses. For example, specify 128 as the fromPort (ICMPv6 type), and 0 as toPort (ICMPv6 code). For more information, see Internet Control Message Protocol for IPv6.

private_ip_address

The private IP address of the instance.

VARCHAR
public_ip_address

The public IP address of the instance.

VARCHAR
resource_type

The type of resource (usually Instance).

VARCHAR
ssh_key_name

The name of the SSH key being used to connect to the instance (LightsailDefaultKeyPair).

VARCHAR
state

The status code and the state (running) for the instance.

STRUCT(
"code" BIGINT,
"name" VARCHAR
)
Show child fields
state.code

The status code for the instance.

state.name

The state of the instance (running or pending).

support_code

The support code. Include this code in your email to support when you have questions about an instance or another resource in Lightsail. This code enables our support team to look up your Lightsail information more easily.

VARCHAR
tags

The tag keys and optional values for the resource. For more information about tags in Lightsail, see the Amazon Lightsail Developer Guide.

STRUCT(
"key" VARCHAR,
"value" VARCHAR
)[]
Show child fields
tags[]
Show child fields
tags[].key

The key of the tag.

Constraints: Tag keys accept a maximum of 128 letters, numbers, spaces in UTF-8, or the following characters: + - = . _ :/@

tags[].value

The value of the tag.

Constraints: Tag values accept a maximum of 256 letters, numbers, spaces in UTF-8, or the following characters: + - = . _ :/@

username

The user name for connecting to the instance (ec2-user).

VARCHAR