NAT Gateway


The natGateway builder creates a NAT Gateway to efficiently manage the SNAT traffic used by resources in a virtual network. By default, it creates a single static public IP for the NAT Gateway, but more IP addresses or prefixes of groups of addresses can be specified.

  • NatGateway (Microsoft.Network/natGateways)

Builder Keywords

Applies ToKeywordPurpose
natGatewaynameName of the NAT Gateway resource
natGatewayidle_timeoutTimeout after which connections that have seen no traffic will be disconnected to free SNAT ports.


#r "nuget:Farmer"

open Farmer
open Farmer.Builders

arm {
    location Location.EastUS
    add_resources [
        natGateway {
            name "my-nat-gateway"
        vnet {
            name "my-net"
            add_address_spaces [ "" ]
            add_subnets [
                subnet {
                    name "my-services"
                    prefix ""
                    nat_gateway (Farmer.Arm.Network.natGateways.resourceId "my-nat-gateway")