azurerm_ virtual_ network cost estimation
A virtual network is free. The address space, subnets, and the network itself cost nothing. The bill comes from the paid resources you run inside it and the traffic it carries.
An azurerm_
The cost of a VNet is the paid infrastructure attached to it and the traffic that crosses its boundaries. The usual drivers are VNet peering (billed per GB in both directions, and much more expensive across regions), NAT Gateway (an hourly charge plus per-GB processing), VPN and ExpressRoute gateways (a fixed hourly charge per gateway), private endpoints, and outbound data transfer to the internet or across regions. A VNet with private subnets almost always pairs with at least one NAT Gateway or gateway, so the free network quietly anchors a recurring bill.
The high-value VNet cost decisions are architectural: whether you peer across regions (expensive) or keep chatty workloads in one region, whether you route egress through a NAT Gateway versus a firewall, and how many gateways you provision. c3x prices the NAT Gateways, gateways, public IPs, and peering traffic attached to your network and treats the VNet, its address space, and subnets as the free scaffolding they are.
Terraform example
A minimal but realistic configuration that C3X can estimate.
resource "azurerm_resource_group" "main" {
name = "network-rg"
location = "eastus"
}
resource "azurerm_virtual_network" "main" {
name = "main-vnet"
resource_group_name = azurerm_resource_group.main.name
location = azurerm_resource_group.main.location
address_space = ["10.0.0.0/16"]
subnet {
name = "app"
address_prefixes = ["10.0.1.0/24"]
}
}Pricing dimensions
What you actually pay for when you provision azurerm_.
| Dimension | Unit | What's being charged |
|---|---|---|
| Virtual network and subnets | free | The VNet, its address space, subnets, and intra-VNet traffic have no charge. $0 |
| VNet peering traffic | per GB | Data sent between peered VNets is billed both ways, and cross-region peering costs several times more than same-region. ~$0.01/GB in and out for same-region peering |
| NAT Gateway or gateway (typical inside) | per hour + per GB | A NAT Gateway, VPN gateway, or ExpressRoute gateway is the most common paid attachment on a VNet with private egress. NAT Gateway: ~$0.045/hour + $0.045/GB processed |
| Outbound data transfer | per GB | Egress to the internet and cross-region traffic generated by resources in the VNet. |
Optimization tips
Common ways to reduce azurerm_ cost without changing the workload.
Keep chatty workloads in one region
Cross-region VNet peering is billed per GB each way at a much higher rate than same-region peering. Colocating services that talk frequently removes that transfer charge.
Share one NAT Gateway across subnets
~$32/month per gateway removedA single NAT Gateway can serve multiple subnets in a region. Consolidating outbound paths avoids paying the hourly charge for several gateways.
Use service endpoints instead of routing PaaS traffic out
Free service endpoints keep traffic to Azure Storage, SQL, and Key Vault on the Azure backbone, off the NAT Gateway and off metered egress.
FAQ
Does an Azure virtual network cost money?
No. The VNet, its address space, subnets, and traffic within the same VNet are all free. Cost comes from paid attachments like NAT Gateways, VPN and ExpressRoute gateways, peering traffic, and outbound data transfer.
What is usually the biggest cost tied to a VNet?
Gateways and cross-boundary traffic. A NAT Gateway or VPN gateway bills hourly, and VNet peering plus internet egress add per-GB charges that scale with usage, especially across regions.
Is VNet peering free?
The peering link has no fixed fee, but data that crosses it is billed per GB in both directions. Same-region peering is inexpensive; cross-region peering is several times more, so it is a real cost driver.
Related resources
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_.