1. Packages
  2. Google Cloud (GCP) Classic
  3. API Docs
  4. compute
  5. RouterNat
Google Cloud Classic v7.29.0 published on Wednesday, Jun 26, 2024 by Pulumi

gcp.compute.RouterNat

Explore with Pulumi AI

gcp logo
Google Cloud Classic v7.29.0 published on Wednesday, Jun 26, 2024 by Pulumi

    A NAT service created in a router.

    To get more information about RouterNat, see:

    Example Usage

    Router Nat Basic

    import * as pulumi from "@pulumi/pulumi";
    import * as gcp from "@pulumi/gcp";
    
    const net = new gcp.compute.Network("net", {name: "my-network"});
    const subnet = new gcp.compute.Subnetwork("subnet", {
        name: "my-subnetwork",
        network: net.id,
        ipCidrRange: "10.0.0.0/16",
        region: "us-central1",
    });
    const router = new gcp.compute.Router("router", {
        name: "my-router",
        region: subnet.region,
        network: net.id,
        bgp: {
            asn: 64514,
        },
    });
    const nat = new gcp.compute.RouterNat("nat", {
        name: "my-router-nat",
        router: router.name,
        region: router.region,
        natIpAllocateOption: "AUTO_ONLY",
        sourceSubnetworkIpRangesToNat: "ALL_SUBNETWORKS_ALL_IP_RANGES",
        logConfig: {
            enable: true,
            filter: "ERRORS_ONLY",
        },
    });
    
    import pulumi
    import pulumi_gcp as gcp
    
    net = gcp.compute.Network("net", name="my-network")
    subnet = gcp.compute.Subnetwork("subnet",
        name="my-subnetwork",
        network=net.id,
        ip_cidr_range="10.0.0.0/16",
        region="us-central1")
    router = gcp.compute.Router("router",
        name="my-router",
        region=subnet.region,
        network=net.id,
        bgp=gcp.compute.RouterBgpArgs(
            asn=64514,
        ))
    nat = gcp.compute.RouterNat("nat",
        name="my-router-nat",
        router=router.name,
        region=router.region,
        nat_ip_allocate_option="AUTO_ONLY",
        source_subnetwork_ip_ranges_to_nat="ALL_SUBNETWORKS_ALL_IP_RANGES",
        log_config=gcp.compute.RouterNatLogConfigArgs(
            enable=True,
            filter="ERRORS_ONLY",
        ))
    
    package main
    
    import (
    	"github.com/pulumi/pulumi-gcp/sdk/v7/go/gcp/compute"
    	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
    )
    
    func main() {
    	pulumi.Run(func(ctx *pulumi.Context) error {
    		net, err := compute.NewNetwork(ctx, "net", &compute.NetworkArgs{
    			Name: pulumi.String("my-network"),
    		})
    		if err != nil {
    			return err
    		}
    		subnet, err := compute.NewSubnetwork(ctx, "subnet", &compute.SubnetworkArgs{
    			Name:        pulumi.String("my-subnetwork"),
    			Network:     net.ID(),
    			IpCidrRange: pulumi.String("10.0.0.0/16"),
    			Region:      pulumi.String("us-central1"),
    		})
    		if err != nil {
    			return err
    		}
    		router, err := compute.NewRouter(ctx, "router", &compute.RouterArgs{
    			Name:    pulumi.String("my-router"),
    			Region:  subnet.Region,
    			Network: net.ID(),
    			Bgp: &compute.RouterBgpArgs{
    				Asn: pulumi.Int(64514),
    			},
    		})
    		if err != nil {
    			return err
    		}
    		_, err = compute.NewRouterNat(ctx, "nat", &compute.RouterNatArgs{
    			Name:                          pulumi.String("my-router-nat"),
    			Router:                        router.Name,
    			Region:                        router.Region,
    			NatIpAllocateOption:           pulumi.String("AUTO_ONLY"),
    			SourceSubnetworkIpRangesToNat: pulumi.String("ALL_SUBNETWORKS_ALL_IP_RANGES"),
    			LogConfig: &compute.RouterNatLogConfigArgs{
    				Enable: pulumi.Bool(true),
    				Filter: pulumi.String("ERRORS_ONLY"),
    			},
    		})
    		if err != nil {
    			return err
    		}
    		return nil
    	})
    }
    
    using System.Collections.Generic;
    using System.Linq;
    using Pulumi;
    using Gcp = Pulumi.Gcp;
    
    return await Deployment.RunAsync(() => 
    {
        var net = new Gcp.Compute.Network("net", new()
        {
            Name = "my-network",
        });
    
        var subnet = new Gcp.Compute.Subnetwork("subnet", new()
        {
            Name = "my-subnetwork",
            Network = net.Id,
            IpCidrRange = "10.0.0.0/16",
            Region = "us-central1",
        });
    
        var router = new Gcp.Compute.Router("router", new()
        {
            Name = "my-router",
            Region = subnet.Region,
            Network = net.Id,
            Bgp = new Gcp.Compute.Inputs.RouterBgpArgs
            {
                Asn = 64514,
            },
        });
    
        var nat = new Gcp.Compute.RouterNat("nat", new()
        {
            Name = "my-router-nat",
            Router = router.Name,
            Region = router.Region,
            NatIpAllocateOption = "AUTO_ONLY",
            SourceSubnetworkIpRangesToNat = "ALL_SUBNETWORKS_ALL_IP_RANGES",
            LogConfig = new Gcp.Compute.Inputs.RouterNatLogConfigArgs
            {
                Enable = true,
                Filter = "ERRORS_ONLY",
            },
        });
    
    });
    
    package generated_program;
    
    import com.pulumi.Context;
    import com.pulumi.Pulumi;
    import com.pulumi.core.Output;
    import com.pulumi.gcp.compute.Network;
    import com.pulumi.gcp.compute.NetworkArgs;
    import com.pulumi.gcp.compute.Subnetwork;
    import com.pulumi.gcp.compute.SubnetworkArgs;
    import com.pulumi.gcp.compute.Router;
    import com.pulumi.gcp.compute.RouterArgs;
    import com.pulumi.gcp.compute.inputs.RouterBgpArgs;
    import com.pulumi.gcp.compute.RouterNat;
    import com.pulumi.gcp.compute.RouterNatArgs;
    import com.pulumi.gcp.compute.inputs.RouterNatLogConfigArgs;
    import java.util.List;
    import java.util.ArrayList;
    import java.util.Map;
    import java.io.File;
    import java.nio.file.Files;
    import java.nio.file.Paths;
    
    public class App {
        public static void main(String[] args) {
            Pulumi.run(App::stack);
        }
    
        public static void stack(Context ctx) {
            var net = new Network("net", NetworkArgs.builder()
                .name("my-network")
                .build());
    
            var subnet = new Subnetwork("subnet", SubnetworkArgs.builder()
                .name("my-subnetwork")
                .network(net.id())
                .ipCidrRange("10.0.0.0/16")
                .region("us-central1")
                .build());
    
            var router = new Router("router", RouterArgs.builder()
                .name("my-router")
                .region(subnet.region())
                .network(net.id())
                .bgp(RouterBgpArgs.builder()
                    .asn(64514)
                    .build())
                .build());
    
            var nat = new RouterNat("nat", RouterNatArgs.builder()
                .name("my-router-nat")
                .router(router.name())
                .region(router.region())
                .natIpAllocateOption("AUTO_ONLY")
                .sourceSubnetworkIpRangesToNat("ALL_SUBNETWORKS_ALL_IP_RANGES")
                .logConfig(RouterNatLogConfigArgs.builder()
                    .enable(true)
                    .filter("ERRORS_ONLY")
                    .build())
                .build());
    
        }
    }
    
    resources:
      net:
        type: gcp:compute:Network
        properties:
          name: my-network
      subnet:
        type: gcp:compute:Subnetwork
        properties:
          name: my-subnetwork
          network: ${net.id}
          ipCidrRange: 10.0.0.0/16
          region: us-central1
      router:
        type: gcp:compute:Router
        properties:
          name: my-router
          region: ${subnet.region}
          network: ${net.id}
          bgp:
            asn: 64514
      nat:
        type: gcp:compute:RouterNat
        properties:
          name: my-router-nat
          router: ${router.name}
          region: ${router.region}
          natIpAllocateOption: AUTO_ONLY
          sourceSubnetworkIpRangesToNat: ALL_SUBNETWORKS_ALL_IP_RANGES
          logConfig:
            enable: true
            filter: ERRORS_ONLY
    

    Router Nat Manual Ips

    import * as pulumi from "@pulumi/pulumi";
    import * as gcp from "@pulumi/gcp";
    
    const net = new gcp.compute.Network("net", {name: "my-network"});
    const subnet = new gcp.compute.Subnetwork("subnet", {
        name: "my-subnetwork",
        network: net.id,
        ipCidrRange: "10.0.0.0/16",
        region: "us-central1",
    });
    const router = new gcp.compute.Router("router", {
        name: "my-router",
        region: subnet.region,
        network: net.id,
    });
    const address: gcp.compute.Address[] = [];
    for (const range = {value: 0}; range.value < 2; range.value++) {
        address.push(new gcp.compute.Address(`address-${range.value}`, {
            name: `nat-manual-ip-${range.value}`,
            region: subnet.region,
        }));
    }
    const natManual = new gcp.compute.RouterNat("nat_manual", {
        name: "my-router-nat",
        router: router.name,
        region: router.region,
        natIpAllocateOption: "MANUAL_ONLY",
        natIps: address.map(__item => __item.selfLink),
        sourceSubnetworkIpRangesToNat: "LIST_OF_SUBNETWORKS",
        subnetworks: [{
            name: subnet.id,
            sourceIpRangesToNats: ["ALL_IP_RANGES"],
        }],
    });
    
    import pulumi
    import pulumi_gcp as gcp
    
    net = gcp.compute.Network("net", name="my-network")
    subnet = gcp.compute.Subnetwork("subnet",
        name="my-subnetwork",
        network=net.id,
        ip_cidr_range="10.0.0.0/16",
        region="us-central1")
    router = gcp.compute.Router("router",
        name="my-router",
        region=subnet.region,
        network=net.id)
    address = []
    for range in [{"value": i} for i in range(0, 2)]:
        address.append(gcp.compute.Address(f"address-{range['value']}",
            name=f"nat-manual-ip-{range['value']}",
            region=subnet.region))
    nat_manual = gcp.compute.RouterNat("nat_manual",
        name="my-router-nat",
        router=router.name,
        region=router.region,
        nat_ip_allocate_option="MANUAL_ONLY",
        nat_ips=[__item.self_link for __item in address],
        source_subnetwork_ip_ranges_to_nat="LIST_OF_SUBNETWORKS",
        subnetworks=[gcp.compute.RouterNatSubnetworkArgs(
            name=subnet.id,
            source_ip_ranges_to_nats=["ALL_IP_RANGES"],
        )])
    
    package main
    
    import (
    	"fmt"
    
    	"github.com/pulumi/pulumi-gcp/sdk/v7/go/gcp/compute"
    	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
    )
    
    func main() {
    	pulumi.Run(func(ctx *pulumi.Context) error {
    		net, err := compute.NewNetwork(ctx, "net", &compute.NetworkArgs{
    			Name: pulumi.String("my-network"),
    		})
    		if err != nil {
    			return err
    		}
    		subnet, err := compute.NewSubnetwork(ctx, "subnet", &compute.SubnetworkArgs{
    			Name:        pulumi.String("my-subnetwork"),
    			Network:     net.ID(),
    			IpCidrRange: pulumi.String("10.0.0.0/16"),
    			Region:      pulumi.String("us-central1"),
    		})
    		if err != nil {
    			return err
    		}
    		router, err := compute.NewRouter(ctx, "router", &compute.RouterArgs{
    			Name:    pulumi.String("my-router"),
    			Region:  subnet.Region,
    			Network: net.ID(),
    		})
    		if err != nil {
    			return err
    		}
    		var address []*compute.Address
    		for index := 0; index < 2; index++ {
    			key0 := index
    			val0 := index
    			__res, err := compute.NewAddress(ctx, fmt.Sprintf("address-%v", key0), &compute.AddressArgs{
    				Name:   pulumi.String(fmt.Sprintf("nat-manual-ip-%v", val0)),
    				Region: subnet.Region,
    			})
    			if err != nil {
    				return err
    			}
    			address = append(address, __res)
    		}
    		var splat0 pulumi.StringArray
    		for _, val0 := range address {
    			splat0 = append(splat0, val0.SelfLink)
    		}
    		_, err = compute.NewRouterNat(ctx, "nat_manual", &compute.RouterNatArgs{
    			Name:                          pulumi.String("my-router-nat"),
    			Router:                        router.Name,
    			Region:                        router.Region,
    			NatIpAllocateOption:           pulumi.String("MANUAL_ONLY"),
    			NatIps:                        splat0,
    			SourceSubnetworkIpRangesToNat: pulumi.String("LIST_OF_SUBNETWORKS"),
    			Subnetworks: compute.RouterNatSubnetworkArray{
    				&compute.RouterNatSubnetworkArgs{
    					Name: subnet.ID(),
    					SourceIpRangesToNats: pulumi.StringArray{
    						pulumi.String("ALL_IP_RANGES"),
    					},
    				},
    			},
    		})
    		if err != nil {
    			return err
    		}
    		return nil
    	})
    }
    
    using System.Collections.Generic;
    using System.Linq;
    using Pulumi;
    using Gcp = Pulumi.Gcp;
    
    return await Deployment.RunAsync(() => 
    {
        var net = new Gcp.Compute.Network("net", new()
        {
            Name = "my-network",
        });
    
        var subnet = new Gcp.Compute.Subnetwork("subnet", new()
        {
            Name = "my-subnetwork",
            Network = net.Id,
            IpCidrRange = "10.0.0.0/16",
            Region = "us-central1",
        });
    
        var router = new Gcp.Compute.Router("router", new()
        {
            Name = "my-router",
            Region = subnet.Region,
            Network = net.Id,
        });
    
        var address = new List<Gcp.Compute.Address>();
        for (var rangeIndex = 0; rangeIndex < 2; rangeIndex++)
        {
            var range = new { Value = rangeIndex };
            address.Add(new Gcp.Compute.Address($"address-{range.Value}", new()
            {
                Name = $"nat-manual-ip-{range.Value}",
                Region = subnet.Region,
            }));
        }
        var natManual = new Gcp.Compute.RouterNat("nat_manual", new()
        {
            Name = "my-router-nat",
            Router = router.Name,
            Region = router.Region,
            NatIpAllocateOption = "MANUAL_ONLY",
            NatIps = address.Select(__item => __item.SelfLink).ToList(),
            SourceSubnetworkIpRangesToNat = "LIST_OF_SUBNETWORKS",
            Subnetworks = new[]
            {
                new Gcp.Compute.Inputs.RouterNatSubnetworkArgs
                {
                    Name = subnet.Id,
                    SourceIpRangesToNats = new[]
                    {
                        "ALL_IP_RANGES",
                    },
                },
            },
        });
    
    });
    
    package generated_program;
    
    import com.pulumi.Context;
    import com.pulumi.Pulumi;
    import com.pulumi.core.Output;
    import com.pulumi.gcp.compute.Network;
    import com.pulumi.gcp.compute.NetworkArgs;
    import com.pulumi.gcp.compute.Subnetwork;
    import com.pulumi.gcp.compute.SubnetworkArgs;
    import com.pulumi.gcp.compute.Router;
    import com.pulumi.gcp.compute.RouterArgs;
    import com.pulumi.gcp.compute.Address;
    import com.pulumi.gcp.compute.AddressArgs;
    import com.pulumi.gcp.compute.RouterNat;
    import com.pulumi.gcp.compute.RouterNatArgs;
    import com.pulumi.gcp.compute.inputs.RouterNatSubnetworkArgs;
    import com.pulumi.codegen.internal.KeyedValue;
    import java.util.List;
    import java.util.ArrayList;
    import java.util.Map;
    import java.io.File;
    import java.nio.file.Files;
    import java.nio.file.Paths;
    
    public class App {
        public static void main(String[] args) {
            Pulumi.run(App::stack);
        }
    
        public static void stack(Context ctx) {
            var net = new Network("net", NetworkArgs.builder()
                .name("my-network")
                .build());
    
            var subnet = new Subnetwork("subnet", SubnetworkArgs.builder()
                .name("my-subnetwork")
                .network(net.id())
                .ipCidrRange("10.0.0.0/16")
                .region("us-central1")
                .build());
    
            var router = new Router("router", RouterArgs.builder()
                .name("my-router")
                .region(subnet.region())
                .network(net.id())
                .build());
    
            for (var i = 0; i < 2; i++) {
                new Address("address-" + i, AddressArgs.builder()
                    .name(String.format("nat-manual-ip-%s", range.value()))
                    .region(subnet.region())
                    .build());
    
            
    }
            var natManual = new RouterNat("natManual", RouterNatArgs.builder()
                .name("my-router-nat")
                .router(router.name())
                .region(router.region())
                .natIpAllocateOption("MANUAL_ONLY")
                .natIps(address.stream().map(element -> element.selfLink()).collect(toList()))
                .sourceSubnetworkIpRangesToNat("LIST_OF_SUBNETWORKS")
                .subnetworks(RouterNatSubnetworkArgs.builder()
                    .name(subnet.id())
                    .sourceIpRangesToNats("ALL_IP_RANGES")
                    .build())
                .build());
    
        }
    }
    
    Coming soon!
    

    Router Nat Rules

    import * as pulumi from "@pulumi/pulumi";
    import * as gcp from "@pulumi/gcp";
    
    const net = new gcp.compute.Network("net", {
        name: "my-network",
        autoCreateSubnetworks: false,
    });
    const subnet = new gcp.compute.Subnetwork("subnet", {
        name: "my-subnetwork",
        network: net.id,
        ipCidrRange: "10.0.0.0/16",
        region: "us-central1",
    });
    const router = new gcp.compute.Router("router", {
        name: "my-router",
        region: subnet.region,
        network: net.id,
    });
    const addr1 = new gcp.compute.Address("addr1", {
        name: "nat-address1",
        region: subnet.region,
    });
    const addr2 = new gcp.compute.Address("addr2", {
        name: "nat-address2",
        region: subnet.region,
    });
    const addr3 = new gcp.compute.Address("addr3", {
        name: "nat-address3",
        region: subnet.region,
    });
    const natRules = new gcp.compute.RouterNat("nat_rules", {
        name: "my-router-nat",
        router: router.name,
        region: router.region,
        natIpAllocateOption: "MANUAL_ONLY",
        natIps: [addr1.selfLink],
        sourceSubnetworkIpRangesToNat: "LIST_OF_SUBNETWORKS",
        subnetworks: [{
            name: subnet.id,
            sourceIpRangesToNats: ["ALL_IP_RANGES"],
        }],
        rules: [{
            ruleNumber: 100,
            description: "nat rules example",
            match: "inIpRange(destination.ip, '1.1.0.0/16') || inIpRange(destination.ip, '2.2.0.0/16')",
            action: {
                sourceNatActiveIps: [
                    addr2.selfLink,
                    addr3.selfLink,
                ],
            },
        }],
        enableEndpointIndependentMapping: false,
    });
    
    import pulumi
    import pulumi_gcp as gcp
    
    net = gcp.compute.Network("net",
        name="my-network",
        auto_create_subnetworks=False)
    subnet = gcp.compute.Subnetwork("subnet",
        name="my-subnetwork",
        network=net.id,
        ip_cidr_range="10.0.0.0/16",
        region="us-central1")
    router = gcp.compute.Router("router",
        name="my-router",
        region=subnet.region,
        network=net.id)
    addr1 = gcp.compute.Address("addr1",
        name="nat-address1",
        region=subnet.region)
    addr2 = gcp.compute.Address("addr2",
        name="nat-address2",
        region=subnet.region)
    addr3 = gcp.compute.Address("addr3",
        name="nat-address3",
        region=subnet.region)
    nat_rules = gcp.compute.RouterNat("nat_rules",
        name="my-router-nat",
        router=router.name,
        region=router.region,
        nat_ip_allocate_option="MANUAL_ONLY",
        nat_ips=[addr1.self_link],
        source_subnetwork_ip_ranges_to_nat="LIST_OF_SUBNETWORKS",
        subnetworks=[gcp.compute.RouterNatSubnetworkArgs(
            name=subnet.id,
            source_ip_ranges_to_nats=["ALL_IP_RANGES"],
        )],
        rules=[gcp.compute.RouterNatRuleArgs(
            rule_number=100,
            description="nat rules example",
            match="inIpRange(destination.ip, '1.1.0.0/16') || inIpRange(destination.ip, '2.2.0.0/16')",
            action=gcp.compute.RouterNatRuleActionArgs(
                source_nat_active_ips=[
                    addr2.self_link,
                    addr3.self_link,
                ],
            ),
        )],
        enable_endpoint_independent_mapping=False)
    
    package main
    
    import (
    	"github.com/pulumi/pulumi-gcp/sdk/v7/go/gcp/compute"
    	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
    )
    
    func main() {
    	pulumi.Run(func(ctx *pulumi.Context) error {
    		net, err := compute.NewNetwork(ctx, "net", &compute.NetworkArgs{
    			Name:                  pulumi.String("my-network"),
    			AutoCreateSubnetworks: pulumi.Bool(false),
    		})
    		if err != nil {
    			return err
    		}
    		subnet, err := compute.NewSubnetwork(ctx, "subnet", &compute.SubnetworkArgs{
    			Name:        pulumi.String("my-subnetwork"),
    			Network:     net.ID(),
    			IpCidrRange: pulumi.String("10.0.0.0/16"),
    			Region:      pulumi.String("us-central1"),
    		})
    		if err != nil {
    			return err
    		}
    		router, err := compute.NewRouter(ctx, "router", &compute.RouterArgs{
    			Name:    pulumi.String("my-router"),
    			Region:  subnet.Region,
    			Network: net.ID(),
    		})
    		if err != nil {
    			return err
    		}
    		addr1, err := compute.NewAddress(ctx, "addr1", &compute.AddressArgs{
    			Name:   pulumi.String("nat-address1"),
    			Region: subnet.Region,
    		})
    		if err != nil {
    			return err
    		}
    		addr2, err := compute.NewAddress(ctx, "addr2", &compute.AddressArgs{
    			Name:   pulumi.String("nat-address2"),
    			Region: subnet.Region,
    		})
    		if err != nil {
    			return err
    		}
    		addr3, err := compute.NewAddress(ctx, "addr3", &compute.AddressArgs{
    			Name:   pulumi.String("nat-address3"),
    			Region: subnet.Region,
    		})
    		if err != nil {
    			return err
    		}
    		_, err = compute.NewRouterNat(ctx, "nat_rules", &compute.RouterNatArgs{
    			Name:                pulumi.String("my-router-nat"),
    			Router:              router.Name,
    			Region:              router.Region,
    			NatIpAllocateOption: pulumi.String("MANUAL_ONLY"),
    			NatIps: pulumi.StringArray{
    				addr1.SelfLink,
    			},
    			SourceSubnetworkIpRangesToNat: pulumi.String("LIST_OF_SUBNETWORKS"),
    			Subnetworks: compute.RouterNatSubnetworkArray{
    				&compute.RouterNatSubnetworkArgs{
    					Name: subnet.ID(),
    					SourceIpRangesToNats: pulumi.StringArray{
    						pulumi.String("ALL_IP_RANGES"),
    					},
    				},
    			},
    			Rules: compute.RouterNatRuleArray{
    				&compute.RouterNatRuleArgs{
    					RuleNumber:  pulumi.Int(100),
    					Description: pulumi.String("nat rules example"),
    					Match:       pulumi.String("inIpRange(destination.ip, '1.1.0.0/16') || inIpRange(destination.ip, '2.2.0.0/16')"),
    					Action: &compute.RouterNatRuleActionArgs{
    						SourceNatActiveIps: pulumi.StringArray{
    							addr2.SelfLink,
    							addr3.SelfLink,
    						},
    					},
    				},
    			},
    			EnableEndpointIndependentMapping: pulumi.Bool(false),
    		})
    		if err != nil {
    			return err
    		}
    		return nil
    	})
    }
    
    using System.Collections.Generic;
    using System.Linq;
    using Pulumi;
    using Gcp = Pulumi.Gcp;
    
    return await Deployment.RunAsync(() => 
    {
        var net = new Gcp.Compute.Network("net", new()
        {
            Name = "my-network",
            AutoCreateSubnetworks = false,
        });
    
        var subnet = new Gcp.Compute.Subnetwork("subnet", new()
        {
            Name = "my-subnetwork",
            Network = net.Id,
            IpCidrRange = "10.0.0.0/16",
            Region = "us-central1",
        });
    
        var router = new Gcp.Compute.Router("router", new()
        {
            Name = "my-router",
            Region = subnet.Region,
            Network = net.Id,
        });
    
        var addr1 = new Gcp.Compute.Address("addr1", new()
        {
            Name = "nat-address1",
            Region = subnet.Region,
        });
    
        var addr2 = new Gcp.Compute.Address("addr2", new()
        {
            Name = "nat-address2",
            Region = subnet.Region,
        });
    
        var addr3 = new Gcp.Compute.Address("addr3", new()
        {
            Name = "nat-address3",
            Region = subnet.Region,
        });
    
        var natRules = new Gcp.Compute.RouterNat("nat_rules", new()
        {
            Name = "my-router-nat",
            Router = router.Name,
            Region = router.Region,
            NatIpAllocateOption = "MANUAL_ONLY",
            NatIps = new[]
            {
                addr1.SelfLink,
            },
            SourceSubnetworkIpRangesToNat = "LIST_OF_SUBNETWORKS",
            Subnetworks = new[]
            {
                new Gcp.Compute.Inputs.RouterNatSubnetworkArgs
                {
                    Name = subnet.Id,
                    SourceIpRangesToNats = new[]
                    {
                        "ALL_IP_RANGES",
                    },
                },
            },
            Rules = new[]
            {
                new Gcp.Compute.Inputs.RouterNatRuleArgs
                {
                    RuleNumber = 100,
                    Description = "nat rules example",
                    Match = "inIpRange(destination.ip, '1.1.0.0/16') || inIpRange(destination.ip, '2.2.0.0/16')",
                    Action = new Gcp.Compute.Inputs.RouterNatRuleActionArgs
                    {
                        SourceNatActiveIps = new[]
                        {
                            addr2.SelfLink,
                            addr3.SelfLink,
                        },
                    },
                },
            },
            EnableEndpointIndependentMapping = false,
        });
    
    });
    
    package generated_program;
    
    import com.pulumi.Context;
    import com.pulumi.Pulumi;
    import com.pulumi.core.Output;
    import com.pulumi.gcp.compute.Network;
    import com.pulumi.gcp.compute.NetworkArgs;
    import com.pulumi.gcp.compute.Subnetwork;
    import com.pulumi.gcp.compute.SubnetworkArgs;
    import com.pulumi.gcp.compute.Router;
    import com.pulumi.gcp.compute.RouterArgs;
    import com.pulumi.gcp.compute.Address;
    import com.pulumi.gcp.compute.AddressArgs;
    import com.pulumi.gcp.compute.RouterNat;
    import com.pulumi.gcp.compute.RouterNatArgs;
    import com.pulumi.gcp.compute.inputs.RouterNatSubnetworkArgs;
    import com.pulumi.gcp.compute.inputs.RouterNatRuleArgs;
    import com.pulumi.gcp.compute.inputs.RouterNatRuleActionArgs;
    import java.util.List;
    import java.util.ArrayList;
    import java.util.Map;
    import java.io.File;
    import java.nio.file.Files;
    import java.nio.file.Paths;
    
    public class App {
        public static void main(String[] args) {
            Pulumi.run(App::stack);
        }
    
        public static void stack(Context ctx) {
            var net = new Network("net", NetworkArgs.builder()
                .name("my-network")
                .autoCreateSubnetworks(false)
                .build());
    
            var subnet = new Subnetwork("subnet", SubnetworkArgs.builder()
                .name("my-subnetwork")
                .network(net.id())
                .ipCidrRange("10.0.0.0/16")
                .region("us-central1")
                .build());
    
            var router = new Router("router", RouterArgs.builder()
                .name("my-router")
                .region(subnet.region())
                .network(net.id())
                .build());
    
            var addr1 = new Address("addr1", AddressArgs.builder()
                .name("nat-address1")
                .region(subnet.region())
                .build());
    
            var addr2 = new Address("addr2", AddressArgs.builder()
                .name("nat-address2")
                .region(subnet.region())
                .build());
    
            var addr3 = new Address("addr3", AddressArgs.builder()
                .name("nat-address3")
                .region(subnet.region())
                .build());
    
            var natRules = new RouterNat("natRules", RouterNatArgs.builder()
                .name("my-router-nat")
                .router(router.name())
                .region(router.region())
                .natIpAllocateOption("MANUAL_ONLY")
                .natIps(addr1.selfLink())
                .sourceSubnetworkIpRangesToNat("LIST_OF_SUBNETWORKS")
                .subnetworks(RouterNatSubnetworkArgs.builder()
                    .name(subnet.id())
                    .sourceIpRangesToNats("ALL_IP_RANGES")
                    .build())
                .rules(RouterNatRuleArgs.builder()
                    .ruleNumber(100)
                    .description("nat rules example")
                    .match("inIpRange(destination.ip, '1.1.0.0/16') || inIpRange(destination.ip, '2.2.0.0/16')")
                    .action(RouterNatRuleActionArgs.builder()
                        .sourceNatActiveIps(                    
                            addr2.selfLink(),
                            addr3.selfLink())
                        .build())
                    .build())
                .enableEndpointIndependentMapping(false)
                .build());
    
        }
    }
    
    resources:
      net:
        type: gcp:compute:Network
        properties:
          name: my-network
          autoCreateSubnetworks: false
      subnet:
        type: gcp:compute:Subnetwork
        properties:
          name: my-subnetwork
          network: ${net.id}
          ipCidrRange: 10.0.0.0/16
          region: us-central1
      router:
        type: gcp:compute:Router
        properties:
          name: my-router
          region: ${subnet.region}
          network: ${net.id}
      addr1:
        type: gcp:compute:Address
        properties:
          name: nat-address1
          region: ${subnet.region}
      addr2:
        type: gcp:compute:Address
        properties:
          name: nat-address2
          region: ${subnet.region}
      addr3:
        type: gcp:compute:Address
        properties:
          name: nat-address3
          region: ${subnet.region}
      natRules:
        type: gcp:compute:RouterNat
        name: nat_rules
        properties:
          name: my-router-nat
          router: ${router.name}
          region: ${router.region}
          natIpAllocateOption: MANUAL_ONLY
          natIps:
            - ${addr1.selfLink}
          sourceSubnetworkIpRangesToNat: LIST_OF_SUBNETWORKS
          subnetworks:
            - name: ${subnet.id}
              sourceIpRangesToNats:
                - ALL_IP_RANGES
          rules:
            - ruleNumber: 100
              description: nat rules example
              match: inIpRange(destination.ip, '1.1.0.0/16') || inIpRange(destination.ip, '2.2.0.0/16')
              action:
                sourceNatActiveIps:
                  - ${addr2.selfLink}
                  - ${addr3.selfLink}
          enableEndpointIndependentMapping: false
    

    Router Nat Private

    import * as pulumi from "@pulumi/pulumi";
    import * as gcp from "@pulumi/gcp";
    
    const net = new gcp.compute.Network("net", {name: "my-network"});
    const subnet = new gcp.compute.Subnetwork("subnet", {
        name: "my-subnetwork",
        network: net.id,
        ipCidrRange: "10.0.0.0/16",
        region: "us-central1",
        purpose: "PRIVATE_NAT",
    });
    const router = new gcp.compute.Router("router", {
        name: "my-router",
        region: subnet.region,
        network: net.id,
    });
    const hub = new gcp.networkconnectivity.Hub("hub", {
        name: "my-hub",
        description: "vpc hub for inter vpc nat",
    });
    const spoke = new gcp.networkconnectivity.Spoke("spoke", {
        name: "my-spoke",
        location: "global",
        description: "vpc spoke for inter vpc nat",
        hub: hub.id,
        linkedVpcNetwork: {
            excludeExportRanges: [
                "198.51.100.0/24",
                "10.10.0.0/16",
            ],
            uri: net.selfLink,
        },
    });
    const natType = new gcp.compute.RouterNat("nat_type", {
        name: "my-router-nat",
        router: router.name,
        region: router.region,
        sourceSubnetworkIpRangesToNat: "LIST_OF_SUBNETWORKS",
        enableDynamicPortAllocation: false,
        enableEndpointIndependentMapping: false,
        minPortsPerVm: 32,
        type: "PRIVATE",
        subnetworks: [{
            name: subnet.id,
            sourceIpRangesToNats: ["ALL_IP_RANGES"],
        }],
        rules: [{
            ruleNumber: 100,
            description: "rule for private nat",
            match: "nexthop.hub == \"//networkconnectivity.googleapis.com/projects/acm-test-proj-123/locations/global/hubs/my-hub\"",
            action: {
                sourceNatActiveRanges: [subnet.selfLink],
            },
        }],
    });
    
    import pulumi
    import pulumi_gcp as gcp
    
    net = gcp.compute.Network("net", name="my-network")
    subnet = gcp.compute.Subnetwork("subnet",
        name="my-subnetwork",
        network=net.id,
        ip_cidr_range="10.0.0.0/16",
        region="us-central1",
        purpose="PRIVATE_NAT")
    router = gcp.compute.Router("router",
        name="my-router",
        region=subnet.region,
        network=net.id)
    hub = gcp.networkconnectivity.Hub("hub",
        name="my-hub",
        description="vpc hub for inter vpc nat")
    spoke = gcp.networkconnectivity.Spoke("spoke",
        name="my-spoke",
        location="global",
        description="vpc spoke for inter vpc nat",
        hub=hub.id,
        linked_vpc_network=gcp.networkconnectivity.SpokeLinkedVpcNetworkArgs(
            exclude_export_ranges=[
                "198.51.100.0/24",
                "10.10.0.0/16",
            ],
            uri=net.self_link,
        ))
    nat_type = gcp.compute.RouterNat("nat_type",
        name="my-router-nat",
        router=router.name,
        region=router.region,
        source_subnetwork_ip_ranges_to_nat="LIST_OF_SUBNETWORKS",
        enable_dynamic_port_allocation=False,
        enable_endpoint_independent_mapping=False,
        min_ports_per_vm=32,
        type="PRIVATE",
        subnetworks=[gcp.compute.RouterNatSubnetworkArgs(
            name=subnet.id,
            source_ip_ranges_to_nats=["ALL_IP_RANGES"],
        )],
        rules=[gcp.compute.RouterNatRuleArgs(
            rule_number=100,
            description="rule for private nat",
            match="nexthop.hub == \"//networkconnectivity.googleapis.com/projects/acm-test-proj-123/locations/global/hubs/my-hub\"",
            action=gcp.compute.RouterNatRuleActionArgs(
                source_nat_active_ranges=[subnet.self_link],
            ),
        )])
    
    package main
    
    import (
    	"github.com/pulumi/pulumi-gcp/sdk/v7/go/gcp/compute"
    	"github.com/pulumi/pulumi-gcp/sdk/v7/go/gcp/networkconnectivity"
    	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
    )
    
    func main() {
    	pulumi.Run(func(ctx *pulumi.Context) error {
    		net, err := compute.NewNetwork(ctx, "net", &compute.NetworkArgs{
    			Name: pulumi.String("my-network"),
    		})
    		if err != nil {
    			return err
    		}
    		subnet, err := compute.NewSubnetwork(ctx, "subnet", &compute.SubnetworkArgs{
    			Name:        pulumi.String("my-subnetwork"),
    			Network:     net.ID(),
    			IpCidrRange: pulumi.String("10.0.0.0/16"),
    			Region:      pulumi.String("us-central1"),
    			Purpose:     pulumi.String("PRIVATE_NAT"),
    		})
    		if err != nil {
    			return err
    		}
    		router, err := compute.NewRouter(ctx, "router", &compute.RouterArgs{
    			Name:    pulumi.String("my-router"),
    			Region:  subnet.Region,
    			Network: net.ID(),
    		})
    		if err != nil {
    			return err
    		}
    		hub, err := networkconnectivity.NewHub(ctx, "hub", &networkconnectivity.HubArgs{
    			Name:        pulumi.String("my-hub"),
    			Description: pulumi.String("vpc hub for inter vpc nat"),
    		})
    		if err != nil {
    			return err
    		}
    		_, err = networkconnectivity.NewSpoke(ctx, "spoke", &networkconnectivity.SpokeArgs{
    			Name:        pulumi.String("my-spoke"),
    			Location:    pulumi.String("global"),
    			Description: pulumi.String("vpc spoke for inter vpc nat"),
    			Hub:         hub.ID(),
    			LinkedVpcNetwork: &networkconnectivity.SpokeLinkedVpcNetworkArgs{
    				ExcludeExportRanges: pulumi.StringArray{
    					pulumi.String("198.51.100.0/24"),
    					pulumi.String("10.10.0.0/16"),
    				},
    				Uri: net.SelfLink,
    			},
    		})
    		if err != nil {
    			return err
    		}
    		_, err = compute.NewRouterNat(ctx, "nat_type", &compute.RouterNatArgs{
    			Name:                             pulumi.String("my-router-nat"),
    			Router:                           router.Name,
    			Region:                           router.Region,
    			SourceSubnetworkIpRangesToNat:    pulumi.String("LIST_OF_SUBNETWORKS"),
    			EnableDynamicPortAllocation:      pulumi.Bool(false),
    			EnableEndpointIndependentMapping: pulumi.Bool(false),
    			MinPortsPerVm:                    pulumi.Int(32),
    			Type:                             pulumi.String("PRIVATE"),
    			Subnetworks: compute.RouterNatSubnetworkArray{
    				&compute.RouterNatSubnetworkArgs{
    					Name: subnet.ID(),
    					SourceIpRangesToNats: pulumi.StringArray{
    						pulumi.String("ALL_IP_RANGES"),
    					},
    				},
    			},
    			Rules: compute.RouterNatRuleArray{
    				&compute.RouterNatRuleArgs{
    					RuleNumber:  pulumi.Int(100),
    					Description: pulumi.String("rule for private nat"),
    					Match:       pulumi.String("nexthop.hub == \"//networkconnectivity.googleapis.com/projects/acm-test-proj-123/locations/global/hubs/my-hub\""),
    					Action: &compute.RouterNatRuleActionArgs{
    						SourceNatActiveRanges: pulumi.StringArray{
    							subnet.SelfLink,
    						},
    					},
    				},
    			},
    		})
    		if err != nil {
    			return err
    		}
    		return nil
    	})
    }
    
    using System.Collections.Generic;
    using System.Linq;
    using Pulumi;
    using Gcp = Pulumi.Gcp;
    
    return await Deployment.RunAsync(() => 
    {
        var net = new Gcp.Compute.Network("net", new()
        {
            Name = "my-network",
        });
    
        var subnet = new Gcp.Compute.Subnetwork("subnet", new()
        {
            Name = "my-subnetwork",
            Network = net.Id,
            IpCidrRange = "10.0.0.0/16",
            Region = "us-central1",
            Purpose = "PRIVATE_NAT",
        });
    
        var router = new Gcp.Compute.Router("router", new()
        {
            Name = "my-router",
            Region = subnet.Region,
            Network = net.Id,
        });
    
        var hub = new Gcp.NetworkConnectivity.Hub("hub", new()
        {
            Name = "my-hub",
            Description = "vpc hub for inter vpc nat",
        });
    
        var spoke = new Gcp.NetworkConnectivity.Spoke("spoke", new()
        {
            Name = "my-spoke",
            Location = "global",
            Description = "vpc spoke for inter vpc nat",
            Hub = hub.Id,
            LinkedVpcNetwork = new Gcp.NetworkConnectivity.Inputs.SpokeLinkedVpcNetworkArgs
            {
                ExcludeExportRanges = new[]
                {
                    "198.51.100.0/24",
                    "10.10.0.0/16",
                },
                Uri = net.SelfLink,
            },
        });
    
        var natType = new Gcp.Compute.RouterNat("nat_type", new()
        {
            Name = "my-router-nat",
            Router = router.Name,
            Region = router.Region,
            SourceSubnetworkIpRangesToNat = "LIST_OF_SUBNETWORKS",
            EnableDynamicPortAllocation = false,
            EnableEndpointIndependentMapping = false,
            MinPortsPerVm = 32,
            Type = "PRIVATE",
            Subnetworks = new[]
            {
                new Gcp.Compute.Inputs.RouterNatSubnetworkArgs
                {
                    Name = subnet.Id,
                    SourceIpRangesToNats = new[]
                    {
                        "ALL_IP_RANGES",
                    },
                },
            },
            Rules = new[]
            {
                new Gcp.Compute.Inputs.RouterNatRuleArgs
                {
                    RuleNumber = 100,
                    Description = "rule for private nat",
                    Match = "nexthop.hub == \"//networkconnectivity.googleapis.com/projects/acm-test-proj-123/locations/global/hubs/my-hub\"",
                    Action = new Gcp.Compute.Inputs.RouterNatRuleActionArgs
                    {
                        SourceNatActiveRanges = new[]
                        {
                            subnet.SelfLink,
                        },
                    },
                },
            },
        });
    
    });
    
    package generated_program;
    
    import com.pulumi.Context;
    import com.pulumi.Pulumi;
    import com.pulumi.core.Output;
    import com.pulumi.gcp.compute.Network;
    import com.pulumi.gcp.compute.NetworkArgs;
    import com.pulumi.gcp.compute.Subnetwork;
    import com.pulumi.gcp.compute.SubnetworkArgs;
    import com.pulumi.gcp.compute.Router;
    import com.pulumi.gcp.compute.RouterArgs;
    import com.pulumi.gcp.networkconnectivity.Hub;
    import com.pulumi.gcp.networkconnectivity.HubArgs;
    import com.pulumi.gcp.networkconnectivity.Spoke;
    import com.pulumi.gcp.networkconnectivity.SpokeArgs;
    import com.pulumi.gcp.networkconnectivity.inputs.SpokeLinkedVpcNetworkArgs;
    import com.pulumi.gcp.compute.RouterNat;
    import com.pulumi.gcp.compute.RouterNatArgs;
    import com.pulumi.gcp.compute.inputs.RouterNatSubnetworkArgs;
    import com.pulumi.gcp.compute.inputs.RouterNatRuleArgs;
    import com.pulumi.gcp.compute.inputs.RouterNatRuleActionArgs;
    import java.util.List;
    import java.util.ArrayList;
    import java.util.Map;
    import java.io.File;
    import java.nio.file.Files;
    import java.nio.file.Paths;
    
    public class App {
        public static void main(String[] args) {
            Pulumi.run(App::stack);
        }
    
        public static void stack(Context ctx) {
            var net = new Network("net", NetworkArgs.builder()
                .name("my-network")
                .build());
    
            var subnet = new Subnetwork("subnet", SubnetworkArgs.builder()
                .name("my-subnetwork")
                .network(net.id())
                .ipCidrRange("10.0.0.0/16")
                .region("us-central1")
                .purpose("PRIVATE_NAT")
                .build());
    
            var router = new Router("router", RouterArgs.builder()
                .name("my-router")
                .region(subnet.region())
                .network(net.id())
                .build());
    
            var hub = new Hub("hub", HubArgs.builder()
                .name("my-hub")
                .description("vpc hub for inter vpc nat")
                .build());
    
            var spoke = new Spoke("spoke", SpokeArgs.builder()
                .name("my-spoke")
                .location("global")
                .description("vpc spoke for inter vpc nat")
                .hub(hub.id())
                .linkedVpcNetwork(SpokeLinkedVpcNetworkArgs.builder()
                    .excludeExportRanges(                
                        "198.51.100.0/24",
                        "10.10.0.0/16")
                    .uri(net.selfLink())
                    .build())
                .build());
    
            var natType = new RouterNat("natType", RouterNatArgs.builder()
                .name("my-router-nat")
                .router(router.name())
                .region(router.region())
                .sourceSubnetworkIpRangesToNat("LIST_OF_SUBNETWORKS")
                .enableDynamicPortAllocation(false)
                .enableEndpointIndependentMapping(false)
                .minPortsPerVm(32)
                .type("PRIVATE")
                .subnetworks(RouterNatSubnetworkArgs.builder()
                    .name(subnet.id())
                    .sourceIpRangesToNats("ALL_IP_RANGES")
                    .build())
                .rules(RouterNatRuleArgs.builder()
                    .ruleNumber(100)
                    .description("rule for private nat")
                    .match("nexthop.hub == \"//networkconnectivity.googleapis.com/projects/acm-test-proj-123/locations/global/hubs/my-hub\"")
                    .action(RouterNatRuleActionArgs.builder()
                        .sourceNatActiveRanges(subnet.selfLink())
                        .build())
                    .build())
                .build());
    
        }
    }
    
    resources:
      net:
        type: gcp:compute:Network
        properties:
          name: my-network
      subnet:
        type: gcp:compute:Subnetwork
        properties:
          name: my-subnetwork
          network: ${net.id}
          ipCidrRange: 10.0.0.0/16
          region: us-central1
          purpose: PRIVATE_NAT
      router:
        type: gcp:compute:Router
        properties:
          name: my-router
          region: ${subnet.region}
          network: ${net.id}
      hub:
        type: gcp:networkconnectivity:Hub
        properties:
          name: my-hub
          description: vpc hub for inter vpc nat
      spoke:
        type: gcp:networkconnectivity:Spoke
        properties:
          name: my-spoke
          location: global
          description: vpc spoke for inter vpc nat
          hub: ${hub.id}
          linkedVpcNetwork:
            excludeExportRanges:
              - 198.51.100.0/24
              - 10.10.0.0/16
            uri: ${net.selfLink}
      natType:
        type: gcp:compute:RouterNat
        name: nat_type
        properties:
          name: my-router-nat
          router: ${router.name}
          region: ${router.region}
          sourceSubnetworkIpRangesToNat: LIST_OF_SUBNETWORKS
          enableDynamicPortAllocation: false
          enableEndpointIndependentMapping: false
          minPortsPerVm: 32
          type: PRIVATE
          subnetworks:
            - name: ${subnet.id}
              sourceIpRangesToNats:
                - ALL_IP_RANGES
          rules:
            - ruleNumber: 100
              description: rule for private nat
              match: nexthop.hub == "//networkconnectivity.googleapis.com/projects/acm-test-proj-123/locations/global/hubs/my-hub"
              action:
                sourceNatActiveRanges:
                  - ${subnet.selfLink}
    

    Create RouterNat Resource

    Resources are created with functions called constructors. To learn more about declaring and configuring resources, see Resources.

    Constructor syntax

    new RouterNat(name: string, args: RouterNatArgs, opts?: CustomResourceOptions);
    @overload
    def RouterNat(resource_name: str,
                  args: RouterNatArgs,
                  opts: Optional[ResourceOptions] = None)
    
    @overload
    def RouterNat(resource_name: str,
                  opts: Optional[ResourceOptions] = None,
                  router: Optional[str] = None,
                  source_subnetwork_ip_ranges_to_nat: Optional[str] = None,
                  nat_ip_allocate_option: Optional[str] = None,
                  region: Optional[str] = None,
                  endpoint_types: Optional[Sequence[str]] = None,
                  icmp_idle_timeout_sec: Optional[int] = None,
                  log_config: Optional[RouterNatLogConfigArgs] = None,
                  max_ports_per_vm: Optional[int] = None,
                  min_ports_per_vm: Optional[int] = None,
                  name: Optional[str] = None,
                  auto_network_tier: Optional[str] = None,
                  nat_ips: Optional[Sequence[str]] = None,
                  project: Optional[str] = None,
                  enable_endpoint_independent_mapping: Optional[bool] = None,
                  enable_dynamic_port_allocation: Optional[bool] = None,
                  rules: Optional[Sequence[RouterNatRuleArgs]] = None,
                  drain_nat_ips: Optional[Sequence[str]] = None,
                  subnetworks: Optional[Sequence[RouterNatSubnetworkArgs]] = None,
                  tcp_established_idle_timeout_sec: Optional[int] = None,
                  tcp_time_wait_timeout_sec: Optional[int] = None,
                  tcp_transitory_idle_timeout_sec: Optional[int] = None,
                  type: Optional[str] = None,
                  udp_idle_timeout_sec: Optional[int] = None)
    func NewRouterNat(ctx *Context, name string, args RouterNatArgs, opts ...ResourceOption) (*RouterNat, error)
    public RouterNat(string name, RouterNatArgs args, CustomResourceOptions? opts = null)
    public RouterNat(String name, RouterNatArgs args)
    public RouterNat(String name, RouterNatArgs args, CustomResourceOptions options)
    
    type: gcp:compute:RouterNat
    properties: # The arguments to resource properties.
    options: # Bag of options to control resource's behavior.
    
    

    Parameters

    name string
    The unique name of the resource.
    args RouterNatArgs
    The arguments to resource properties.
    opts CustomResourceOptions
    Bag of options to control resource's behavior.
    resource_name str
    The unique name of the resource.
    args RouterNatArgs
    The arguments to resource properties.
    opts ResourceOptions
    Bag of options to control resource's behavior.
    ctx Context
    Context object for the current deployment.
    name string
    The unique name of the resource.
    args RouterNatArgs
    The arguments to resource properties.
    opts ResourceOption
    Bag of options to control resource's behavior.
    name string
    The unique name of the resource.
    args RouterNatArgs
    The arguments to resource properties.
    opts CustomResourceOptions
    Bag of options to control resource's behavior.
    name String
    The unique name of the resource.
    args RouterNatArgs
    The arguments to resource properties.
    options CustomResourceOptions
    Bag of options to control resource's behavior.

    Constructor example

    The following reference example uses placeholder values for all input properties.

    var routerNatResource = new Gcp.Compute.RouterNat("routerNatResource", new()
    {
        Router = "string",
        SourceSubnetworkIpRangesToNat = "string",
        NatIpAllocateOption = "string",
        Region = "string",
        EndpointTypes = new[]
        {
            "string",
        },
        IcmpIdleTimeoutSec = 0,
        LogConfig = new Gcp.Compute.Inputs.RouterNatLogConfigArgs
        {
            Enable = false,
            Filter = "string",
        },
        MaxPortsPerVm = 0,
        MinPortsPerVm = 0,
        Name = "string",
        AutoNetworkTier = "string",
        NatIps = new[]
        {
            "string",
        },
        Project = "string",
        EnableEndpointIndependentMapping = false,
        EnableDynamicPortAllocation = false,
        Rules = new[]
        {
            new Gcp.Compute.Inputs.RouterNatRuleArgs
            {
                Match = "string",
                RuleNumber = 0,
                Action = new Gcp.Compute.Inputs.RouterNatRuleActionArgs
                {
                    SourceNatActiveIps = new[]
                    {
                        "string",
                    },
                    SourceNatActiveRanges = new[]
                    {
                        "string",
                    },
                    SourceNatDrainIps = new[]
                    {
                        "string",
                    },
                    SourceNatDrainRanges = new[]
                    {
                        "string",
                    },
                },
                Description = "string",
            },
        },
        DrainNatIps = new[]
        {
            "string",
        },
        Subnetworks = new[]
        {
            new Gcp.Compute.Inputs.RouterNatSubnetworkArgs
            {
                Name = "string",
                SourceIpRangesToNats = new[]
                {
                    "string",
                },
                SecondaryIpRangeNames = new[]
                {
                    "string",
                },
            },
        },
        TcpEstablishedIdleTimeoutSec = 0,
        TcpTimeWaitTimeoutSec = 0,
        TcpTransitoryIdleTimeoutSec = 0,
        Type = "string",
        UdpIdleTimeoutSec = 0,
    });
    
    example, err := compute.NewRouterNat(ctx, "routerNatResource", &compute.RouterNatArgs{
    	Router:                        pulumi.String("string"),
    	SourceSubnetworkIpRangesToNat: pulumi.String("string"),
    	NatIpAllocateOption:           pulumi.String("string"),
    	Region:                        pulumi.String("string"),
    	EndpointTypes: pulumi.StringArray{
    		pulumi.String("string"),
    	},
    	IcmpIdleTimeoutSec: pulumi.Int(0),
    	LogConfig: &compute.RouterNatLogConfigArgs{
    		Enable: pulumi.Bool(false),
    		Filter: pulumi.String("string"),
    	},
    	MaxPortsPerVm:   pulumi.Int(0),
    	MinPortsPerVm:   pulumi.Int(0),
    	Name:            pulumi.String("string"),
    	AutoNetworkTier: pulumi.String("string"),
    	NatIps: pulumi.StringArray{
    		pulumi.String("string"),
    	},
    	Project:                          pulumi.String("string"),
    	EnableEndpointIndependentMapping: pulumi.Bool(false),
    	EnableDynamicPortAllocation:      pulumi.Bool(false),
    	Rules: compute.RouterNatRuleArray{
    		&compute.RouterNatRuleArgs{
    			Match:      pulumi.String("string"),
    			RuleNumber: pulumi.Int(0),
    			Action: &compute.RouterNatRuleActionArgs{
    				SourceNatActiveIps: pulumi.StringArray{
    					pulumi.String("string"),
    				},
    				SourceNatActiveRanges: pulumi.StringArray{
    					pulumi.String("string"),
    				},
    				SourceNatDrainIps: pulumi.StringArray{
    					pulumi.String("string"),
    				},
    				SourceNatDrainRanges: pulumi.StringArray{
    					pulumi.String("string"),
    				},
    			},
    			Description: pulumi.String("string"),
    		},
    	},
    	DrainNatIps: pulumi.StringArray{
    		pulumi.String("string"),
    	},
    	Subnetworks: compute.RouterNatSubnetworkArray{
    		&compute.RouterNatSubnetworkArgs{
    			Name: pulumi.String("string"),
    			SourceIpRangesToNats: pulumi.StringArray{
    				pulumi.String("string"),
    			},
    			SecondaryIpRangeNames: pulumi.StringArray{
    				pulumi.String("string"),
    			},
    		},
    	},
    	TcpEstablishedIdleTimeoutSec: pulumi.Int(0),
    	TcpTimeWaitTimeoutSec:        pulumi.Int(0),
    	TcpTransitoryIdleTimeoutSec:  pulumi.Int(0),
    	Type:                         pulumi.String("string"),
    	UdpIdleTimeoutSec:            pulumi.Int(0),
    })
    
    var routerNatResource = new RouterNat("routerNatResource", RouterNatArgs.builder()
        .router("string")
        .sourceSubnetworkIpRangesToNat("string")
        .natIpAllocateOption("string")
        .region("string")
        .endpointTypes("string")
        .icmpIdleTimeoutSec(0)
        .logConfig(RouterNatLogConfigArgs.builder()
            .enable(false)
            .filter("string")
            .build())
        .maxPortsPerVm(0)
        .minPortsPerVm(0)
        .name("string")
        .autoNetworkTier("string")
        .natIps("string")
        .project("string")
        .enableEndpointIndependentMapping(false)
        .enableDynamicPortAllocation(false)
        .rules(RouterNatRuleArgs.builder()
            .match("string")
            .ruleNumber(0)
            .action(RouterNatRuleActionArgs.builder()
                .sourceNatActiveIps("string")
                .sourceNatActiveRanges("string")
                .sourceNatDrainIps("string")
                .sourceNatDrainRanges("string")
                .build())
            .description("string")
            .build())
        .drainNatIps("string")
        .subnetworks(RouterNatSubnetworkArgs.builder()
            .name("string")
            .sourceIpRangesToNats("string")
            .secondaryIpRangeNames("string")
            .build())
        .tcpEstablishedIdleTimeoutSec(0)
        .tcpTimeWaitTimeoutSec(0)
        .tcpTransitoryIdleTimeoutSec(0)
        .type("string")
        .udpIdleTimeoutSec(0)
        .build());
    
    router_nat_resource = gcp.compute.RouterNat("routerNatResource",
        router="string",
        source_subnetwork_ip_ranges_to_nat="string",
        nat_ip_allocate_option="string",
        region="string",
        endpoint_types=["string"],
        icmp_idle_timeout_sec=0,
        log_config=gcp.compute.RouterNatLogConfigArgs(
            enable=False,
            filter="string",
        ),
        max_ports_per_vm=0,
        min_ports_per_vm=0,
        name="string",
        auto_network_tier="string",
        nat_ips=["string"],
        project="string",
        enable_endpoint_independent_mapping=False,
        enable_dynamic_port_allocation=False,
        rules=[gcp.compute.RouterNatRuleArgs(
            match="string",
            rule_number=0,
            action=gcp.compute.RouterNatRuleActionArgs(
                source_nat_active_ips=["string"],
                source_nat_active_ranges=["string"],
                source_nat_drain_ips=["string"],
                source_nat_drain_ranges=["string"],
            ),
            description="string",
        )],
        drain_nat_ips=["string"],
        subnetworks=[gcp.compute.RouterNatSubnetworkArgs(
            name="string",
            source_ip_ranges_to_nats=["string"],
            secondary_ip_range_names=["string"],
        )],
        tcp_established_idle_timeout_sec=0,
        tcp_time_wait_timeout_sec=0,
        tcp_transitory_idle_timeout_sec=0,
        type="string",
        udp_idle_timeout_sec=0)
    
    const routerNatResource = new gcp.compute.RouterNat("routerNatResource", {
        router: "string",
        sourceSubnetworkIpRangesToNat: "string",
        natIpAllocateOption: "string",
        region: "string",
        endpointTypes: ["string"],
        icmpIdleTimeoutSec: 0,
        logConfig: {
            enable: false,
            filter: "string",
        },
        maxPortsPerVm: 0,
        minPortsPerVm: 0,
        name: "string",
        autoNetworkTier: "string",
        natIps: ["string"],
        project: "string",
        enableEndpointIndependentMapping: false,
        enableDynamicPortAllocation: false,
        rules: [{
            match: "string",
            ruleNumber: 0,
            action: {
                sourceNatActiveIps: ["string"],
                sourceNatActiveRanges: ["string"],
                sourceNatDrainIps: ["string"],
                sourceNatDrainRanges: ["string"],
            },
            description: "string",
        }],
        drainNatIps: ["string"],
        subnetworks: [{
            name: "string",
            sourceIpRangesToNats: ["string"],
            secondaryIpRangeNames: ["string"],
        }],
        tcpEstablishedIdleTimeoutSec: 0,
        tcpTimeWaitTimeoutSec: 0,
        tcpTransitoryIdleTimeoutSec: 0,
        type: "string",
        udpIdleTimeoutSec: 0,
    });
    
    type: gcp:compute:RouterNat
    properties:
        autoNetworkTier: string
        drainNatIps:
            - string
        enableDynamicPortAllocation: false
        enableEndpointIndependentMapping: false
        endpointTypes:
            - string
        icmpIdleTimeoutSec: 0
        logConfig:
            enable: false
            filter: string
        maxPortsPerVm: 0
        minPortsPerVm: 0
        name: string
        natIpAllocateOption: string
        natIps:
            - string
        project: string
        region: string
        router: string
        rules:
            - action:
                sourceNatActiveIps:
                    - string
                sourceNatActiveRanges:
                    - string
                sourceNatDrainIps:
                    - string
                sourceNatDrainRanges:
                    - string
              description: string
              match: string
              ruleNumber: 0
        sourceSubnetworkIpRangesToNat: string
        subnetworks:
            - name: string
              secondaryIpRangeNames:
                - string
              sourceIpRangesToNats:
                - string
        tcpEstablishedIdleTimeoutSec: 0
        tcpTimeWaitTimeoutSec: 0
        tcpTransitoryIdleTimeoutSec: 0
        type: string
        udpIdleTimeoutSec: 0
    

    RouterNat Resource Properties

    To learn more about resource properties and how to use them, see Inputs and Outputs in the Architecture and Concepts docs.

    Inputs

    The RouterNat resource accepts the following input properties:

    Router string
    The name of the Cloud Router in which this NAT will be configured.


    SourceSubnetworkIpRangesToNat string
    How NAT should be configured per Subnetwork. If ALL_SUBNETWORKS_ALL_IP_RANGES, all of the IP ranges in every Subnetwork are allowed to Nat. If ALL_SUBNETWORKS_ALL_PRIMARY_IP_RANGES, all of the primary IP ranges in every Subnetwork are allowed to Nat. LIST_OF_SUBNETWORKS: A list of Subnetworks are allowed to Nat (specified in the field subnetwork below). Note that if this field contains ALL_SUBNETWORKS_ALL_IP_RANGES or ALL_SUBNETWORKS_ALL_PRIMARY_IP_RANGES, then there should not be any other RouterNat section in any Router for this network in this region. Possible values are: ALL_SUBNETWORKS_ALL_IP_RANGES, ALL_SUBNETWORKS_ALL_PRIMARY_IP_RANGES, LIST_OF_SUBNETWORKS.
    AutoNetworkTier string
    The network tier to use when automatically reserving NAT IP addresses. Must be one of: PREMIUM, STANDARD. If not specified, then the current project-level default tier is used. Possible values are: PREMIUM, STANDARD.
    DrainNatIps List<string>
    A list of URLs of the IP resources to be drained. These IPs must be valid static external IPs that have been assigned to the NAT.
    EnableDynamicPortAllocation bool
    Enable Dynamic Port Allocation. If minPortsPerVm is set, minPortsPerVm must be set to a power of two greater than or equal to 32. If minPortsPerVm is not set, a minimum of 32 ports will be allocated to a VM from this NAT config. If maxPortsPerVm is set, maxPortsPerVm must be set to a power of two greater than minPortsPerVm. If maxPortsPerVm is not set, a maximum of 65536 ports will be allocated to a VM from this NAT config. Mutually exclusive with enableEndpointIndependentMapping.
    EnableEndpointIndependentMapping bool
    Enable endpoint independent mapping. For more information see the official documentation.
    EndpointTypes List<string>
    Specifies the endpoint Types supported by the NAT Gateway. Supported values include: ENDPOINT_TYPE_VM, ENDPOINT_TYPE_SWG, ENDPOINT_TYPE_MANAGED_PROXY_LB.
    IcmpIdleTimeoutSec int
    Timeout (in seconds) for ICMP connections. Defaults to 30s if not set.
    LogConfig RouterNatLogConfig
    Configuration for logging on NAT Structure is documented below.
    MaxPortsPerVm int
    Maximum number of ports allocated to a VM from this NAT. This field can only be set when enableDynamicPortAllocation is enabled.
    MinPortsPerVm int
    Minimum number of ports allocated to a VM from this NAT. Defaults to 64 for static port allocation and 32 dynamic port allocation if not set.
    Name string
    Name of the NAT service. The name must be 1-63 characters long and comply with RFC1035.
    NatIpAllocateOption string
    How external IPs should be allocated for this NAT. Valid values are AUTO_ONLY for only allowing NAT IPs allocated by Google Cloud Platform, or MANUAL_ONLY for only user-allocated NAT IP addresses. Possible values are: MANUAL_ONLY, AUTO_ONLY.
    NatIps List<string>
    Self-links of NAT IPs. Only valid if natIpAllocateOption is set to MANUAL_ONLY.
    Project string
    The ID of the project in which the resource belongs. If it is not provided, the provider project is used.
    Region string
    Region where the router and NAT reside.
    Rules List<RouterNatRule>
    A list of rules associated with this NAT. Structure is documented below.
    Subnetworks List<RouterNatSubnetwork>
    One or more subnetwork NAT configurations. Only used if source_subnetwork_ip_ranges_to_nat is set to LIST_OF_SUBNETWORKS Structure is documented below.
    TcpEstablishedIdleTimeoutSec int
    Timeout (in seconds) for TCP established connections. Defaults to 1200s if not set.
    TcpTimeWaitTimeoutSec int
    Timeout (in seconds) for TCP connections that are in TIME_WAIT state. Defaults to 120s if not set.
    TcpTransitoryIdleTimeoutSec int
    Timeout (in seconds) for TCP transitory connections. Defaults to 30s if not set.
    Type string
    Indicates whether this NAT is used for public or private IP translation. If unspecified, it defaults to PUBLIC. If PUBLIC NAT used for public IP translation. If PRIVATE NAT used for private IP translation. Default value is PUBLIC. Possible values are: PUBLIC, PRIVATE.
    UdpIdleTimeoutSec int
    Timeout (in seconds) for UDP connections. Defaults to 30s if not set.
    Router string
    The name of the Cloud Router in which this NAT will be configured.


    SourceSubnetworkIpRangesToNat string
    How NAT should be configured per Subnetwork. If ALL_SUBNETWORKS_ALL_IP_RANGES, all of the IP ranges in every Subnetwork are allowed to Nat. If ALL_SUBNETWORKS_ALL_PRIMARY_IP_RANGES, all of the primary IP ranges in every Subnetwork are allowed to Nat. LIST_OF_SUBNETWORKS: A list of Subnetworks are allowed to Nat (specified in the field subnetwork below). Note that if this field contains ALL_SUBNETWORKS_ALL_IP_RANGES or ALL_SUBNETWORKS_ALL_PRIMARY_IP_RANGES, then there should not be any other RouterNat section in any Router for this network in this region. Possible values are: ALL_SUBNETWORKS_ALL_IP_RANGES, ALL_SUBNETWORKS_ALL_PRIMARY_IP_RANGES, LIST_OF_SUBNETWORKS.
    AutoNetworkTier string
    The network tier to use when automatically reserving NAT IP addresses. Must be one of: PREMIUM, STANDARD. If not specified, then the current project-level default tier is used. Possible values are: PREMIUM, STANDARD.
    DrainNatIps []string
    A list of URLs of the IP resources to be drained. These IPs must be valid static external IPs that have been assigned to the NAT.
    EnableDynamicPortAllocation bool
    Enable Dynamic Port Allocation. If minPortsPerVm is set, minPortsPerVm must be set to a power of two greater than or equal to 32. If minPortsPerVm is not set, a minimum of 32 ports will be allocated to a VM from this NAT config. If maxPortsPerVm is set, maxPortsPerVm must be set to a power of two greater than minPortsPerVm. If maxPortsPerVm is not set, a maximum of 65536 ports will be allocated to a VM from this NAT config. Mutually exclusive with enableEndpointIndependentMapping.
    EnableEndpointIndependentMapping bool
    Enable endpoint independent mapping. For more information see the official documentation.
    EndpointTypes []string
    Specifies the endpoint Types supported by the NAT Gateway. Supported values include: ENDPOINT_TYPE_VM, ENDPOINT_TYPE_SWG, ENDPOINT_TYPE_MANAGED_PROXY_LB.
    IcmpIdleTimeoutSec int
    Timeout (in seconds) for ICMP connections. Defaults to 30s if not set.
    LogConfig RouterNatLogConfigArgs
    Configuration for logging on NAT Structure is documented below.
    MaxPortsPerVm int
    Maximum number of ports allocated to a VM from this NAT. This field can only be set when enableDynamicPortAllocation is enabled.
    MinPortsPerVm int
    Minimum number of ports allocated to a VM from this NAT. Defaults to 64 for static port allocation and 32 dynamic port allocation if not set.
    Name string
    Name of the NAT service. The name must be 1-63 characters long and comply with RFC1035.
    NatIpAllocateOption string
    How external IPs should be allocated for this NAT. Valid values are AUTO_ONLY for only allowing NAT IPs allocated by Google Cloud Platform, or MANUAL_ONLY for only user-allocated NAT IP addresses. Possible values are: MANUAL_ONLY, AUTO_ONLY.
    NatIps []string
    Self-links of NAT IPs. Only valid if natIpAllocateOption is set to MANUAL_ONLY.
    Project string
    The ID of the project in which the resource belongs. If it is not provided, the provider project is used.
    Region string
    Region where the router and NAT reside.
    Rules []RouterNatRuleArgs
    A list of rules associated with this NAT. Structure is documented below.
    Subnetworks []RouterNatSubnetworkArgs
    One or more subnetwork NAT configurations. Only used if source_subnetwork_ip_ranges_to_nat is set to LIST_OF_SUBNETWORKS Structure is documented below.
    TcpEstablishedIdleTimeoutSec int
    Timeout (in seconds) for TCP established connections. Defaults to 1200s if not set.
    TcpTimeWaitTimeoutSec int
    Timeout (in seconds) for TCP connections that are in TIME_WAIT state. Defaults to 120s if not set.
    TcpTransitoryIdleTimeoutSec int
    Timeout (in seconds) for TCP transitory connections. Defaults to 30s if not set.
    Type string
    Indicates whether this NAT is used for public or private IP translation. If unspecified, it defaults to PUBLIC. If PUBLIC NAT used for public IP translation. If PRIVATE NAT used for private IP translation. Default value is PUBLIC. Possible values are: PUBLIC, PRIVATE.
    UdpIdleTimeoutSec int
    Timeout (in seconds) for UDP connections. Defaults to 30s if not set.
    router String
    The name of the Cloud Router in which this NAT will be configured.


    sourceSubnetworkIpRangesToNat String
    How NAT should be configured per Subnetwork. If ALL_SUBNETWORKS_ALL_IP_RANGES, all of the IP ranges in every Subnetwork are allowed to Nat. If ALL_SUBNETWORKS_ALL_PRIMARY_IP_RANGES, all of the primary IP ranges in every Subnetwork are allowed to Nat. LIST_OF_SUBNETWORKS: A list of Subnetworks are allowed to Nat (specified in the field subnetwork below). Note that if this field contains ALL_SUBNETWORKS_ALL_IP_RANGES or ALL_SUBNETWORKS_ALL_PRIMARY_IP_RANGES, then there should not be any other RouterNat section in any Router for this network in this region. Possible values are: ALL_SUBNETWORKS_ALL_IP_RANGES, ALL_SUBNETWORKS_ALL_PRIMARY_IP_RANGES, LIST_OF_SUBNETWORKS.
    autoNetworkTier String
    The network tier to use when automatically reserving NAT IP addresses. Must be one of: PREMIUM, STANDARD. If not specified, then the current project-level default tier is used. Possible values are: PREMIUM, STANDARD.
    drainNatIps List<String>
    A list of URLs of the IP resources to be drained. These IPs must be valid static external IPs that have been assigned to the NAT.
    enableDynamicPortAllocation Boolean
    Enable Dynamic Port Allocation. If minPortsPerVm is set, minPortsPerVm must be set to a power of two greater than or equal to 32. If minPortsPerVm is not set, a minimum of 32 ports will be allocated to a VM from this NAT config. If maxPortsPerVm is set, maxPortsPerVm must be set to a power of two greater than minPortsPerVm. If maxPortsPerVm is not set, a maximum of 65536 ports will be allocated to a VM from this NAT config. Mutually exclusive with enableEndpointIndependentMapping.
    enableEndpointIndependentMapping Boolean
    Enable endpoint independent mapping. For more information see the official documentation.
    endpointTypes List<String>
    Specifies the endpoint Types supported by the NAT Gateway. Supported values include: ENDPOINT_TYPE_VM, ENDPOINT_TYPE_SWG, ENDPOINT_TYPE_MANAGED_PROXY_LB.
    icmpIdleTimeoutSec Integer
    Timeout (in seconds) for ICMP connections. Defaults to 30s if not set.
    logConfig RouterNatLogConfig
    Configuration for logging on NAT Structure is documented below.
    maxPortsPerVm Integer
    Maximum number of ports allocated to a VM from this NAT. This field can only be set when enableDynamicPortAllocation is enabled.
    minPortsPerVm Integer
    Minimum number of ports allocated to a VM from this NAT. Defaults to 64 for static port allocation and 32 dynamic port allocation if not set.
    name String
    Name of the NAT service. The name must be 1-63 characters long and comply with RFC1035.
    natIpAllocateOption String
    How external IPs should be allocated for this NAT. Valid values are AUTO_ONLY for only allowing NAT IPs allocated by Google Cloud Platform, or MANUAL_ONLY for only user-allocated NAT IP addresses. Possible values are: MANUAL_ONLY, AUTO_ONLY.
    natIps List<String>
    Self-links of NAT IPs. Only valid if natIpAllocateOption is set to MANUAL_ONLY.
    project String
    The ID of the project in which the resource belongs. If it is not provided, the provider project is used.
    region String
    Region where the router and NAT reside.
    rules List<RouterNatRule>
    A list of rules associated with this NAT. Structure is documented below.
    subnetworks List<RouterNatSubnetwork>
    One or more subnetwork NAT configurations. Only used if source_subnetwork_ip_ranges_to_nat is set to LIST_OF_SUBNETWORKS Structure is documented below.
    tcpEstablishedIdleTimeoutSec Integer
    Timeout (in seconds) for TCP established connections. Defaults to 1200s if not set.
    tcpTimeWaitTimeoutSec Integer
    Timeout (in seconds) for TCP connections that are in TIME_WAIT state. Defaults to 120s if not set.
    tcpTransitoryIdleTimeoutSec Integer
    Timeout (in seconds) for TCP transitory connections. Defaults to 30s if not set.
    type String
    Indicates whether this NAT is used for public or private IP translation. If unspecified, it defaults to PUBLIC. If PUBLIC NAT used for public IP translation. If PRIVATE NAT used for private IP translation. Default value is PUBLIC. Possible values are: PUBLIC, PRIVATE.
    udpIdleTimeoutSec Integer
    Timeout (in seconds) for UDP connections. Defaults to 30s if not set.
    router string
    The name of the Cloud Router in which this NAT will be configured.


    sourceSubnetworkIpRangesToNat string
    How NAT should be configured per Subnetwork. If ALL_SUBNETWORKS_ALL_IP_RANGES, all of the IP ranges in every Subnetwork are allowed to Nat. If ALL_SUBNETWORKS_ALL_PRIMARY_IP_RANGES, all of the primary IP ranges in every Subnetwork are allowed to Nat. LIST_OF_SUBNETWORKS: A list of Subnetworks are allowed to Nat (specified in the field subnetwork below). Note that if this field contains ALL_SUBNETWORKS_ALL_IP_RANGES or ALL_SUBNETWORKS_ALL_PRIMARY_IP_RANGES, then there should not be any other RouterNat section in any Router for this network in this region. Possible values are: ALL_SUBNETWORKS_ALL_IP_RANGES, ALL_SUBNETWORKS_ALL_PRIMARY_IP_RANGES, LIST_OF_SUBNETWORKS.
    autoNetworkTier string
    The network tier to use when automatically reserving NAT IP addresses. Must be one of: PREMIUM, STANDARD. If not specified, then the current project-level default tier is used. Possible values are: PREMIUM, STANDARD.
    drainNatIps string[]
    A list of URLs of the IP resources to be drained. These IPs must be valid static external IPs that have been assigned to the NAT.
    enableDynamicPortAllocation boolean
    Enable Dynamic Port Allocation. If minPortsPerVm is set, minPortsPerVm must be set to a power of two greater than or equal to 32. If minPortsPerVm is not set, a minimum of 32 ports will be allocated to a VM from this NAT config. If maxPortsPerVm is set, maxPortsPerVm must be set to a power of two greater than minPortsPerVm. If maxPortsPerVm is not set, a maximum of 65536 ports will be allocated to a VM from this NAT config. Mutually exclusive with enableEndpointIndependentMapping.
    enableEndpointIndependentMapping boolean
    Enable endpoint independent mapping. For more information see the official documentation.
    endpointTypes string[]
    Specifies the endpoint Types supported by the NAT Gateway. Supported values include: ENDPOINT_TYPE_VM, ENDPOINT_TYPE_SWG, ENDPOINT_TYPE_MANAGED_PROXY_LB.
    icmpIdleTimeoutSec number
    Timeout (in seconds) for ICMP connections. Defaults to 30s if not set.
    logConfig RouterNatLogConfig
    Configuration for logging on NAT Structure is documented below.
    maxPortsPerVm number
    Maximum number of ports allocated to a VM from this NAT. This field can only be set when enableDynamicPortAllocation is enabled.
    minPortsPerVm number
    Minimum number of ports allocated to a VM from this NAT. Defaults to 64 for static port allocation and 32 dynamic port allocation if not set.
    name string
    Name of the NAT service. The name must be 1-63 characters long and comply with RFC1035.
    natIpAllocateOption string
    How external IPs should be allocated for this NAT. Valid values are AUTO_ONLY for only allowing NAT IPs allocated by Google Cloud Platform, or MANUAL_ONLY for only user-allocated NAT IP addresses. Possible values are: MANUAL_ONLY, AUTO_ONLY.
    natIps string[]
    Self-links of NAT IPs. Only valid if natIpAllocateOption is set to MANUAL_ONLY.
    project string
    The ID of the project in which the resource belongs. If it is not provided, the provider project is used.
    region string
    Region where the router and NAT reside.
    rules RouterNatRule[]
    A list of rules associated with this NAT. Structure is documented below.
    subnetworks RouterNatSubnetwork[]
    One or more subnetwork NAT configurations. Only used if source_subnetwork_ip_ranges_to_nat is set to LIST_OF_SUBNETWORKS Structure is documented below.
    tcpEstablishedIdleTimeoutSec number
    Timeout (in seconds) for TCP established connections. Defaults to 1200s if not set.
    tcpTimeWaitTimeoutSec number
    Timeout (in seconds) for TCP connections that are in TIME_WAIT state. Defaults to 120s if not set.
    tcpTransitoryIdleTimeoutSec number
    Timeout (in seconds) for TCP transitory connections. Defaults to 30s if not set.
    type string
    Indicates whether this NAT is used for public or private IP translation. If unspecified, it defaults to PUBLIC. If PUBLIC NAT used for public IP translation. If PRIVATE NAT used for private IP translation. Default value is PUBLIC. Possible values are: PUBLIC, PRIVATE.
    udpIdleTimeoutSec number
    Timeout (in seconds) for UDP connections. Defaults to 30s if not set.
    router str
    The name of the Cloud Router in which this NAT will be configured.


    source_subnetwork_ip_ranges_to_nat str
    How NAT should be configured per Subnetwork. If ALL_SUBNETWORKS_ALL_IP_RANGES, all of the IP ranges in every Subnetwork are allowed to Nat. If ALL_SUBNETWORKS_ALL_PRIMARY_IP_RANGES, all of the primary IP ranges in every Subnetwork are allowed to Nat. LIST_OF_SUBNETWORKS: A list of Subnetworks are allowed to Nat (specified in the field subnetwork below). Note that if this field contains ALL_SUBNETWORKS_ALL_IP_RANGES or ALL_SUBNETWORKS_ALL_PRIMARY_IP_RANGES, then there should not be any other RouterNat section in any Router for this network in this region. Possible values are: ALL_SUBNETWORKS_ALL_IP_RANGES, ALL_SUBNETWORKS_ALL_PRIMARY_IP_RANGES, LIST_OF_SUBNETWORKS.
    auto_network_tier str
    The network tier to use when automatically reserving NAT IP addresses. Must be one of: PREMIUM, STANDARD. If not specified, then the current project-level default tier is used. Possible values are: PREMIUM, STANDARD.
    drain_nat_ips Sequence[str]
    A list of URLs of the IP resources to be drained. These IPs must be valid static external IPs that have been assigned to the NAT.
    enable_dynamic_port_allocation bool
    Enable Dynamic Port Allocation. If minPortsPerVm is set, minPortsPerVm must be set to a power of two greater than or equal to 32. If minPortsPerVm is not set, a minimum of 32 ports will be allocated to a VM from this NAT config. If maxPortsPerVm is set, maxPortsPerVm must be set to a power of two greater than minPortsPerVm. If maxPortsPerVm is not set, a maximum of 65536 ports will be allocated to a VM from this NAT config. Mutually exclusive with enableEndpointIndependentMapping.
    enable_endpoint_independent_mapping bool
    Enable endpoint independent mapping. For more information see the official documentation.
    endpoint_types Sequence[str]
    Specifies the endpoint Types supported by the NAT Gateway. Supported values include: ENDPOINT_TYPE_VM, ENDPOINT_TYPE_SWG, ENDPOINT_TYPE_MANAGED_PROXY_LB.
    icmp_idle_timeout_sec int
    Timeout (in seconds) for ICMP connections. Defaults to 30s if not set.
    log_config RouterNatLogConfigArgs
    Configuration for logging on NAT Structure is documented below.
    max_ports_per_vm int
    Maximum number of ports allocated to a VM from this NAT. This field can only be set when enableDynamicPortAllocation is enabled.
    min_ports_per_vm int
    Minimum number of ports allocated to a VM from this NAT. Defaults to 64 for static port allocation and 32 dynamic port allocation if not set.
    name str
    Name of the NAT service. The name must be 1-63 characters long and comply with RFC1035.
    nat_ip_allocate_option str
    How external IPs should be allocated for this NAT. Valid values are AUTO_ONLY for only allowing NAT IPs allocated by Google Cloud Platform, or MANUAL_ONLY for only user-allocated NAT IP addresses. Possible values are: MANUAL_ONLY, AUTO_ONLY.
    nat_ips Sequence[str]
    Self-links of NAT IPs. Only valid if natIpAllocateOption is set to MANUAL_ONLY.
    project str
    The ID of the project in which the resource belongs. If it is not provided, the provider project is used.
    region str
    Region where the router and NAT reside.
    rules Sequence[RouterNatRuleArgs]
    A list of rules associated with this NAT. Structure is documented below.
    subnetworks Sequence[RouterNatSubnetworkArgs]
    One or more subnetwork NAT configurations. Only used if source_subnetwork_ip_ranges_to_nat is set to LIST_OF_SUBNETWORKS Structure is documented below.
    tcp_established_idle_timeout_sec int
    Timeout (in seconds) for TCP established connections. Defaults to 1200s if not set.
    tcp_time_wait_timeout_sec int
    Timeout (in seconds) for TCP connections that are in TIME_WAIT state. Defaults to 120s if not set.
    tcp_transitory_idle_timeout_sec int
    Timeout (in seconds) for TCP transitory connections. Defaults to 30s if not set.
    type str
    Indicates whether this NAT is used for public or private IP translation. If unspecified, it defaults to PUBLIC. If PUBLIC NAT used for public IP translation. If PRIVATE NAT used for private IP translation. Default value is PUBLIC. Possible values are: PUBLIC, PRIVATE.
    udp_idle_timeout_sec int
    Timeout (in seconds) for UDP connections. Defaults to 30s if not set.
    router String
    The name of the Cloud Router in which this NAT will be configured.


    sourceSubnetworkIpRangesToNat String
    How NAT should be configured per Subnetwork. If ALL_SUBNETWORKS_ALL_IP_RANGES, all of the IP ranges in every Subnetwork are allowed to Nat. If ALL_SUBNETWORKS_ALL_PRIMARY_IP_RANGES, all of the primary IP ranges in every Subnetwork are allowed to Nat. LIST_OF_SUBNETWORKS: A list of Subnetworks are allowed to Nat (specified in the field subnetwork below). Note that if this field contains ALL_SUBNETWORKS_ALL_IP_RANGES or ALL_SUBNETWORKS_ALL_PRIMARY_IP_RANGES, then there should not be any other RouterNat section in any Router for this network in this region. Possible values are: ALL_SUBNETWORKS_ALL_IP_RANGES, ALL_SUBNETWORKS_ALL_PRIMARY_IP_RANGES, LIST_OF_SUBNETWORKS.
    autoNetworkTier String
    The network tier to use when automatically reserving NAT IP addresses. Must be one of: PREMIUM, STANDARD. If not specified, then the current project-level default tier is used. Possible values are: PREMIUM, STANDARD.
    drainNatIps List<String>
    A list of URLs of the IP resources to be drained. These IPs must be valid static external IPs that have been assigned to the NAT.
    enableDynamicPortAllocation Boolean
    Enable Dynamic Port Allocation. If minPortsPerVm is set, minPortsPerVm must be set to a power of two greater than or equal to 32. If minPortsPerVm is not set, a minimum of 32 ports will be allocated to a VM from this NAT config. If maxPortsPerVm is set, maxPortsPerVm must be set to a power of two greater than minPortsPerVm. If maxPortsPerVm is not set, a maximum of 65536 ports will be allocated to a VM from this NAT config. Mutually exclusive with enableEndpointIndependentMapping.
    enableEndpointIndependentMapping Boolean
    Enable endpoint independent mapping. For more information see the official documentation.
    endpointTypes List<String>
    Specifies the endpoint Types supported by the NAT Gateway. Supported values include: ENDPOINT_TYPE_VM, ENDPOINT_TYPE_SWG, ENDPOINT_TYPE_MANAGED_PROXY_LB.
    icmpIdleTimeoutSec Number
    Timeout (in seconds) for ICMP connections. Defaults to 30s if not set.
    logConfig Property Map
    Configuration for logging on NAT Structure is documented below.
    maxPortsPerVm Number
    Maximum number of ports allocated to a VM from this NAT. This field can only be set when enableDynamicPortAllocation is enabled.
    minPortsPerVm Number
    Minimum number of ports allocated to a VM from this NAT. Defaults to 64 for static port allocation and 32 dynamic port allocation if not set.
    name String
    Name of the NAT service. The name must be 1-63 characters long and comply with RFC1035.
    natIpAllocateOption String
    How external IPs should be allocated for this NAT. Valid values are AUTO_ONLY for only allowing NAT IPs allocated by Google Cloud Platform, or MANUAL_ONLY for only user-allocated NAT IP addresses. Possible values are: MANUAL_ONLY, AUTO_ONLY.
    natIps List<String>
    Self-links of NAT IPs. Only valid if natIpAllocateOption is set to MANUAL_ONLY.
    project String
    The ID of the project in which the resource belongs. If it is not provided, the provider project is used.
    region String
    Region where the router and NAT reside.
    rules List<Property Map>
    A list of rules associated with this NAT. Structure is documented below.
    subnetworks List<Property Map>
    One or more subnetwork NAT configurations. Only used if source_subnetwork_ip_ranges_to_nat is set to LIST_OF_SUBNETWORKS Structure is documented below.
    tcpEstablishedIdleTimeoutSec Number
    Timeout (in seconds) for TCP established connections. Defaults to 1200s if not set.
    tcpTimeWaitTimeoutSec Number
    Timeout (in seconds) for TCP connections that are in TIME_WAIT state. Defaults to 120s if not set.
    tcpTransitoryIdleTimeoutSec Number
    Timeout (in seconds) for TCP transitory connections. Defaults to 30s if not set.
    type String
    Indicates whether this NAT is used for public or private IP translation. If unspecified, it defaults to PUBLIC. If PUBLIC NAT used for public IP translation. If PRIVATE NAT used for private IP translation. Default value is PUBLIC. Possible values are: PUBLIC, PRIVATE.
    udpIdleTimeoutSec Number
    Timeout (in seconds) for UDP connections. Defaults to 30s if not set.

    Outputs

    All input properties are implicitly available as output properties. Additionally, the RouterNat resource produces the following output properties:

    Id string
    The provider-assigned unique ID for this managed resource.
    Id string
    The provider-assigned unique ID for this managed resource.
    id String
    The provider-assigned unique ID for this managed resource.
    id string
    The provider-assigned unique ID for this managed resource.
    id str
    The provider-assigned unique ID for this managed resource.
    id String
    The provider-assigned unique ID for this managed resource.

    Look up Existing RouterNat Resource

    Get an existing RouterNat resource’s state with the given name, ID, and optional extra properties used to qualify the lookup.

    public static get(name: string, id: Input<ID>, state?: RouterNatState, opts?: CustomResourceOptions): RouterNat
    @staticmethod
    def get(resource_name: str,
            id: str,
            opts: Optional[ResourceOptions] = None,
            auto_network_tier: Optional[str] = None,
            drain_nat_ips: Optional[Sequence[str]] = None,
            enable_dynamic_port_allocation: Optional[bool] = None,
            enable_endpoint_independent_mapping: Optional[bool] = None,
            endpoint_types: Optional[Sequence[str]] = None,
            icmp_idle_timeout_sec: Optional[int] = None,
            log_config: Optional[RouterNatLogConfigArgs] = None,
            max_ports_per_vm: Optional[int] = None,
            min_ports_per_vm: Optional[int] = None,
            name: Optional[str] = None,
            nat_ip_allocate_option: Optional[str] = None,
            nat_ips: Optional[Sequence[str]] = None,
            project: Optional[str] = None,
            region: Optional[str] = None,
            router: Optional[str] = None,
            rules: Optional[Sequence[RouterNatRuleArgs]] = None,
            source_subnetwork_ip_ranges_to_nat: Optional[str] = None,
            subnetworks: Optional[Sequence[RouterNatSubnetworkArgs]] = None,
            tcp_established_idle_timeout_sec: Optional[int] = None,
            tcp_time_wait_timeout_sec: Optional[int] = None,
            tcp_transitory_idle_timeout_sec: Optional[int] = None,
            type: Optional[str] = None,
            udp_idle_timeout_sec: Optional[int] = None) -> RouterNat
    func GetRouterNat(ctx *Context, name string, id IDInput, state *RouterNatState, opts ...ResourceOption) (*RouterNat, error)
    public static RouterNat Get(string name, Input<string> id, RouterNatState? state, CustomResourceOptions? opts = null)
    public static RouterNat get(String name, Output<String> id, RouterNatState state, CustomResourceOptions options)
    Resource lookup is not supported in YAML
    name
    The unique name of the resulting resource.
    id
    The unique provider ID of the resource to lookup.
    state
    Any extra arguments used during the lookup.
    opts
    A bag of options that control this resource's behavior.
    resource_name
    The unique name of the resulting resource.
    id
    The unique provider ID of the resource to lookup.
    name
    The unique name of the resulting resource.
    id
    The unique provider ID of the resource to lookup.
    state
    Any extra arguments used during the lookup.
    opts
    A bag of options that control this resource's behavior.
    name
    The unique name of the resulting resource.
    id
    The unique provider ID of the resource to lookup.
    state
    Any extra arguments used during the lookup.
    opts
    A bag of options that control this resource's behavior.
    name
    The unique name of the resulting resource.
    id
    The unique provider ID of the resource to lookup.
    state
    Any extra arguments used during the lookup.
    opts
    A bag of options that control this resource's behavior.
    The following state arguments are supported:
    AutoNetworkTier string
    The network tier to use when automatically reserving NAT IP addresses. Must be one of: PREMIUM, STANDARD. If not specified, then the current project-level default tier is used. Possible values are: PREMIUM, STANDARD.
    DrainNatIps List<string>
    A list of URLs of the IP resources to be drained. These IPs must be valid static external IPs that have been assigned to the NAT.
    EnableDynamicPortAllocation bool
    Enable Dynamic Port Allocation. If minPortsPerVm is set, minPortsPerVm must be set to a power of two greater than or equal to 32. If minPortsPerVm is not set, a minimum of 32 ports will be allocated to a VM from this NAT config. If maxPortsPerVm is set, maxPortsPerVm must be set to a power of two greater than minPortsPerVm. If maxPortsPerVm is not set, a maximum of 65536 ports will be allocated to a VM from this NAT config. Mutually exclusive with enableEndpointIndependentMapping.
    EnableEndpointIndependentMapping bool
    Enable endpoint independent mapping. For more information see the official documentation.
    EndpointTypes List<string>
    Specifies the endpoint Types supported by the NAT Gateway. Supported values include: ENDPOINT_TYPE_VM, ENDPOINT_TYPE_SWG, ENDPOINT_TYPE_MANAGED_PROXY_LB.
    IcmpIdleTimeoutSec int
    Timeout (in seconds) for ICMP connections. Defaults to 30s if not set.
    LogConfig RouterNatLogConfig
    Configuration for logging on NAT Structure is documented below.
    MaxPortsPerVm int
    Maximum number of ports allocated to a VM from this NAT. This field can only be set when enableDynamicPortAllocation is enabled.
    MinPortsPerVm int
    Minimum number of ports allocated to a VM from this NAT. Defaults to 64 for static port allocation and 32 dynamic port allocation if not set.
    Name string
    Name of the NAT service. The name must be 1-63 characters long and comply with RFC1035.
    NatIpAllocateOption string
    How external IPs should be allocated for this NAT. Valid values are AUTO_ONLY for only allowing NAT IPs allocated by Google Cloud Platform, or MANUAL_ONLY for only user-allocated NAT IP addresses. Possible values are: MANUAL_ONLY, AUTO_ONLY.
    NatIps List<string>
    Self-links of NAT IPs. Only valid if natIpAllocateOption is set to MANUAL_ONLY.
    Project string
    The ID of the project in which the resource belongs. If it is not provided, the provider project is used.
    Region string
    Region where the router and NAT reside.
    Router string
    The name of the Cloud Router in which this NAT will be configured.


    Rules List<RouterNatRule>
    A list of rules associated with this NAT. Structure is documented below.
    SourceSubnetworkIpRangesToNat string
    How NAT should be configured per Subnetwork. If ALL_SUBNETWORKS_ALL_IP_RANGES, all of the IP ranges in every Subnetwork are allowed to Nat. If ALL_SUBNETWORKS_ALL_PRIMARY_IP_RANGES, all of the primary IP ranges in every Subnetwork are allowed to Nat. LIST_OF_SUBNETWORKS: A list of Subnetworks are allowed to Nat (specified in the field subnetwork below). Note that if this field contains ALL_SUBNETWORKS_ALL_IP_RANGES or ALL_SUBNETWORKS_ALL_PRIMARY_IP_RANGES, then there should not be any other RouterNat section in any Router for this network in this region. Possible values are: ALL_SUBNETWORKS_ALL_IP_RANGES, ALL_SUBNETWORKS_ALL_PRIMARY_IP_RANGES, LIST_OF_SUBNETWORKS.
    Subnetworks List<RouterNatSubnetwork>
    One or more subnetwork NAT configurations. Only used if source_subnetwork_ip_ranges_to_nat is set to LIST_OF_SUBNETWORKS Structure is documented below.
    TcpEstablishedIdleTimeoutSec int
    Timeout (in seconds) for TCP established connections. Defaults to 1200s if not set.
    TcpTimeWaitTimeoutSec int
    Timeout (in seconds) for TCP connections that are in TIME_WAIT state. Defaults to 120s if not set.
    TcpTransitoryIdleTimeoutSec int
    Timeout (in seconds) for TCP transitory connections. Defaults to 30s if not set.
    Type string
    Indicates whether this NAT is used for public or private IP translation. If unspecified, it defaults to PUBLIC. If PUBLIC NAT used for public IP translation. If PRIVATE NAT used for private IP translation. Default value is PUBLIC. Possible values are: PUBLIC, PRIVATE.
    UdpIdleTimeoutSec int
    Timeout (in seconds) for UDP connections. Defaults to 30s if not set.
    AutoNetworkTier string
    The network tier to use when automatically reserving NAT IP addresses. Must be one of: PREMIUM, STANDARD. If not specified, then the current project-level default tier is used. Possible values are: PREMIUM, STANDARD.
    DrainNatIps []string
    A list of URLs of the IP resources to be drained. These IPs must be valid static external IPs that have been assigned to the NAT.
    EnableDynamicPortAllocation bool
    Enable Dynamic Port Allocation. If minPortsPerVm is set, minPortsPerVm must be set to a power of two greater than or equal to 32. If minPortsPerVm is not set, a minimum of 32 ports will be allocated to a VM from this NAT config. If maxPortsPerVm is set, maxPortsPerVm must be set to a power of two greater than minPortsPerVm. If maxPortsPerVm is not set, a maximum of 65536 ports will be allocated to a VM from this NAT config. Mutually exclusive with enableEndpointIndependentMapping.
    EnableEndpointIndependentMapping bool
    Enable endpoint independent mapping. For more information see the official documentation.
    EndpointTypes []string
    Specifies the endpoint Types supported by the NAT Gateway. Supported values include: ENDPOINT_TYPE_VM, ENDPOINT_TYPE_SWG, ENDPOINT_TYPE_MANAGED_PROXY_LB.
    IcmpIdleTimeoutSec int
    Timeout (in seconds) for ICMP connections. Defaults to 30s if not set.
    LogConfig RouterNatLogConfigArgs
    Configuration for logging on NAT Structure is documented below.
    MaxPortsPerVm int
    Maximum number of ports allocated to a VM from this NAT. This field can only be set when enableDynamicPortAllocation is enabled.
    MinPortsPerVm int
    Minimum number of ports allocated to a VM from this NAT. Defaults to 64 for static port allocation and 32 dynamic port allocation if not set.
    Name string
    Name of the NAT service. The name must be 1-63 characters long and comply with RFC1035.
    NatIpAllocateOption string
    How external IPs should be allocated for this NAT. Valid values are AUTO_ONLY for only allowing NAT IPs allocated by Google Cloud Platform, or MANUAL_ONLY for only user-allocated NAT IP addresses. Possible values are: MANUAL_ONLY, AUTO_ONLY.
    NatIps []string
    Self-links of NAT IPs. Only valid if natIpAllocateOption is set to MANUAL_ONLY.
    Project string
    The ID of the project in which the resource belongs. If it is not provided, the provider project is used.
    Region string
    Region where the router and NAT reside.
    Router string
    The name of the Cloud Router in which this NAT will be configured.


    Rules []RouterNatRuleArgs
    A list of rules associated with this NAT. Structure is documented below.
    SourceSubnetworkIpRangesToNat string
    How NAT should be configured per Subnetwork. If ALL_SUBNETWORKS_ALL_IP_RANGES, all of the IP ranges in every Subnetwork are allowed to Nat. If ALL_SUBNETWORKS_ALL_PRIMARY_IP_RANGES, all of the primary IP ranges in every Subnetwork are allowed to Nat. LIST_OF_SUBNETWORKS: A list of Subnetworks are allowed to Nat (specified in the field subnetwork below). Note that if this field contains ALL_SUBNETWORKS_ALL_IP_RANGES or ALL_SUBNETWORKS_ALL_PRIMARY_IP_RANGES, then there should not be any other RouterNat section in any Router for this network in this region. Possible values are: ALL_SUBNETWORKS_ALL_IP_RANGES, ALL_SUBNETWORKS_ALL_PRIMARY_IP_RANGES, LIST_OF_SUBNETWORKS.
    Subnetworks []RouterNatSubnetworkArgs
    One or more subnetwork NAT configurations. Only used if source_subnetwork_ip_ranges_to_nat is set to LIST_OF_SUBNETWORKS Structure is documented below.
    TcpEstablishedIdleTimeoutSec int
    Timeout (in seconds) for TCP established connections. Defaults to 1200s if not set.
    TcpTimeWaitTimeoutSec int
    Timeout (in seconds) for TCP connections that are in TIME_WAIT state. Defaults to 120s if not set.
    TcpTransitoryIdleTimeoutSec int
    Timeout (in seconds) for TCP transitory connections. Defaults to 30s if not set.
    Type string
    Indicates whether this NAT is used for public or private IP translation. If unspecified, it defaults to PUBLIC. If PUBLIC NAT used for public IP translation. If PRIVATE NAT used for private IP translation. Default value is PUBLIC. Possible values are: PUBLIC, PRIVATE.
    UdpIdleTimeoutSec int
    Timeout (in seconds) for UDP connections. Defaults to 30s if not set.
    autoNetworkTier String
    The network tier to use when automatically reserving NAT IP addresses. Must be one of: PREMIUM, STANDARD. If not specified, then the current project-level default tier is used. Possible values are: PREMIUM, STANDARD.
    drainNatIps List<String>
    A list of URLs of the IP resources to be drained. These IPs must be valid static external IPs that have been assigned to the NAT.
    enableDynamicPortAllocation Boolean
    Enable Dynamic Port Allocation. If minPortsPerVm is set, minPortsPerVm must be set to a power of two greater than or equal to 32. If minPortsPerVm is not set, a minimum of 32 ports will be allocated to a VM from this NAT config. If maxPortsPerVm is set, maxPortsPerVm must be set to a power of two greater than minPortsPerVm. If maxPortsPerVm is not set, a maximum of 65536 ports will be allocated to a VM from this NAT config. Mutually exclusive with enableEndpointIndependentMapping.
    enableEndpointIndependentMapping Boolean
    Enable endpoint independent mapping. For more information see the official documentation.
    endpointTypes List<String>
    Specifies the endpoint Types supported by the NAT Gateway. Supported values include: ENDPOINT_TYPE_VM, ENDPOINT_TYPE_SWG, ENDPOINT_TYPE_MANAGED_PROXY_LB.
    icmpIdleTimeoutSec Integer
    Timeout (in seconds) for ICMP connections. Defaults to 30s if not set.
    logConfig RouterNatLogConfig
    Configuration for logging on NAT Structure is documented below.
    maxPortsPerVm Integer
    Maximum number of ports allocated to a VM from this NAT. This field can only be set when enableDynamicPortAllocation is enabled.
    minPortsPerVm Integer
    Minimum number of ports allocated to a VM from this NAT. Defaults to 64 for static port allocation and 32 dynamic port allocation if not set.
    name String
    Name of the NAT service. The name must be 1-63 characters long and comply with RFC1035.
    natIpAllocateOption String
    How external IPs should be allocated for this NAT. Valid values are AUTO_ONLY for only allowing NAT IPs allocated by Google Cloud Platform, or MANUAL_ONLY for only user-allocated NAT IP addresses. Possible values are: MANUAL_ONLY, AUTO_ONLY.
    natIps List<String>
    Self-links of NAT IPs. Only valid if natIpAllocateOption is set to MANUAL_ONLY.
    project String
    The ID of the project in which the resource belongs. If it is not provided, the provider project is used.
    region String
    Region where the router and NAT reside.
    router String
    The name of the Cloud Router in which this NAT will be configured.


    rules List<RouterNatRule>
    A list of rules associated with this NAT. Structure is documented below.
    sourceSubnetworkIpRangesToNat String
    How NAT should be configured per Subnetwork. If ALL_SUBNETWORKS_ALL_IP_RANGES, all of the IP ranges in every Subnetwork are allowed to Nat. If ALL_SUBNETWORKS_ALL_PRIMARY_IP_RANGES, all of the primary IP ranges in every Subnetwork are allowed to Nat. LIST_OF_SUBNETWORKS: A list of Subnetworks are allowed to Nat (specified in the field subnetwork below). Note that if this field contains ALL_SUBNETWORKS_ALL_IP_RANGES or ALL_SUBNETWORKS_ALL_PRIMARY_IP_RANGES, then there should not be any other RouterNat section in any Router for this network in this region. Possible values are: ALL_SUBNETWORKS_ALL_IP_RANGES, ALL_SUBNETWORKS_ALL_PRIMARY_IP_RANGES, LIST_OF_SUBNETWORKS.
    subnetworks List<RouterNatSubnetwork>
    One or more subnetwork NAT configurations. Only used if source_subnetwork_ip_ranges_to_nat is set to LIST_OF_SUBNETWORKS Structure is documented below.
    tcpEstablishedIdleTimeoutSec Integer
    Timeout (in seconds) for TCP established connections. Defaults to 1200s if not set.
    tcpTimeWaitTimeoutSec Integer
    Timeout (in seconds) for TCP connections that are in TIME_WAIT state. Defaults to 120s if not set.
    tcpTransitoryIdleTimeoutSec Integer
    Timeout (in seconds) for TCP transitory connections. Defaults to 30s if not set.
    type String
    Indicates whether this NAT is used for public or private IP translation. If unspecified, it defaults to PUBLIC. If PUBLIC NAT used for public IP translation. If PRIVATE NAT used for private IP translation. Default value is PUBLIC. Possible values are: PUBLIC, PRIVATE.
    udpIdleTimeoutSec Integer
    Timeout (in seconds) for UDP connections. Defaults to 30s if not set.
    autoNetworkTier string
    The network tier to use when automatically reserving NAT IP addresses. Must be one of: PREMIUM, STANDARD. If not specified, then the current project-level default tier is used. Possible values are: PREMIUM, STANDARD.
    drainNatIps string[]
    A list of URLs of the IP resources to be drained. These IPs must be valid static external IPs that have been assigned to the NAT.
    enableDynamicPortAllocation boolean
    Enable Dynamic Port Allocation. If minPortsPerVm is set, minPortsPerVm must be set to a power of two greater than or equal to 32. If minPortsPerVm is not set, a minimum of 32 ports will be allocated to a VM from this NAT config. If maxPortsPerVm is set, maxPortsPerVm must be set to a power of two greater than minPortsPerVm. If maxPortsPerVm is not set, a maximum of 65536 ports will be allocated to a VM from this NAT config. Mutually exclusive with enableEndpointIndependentMapping.
    enableEndpointIndependentMapping boolean
    Enable endpoint independent mapping. For more information see the official documentation.
    endpointTypes string[]
    Specifies the endpoint Types supported by the NAT Gateway. Supported values include: ENDPOINT_TYPE_VM, ENDPOINT_TYPE_SWG, ENDPOINT_TYPE_MANAGED_PROXY_LB.
    icmpIdleTimeoutSec number
    Timeout (in seconds) for ICMP connections. Defaults to 30s if not set.
    logConfig RouterNatLogConfig
    Configuration for logging on NAT Structure is documented below.
    maxPortsPerVm number
    Maximum number of ports allocated to a VM from this NAT. This field can only be set when enableDynamicPortAllocation is enabled.
    minPortsPerVm number
    Minimum number of ports allocated to a VM from this NAT. Defaults to 64 for static port allocation and 32 dynamic port allocation if not set.
    name string
    Name of the NAT service. The name must be 1-63 characters long and comply with RFC1035.
    natIpAllocateOption string
    How external IPs should be allocated for this NAT. Valid values are AUTO_ONLY for only allowing NAT IPs allocated by Google Cloud Platform, or MANUAL_ONLY for only user-allocated NAT IP addresses. Possible values are: MANUAL_ONLY, AUTO_ONLY.
    natIps string[]
    Self-links of NAT IPs. Only valid if natIpAllocateOption is set to MANUAL_ONLY.
    project string
    The ID of the project in which the resource belongs. If it is not provided, the provider project is used.
    region string
    Region where the router and NAT reside.
    router string
    The name of the Cloud Router in which this NAT will be configured.


    rules RouterNatRule[]
    A list of rules associated with this NAT. Structure is documented below.
    sourceSubnetworkIpRangesToNat string
    How NAT should be configured per Subnetwork. If ALL_SUBNETWORKS_ALL_IP_RANGES, all of the IP ranges in every Subnetwork are allowed to Nat. If ALL_SUBNETWORKS_ALL_PRIMARY_IP_RANGES, all of the primary IP ranges in every Subnetwork are allowed to Nat. LIST_OF_SUBNETWORKS: A list of Subnetworks are allowed to Nat (specified in the field subnetwork below). Note that if this field contains ALL_SUBNETWORKS_ALL_IP_RANGES or ALL_SUBNETWORKS_ALL_PRIMARY_IP_RANGES, then there should not be any other RouterNat section in any Router for this network in this region. Possible values are: ALL_SUBNETWORKS_ALL_IP_RANGES, ALL_SUBNETWORKS_ALL_PRIMARY_IP_RANGES, LIST_OF_SUBNETWORKS.
    subnetworks RouterNatSubnetwork[]
    One or more subnetwork NAT configurations. Only used if source_subnetwork_ip_ranges_to_nat is set to LIST_OF_SUBNETWORKS Structure is documented below.
    tcpEstablishedIdleTimeoutSec number
    Timeout (in seconds) for TCP established connections. Defaults to 1200s if not set.
    tcpTimeWaitTimeoutSec number
    Timeout (in seconds) for TCP connections that are in TIME_WAIT state. Defaults to 120s if not set.
    tcpTransitoryIdleTimeoutSec number
    Timeout (in seconds) for TCP transitory connections. Defaults to 30s if not set.
    type string
    Indicates whether this NAT is used for public or private IP translation. If unspecified, it defaults to PUBLIC. If PUBLIC NAT used for public IP translation. If PRIVATE NAT used for private IP translation. Default value is PUBLIC. Possible values are: PUBLIC, PRIVATE.
    udpIdleTimeoutSec number
    Timeout (in seconds) for UDP connections. Defaults to 30s if not set.
    auto_network_tier str
    The network tier to use when automatically reserving NAT IP addresses. Must be one of: PREMIUM, STANDARD. If not specified, then the current project-level default tier is used. Possible values are: PREMIUM, STANDARD.
    drain_nat_ips Sequence[str]
    A list of URLs of the IP resources to be drained. These IPs must be valid static external IPs that have been assigned to the NAT.
    enable_dynamic_port_allocation bool
    Enable Dynamic Port Allocation. If minPortsPerVm is set, minPortsPerVm must be set to a power of two greater than or equal to 32. If minPortsPerVm is not set, a minimum of 32 ports will be allocated to a VM from this NAT config. If maxPortsPerVm is set, maxPortsPerVm must be set to a power of two greater than minPortsPerVm. If maxPortsPerVm is not set, a maximum of 65536 ports will be allocated to a VM from this NAT config. Mutually exclusive with enableEndpointIndependentMapping.
    enable_endpoint_independent_mapping bool
    Enable endpoint independent mapping. For more information see the official documentation.
    endpoint_types Sequence[str]
    Specifies the endpoint Types supported by the NAT Gateway. Supported values include: ENDPOINT_TYPE_VM, ENDPOINT_TYPE_SWG, ENDPOINT_TYPE_MANAGED_PROXY_LB.
    icmp_idle_timeout_sec int
    Timeout (in seconds) for ICMP connections. Defaults to 30s if not set.
    log_config RouterNatLogConfigArgs
    Configuration for logging on NAT Structure is documented below.
    max_ports_per_vm int
    Maximum number of ports allocated to a VM from this NAT. This field can only be set when enableDynamicPortAllocation is enabled.
    min_ports_per_vm int
    Minimum number of ports allocated to a VM from this NAT. Defaults to 64 for static port allocation and 32 dynamic port allocation if not set.
    name str
    Name of the NAT service. The name must be 1-63 characters long and comply with RFC1035.
    nat_ip_allocate_option str
    How external IPs should be allocated for this NAT. Valid values are AUTO_ONLY for only allowing NAT IPs allocated by Google Cloud Platform, or MANUAL_ONLY for only user-allocated NAT IP addresses. Possible values are: MANUAL_ONLY, AUTO_ONLY.
    nat_ips Sequence[str]
    Self-links of NAT IPs. Only valid if natIpAllocateOption is set to MANUAL_ONLY.
    project str
    The ID of the project in which the resource belongs. If it is not provided, the provider project is used.
    region str
    Region where the router and NAT reside.
    router str
    The name of the Cloud Router in which this NAT will be configured.


    rules Sequence[RouterNatRuleArgs]
    A list of rules associated with this NAT. Structure is documented below.
    source_subnetwork_ip_ranges_to_nat str
    How NAT should be configured per Subnetwork. If ALL_SUBNETWORKS_ALL_IP_RANGES, all of the IP ranges in every Subnetwork are allowed to Nat. If ALL_SUBNETWORKS_ALL_PRIMARY_IP_RANGES, all of the primary IP ranges in every Subnetwork are allowed to Nat. LIST_OF_SUBNETWORKS: A list of Subnetworks are allowed to Nat (specified in the field subnetwork below). Note that if this field contains ALL_SUBNETWORKS_ALL_IP_RANGES or ALL_SUBNETWORKS_ALL_PRIMARY_IP_RANGES, then there should not be any other RouterNat section in any Router for this network in this region. Possible values are: ALL_SUBNETWORKS_ALL_IP_RANGES, ALL_SUBNETWORKS_ALL_PRIMARY_IP_RANGES, LIST_OF_SUBNETWORKS.
    subnetworks Sequence[RouterNatSubnetworkArgs]
    One or more subnetwork NAT configurations. Only used if source_subnetwork_ip_ranges_to_nat is set to LIST_OF_SUBNETWORKS Structure is documented below.
    tcp_established_idle_timeout_sec int
    Timeout (in seconds) for TCP established connections. Defaults to 1200s if not set.
    tcp_time_wait_timeout_sec int
    Timeout (in seconds) for TCP connections that are in TIME_WAIT state. Defaults to 120s if not set.
    tcp_transitory_idle_timeout_sec int
    Timeout (in seconds) for TCP transitory connections. Defaults to 30s if not set.
    type str
    Indicates whether this NAT is used for public or private IP translation. If unspecified, it defaults to PUBLIC. If PUBLIC NAT used for public IP translation. If PRIVATE NAT used for private IP translation. Default value is PUBLIC. Possible values are: PUBLIC, PRIVATE.
    udp_idle_timeout_sec int
    Timeout (in seconds) for UDP connections. Defaults to 30s if not set.
    autoNetworkTier String
    The network tier to use when automatically reserving NAT IP addresses. Must be one of: PREMIUM, STANDARD. If not specified, then the current project-level default tier is used. Possible values are: PREMIUM, STANDARD.
    drainNatIps List<String>
    A list of URLs of the IP resources to be drained. These IPs must be valid static external IPs that have been assigned to the NAT.
    enableDynamicPortAllocation Boolean
    Enable Dynamic Port Allocation. If minPortsPerVm is set, minPortsPerVm must be set to a power of two greater than or equal to 32. If minPortsPerVm is not set, a minimum of 32 ports will be allocated to a VM from this NAT config. If maxPortsPerVm is set, maxPortsPerVm must be set to a power of two greater than minPortsPerVm. If maxPortsPerVm is not set, a maximum of 65536 ports will be allocated to a VM from this NAT config. Mutually exclusive with enableEndpointIndependentMapping.
    enableEndpointIndependentMapping Boolean
    Enable endpoint independent mapping. For more information see the official documentation.
    endpointTypes List<String>
    Specifies the endpoint Types supported by the NAT Gateway. Supported values include: ENDPOINT_TYPE_VM, ENDPOINT_TYPE_SWG, ENDPOINT_TYPE_MANAGED_PROXY_LB.
    icmpIdleTimeoutSec Number
    Timeout (in seconds) for ICMP connections. Defaults to 30s if not set.
    logConfig Property Map
    Configuration for logging on NAT Structure is documented below.
    maxPortsPerVm Number
    Maximum number of ports allocated to a VM from this NAT. This field can only be set when enableDynamicPortAllocation is enabled.
    minPortsPerVm Number
    Minimum number of ports allocated to a VM from this NAT. Defaults to 64 for static port allocation and 32 dynamic port allocation if not set.
    name String
    Name of the NAT service. The name must be 1-63 characters long and comply with RFC1035.
    natIpAllocateOption String
    How external IPs should be allocated for this NAT. Valid values are AUTO_ONLY for only allowing NAT IPs allocated by Google Cloud Platform, or MANUAL_ONLY for only user-allocated NAT IP addresses. Possible values are: MANUAL_ONLY, AUTO_ONLY.
    natIps List<String>
    Self-links of NAT IPs. Only valid if natIpAllocateOption is set to MANUAL_ONLY.
    project String
    The ID of the project in which the resource belongs. If it is not provided, the provider project is used.
    region String
    Region where the router and NAT reside.
    router String
    The name of the Cloud Router in which this NAT will be configured.


    rules List<Property Map>
    A list of rules associated with this NAT. Structure is documented below.
    sourceSubnetworkIpRangesToNat String
    How NAT should be configured per Subnetwork. If ALL_SUBNETWORKS_ALL_IP_RANGES, all of the IP ranges in every Subnetwork are allowed to Nat. If ALL_SUBNETWORKS_ALL_PRIMARY_IP_RANGES, all of the primary IP ranges in every Subnetwork are allowed to Nat. LIST_OF_SUBNETWORKS: A list of Subnetworks are allowed to Nat (specified in the field subnetwork below). Note that if this field contains ALL_SUBNETWORKS_ALL_IP_RANGES or ALL_SUBNETWORKS_ALL_PRIMARY_IP_RANGES, then there should not be any other RouterNat section in any Router for this network in this region. Possible values are: ALL_SUBNETWORKS_ALL_IP_RANGES, ALL_SUBNETWORKS_ALL_PRIMARY_IP_RANGES, LIST_OF_SUBNETWORKS.
    subnetworks List<Property Map>
    One or more subnetwork NAT configurations. Only used if source_subnetwork_ip_ranges_to_nat is set to LIST_OF_SUBNETWORKS Structure is documented below.
    tcpEstablishedIdleTimeoutSec Number
    Timeout (in seconds) for TCP established connections. Defaults to 1200s if not set.
    tcpTimeWaitTimeoutSec Number
    Timeout (in seconds) for TCP connections that are in TIME_WAIT state. Defaults to 120s if not set.
    tcpTransitoryIdleTimeoutSec Number
    Timeout (in seconds) for TCP transitory connections. Defaults to 30s if not set.
    type String
    Indicates whether this NAT is used for public or private IP translation. If unspecified, it defaults to PUBLIC. If PUBLIC NAT used for public IP translation. If PRIVATE NAT used for private IP translation. Default value is PUBLIC. Possible values are: PUBLIC, PRIVATE.
    udpIdleTimeoutSec Number
    Timeout (in seconds) for UDP connections. Defaults to 30s if not set.

    Supporting Types

    RouterNatLogConfig, RouterNatLogConfigArgs

    Enable bool
    Indicates whether or not to export logs.
    Filter string
    Specifies the desired filtering of logs on this NAT. Possible values are: ERRORS_ONLY, TRANSLATIONS_ONLY, ALL.
    Enable bool
    Indicates whether or not to export logs.
    Filter string
    Specifies the desired filtering of logs on this NAT. Possible values are: ERRORS_ONLY, TRANSLATIONS_ONLY, ALL.
    enable Boolean
    Indicates whether or not to export logs.
    filter String
    Specifies the desired filtering of logs on this NAT. Possible values are: ERRORS_ONLY, TRANSLATIONS_ONLY, ALL.
    enable boolean
    Indicates whether or not to export logs.
    filter string
    Specifies the desired filtering of logs on this NAT. Possible values are: ERRORS_ONLY, TRANSLATIONS_ONLY, ALL.
    enable bool
    Indicates whether or not to export logs.
    filter str
    Specifies the desired filtering of logs on this NAT. Possible values are: ERRORS_ONLY, TRANSLATIONS_ONLY, ALL.
    enable Boolean
    Indicates whether or not to export logs.
    filter String
    Specifies the desired filtering of logs on this NAT. Possible values are: ERRORS_ONLY, TRANSLATIONS_ONLY, ALL.

    RouterNatRule, RouterNatRuleArgs

    Match string
    CEL expression that specifies the match condition that egress traffic from a VM is evaluated against. If it evaluates to true, the corresponding action is enforced. The following examples are valid match expressions for public NAT: "inIpRange(destination.ip, '1.1.0.0/16') || inIpRange(destination.ip, '2.2.0.0/16')" "destination.ip == '1.1.0.1' || destination.ip == '8.8.8.8'" The following example is a valid match expression for private NAT: "nexthop.hub == 'https://networkconnectivity.googleapis.com/v1alpha1/projects/my-project/global/hub/hub-1'"
    RuleNumber int
    An integer uniquely identifying a rule in the list. The rule number must be a positive value between 0 and 65000, and must be unique among rules within a NAT.
    Action RouterNatRuleAction
    The action to be enforced for traffic that matches this rule. Structure is documented below.
    Description string
    An optional description of this rule.
    Match string
    CEL expression that specifies the match condition that egress traffic from a VM is evaluated against. If it evaluates to true, the corresponding action is enforced. The following examples are valid match expressions for public NAT: "inIpRange(destination.ip, '1.1.0.0/16') || inIpRange(destination.ip, '2.2.0.0/16')" "destination.ip == '1.1.0.1' || destination.ip == '8.8.8.8'" The following example is a valid match expression for private NAT: "nexthop.hub == 'https://networkconnectivity.googleapis.com/v1alpha1/projects/my-project/global/hub/hub-1'"
    RuleNumber int
    An integer uniquely identifying a rule in the list. The rule number must be a positive value between 0 and 65000, and must be unique among rules within a NAT.
    Action RouterNatRuleAction
    The action to be enforced for traffic that matches this rule. Structure is documented below.
    Description string
    An optional description of this rule.
    match String
    CEL expression that specifies the match condition that egress traffic from a VM is evaluated against. If it evaluates to true, the corresponding action is enforced. The following examples are valid match expressions for public NAT: "inIpRange(destination.ip, '1.1.0.0/16') || inIpRange(destination.ip, '2.2.0.0/16')" "destination.ip == '1.1.0.1' || destination.ip == '8.8.8.8'" The following example is a valid match expression for private NAT: "nexthop.hub == 'https://networkconnectivity.googleapis.com/v1alpha1/projects/my-project/global/hub/hub-1'"
    ruleNumber Integer
    An integer uniquely identifying a rule in the list. The rule number must be a positive value between 0 and 65000, and must be unique among rules within a NAT.
    action RouterNatRuleAction
    The action to be enforced for traffic that matches this rule. Structure is documented below.
    description String
    An optional description of this rule.
    match string
    CEL expression that specifies the match condition that egress traffic from a VM is evaluated against. If it evaluates to true, the corresponding action is enforced. The following examples are valid match expressions for public NAT: "inIpRange(destination.ip, '1.1.0.0/16') || inIpRange(destination.ip, '2.2.0.0/16')" "destination.ip == '1.1.0.1' || destination.ip == '8.8.8.8'" The following example is a valid match expression for private NAT: "nexthop.hub == 'https://networkconnectivity.googleapis.com/v1alpha1/projects/my-project/global/hub/hub-1'"
    ruleNumber number
    An integer uniquely identifying a rule in the list. The rule number must be a positive value between 0 and 65000, and must be unique among rules within a NAT.
    action RouterNatRuleAction
    The action to be enforced for traffic that matches this rule. Structure is documented below.
    description string
    An optional description of this rule.
    match str
    CEL expression that specifies the match condition that egress traffic from a VM is evaluated against. If it evaluates to true, the corresponding action is enforced. The following examples are valid match expressions for public NAT: "inIpRange(destination.ip, '1.1.0.0/16') || inIpRange(destination.ip, '2.2.0.0/16')" "destination.ip == '1.1.0.1' || destination.ip == '8.8.8.8'" The following example is a valid match expression for private NAT: "nexthop.hub == 'https://networkconnectivity.googleapis.com/v1alpha1/projects/my-project/global/hub/hub-1'"
    rule_number int
    An integer uniquely identifying a rule in the list. The rule number must be a positive value between 0 and 65000, and must be unique among rules within a NAT.
    action RouterNatRuleAction
    The action to be enforced for traffic that matches this rule. Structure is documented below.
    description str
    An optional description of this rule.
    match String
    CEL expression that specifies the match condition that egress traffic from a VM is evaluated against. If it evaluates to true, the corresponding action is enforced. The following examples are valid match expressions for public NAT: "inIpRange(destination.ip, '1.1.0.0/16') || inIpRange(destination.ip, '2.2.0.0/16')" "destination.ip == '1.1.0.1' || destination.ip == '8.8.8.8'" The following example is a valid match expression for private NAT: "nexthop.hub == 'https://networkconnectivity.googleapis.com/v1alpha1/projects/my-project/global/hub/hub-1'"
    ruleNumber Number
    An integer uniquely identifying a rule in the list. The rule number must be a positive value between 0 and 65000, and must be unique among rules within a NAT.
    action Property Map
    The action to be enforced for traffic that matches this rule. Structure is documented below.
    description String
    An optional description of this rule.

    RouterNatRuleAction, RouterNatRuleActionArgs

    SourceNatActiveIps List<string>
    A list of URLs of the IP resources used for this NAT rule. These IP addresses must be valid static external IP addresses assigned to the project. This field is used for public NAT.
    SourceNatActiveRanges List<string>
    A list of URLs of the subnetworks used as source ranges for this NAT Rule. These subnetworks must have purpose set to PRIVATE_NAT. This field is used for private NAT.
    SourceNatDrainIps List<string>
    A list of URLs of the IP resources to be drained. These IPs must be valid static external IPs that have been assigned to the NAT. These IPs should be used for updating/patching a NAT rule only. This field is used for public NAT.
    SourceNatDrainRanges List<string>
    A list of URLs of subnetworks representing source ranges to be drained. This is only supported on patch/update, and these subnetworks must have previously been used as active ranges in this NAT Rule. This field is used for private NAT.
    SourceNatActiveIps []string
    A list of URLs of the IP resources used for this NAT rule. These IP addresses must be valid static external IP addresses assigned to the project. This field is used for public NAT.
    SourceNatActiveRanges []string
    A list of URLs of the subnetworks used as source ranges for this NAT Rule. These subnetworks must have purpose set to PRIVATE_NAT. This field is used for private NAT.
    SourceNatDrainIps []string
    A list of URLs of the IP resources to be drained. These IPs must be valid static external IPs that have been assigned to the NAT. These IPs should be used for updating/patching a NAT rule only. This field is used for public NAT.
    SourceNatDrainRanges []string
    A list of URLs of subnetworks representing source ranges to be drained. This is only supported on patch/update, and these subnetworks must have previously been used as active ranges in this NAT Rule. This field is used for private NAT.
    sourceNatActiveIps List<String>
    A list of URLs of the IP resources used for this NAT rule. These IP addresses must be valid static external IP addresses assigned to the project. This field is used for public NAT.
    sourceNatActiveRanges List<String>
    A list of URLs of the subnetworks used as source ranges for this NAT Rule. These subnetworks must have purpose set to PRIVATE_NAT. This field is used for private NAT.
    sourceNatDrainIps List<String>
    A list of URLs of the IP resources to be drained. These IPs must be valid static external IPs that have been assigned to the NAT. These IPs should be used for updating/patching a NAT rule only. This field is used for public NAT.
    sourceNatDrainRanges List<String>
    A list of URLs of subnetworks representing source ranges to be drained. This is only supported on patch/update, and these subnetworks must have previously been used as active ranges in this NAT Rule. This field is used for private NAT.
    sourceNatActiveIps string[]
    A list of URLs of the IP resources used for this NAT rule. These IP addresses must be valid static external IP addresses assigned to the project. This field is used for public NAT.
    sourceNatActiveRanges string[]
    A list of URLs of the subnetworks used as source ranges for this NAT Rule. These subnetworks must have purpose set to PRIVATE_NAT. This field is used for private NAT.
    sourceNatDrainIps string[]
    A list of URLs of the IP resources to be drained. These IPs must be valid static external IPs that have been assigned to the NAT. These IPs should be used for updating/patching a NAT rule only. This field is used for public NAT.
    sourceNatDrainRanges string[]
    A list of URLs of subnetworks representing source ranges to be drained. This is only supported on patch/update, and these subnetworks must have previously been used as active ranges in this NAT Rule. This field is used for private NAT.
    source_nat_active_ips Sequence[str]
    A list of URLs of the IP resources used for this NAT rule. These IP addresses must be valid static external IP addresses assigned to the project. This field is used for public NAT.
    source_nat_active_ranges Sequence[str]
    A list of URLs of the subnetworks used as source ranges for this NAT Rule. These subnetworks must have purpose set to PRIVATE_NAT. This field is used for private NAT.
    source_nat_drain_ips Sequence[str]
    A list of URLs of the IP resources to be drained. These IPs must be valid static external IPs that have been assigned to the NAT. These IPs should be used for updating/patching a NAT rule only. This field is used for public NAT.
    source_nat_drain_ranges Sequence[str]
    A list of URLs of subnetworks representing source ranges to be drained. This is only supported on patch/update, and these subnetworks must have previously been used as active ranges in this NAT Rule. This field is used for private NAT.
    sourceNatActiveIps List<String>
    A list of URLs of the IP resources used for this NAT rule. These IP addresses must be valid static external IP addresses assigned to the project. This field is used for public NAT.
    sourceNatActiveRanges List<String>
    A list of URLs of the subnetworks used as source ranges for this NAT Rule. These subnetworks must have purpose set to PRIVATE_NAT. This field is used for private NAT.
    sourceNatDrainIps List<String>
    A list of URLs of the IP resources to be drained. These IPs must be valid static external IPs that have been assigned to the NAT. These IPs should be used for updating/patching a NAT rule only. This field is used for public NAT.
    sourceNatDrainRanges List<String>
    A list of URLs of subnetworks representing source ranges to be drained. This is only supported on patch/update, and these subnetworks must have previously been used as active ranges in this NAT Rule. This field is used for private NAT.

    RouterNatSubnetwork, RouterNatSubnetworkArgs

    Name string
    Self-link of subnetwork to NAT
    SourceIpRangesToNats List<string>
    List of options for which source IPs in the subnetwork should have NAT enabled. Supported values include: ALL_IP_RANGES, LIST_OF_SECONDARY_IP_RANGES, PRIMARY_IP_RANGE.
    SecondaryIpRangeNames List<string>
    List of the secondary ranges of the subnetwork that are allowed to use NAT. This can be populated only if LIST_OF_SECONDARY_IP_RANGES is one of the values in sourceIpRangesToNat
    Name string
    Self-link of subnetwork to NAT
    SourceIpRangesToNats []string
    List of options for which source IPs in the subnetwork should have NAT enabled. Supported values include: ALL_IP_RANGES, LIST_OF_SECONDARY_IP_RANGES, PRIMARY_IP_RANGE.
    SecondaryIpRangeNames []string
    List of the secondary ranges of the subnetwork that are allowed to use NAT. This can be populated only if LIST_OF_SECONDARY_IP_RANGES is one of the values in sourceIpRangesToNat
    name String
    Self-link of subnetwork to NAT
    sourceIpRangesToNats List<String>
    List of options for which source IPs in the subnetwork should have NAT enabled. Supported values include: ALL_IP_RANGES, LIST_OF_SECONDARY_IP_RANGES, PRIMARY_IP_RANGE.
    secondaryIpRangeNames List<String>
    List of the secondary ranges of the subnetwork that are allowed to use NAT. This can be populated only if LIST_OF_SECONDARY_IP_RANGES is one of the values in sourceIpRangesToNat
    name string
    Self-link of subnetwork to NAT
    sourceIpRangesToNats string[]
    List of options for which source IPs in the subnetwork should have NAT enabled. Supported values include: ALL_IP_RANGES, LIST_OF_SECONDARY_IP_RANGES, PRIMARY_IP_RANGE.
    secondaryIpRangeNames string[]
    List of the secondary ranges of the subnetwork that are allowed to use NAT. This can be populated only if LIST_OF_SECONDARY_IP_RANGES is one of the values in sourceIpRangesToNat
    name str
    Self-link of subnetwork to NAT
    source_ip_ranges_to_nats Sequence[str]
    List of options for which source IPs in the subnetwork should have NAT enabled. Supported values include: ALL_IP_RANGES, LIST_OF_SECONDARY_IP_RANGES, PRIMARY_IP_RANGE.
    secondary_ip_range_names Sequence[str]
    List of the secondary ranges of the subnetwork that are allowed to use NAT. This can be populated only if LIST_OF_SECONDARY_IP_RANGES is one of the values in sourceIpRangesToNat
    name String
    Self-link of subnetwork to NAT
    sourceIpRangesToNats List<String>
    List of options for which source IPs in the subnetwork should have NAT enabled. Supported values include: ALL_IP_RANGES, LIST_OF_SECONDARY_IP_RANGES, PRIMARY_IP_RANGE.
    secondaryIpRangeNames List<String>
    List of the secondary ranges of the subnetwork that are allowed to use NAT. This can be populated only if LIST_OF_SECONDARY_IP_RANGES is one of the values in sourceIpRangesToNat

    Import

    RouterNat can be imported using any of these accepted formats:

    • projects/{{project}}/regions/{{region}}/routers/{{router}}/{{name}}

    • {{project}}/{{region}}/{{router}}/{{name}}

    • {{region}}/{{router}}/{{name}}

    • {{router}}/{{name}}

    When using the pulumi import command, RouterNat can be imported using one of the formats above. For example:

    $ pulumi import gcp:compute/routerNat:RouterNat default projects/{{project}}/regions/{{region}}/routers/{{router}}/{{name}}
    
    $ pulumi import gcp:compute/routerNat:RouterNat default {{project}}/{{region}}/{{router}}/{{name}}
    
    $ pulumi import gcp:compute/routerNat:RouterNat default {{region}}/{{router}}/{{name}}
    
    $ pulumi import gcp:compute/routerNat:RouterNat default {{router}}/{{name}}
    

    To learn more about importing existing cloud resources, see Importing resources.

    Package Details

    Repository
    Google Cloud (GCP) Classic pulumi/pulumi-gcp
    License
    Apache-2.0
    Notes
    This Pulumi package is based on the google-beta Terraform Provider.
    gcp logo
    Google Cloud Classic v7.29.0 published on Wednesday, Jun 26, 2024 by Pulumi