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, typefrom azure_nat_gateway;
select name, id, provisioning_state, sku_name, typefrom 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_methodfrom azure_nat_gateway as n, azure_public_ip as i, jsonb_array_elements(n.public_ip_addresses) as ipwhere 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_methodfrom azure_nat_gateway as n, azure_public_ip as i, json_each(n.public_ip_addresses) as ipwhere 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_namefrom azure_nat_gateway as n, azure_subnet as s, jsonb_array_elements(n.subnets) as sbwhere sb ->> 'id' = s.id;
select n.name as name, s.name as subnet_name, s.virtual_network_name as virtual_network_namefrom azure_nat_gateway as n, azure_subnet as s, json_each(n.subnets) as sbwhere json_extract(sb.value, '$.id') = s.id;
Query examples
Schema for azure_nat_gateway
Name | Type | Operators | Description |
---|---|---|---|
_ctx | jsonb | Steampipe context in JSON form. | |
akas | jsonb | Array of globally unique identifier strings (also known as) for the resource. | |
cloud_environment | text | The Azure Cloud Environment. | |
etag | text | An unique read-only string that changes whenever the resource is updated. | |
id | text | Contains ID to identify a nat gateway uniquely. | |
idle_timeout_in_minutes | bigint | The idle timeout of the nat gateway. | |
name | text | = | The friendly name that identifies the nat gateway. |
provisioning_state | text | The provisioning state of the nat gateway resource. | |
public_ip_addresses | jsonb | An array of public ip addresses associated with the nat gateway resource. | |
public_ip_prefixes | jsonb | An array of public ip prefixes associated with the nat gateway resource. | |
region | text | The Azure region/location in which the resource is located. | |
resource_group | text | = | The resource group which holds this resource. |
resource_guid | text | The provisioning state of the nat gateway resource. | |
sku_name | text | The nat gateway SKU. | |
sp_connection_name | text | =, !=, ~~, ~~*, !~~, !~~* | Steampipe connection name. |
sp_ctx | jsonb | Steampipe context in JSON form. | |
subnets | jsonb | An array of references to the subnets using this nat gateway resource. | |
subscription_id | text | =, !=, ~~, ~~*, !~~, !~~* | The Azure Subscription ID in which the resource is located. |
tags | jsonb | A map of tags for the resource. | |
title | text | Title of the resource. | |
type | text | The resource type of the nat gateway. | |
zones | jsonb | A 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