steampipe plugin install azure

Table: azure_nat_gateway - Query Azure NAT Gateways using SQL

Azure NAT Gateway is a service within Microsoft Azure that simplifies outbound-only internet connectivity for virtual networks. When configured on a subnet, all outbound connectivity uses your specified static public IP addresses. Overcome the challenges of outbound connectivity from your virtual networks with Azure NAT Gateway.

Table Usage Guide

The azure_nat_gateway table provides insights into NAT Gateways within Microsoft Azure. As a Network Administrator, you can explore details about each NAT Gateway, including its configuration, associated resources, and status. Use this table to ensure your network's outbound connectivity is correctly routed and to quickly identify any potential issues.

Examples

Basic info

Explore the status and details of your Azure NAT Gateway configurations to understand their current state and type. This is beneficial for auditing and managing your network resources effectively.

select
name,
id,
provisioning_state,
sku_name,
type
from
azure_nat_gateway;
select
name,
id,
provisioning_state,
sku_name,
type
from
azure_nat_gateway;

List public IP address details for each nat gateway

Identify the public IP address details linked with each network address translation (NAT) gateway. This can help in managing network traffic and understanding the allocation method and IP version of each public IP address.

select
n.name,
i.ip_address as ip_address,
i.ip_configuration_id as ip_configuration_id,
i.public_ip_address_version as public_ip_address_version,
i.public_ip_allocation_method as public_ip_allocation_method
from
azure_nat_gateway as n,
azure_public_ip as i,
jsonb_array_elements(n.public_ip_addresses) as ip
where
ip ->> 'id' = i.id;
select
n.name,
i.ip_address as ip_address,
i.ip_configuration_id as ip_configuration_id,
i.public_ip_address_version as public_ip_address_version,
i.public_ip_allocation_method as public_ip_allocation_method
from
azure_nat_gateway as n,
azure_public_ip as i,
json_each(n.public_ip_addresses) as ip
where
json_extract(ip.value, '$.id') = i.id;

List subnet details associated with each nat gateway

Explore the connection between NAT gateways and their associated subnets in your Azure environment. This helps in understanding network flow and can assist in troubleshooting connectivity issues.

select
n.name as name,
s.name as subnet_name,
s.virtual_network_name as virtual_network_name
from
azure_nat_gateway as n,
azure_subnet as s,
jsonb_array_elements(n.subnets) as sb
where
sb ->> 'id' = s.id;
select
n.name as name,
s.name as subnet_name,
s.virtual_network_name as virtual_network_name
from
azure_nat_gateway as n,
azure_subnet as s,
json_each(n.subnets) as sb
where
json_extract(sb.value, '$.id') = s.id;

Schema for azure_nat_gateway

NameTypeOperatorsDescription
_ctxjsonbSteampipe context in JSON form.
akasjsonbArray of globally unique identifier strings (also known as) for the resource.
cloud_environmenttextThe Azure Cloud Environment.
etagtextAn unique read-only string that changes whenever the resource is updated.
idtextContains ID to identify a nat gateway uniquely.
idle_timeout_in_minutesbigintThe idle timeout of the nat gateway.
nametext=The friendly name that identifies the nat gateway.
provisioning_statetextThe provisioning state of the nat gateway resource.
public_ip_addressesjsonbAn array of public ip addresses associated with the nat gateway resource.
public_ip_prefixesjsonbAn array of public ip prefixes associated with the nat gateway resource.
regiontextThe Azure region/location in which the resource is located.
resource_grouptext=The resource group which holds this resource.
resource_guidtextThe provisioning state of the nat gateway resource.
sku_nametextThe nat gateway SKU.
sp_connection_nametext=, !=, ~~, ~~*, !~~, !~~*Steampipe connection name.
sp_ctxjsonbSteampipe context in JSON form.
subnetsjsonbAn array of references to the subnets using this nat gateway resource.
subscription_idtext=, !=, ~~, ~~*, !~~, !~~*The Azure Subscription ID in which the resource is located.
tagsjsonbA map of tags for the resource.
titletextTitle of the resource.
typetextThe resource type of the nat gateway.
zonesjsonbA list of availability zones denoting the zone in which Nat Gateway should be deployed.

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)" -- azure

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

steampipe_export_azure --config '<your_config>' azure_nat_gateway