Skip to content

aws.ec2.describe_nat_gateways

Example SQL Queries

SELECT * FROM
aws.ec2.describe_nat_gateways;

Description

Describes your NAT gateways. The default is to describe all your NAT gateways. Alternatively, you can specify specific NAT gateway IDs or filter the results to include only the NAT gateways that match specific criteria.

Table Definition

Column NameColumn Data Type
dry_run Input Column

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.

BOOLEAN
filter Input Column

The filters.

  • nat-gateway-id - The ID of the NAT gateway.

  • state - The state of the NAT gateway (pending | failed | available | deleting | deleted).

  • subnet-id - The ID of the subnet in which the NAT gateway resides.

  • tag:<key> - The key/value combination of a tag assigned to the resource. Use the tag key in the filter name and the tag value as the filter value. For example, to find all resources that have a tag with the key Owner and the value TeamA, specify tag:Owner for the filter name and TeamA for the filter value.

  • tag-key - The key of a tag assigned to the resource. Use this filter to find all resources assigned a tag with a specific key, regardless of the tag value.

  • vpc-id - The ID of the VPC in which the NAT gateway resides.

STRUCT(
"name" VARCHAR,
"values" VARCHAR[]
)[]
Show child fields
filter[]
Show child fields
filter[].name

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

filter[].values[]
nat_gateway_ids Input Column

The IDs of the NAT gateways.

VARCHAR[]
Show child fields
nat_gateway_ids[]
_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
connectivity_type

Indicates whether the NAT gateway supports public or private connectivity.

VARCHAR
create_time

The date and time the NAT gateway was created.

TIMESTAMP_S
delete_time

The date and time the NAT gateway was deleted, if applicable.

TIMESTAMP_S
failure_code

If the NAT gateway could not be created, specifies the error code for the failure. (InsufficientFreeAddressesInSubnet | Gateway.NotAttached | InvalidAllocationID.NotFound | Resource.AlreadyAssociated | InternalError | InvalidSubnetID.NotFound)

VARCHAR
failure_message

If the NAT gateway could not be created, specifies the error message for the failure, that corresponds to the error code.

  • For InsufficientFreeAddressesInSubnet: "Subnet has insufficient free addresses to create this NAT gateway"

  • For Gateway.NotAttached: "Network vpc-xxxxxxxx has no Internet gateway attached"

  • For InvalidAllocationID.NotFound: "Elastic IP address eipalloc-xxxxxxxx could not be associated with this NAT gateway"

  • For Resource.AlreadyAssociated: "Elastic IP address eipalloc-xxxxxxxx is already associated"

  • For InternalError: "Network interface eni-xxxxxxxx, created and used internally by this NAT gateway is in an invalid state. Please try again."

  • For InvalidSubnetID.NotFound: "The specified subnet subnet-xxxxxxxx does not exist or could not be found."

VARCHAR
nat_gateway_addresses

Information about the IP addresses and network interface associated with the NAT gateway.

STRUCT(
"allocation_id" VARCHAR,
"network_interface_id" VARCHAR,
"private_ip" VARCHAR,
"public_ip" VARCHAR,
"association_id" VARCHAR,
"is_primary" BOOLEAN,
"failure_message" VARCHAR,
"status" VARCHAR
)[]
Show child fields
nat_gateway_addresses[]
Show child fields
nat_gateway_addresses[].allocation_id

[Public NAT gateway only] The allocation ID of the Elastic IP address that's associated with the NAT gateway.

nat_gateway_addresses[].association_id

[Public NAT gateway only] The association ID of the Elastic IP address that's associated with the NAT gateway.

nat_gateway_addresses[].failure_message

The address failure message.

nat_gateway_addresses[].is_primary

Defines if the IP address is the primary address.

nat_gateway_addresses[].network_interface_id

The ID of the network interface associated with the NAT gateway.

nat_gateway_addresses[].private_ip

The private IP address associated with the NAT gateway.

nat_gateway_addresses[].public_ip

[Public NAT gateway only] The Elastic IP address associated with the NAT gateway.

nat_gateway_addresses[].status

The address status.

nat_gateway_id

The ID of the NAT gateway.

VARCHAR
provisioned_bandwidth

Reserved. If you need to sustain traffic greater than the documented limits, contact Amazon Web Services Support.

STRUCT(
"provision_time" TIMESTAMP_S,
"provisioned" VARCHAR,
"request_time" TIMESTAMP_S,
"requested" VARCHAR,
"status" VARCHAR
)
Show child fields
provisioned_bandwidth.provision_time

Reserved.

provisioned_bandwidth.provisioned

Reserved.

provisioned_bandwidth.request_time

Reserved.

provisioned_bandwidth.requested

Reserved.

provisioned_bandwidth.status

Reserved.

state

The state of the NAT gateway.

  • pending: The NAT gateway is being created and is not ready to process traffic.

  • failed: The NAT gateway could not be created. Check the failureCode and failureMessage fields for the reason.

  • available: The NAT gateway is able to process traffic. This status remains until you delete the NAT gateway, and does not indicate the health of the NAT gateway.

  • deleting: The NAT gateway is in the process of being terminated and may still be processing traffic.

  • deleted: The NAT gateway has been terminated and is no longer processing traffic.

VARCHAR
subnet_id

The ID of the subnet in which the NAT gateway is located.

VARCHAR
tags

The tags for the NAT gateway.

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

The key of the tag.

Constraints: Tag keys are case-sensitive and accept a maximum of 127 Unicode characters. May not begin with aws:.

tags[].value

The value of the tag.

Constraints: Tag values are case-sensitive and accept a maximum of 256 Unicode characters.

vpc_id

The ID of the VPC in which the NAT gateway is located.

VARCHAR