Skip to content

aws.ec2.describe_route_tables

Example SQL Queries

SELECT * FROM
aws.ec2.describe_route_tables;

Description

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

Each subnet in your VPC must be associated with a route table. If a subnet is not explicitly associated with any route table, it is implicitly associated with the main route table. This command does not return the subnet ID for implicit associations.

For more information, see Route tables in the Amazon VPC User Guide.

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
filters Input Column

The filters.

  • association.gateway-id - The ID of the gateway involved in the association.

  • association.route-table-association-id - The ID of an association ID for the route table.

  • association.route-table-id - The ID of the route table involved in the association.

  • association.subnet-id - The ID of the subnet involved in the association.

  • association.main - Indicates whether the route table is the main route table for the VPC (true | false). Route tables that do not have an association ID are not returned in the response.

  • owner-id - The ID of the Amazon Web Services account that owns the route table.

  • route-table-id - The ID of the route table.

  • route.destination-cidr-block - The IPv4 CIDR range specified in a route in the table.

  • route.destination-ipv6-cidr-block - The IPv6 CIDR range specified in a route in the route table.

  • route.destination-prefix-list-id - The ID (prefix) of the Amazon Web Services service specified in a route in the table.

  • route.egress-only-internet-gateway-id - The ID of an egress-only Internet gateway specified in a route in the route table.

  • route.gateway-id - The ID of a gateway specified in a route in the table.

  • route.instance-id - The ID of an instance specified in a route in the table.

  • route.nat-gateway-id - The ID of a NAT gateway.

  • route.transit-gateway-id - The ID of a transit gateway.

  • route.origin - Describes how the route was created. CreateRouteTable indicates that the route was automatically created when the route table was created; CreateRoute indicates that the route was manually added to the route table; EnableVgwRoutePropagation indicates that the route was propagated by route propagation.

  • route.state - The state of a route in the route table (active | blackhole). The blackhole state indicates that the route's target isn't available (for example, the specified gateway isn't attached to the VPC, the specified NAT instance has been terminated, and so on).

  • route.vpc-peering-connection-id - The ID of a VPC peering connection specified in a route in the table.

  • 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 for the route table.

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

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

filters[].values[]
route_table_ids Input Column

The IDs of the route tables.

VARCHAR[]
Show child fields
route_table_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
associations

The associations between the route table and your subnets or gateways.

STRUCT(
"main" BOOLEAN,
"route_table_association_id" VARCHAR,
"route_table_id" VARCHAR,
"subnet_id" VARCHAR,
"gateway_id" VARCHAR,
"association_state" STRUCT(
"state" VARCHAR,
"status_message" VARCHAR
)
)[]
Show child fields
associations[]
Show child fields
associations[].association_state

The state of the association.

Show child fields
associations[].association_state.state

The state of the association.

associations[].association_state.status_message

The status message, if applicable.

associations[].gateway_id

The ID of the internet gateway or virtual private gateway.

associations[].main

Indicates whether this is the main route table.

associations[].route_table_association_id

The ID of the association.

associations[].route_table_id

The ID of the route table.

associations[].subnet_id

The ID of the subnet. A subnet ID is not returned for an implicit association.

owner_id

The ID of the Amazon Web Services account that owns the route table.

VARCHAR
propagating_vgws

Any virtual private gateway (VGW) propagating routes.

STRUCT(
"gateway_id" VARCHAR
)[]
Show child fields
propagating_vgws[]
Show child fields
propagating_vgws[].gateway_id

The ID of the virtual private gateway.

route_table_id

The ID of the route table.

VARCHAR
routes

The routes in the route table.

STRUCT(
"destination_cidr_block" VARCHAR,
"destination_ipv6_cidr_block" VARCHAR,
"destination_prefix_list_id" VARCHAR,
"egress_only_internet_gateway_id" VARCHAR,
"gateway_id" VARCHAR,
"instance_id" VARCHAR,
"instance_owner_id" VARCHAR,
"nat_gateway_id" VARCHAR,
"transit_gateway_id" VARCHAR,
"local_gateway_id" VARCHAR,
"carrier_gateway_id" VARCHAR,
"network_interface_id" VARCHAR,
"origin" VARCHAR,
"state" VARCHAR,
"vpc_peering_connection_id" VARCHAR,
"core_network_arn" VARCHAR
)[]
Show child fields
routes[]
Show child fields
routes[].carrier_gateway_id

The ID of the carrier gateway.

routes[].core_network_arn

The Amazon Resource Name (ARN) of the core network.

routes[].destination_cidr_block

The IPv4 CIDR block used for the destination match.

routes[].destination_ipv6_cidr_block

The IPv6 CIDR block used for the destination match.

routes[].destination_prefix_list_id

The prefix of the Amazon Web Services service.

routes[].egress_only_internet_gateway_id

The ID of the egress-only internet gateway.

routes[].gateway_id

The ID of a gateway attached to your VPC.

routes[].instance_id

The ID of a NAT instance in your VPC.

routes[].instance_owner_id

The ID of Amazon Web Services account that owns the instance.

routes[].local_gateway_id

The ID of the local gateway.

routes[].nat_gateway_id

The ID of a NAT gateway.

routes[].network_interface_id

The ID of the network interface.

routes[].origin

Describes how the route was created.

  • CreateRouteTable - The route was automatically created when the route table was created.

  • CreateRoute - The route was manually added to the route table.

  • EnableVgwRoutePropagation - The route was propagated by route propagation.

routes[].state

The state of the route. The blackhole state indicates that the route's target isn't available (for example, the specified gateway isn't attached to the VPC, or the specified NAT instance has been terminated).

routes[].transit_gateway_id

The ID of a transit gateway.

routes[].vpc_peering_connection_id

The ID of a VPC peering connection.

tags

Any tags assigned to the route table.

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.

VARCHAR