turbot/alicloud
steampipe plugin install alicloud

Table: alicloud_vpc_route_table

A route table contains a set of rules, called routes, that are used to determine where network traffic from your subnet or gateway is directed.

Examples

Basic info

This query is used to gain insights into the configuration of your Alicloud Virtual Private Cloud (VPC) by examining the details of its routing tables. It can be particularly useful in managing network traffic and ensuring optimal routing strategies within your VPC environment.

select
name,
route_table_id,
description,
route_table_type,
router_id,
region
from
alicloud_vpc_route_table;
select
name,
route_table_id,
description,
route_table_type,
router_id,
region
from
alicloud_vpc_route_table;

Get VPC and VSwitch attachment info for each route table

Explore the relationships between your virtual private cloud (VPC) and virtual switch (VSwitch) by understanding their attachment details for each route table. This can be particularly useful in managing network routing and ensuring efficient data traffic within your cloud environment.

select
name,
route_table_id,
vpc_id,
jsonb_array_elements_text(vswitch_ids)
from
alicloud_vpc_route_table;
select
name,
route_table_id,
vpc_id,
json_each.value
from
alicloud_vpc_route_table,
json_each(vswitch_ids);

Routing details for each route table

Explore the intricate details of your network routing configurations. This query can help you understand how data is being directed across your network, which can be critical for troubleshooting connectivity issues or optimizing network performance.

select
route_table_id,
route_detail ->> 'Description' as description,
route_detail ->> 'DestinationCidrBlock' as destination_CIDR_block,
route_detail ->> 'InstanceId' as instance_id,
route_detail ->> 'IpVersion' as ip_version,
route_detail ->> 'NextHopOppsiteInstanceId' as next_hop_oppsite_instance_id,
route_detail ->> 'NextHopOppsiteRegionId' as next_hop_oppsite_region_id,
route_detail ->> 'NextHopOppsiteType' as next_hop_oppsite_type,
route_detail ->> 'NextHopRegionId' as next_hop_region_id,
route_detail ->> 'NextHopType' as next_hop_type,
route_detail ->> 'RouteEntryId' as route_entry_id,
route_detail ->> 'RouteEntryName' as route_entry_name,
route_detail ->> 'RouteTableId' as route_table_id,
route_detail ->> 'Status' as status
from
alicloud_vpc_route_table,
jsonb_array_elements(route_entries) as route_detail;
select
route_table_id,
json_extract(route_detail.value, '$.Description') as description,
json_extract(route_detail.value, '$.DestinationCidrBlock') as destination_CIDR_block,
json_extract(route_detail.value, '$.InstanceId') as instance_id,
json_extract(route_detail.value, '$.IpVersion') as ip_version,
json_extract(route_detail.value, '$.NextHopOppsiteInstanceId') as next_hop_oppsite_instance_id,
json_extract(route_detail.value, '$.NextHopOppsiteRegionId') as next_hop_oppsite_region_id,
json_extract(route_detail.value, '$.NextHopOppsiteType') as next_hop_oppsite_type,
json_extract(route_detail.value, '$.NextHopRegionId') as next_hop_region_id,
json_extract(route_detail.value, '$.NextHopType') as next_hop_type,
json_extract(route_detail.value, '$.RouteEntryId') as route_entry_id,
json_extract(route_detail.value, '$.RouteEntryName') as route_entry_name,
json_extract(route_detail.value, '$.RouteTableId') as route_table_id,
json_extract(route_detail.value, '$.Status') as status
from
alicloud_vpc_route_table,
json_each(route_entries) as route_detail;

List route tables without application tag key

Determine the areas in which route tables lack an application tag key. This can be useful for identifying potential gaps in your tagging strategy, ensuring that all resources are correctly tagged for better management and organization.

select
name,
route_table_id
from
alicloud_vpc_route_table
where
not tags :: JSONB ? 'application';
select
name,
route_table_id
from
alicloud_vpc_route_table
where
json_extract(tags, '$.application') is null;

Schema for alicloud_vpc_route_table

NameTypeOperatorsDescription
_ctxjsonbSteampipe context in JSON form.
account_idtext=, !=, ~~, ~~*, !~~, !~~*The Alicloud Account ID in which the resource is located.
akasjsonbArray of globally unique identifier strings (also known as) for the resource.
creation_timetimestamp with time zoneThe time when the Route Table was created.
descriptiontextThe description of the Route Table.
nametextThe name of the Route Table.
owner_idtextThe ID of the owner of the VPC.
regiontextThe Alicloud region in which the resource is located.
resource_group_idtextThe ID of the resource group to which the VPC belongs.
route_entriesjsonbRoute entry represents a route item of one VPC route table.
route_table_idtext=The id of the Route Table.
route_table_typetextThe type of Route Table.
router_idtextThe ID of the region to which the VPC belongs.
router_typetextThe type of the VRouter to which the route table belongs. Valid Values are 'VRouter' and 'VBR'.
sp_connection_nametext=, !=, ~~, ~~*, !~~, !~~*Steampipe connection name.
sp_ctxjsonbSteampipe context in JSON form.
statustextThe status of the route table.
tagsjsonbA map of tags for the resource.
tags_srcjsonbA list of tags assigned to the resource.
titletextTitle of the resource.
vpc_idtextThe ID of the VPC to which the route table belongs.
vswitch_idsjsonbThe unique ID of the VPC.

Export

This table is available as a standalone Exporter CLI. Steampipe exporters are stand-alone binaries that allow you to extract data using Steampipe plugins without a database.

You can download the tarball for your platform from the Releases page, but it is simplest to install them with the steampipe_export_installer.sh script:

/bin/sh -c "$(curl -fsSL https://steampipe.io/install/export.sh)" -- alicloud

You can pass the configuration to the command with the --config argument:

steampipe_export_alicloud --config '<your_config>' alicloud_vpc_route_table