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, tagsfrom oci_core_nat_gateway;
select display_name, id, time_created, lifecycle_state as state, public_ip_id, region, tagsfrom 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_trafficfrom oci_core_nat_gatewaywhere block_traffic;
select display_name, id, block_trafficfrom oci_core_nat_gatewaywhere 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_countfrom oci_core_nat_gatewaygroup by vcn_id;
select vcn_id, count(*) as nat_gateway_countfrom oci_core_nat_gatewaygroup by vcn_id;
Schema for oci_core_nat_gateway
Name | Type | Operators | Description |
---|---|---|---|
_ctx | jsonb | Steampipe context in JSON form. | |
block_traffic | boolean | Specifies whether the NAT gateway blocks traffic through it. | |
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 of the NAT gateway. |
freeform_tags | jsonb | Free-form tags for resource. This tags can be applied by any user with permissions on the resource. | |
id | text | = | The OCID of the NAT gateway. |
lifecycle_state | text | = | The NAT gateway's current state. |
nat_ip | inet | The IP address associated with the NAT gateway. | |
public_ip_id | text | The OCID of the public IP address associated with the NAT gateway. | |
region | text | The OCI region in which the resource is located. | |
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 NAT gateway was created. | |
title | text | Title of the resource. | |
vcn_id | text | = | 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