steampipe plugin install oci

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,
region
from
oci_core_route_table;
select
display_name,
id,
vcn_id,
time_created,
lifecycle_state as state,
region
from
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_id
from
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_id
from
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 destination
from
oci_core_route_table,
jsonb_array_elements(route_rules) as rt
where
rt ->> 'destination' = '0.0.0.0/0'
select
display_name,
id,
json_extract(rt.value, '$.destination') as destination
from
oci_core_route_table,
json_each(route_rules) as rt
where
json_extract(rt.value, '$.destination') = '0.0.0.0/0'

Schema for oci_core_route_table

NameTypeOperatorsDescription
_ctxjsonbSteampipe context in JSON form.
compartment_idtext=The OCID of the compartment in Tenant in which the resource is located.
defined_tagsjsonbDefined 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_nametext=A user-friendly name. Does not have to be unique, and it's changeable.
freeform_tagsjsonbFree-form tags for resource. This tags can be applied by any user with permissions on the resource.
idtext=The route table's Oracle ID (OCID).
lifecycle_statetext=The route table's current state.
regiontextThe OCI region in which the resource is located.
route_rulesjsonbThe collection of rules for routing destination IPs to network devices.
sp_connection_nametext=, !=, ~~, ~~*, !~~, !~~*Steampipe connection name.
sp_ctxjsonbSteampipe context in JSON form.
tagsjsonbA map of tags for the resource.
tenant_idtext=, !=, ~~, ~~*, !~~, !~~*The OCID of the Tenant in which the resource is located.
tenant_nametextThe name of the Tenant in which the resource is located.
time_createdtimestamp with time zoneThe date and time the route table was created.
titletextTitle of the resource.
vcn_idtext=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