Table: oci_core_route_table - Query OCI Core Route Tables using SQL
The OCI Core Route Table is a virtual table in Oracle Cloud Infrastructure (OCI) that enables network traffic routing within a Virtual Cloud Network (VCN). It contains rules that determine where network traffic is directed. Each subnet in a VCN uses a route table to direct outgoing traffic.
Table Usage Guide
The oci_core_route_table
table provides insights into the route tables within Oracle Cloud Infrastructure's Core Networking service. As a network engineer, you can explore route table-specific details through this table, including associated rules, route targets, and associated metadata. Utilize it to uncover information about route tables, such as those with specific rules, the targets of each route, and the verification of route targets.
Examples
Basic info
Explore which routes are active within your network by identifying their creation time and regional distribution. This can help understand the network's structure and management, and optimize its performance.
select display_name, id, vcn_id, time_created, lifecycle_state as state, regionfrom oci_core_route_table;
select display_name, id, vcn_id, time_created, lifecycle_state as state, regionfrom oci_core_route_table;
Get routing details for each route table
Explore the routing details for each network route, gaining insights into their destination types and associated network entities. This is useful in identifying potential network bottlenecks and understanding the network's architecture.
select display_name, id, rt ->> 'cidrBlock' as cidr_block, rt ->> 'description' as description, rt ->> 'destination' as destination, rt ->> 'destinationType' as destination_type, rt ->> 'networkEntityId' as network_entity_idfrom oci_core_route_table, jsonb_array_elements(route_rules) as rt;
select display_name, id, json_extract(rt.value, '$.cidrBlock') as cidr_block, json_extract(rt.value, '$.description') as description, json_extract(rt.value, '$.destination') as destination, json_extract(rt.value, '$.destinationType') as destination_type, json_extract(rt.value, '$.networkEntityId') as network_entity_idfrom oci_core_route_table, json_each(route_rules) as rt;
List route tables with routes directed to the Internet
Explore which route tables have routes directed to the Internet. This is particularly helpful for assessing potential security risks and ensuring correct data routing configurations.
select display_name, id, rt ->> 'destination' as destinationfrom oci_core_route_table, jsonb_array_elements(route_rules) as rtwhere rt ->> 'destination' = '0.0.0.0/0'
select display_name, id, json_extract(rt.value, '$.destination') as destinationfrom oci_core_route_table, json_each(route_rules) as rtwhere json_extract(rt.value, '$.destination') = '0.0.0.0/0'
Schema for oci_core_route_table
Name | Type | Operators | Description |
---|---|---|---|
_ctx | jsonb | Steampipe context in JSON form. | |
compartment_id | text | = | The OCID of the compartment in Tenant in which the resource is located. |
defined_tags | jsonb | Defined tags for resource. Defined tags are set up in your tenancy by an administrator. Only users granted permission to work with the defined tags can apply them to resources. | |
display_name | text | = | A user-friendly name. Does not have to be unique, and it's changeable. |
freeform_tags | jsonb | Free-form tags for resource. This tags can be applied by any user with permissions on the resource. | |
id | text | = | The route table's Oracle ID (OCID). |
lifecycle_state | text | = | The route table's current state. |
region | text | The OCI region in which the resource is located. | |
route_rules | jsonb | The collection of rules for routing destination IPs to network devices. | |
sp_connection_name | text | =, !=, ~~, ~~*, !~~, !~~* | Steampipe connection name. |
sp_ctx | jsonb | Steampipe context in JSON form. | |
tags | jsonb | A map of tags for the resource. | |
tenant_id | text | =, !=, ~~, ~~*, !~~, !~~* | The OCID of the Tenant in which the resource is located. |
tenant_name | text | The name of the Tenant in which the resource is located. | |
time_created | timestamp with time zone | The date and time the route table was created. | |
title | text | Title of the resource. | |
vcn_id | text | = | The OCID of the VCN the route table list belongs to. |
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)" -- oci
You can pass the configuration to the command with the --config
argument:
steampipe_export_oci --config '<your_config>' oci_core_route_table