steampipe plugin install oci

Table: oci_core_nat_gateway - Query OCI Core NAT Gateways using SQL

A NAT Gateway in the Oracle Cloud Infrastructure Core Service is a networking component that enables instances in a private subnet to connect to the internet or other Oracle services, but prevents the internet from initiating connections with those instances. It provides a path for private network resources to access the internet, with the NAT Gateway acting as a public-facing, internet-resolvable IP address. The NAT Gateway ensures that return traffic is directed to the correct resource.

Table Usage Guide

The oci_core_nat_gateway table provides insights into the NAT Gateways within the Oracle Cloud Infrastructure Core Service. As a network engineer or cloud architect, explore NAT Gateway-specific details through this table, including its lifecycle state, block traffic IP address, and associated network details. Utilize it to uncover information about NAT Gateways, such as their associated subnets, the public IP address used, and the verification of their operational status.

Examples

Basic info

Explore which NAT gateways are currently active within your Oracle Cloud Infrastructure. This query can help you assess the state and region of each gateway, as well as any associated tags, providing a comprehensive overview of your network's security and routing configuration.

select
display_name,
id,
time_created,
lifecycle_state as state,
public_ip_id,
region,
tags
from
oci_core_nat_gateway;
select
display_name,
id,
time_created,
lifecycle_state as state,
public_ip_id,
region,
tags
from
oci_core_nat_gateway;

List NAT Gateways that blocks traffic

Determine the areas in which NAT Gateways are blocking traffic to assess potential network bottlenecks or security measures.

select
display_name,
id,
block_traffic
from
oci_core_nat_gateway
where
block_traffic;
select
display_name,
id,
block_traffic
from
oci_core_nat_gateway
where
block_traffic = 1;

Count NAT gateways by VCN

Assess the distribution of NAT gateways across your virtual cloud networks to better understand your network infrastructure and optimize resource allocation.

select
vcn_id,
count(*) as nat_gateway_count
from
oci_core_nat_gateway
group by
vcn_id;
select
vcn_id,
count(*) as nat_gateway_count
from
oci_core_nat_gateway
group by
vcn_id;

Schema for oci_core_nat_gateway

NameTypeOperatorsDescription
_ctxjsonbSteampipe context in JSON form.
block_trafficbooleanSpecifies whether the NAT gateway blocks traffic through it.
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 of the NAT gateway.
freeform_tagsjsonbFree-form tags for resource. This tags can be applied by any user with permissions on the resource.
idtext=The OCID of the NAT gateway.
lifecycle_statetext=The NAT gateway's current state.
nat_ipinetThe IP address associated with the NAT gateway.
public_ip_idtextThe OCID of the public IP address associated with the NAT gateway.
regiontextThe OCI region in which the resource is located.
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 NAT gateway was created.
titletextTitle of the resource.
vcn_idtext=The OCID of the VCN the NAT gateway 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_nat_gateway