azurerm_ nat_ gateway cost estimation
Managed outbound SNAT for a subnet. Priced per gateway-hour plus per-GB of data processed, with the attached public IP billed separately.
An azurerm_
The gateway itself bills per resource-hour at roughly $0.045/hour (about $32.85/month), running continuously once attached. On top of that, every gigabyte that flows through the gateway is billed at roughly $0.045/GB of data processed. For a quiet subnet the gateway hour dominates; for a high-egress workload the data-processed charge can exceed it.
The third piece is the public IP: a NAT Gateway needs at least one Standard public IP (or an IP prefix), and that azurerm_
Terraform example
A minimal but realistic configuration that C3X can estimate.
resource "azurerm_nat_gateway" "egress" {
name = "subnet-egress"
resource_group_name = azurerm_resource_group.net.name
location = "eastus"
sku_name = "Standard"
}
resource "azurerm_nat_gateway_public_ip_association" "egress" {
nat_gateway_id = azurerm_nat_gateway.egress.id
public_ip_address_id = azurerm_public_ip.nat.id
}Pricing dimensions
What you actually pay for when you provision azurerm_.
| Dimension | Unit | What's being charged |
|---|---|---|
| Gateway hours | per hour | Per-resource hour for the NAT gateway, billed continuously. c3x assumes 730 hours/month. ~$0.045/hour (~$32.85/month) |
| Data processed | per GB | Every GB flowing outbound through the gateway. Usage-based; define expected egress in c3x-usage.yml. ~$0.045/GB |
| Public IP (separate resource) | per hour | A Standard public IP or IP prefix is required and billed as azurerm_ |
Sample C3X output
Example output from c3x estimate (100 GB processed):
azurerm_nat_gateway.egress
├─ Gateway 730 hours $32.85
└─ Data processed 100 GB $4.50
OVERALL TOTAL $37.35
(public IP billed via azurerm_public_ip)Optimization tips
Common ways to reduce azurerm_ cost without changing the workload.
Share one NAT gateway across subnets in a zone
Per duplicate gatewayA single NAT gateway can serve multiple subnets in the same availability zone. Deploying one per subnet multiplies the always-on gateway-hour cost for no benefit.
Route known destinations through service/private endpoints
Data-processed on PaaS trafficTraffic to Azure PaaS services via service endpoints or private endpoints bypasses the NAT gateway, cutting the data-processed charge for that traffic to zero.
Reassess for very low egress workloads
Workload-dependentIf a subnet egresses only a trickle, the ~$33/month gateway plus IP may exceed the value. Basic outbound or a small instance-level IP can be cheaper at tiny scale.
FAQ
How does c3x estimate Azure NAT Gateway cost?
It prices the gateway hour at 730 hours/month and the data-processed dimension from the egress volume you supply in c3x-usage.yml. The required public IP is priced separately as azurerm_
Why does a NAT gateway cost money even with no traffic?
The gateway bills per hour continuously once attached, around $32.85/month, plus the public IP. Data-processed charges are on top of that. There is no scale-to-zero.
Is the public IP included in the gateway price?
No. A NAT gateway requires at least one Standard public IP or IP prefix, which bills separately (about $3.65/month for a static Standard IP). c3x prices it as its own resource.
How can I reduce the data-processed charge?
Route traffic to Azure PaaS services through service or private endpoints, which bypass the NAT gateway. Only traffic that actually transits the gateway is billed per GB.
Can multiple subnets use one gateway?
Yes, within the same availability zone. Consolidating to one gateway per zone, rather than one per subnet, directly reduces the always-on cost.
Related resources
More Azure resources
Further reading
- Azure NAT Gateway cost: hourly fee plus per-GB, like AWS
Azure NAT Gateway charges about $0.045 per hour plus about $0.045 per GB processed, the same shape as the AWS NAT gateway. It is often cheaper and simpler than Azure Firewall for outbound-only needs. Here is how it prices and where it fits.
- Cutting the data transfer bill: a playbook for the invisible line
Data transfer is billed per GB with no resource to point at, which is why it is the hardest line to attribute and the easiest to ignore. Here is how to find the flows, rank them, and cut them, with the per GB rates that matter.
- Azure Firewall cost: the deployment fee is the surprise
Azure Firewall charges a fixed hourly deployment fee (around $1.25/hour, roughly $900/month) plus about $0.016 per GB processed. The always-on hourly fee, not data processing, is what shocks teams. Here is the breakdown and cheaper alternatives.
- Orphaned resource cleanup: reclaiming what nothing uses
Unattached disks, unassociated IPs, empty load balancers, and stale snapshots bill continuously while delivering nothing. A systematic cleanup finds and removes them safely. Here is the guide, resource by resource.
Estimate this resource in your own Terraform
Free, open source, no API key. C3X parses your Terraform and shows line-item cost for every resource, including azurerm_.