1. Packages
  2. Google Cloud (GCP) Classic
  3. API Docs
  4. compute
  5. Subnetwork
Google Cloud Classic v8.7.0 published on Tuesday, Oct 29, 2024 by Pulumi

gcp.compute.Subnetwork

Explore with Pulumi AI

gcp logo
Google Cloud Classic v8.7.0 published on Tuesday, Oct 29, 2024 by Pulumi

    A VPC network is a virtual version of the traditional physical networks that exist within and between physical data centers. A VPC network provides connectivity for your Compute Engine virtual machine (VM) instances, Container Engine containers, App Engine Flex services, and other network-related resources.

    Each GCP project contains one or more VPC networks. Each VPC network is a global entity spanning all GCP regions. This global VPC network allows VM instances and other resources to communicate with each other via internal, private IP addresses.

    Each VPC network is subdivided into subnets, and each subnet is contained within a single region. You can have more than one subnet in a region for a given VPC network. Each subnet has a contiguous private RFC1918 IP space. You create instances, containers, and the like in these subnets. When you create an instance, you must create it in a subnet, and the instance draws its internal IP address from that subnet.

    Virtual machine (VM) instances in a VPC network can communicate with instances in all other subnets of the same VPC network, regardless of region, using their RFC1918 private IP addresses. You can isolate portions of the network, even entire subnets, using firewall rules.

    To get more information about Subnetwork, see:

    Example Usage

    Subnetwork Basic

    import * as pulumi from "@pulumi/pulumi";
    import * as gcp from "@pulumi/gcp";
    
    const custom_test = new gcp.compute.Network("custom-test", {
        name: "test-network",
        autoCreateSubnetworks: false,
    });
    const network_with_private_secondary_ip_ranges = new gcp.compute.Subnetwork("network-with-private-secondary-ip-ranges", {
        name: "test-subnetwork",
        ipCidrRange: "10.2.0.0/16",
        region: "us-central1",
        network: custom_test.id,
        secondaryIpRanges: [{
            rangeName: "tf-test-secondary-range-update1",
            ipCidrRange: "192.168.10.0/24",
        }],
    });
    
    import pulumi
    import pulumi_gcp as gcp
    
    custom_test = gcp.compute.Network("custom-test",
        name="test-network",
        auto_create_subnetworks=False)
    network_with_private_secondary_ip_ranges = gcp.compute.Subnetwork("network-with-private-secondary-ip-ranges",
        name="test-subnetwork",
        ip_cidr_range="10.2.0.0/16",
        region="us-central1",
        network=custom_test.id,
        secondary_ip_ranges=[{
            "range_name": "tf-test-secondary-range-update1",
            "ip_cidr_range": "192.168.10.0/24",
        }])
    
    package main
    
    import (
    	"github.com/pulumi/pulumi-gcp/sdk/v8/go/gcp/compute"
    	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
    )
    
    func main() {
    	pulumi.Run(func(ctx *pulumi.Context) error {
    		_, err := compute.NewNetwork(ctx, "custom-test", &compute.NetworkArgs{
    			Name:                  pulumi.String("test-network"),
    			AutoCreateSubnetworks: pulumi.Bool(false),
    		})
    		if err != nil {
    			return err
    		}
    		_, err = compute.NewSubnetwork(ctx, "network-with-private-secondary-ip-ranges", &compute.SubnetworkArgs{
    			Name:        pulumi.String("test-subnetwork"),
    			IpCidrRange: pulumi.String("10.2.0.0/16"),
    			Region:      pulumi.String("us-central1"),
    			Network:     custom_test.ID(),
    			SecondaryIpRanges: compute.SubnetworkSecondaryIpRangeArray{
    				&compute.SubnetworkSecondaryIpRangeArgs{
    					RangeName:   pulumi.String("tf-test-secondary-range-update1"),
    					IpCidrRange: pulumi.String("192.168.10.0/24"),
    				},
    			},
    		})
    		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 custom_test = new Gcp.Compute.Network("custom-test", new()
        {
            Name = "test-network",
            AutoCreateSubnetworks = false,
        });
    
        var network_with_private_secondary_ip_ranges = new Gcp.Compute.Subnetwork("network-with-private-secondary-ip-ranges", new()
        {
            Name = "test-subnetwork",
            IpCidrRange = "10.2.0.0/16",
            Region = "us-central1",
            Network = custom_test.Id,
            SecondaryIpRanges = new[]
            {
                new Gcp.Compute.Inputs.SubnetworkSecondaryIpRangeArgs
                {
                    RangeName = "tf-test-secondary-range-update1",
                    IpCidrRange = "192.168.10.0/24",
                },
            },
        });
    
    });
    
    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.inputs.SubnetworkSecondaryIpRangeArgs;
    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 custom_test = new Network("custom-test", NetworkArgs.builder()
                .name("test-network")
                .autoCreateSubnetworks(false)
                .build());
    
            var network_with_private_secondary_ip_ranges = new Subnetwork("network-with-private-secondary-ip-ranges", SubnetworkArgs.builder()
                .name("test-subnetwork")
                .ipCidrRange("10.2.0.0/16")
                .region("us-central1")
                .network(custom_test.id())
                .secondaryIpRanges(SubnetworkSecondaryIpRangeArgs.builder()
                    .rangeName("tf-test-secondary-range-update1")
                    .ipCidrRange("192.168.10.0/24")
                    .build())
                .build());
    
        }
    }
    
    resources:
      network-with-private-secondary-ip-ranges:
        type: gcp:compute:Subnetwork
        properties:
          name: test-subnetwork
          ipCidrRange: 10.2.0.0/16
          region: us-central1
          network: ${["custom-test"].id}
          secondaryIpRanges:
            - rangeName: tf-test-secondary-range-update1
              ipCidrRange: 192.168.10.0/24
      custom-test:
        type: gcp:compute:Network
        properties:
          name: test-network
          autoCreateSubnetworks: false
    

    Subnetwork Logging Config

    import * as pulumi from "@pulumi/pulumi";
    import * as gcp from "@pulumi/gcp";
    
    const custom_test = new gcp.compute.Network("custom-test", {
        name: "log-test-network",
        autoCreateSubnetworks: false,
    });
    const subnet_with_logging = new gcp.compute.Subnetwork("subnet-with-logging", {
        name: "log-test-subnetwork",
        ipCidrRange: "10.2.0.0/16",
        region: "us-central1",
        network: custom_test.id,
        logConfig: {
            aggregationInterval: "INTERVAL_10_MIN",
            flowSampling: 0.5,
            metadata: "INCLUDE_ALL_METADATA",
        },
    });
    
    import pulumi
    import pulumi_gcp as gcp
    
    custom_test = gcp.compute.Network("custom-test",
        name="log-test-network",
        auto_create_subnetworks=False)
    subnet_with_logging = gcp.compute.Subnetwork("subnet-with-logging",
        name="log-test-subnetwork",
        ip_cidr_range="10.2.0.0/16",
        region="us-central1",
        network=custom_test.id,
        log_config={
            "aggregation_interval": "INTERVAL_10_MIN",
            "flow_sampling": 0.5,
            "metadata": "INCLUDE_ALL_METADATA",
        })
    
    package main
    
    import (
    	"github.com/pulumi/pulumi-gcp/sdk/v8/go/gcp/compute"
    	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
    )
    
    func main() {
    	pulumi.Run(func(ctx *pulumi.Context) error {
    		_, err := compute.NewNetwork(ctx, "custom-test", &compute.NetworkArgs{
    			Name:                  pulumi.String("log-test-network"),
    			AutoCreateSubnetworks: pulumi.Bool(false),
    		})
    		if err != nil {
    			return err
    		}
    		_, err = compute.NewSubnetwork(ctx, "subnet-with-logging", &compute.SubnetworkArgs{
    			Name:        pulumi.String("log-test-subnetwork"),
    			IpCidrRange: pulumi.String("10.2.0.0/16"),
    			Region:      pulumi.String("us-central1"),
    			Network:     custom_test.ID(),
    			LogConfig: &compute.SubnetworkLogConfigArgs{
    				AggregationInterval: pulumi.String("INTERVAL_10_MIN"),
    				FlowSampling:        pulumi.Float64(0.5),
    				Metadata:            pulumi.String("INCLUDE_ALL_METADATA"),
    			},
    		})
    		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 custom_test = new Gcp.Compute.Network("custom-test", new()
        {
            Name = "log-test-network",
            AutoCreateSubnetworks = false,
        });
    
        var subnet_with_logging = new Gcp.Compute.Subnetwork("subnet-with-logging", new()
        {
            Name = "log-test-subnetwork",
            IpCidrRange = "10.2.0.0/16",
            Region = "us-central1",
            Network = custom_test.Id,
            LogConfig = new Gcp.Compute.Inputs.SubnetworkLogConfigArgs
            {
                AggregationInterval = "INTERVAL_10_MIN",
                FlowSampling = 0.5,
                Metadata = "INCLUDE_ALL_METADATA",
            },
        });
    
    });
    
    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.inputs.SubnetworkLogConfigArgs;
    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 custom_test = new Network("custom-test", NetworkArgs.builder()
                .name("log-test-network")
                .autoCreateSubnetworks(false)
                .build());
    
            var subnet_with_logging = new Subnetwork("subnet-with-logging", SubnetworkArgs.builder()
                .name("log-test-subnetwork")
                .ipCidrRange("10.2.0.0/16")
                .region("us-central1")
                .network(custom_test.id())
                .logConfig(SubnetworkLogConfigArgs.builder()
                    .aggregationInterval("INTERVAL_10_MIN")
                    .flowSampling(0.5)
                    .metadata("INCLUDE_ALL_METADATA")
                    .build())
                .build());
    
        }
    }
    
    resources:
      subnet-with-logging:
        type: gcp:compute:Subnetwork
        properties:
          name: log-test-subnetwork
          ipCidrRange: 10.2.0.0/16
          region: us-central1
          network: ${["custom-test"].id}
          logConfig:
            aggregationInterval: INTERVAL_10_MIN
            flowSampling: 0.5
            metadata: INCLUDE_ALL_METADATA
      custom-test:
        type: gcp:compute:Network
        properties:
          name: log-test-network
          autoCreateSubnetworks: false
    

    Subnetwork Internal L7lb

    import * as pulumi from "@pulumi/pulumi";
    import * as gcp from "@pulumi/gcp";
    
    const custom_test = new gcp.compute.Network("custom-test", {
        name: "l7lb-test-network",
        autoCreateSubnetworks: false,
    });
    const network_for_l7lb = new gcp.compute.Subnetwork("network-for-l7lb", {
        name: "l7lb-test-subnetwork",
        ipCidrRange: "10.0.0.0/22",
        region: "us-central1",
        purpose: "REGIONAL_MANAGED_PROXY",
        role: "ACTIVE",
        network: custom_test.id,
    });
    
    import pulumi
    import pulumi_gcp as gcp
    
    custom_test = gcp.compute.Network("custom-test",
        name="l7lb-test-network",
        auto_create_subnetworks=False)
    network_for_l7lb = gcp.compute.Subnetwork("network-for-l7lb",
        name="l7lb-test-subnetwork",
        ip_cidr_range="10.0.0.0/22",
        region="us-central1",
        purpose="REGIONAL_MANAGED_PROXY",
        role="ACTIVE",
        network=custom_test.id)
    
    package main
    
    import (
    	"github.com/pulumi/pulumi-gcp/sdk/v8/go/gcp/compute"
    	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
    )
    
    func main() {
    	pulumi.Run(func(ctx *pulumi.Context) error {
    		_, err := compute.NewNetwork(ctx, "custom-test", &compute.NetworkArgs{
    			Name:                  pulumi.String("l7lb-test-network"),
    			AutoCreateSubnetworks: pulumi.Bool(false),
    		})
    		if err != nil {
    			return err
    		}
    		_, err = compute.NewSubnetwork(ctx, "network-for-l7lb", &compute.SubnetworkArgs{
    			Name:        pulumi.String("l7lb-test-subnetwork"),
    			IpCidrRange: pulumi.String("10.0.0.0/22"),
    			Region:      pulumi.String("us-central1"),
    			Purpose:     pulumi.String("REGIONAL_MANAGED_PROXY"),
    			Role:        pulumi.String("ACTIVE"),
    			Network:     custom_test.ID(),
    		})
    		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 custom_test = new Gcp.Compute.Network("custom-test", new()
        {
            Name = "l7lb-test-network",
            AutoCreateSubnetworks = false,
        });
    
        var network_for_l7lb = new Gcp.Compute.Subnetwork("network-for-l7lb", new()
        {
            Name = "l7lb-test-subnetwork",
            IpCidrRange = "10.0.0.0/22",
            Region = "us-central1",
            Purpose = "REGIONAL_MANAGED_PROXY",
            Role = "ACTIVE",
            Network = custom_test.Id,
        });
    
    });
    
    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 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 custom_test = new Network("custom-test", NetworkArgs.builder()
                .name("l7lb-test-network")
                .autoCreateSubnetworks(false)
                .build());
    
            var network_for_l7lb = new Subnetwork("network-for-l7lb", SubnetworkArgs.builder()
                .name("l7lb-test-subnetwork")
                .ipCidrRange("10.0.0.0/22")
                .region("us-central1")
                .purpose("REGIONAL_MANAGED_PROXY")
                .role("ACTIVE")
                .network(custom_test.id())
                .build());
    
        }
    }
    
    resources:
      network-for-l7lb:
        type: gcp:compute:Subnetwork
        properties:
          name: l7lb-test-subnetwork
          ipCidrRange: 10.0.0.0/22
          region: us-central1
          purpose: REGIONAL_MANAGED_PROXY
          role: ACTIVE
          network: ${["custom-test"].id}
      custom-test:
        type: gcp:compute:Network
        properties:
          name: l7lb-test-network
          autoCreateSubnetworks: false
    

    Subnetwork Ipv6

    import * as pulumi from "@pulumi/pulumi";
    import * as gcp from "@pulumi/gcp";
    
    const custom_test = new gcp.compute.Network("custom-test", {
        name: "ipv6-test-network",
        autoCreateSubnetworks: false,
    });
    const subnetwork_ipv6 = new gcp.compute.Subnetwork("subnetwork-ipv6", {
        name: "ipv6-test-subnetwork",
        ipCidrRange: "10.0.0.0/22",
        region: "us-west2",
        stackType: "IPV4_IPV6",
        ipv6AccessType: "EXTERNAL",
        network: custom_test.id,
    });
    
    import pulumi
    import pulumi_gcp as gcp
    
    custom_test = gcp.compute.Network("custom-test",
        name="ipv6-test-network",
        auto_create_subnetworks=False)
    subnetwork_ipv6 = gcp.compute.Subnetwork("subnetwork-ipv6",
        name="ipv6-test-subnetwork",
        ip_cidr_range="10.0.0.0/22",
        region="us-west2",
        stack_type="IPV4_IPV6",
        ipv6_access_type="EXTERNAL",
        network=custom_test.id)
    
    package main
    
    import (
    	"github.com/pulumi/pulumi-gcp/sdk/v8/go/gcp/compute"
    	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
    )
    
    func main() {
    	pulumi.Run(func(ctx *pulumi.Context) error {
    		_, err := compute.NewNetwork(ctx, "custom-test", &compute.NetworkArgs{
    			Name:                  pulumi.String("ipv6-test-network"),
    			AutoCreateSubnetworks: pulumi.Bool(false),
    		})
    		if err != nil {
    			return err
    		}
    		_, err = compute.NewSubnetwork(ctx, "subnetwork-ipv6", &compute.SubnetworkArgs{
    			Name:           pulumi.String("ipv6-test-subnetwork"),
    			IpCidrRange:    pulumi.String("10.0.0.0/22"),
    			Region:         pulumi.String("us-west2"),
    			StackType:      pulumi.String("IPV4_IPV6"),
    			Ipv6AccessType: pulumi.String("EXTERNAL"),
    			Network:        custom_test.ID(),
    		})
    		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 custom_test = new Gcp.Compute.Network("custom-test", new()
        {
            Name = "ipv6-test-network",
            AutoCreateSubnetworks = false,
        });
    
        var subnetwork_ipv6 = new Gcp.Compute.Subnetwork("subnetwork-ipv6", new()
        {
            Name = "ipv6-test-subnetwork",
            IpCidrRange = "10.0.0.0/22",
            Region = "us-west2",
            StackType = "IPV4_IPV6",
            Ipv6AccessType = "EXTERNAL",
            Network = custom_test.Id,
        });
    
    });
    
    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 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 custom_test = new Network("custom-test", NetworkArgs.builder()
                .name("ipv6-test-network")
                .autoCreateSubnetworks(false)
                .build());
    
            var subnetwork_ipv6 = new Subnetwork("subnetwork-ipv6", SubnetworkArgs.builder()
                .name("ipv6-test-subnetwork")
                .ipCidrRange("10.0.0.0/22")
                .region("us-west2")
                .stackType("IPV4_IPV6")
                .ipv6AccessType("EXTERNAL")
                .network(custom_test.id())
                .build());
    
        }
    }
    
    resources:
      subnetwork-ipv6:
        type: gcp:compute:Subnetwork
        properties:
          name: ipv6-test-subnetwork
          ipCidrRange: 10.0.0.0/22
          region: us-west2
          stackType: IPV4_IPV6
          ipv6AccessType: EXTERNAL
          network: ${["custom-test"].id}
      custom-test:
        type: gcp:compute:Network
        properties:
          name: ipv6-test-network
          autoCreateSubnetworks: false
    

    Subnetwork Internal Ipv6

    import * as pulumi from "@pulumi/pulumi";
    import * as gcp from "@pulumi/gcp";
    
    const custom_test = new gcp.compute.Network("custom-test", {
        name: "internal-ipv6-test-network",
        autoCreateSubnetworks: false,
        enableUlaInternalIpv6: true,
    });
    const subnetwork_internal_ipv6 = new gcp.compute.Subnetwork("subnetwork-internal-ipv6", {
        name: "internal-ipv6-test-subnetwork",
        ipCidrRange: "10.0.0.0/22",
        region: "us-west2",
        stackType: "IPV4_IPV6",
        ipv6AccessType: "INTERNAL",
        network: custom_test.id,
    });
    
    import pulumi
    import pulumi_gcp as gcp
    
    custom_test = gcp.compute.Network("custom-test",
        name="internal-ipv6-test-network",
        auto_create_subnetworks=False,
        enable_ula_internal_ipv6=True)
    subnetwork_internal_ipv6 = gcp.compute.Subnetwork("subnetwork-internal-ipv6",
        name="internal-ipv6-test-subnetwork",
        ip_cidr_range="10.0.0.0/22",
        region="us-west2",
        stack_type="IPV4_IPV6",
        ipv6_access_type="INTERNAL",
        network=custom_test.id)
    
    package main
    
    import (
    	"github.com/pulumi/pulumi-gcp/sdk/v8/go/gcp/compute"
    	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
    )
    
    func main() {
    	pulumi.Run(func(ctx *pulumi.Context) error {
    		_, err := compute.NewNetwork(ctx, "custom-test", &compute.NetworkArgs{
    			Name:                  pulumi.String("internal-ipv6-test-network"),
    			AutoCreateSubnetworks: pulumi.Bool(false),
    			EnableUlaInternalIpv6: pulumi.Bool(true),
    		})
    		if err != nil {
    			return err
    		}
    		_, err = compute.NewSubnetwork(ctx, "subnetwork-internal-ipv6", &compute.SubnetworkArgs{
    			Name:           pulumi.String("internal-ipv6-test-subnetwork"),
    			IpCidrRange:    pulumi.String("10.0.0.0/22"),
    			Region:         pulumi.String("us-west2"),
    			StackType:      pulumi.String("IPV4_IPV6"),
    			Ipv6AccessType: pulumi.String("INTERNAL"),
    			Network:        custom_test.ID(),
    		})
    		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 custom_test = new Gcp.Compute.Network("custom-test", new()
        {
            Name = "internal-ipv6-test-network",
            AutoCreateSubnetworks = false,
            EnableUlaInternalIpv6 = true,
        });
    
        var subnetwork_internal_ipv6 = new Gcp.Compute.Subnetwork("subnetwork-internal-ipv6", new()
        {
            Name = "internal-ipv6-test-subnetwork",
            IpCidrRange = "10.0.0.0/22",
            Region = "us-west2",
            StackType = "IPV4_IPV6",
            Ipv6AccessType = "INTERNAL",
            Network = custom_test.Id,
        });
    
    });
    
    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 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 custom_test = new Network("custom-test", NetworkArgs.builder()
                .name("internal-ipv6-test-network")
                .autoCreateSubnetworks(false)
                .enableUlaInternalIpv6(true)
                .build());
    
            var subnetwork_internal_ipv6 = new Subnetwork("subnetwork-internal-ipv6", SubnetworkArgs.builder()
                .name("internal-ipv6-test-subnetwork")
                .ipCidrRange("10.0.0.0/22")
                .region("us-west2")
                .stackType("IPV4_IPV6")
                .ipv6AccessType("INTERNAL")
                .network(custom_test.id())
                .build());
    
        }
    }
    
    resources:
      subnetwork-internal-ipv6:
        type: gcp:compute:Subnetwork
        properties:
          name: internal-ipv6-test-subnetwork
          ipCidrRange: 10.0.0.0/22
          region: us-west2
          stackType: IPV4_IPV6
          ipv6AccessType: INTERNAL
          network: ${["custom-test"].id}
      custom-test:
        type: gcp:compute:Network
        properties:
          name: internal-ipv6-test-network
          autoCreateSubnetworks: false
          enableUlaInternalIpv6: true
    

    Subnetwork Purpose Private Nat

    import * as pulumi from "@pulumi/pulumi";
    import * as gcp from "@pulumi/gcp";
    
    const custom_test = new gcp.compute.Network("custom-test", {
        name: "subnet-purpose-test-network",
        autoCreateSubnetworks: false,
    });
    const subnetwork_purpose_private_nat = new gcp.compute.Subnetwork("subnetwork-purpose-private-nat", {
        name: "subnet-purpose-test-subnetwork",
        region: "us-west2",
        ipCidrRange: "192.168.1.0/24",
        purpose: "PRIVATE_NAT",
        network: custom_test.id,
    });
    
    import pulumi
    import pulumi_gcp as gcp
    
    custom_test = gcp.compute.Network("custom-test",
        name="subnet-purpose-test-network",
        auto_create_subnetworks=False)
    subnetwork_purpose_private_nat = gcp.compute.Subnetwork("subnetwork-purpose-private-nat",
        name="subnet-purpose-test-subnetwork",
        region="us-west2",
        ip_cidr_range="192.168.1.0/24",
        purpose="PRIVATE_NAT",
        network=custom_test.id)
    
    package main
    
    import (
    	"github.com/pulumi/pulumi-gcp/sdk/v8/go/gcp/compute"
    	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
    )
    
    func main() {
    	pulumi.Run(func(ctx *pulumi.Context) error {
    		_, err := compute.NewNetwork(ctx, "custom-test", &compute.NetworkArgs{
    			Name:                  pulumi.String("subnet-purpose-test-network"),
    			AutoCreateSubnetworks: pulumi.Bool(false),
    		})
    		if err != nil {
    			return err
    		}
    		_, err = compute.NewSubnetwork(ctx, "subnetwork-purpose-private-nat", &compute.SubnetworkArgs{
    			Name:        pulumi.String("subnet-purpose-test-subnetwork"),
    			Region:      pulumi.String("us-west2"),
    			IpCidrRange: pulumi.String("192.168.1.0/24"),
    			Purpose:     pulumi.String("PRIVATE_NAT"),
    			Network:     custom_test.ID(),
    		})
    		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 custom_test = new Gcp.Compute.Network("custom-test", new()
        {
            Name = "subnet-purpose-test-network",
            AutoCreateSubnetworks = false,
        });
    
        var subnetwork_purpose_private_nat = new Gcp.Compute.Subnetwork("subnetwork-purpose-private-nat", new()
        {
            Name = "subnet-purpose-test-subnetwork",
            Region = "us-west2",
            IpCidrRange = "192.168.1.0/24",
            Purpose = "PRIVATE_NAT",
            Network = custom_test.Id,
        });
    
    });
    
    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 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 custom_test = new Network("custom-test", NetworkArgs.builder()
                .name("subnet-purpose-test-network")
                .autoCreateSubnetworks(false)
                .build());
    
            var subnetwork_purpose_private_nat = new Subnetwork("subnetwork-purpose-private-nat", SubnetworkArgs.builder()
                .name("subnet-purpose-test-subnetwork")
                .region("us-west2")
                .ipCidrRange("192.168.1.0/24")
                .purpose("PRIVATE_NAT")
                .network(custom_test.id())
                .build());
    
        }
    }
    
    resources:
      subnetwork-purpose-private-nat:
        type: gcp:compute:Subnetwork
        properties:
          name: subnet-purpose-test-subnetwork
          region: us-west2
          ipCidrRange: 192.168.1.0/24
          purpose: PRIVATE_NAT
          network: ${["custom-test"].id}
      custom-test:
        type: gcp:compute:Network
        properties:
          name: subnet-purpose-test-network
          autoCreateSubnetworks: false
    

    Subnetwork Cidr Overlap

    import * as pulumi from "@pulumi/pulumi";
    import * as gcp from "@pulumi/gcp";
    
    const net_cidr_overlap = new gcp.compute.Network("net-cidr-overlap", {
        name: "net-cidr-overlap",
        autoCreateSubnetworks: false,
    });
    const subnetwork_cidr_overlap = new gcp.compute.Subnetwork("subnetwork-cidr-overlap", {
        name: "subnet-cidr-overlap",
        region: "us-west2",
        ipCidrRange: "192.168.1.0/24",
        allowSubnetCidrRoutesOverlap: true,
        network: net_cidr_overlap.id,
    });
    
    import pulumi
    import pulumi_gcp as gcp
    
    net_cidr_overlap = gcp.compute.Network("net-cidr-overlap",
        name="net-cidr-overlap",
        auto_create_subnetworks=False)
    subnetwork_cidr_overlap = gcp.compute.Subnetwork("subnetwork-cidr-overlap",
        name="subnet-cidr-overlap",
        region="us-west2",
        ip_cidr_range="192.168.1.0/24",
        allow_subnet_cidr_routes_overlap=True,
        network=net_cidr_overlap.id)
    
    package main
    
    import (
    	"github.com/pulumi/pulumi-gcp/sdk/v8/go/gcp/compute"
    	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
    )
    
    func main() {
    	pulumi.Run(func(ctx *pulumi.Context) error {
    		_, err := compute.NewNetwork(ctx, "net-cidr-overlap", &compute.NetworkArgs{
    			Name:                  pulumi.String("net-cidr-overlap"),
    			AutoCreateSubnetworks: pulumi.Bool(false),
    		})
    		if err != nil {
    			return err
    		}
    		_, err = compute.NewSubnetwork(ctx, "subnetwork-cidr-overlap", &compute.SubnetworkArgs{
    			Name:                         pulumi.String("subnet-cidr-overlap"),
    			Region:                       pulumi.String("us-west2"),
    			IpCidrRange:                  pulumi.String("192.168.1.0/24"),
    			AllowSubnetCidrRoutesOverlap: pulumi.Bool(true),
    			Network:                      net_cidr_overlap.ID(),
    		})
    		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_cidr_overlap = new Gcp.Compute.Network("net-cidr-overlap", new()
        {
            Name = "net-cidr-overlap",
            AutoCreateSubnetworks = false,
        });
    
        var subnetwork_cidr_overlap = new Gcp.Compute.Subnetwork("subnetwork-cidr-overlap", new()
        {
            Name = "subnet-cidr-overlap",
            Region = "us-west2",
            IpCidrRange = "192.168.1.0/24",
            AllowSubnetCidrRoutesOverlap = true,
            Network = net_cidr_overlap.Id,
        });
    
    });
    
    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 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_cidr_overlap = new Network("net-cidr-overlap", NetworkArgs.builder()
                .name("net-cidr-overlap")
                .autoCreateSubnetworks(false)
                .build());
    
            var subnetwork_cidr_overlap = new Subnetwork("subnetwork-cidr-overlap", SubnetworkArgs.builder()
                .name("subnet-cidr-overlap")
                .region("us-west2")
                .ipCidrRange("192.168.1.0/24")
                .allowSubnetCidrRoutesOverlap(true)
                .network(net_cidr_overlap.id())
                .build());
    
        }
    }
    
    resources:
      subnetwork-cidr-overlap:
        type: gcp:compute:Subnetwork
        properties:
          name: subnet-cidr-overlap
          region: us-west2
          ipCidrRange: 192.168.1.0/24
          allowSubnetCidrRoutesOverlap: true
          network: ${["net-cidr-overlap"].id}
      net-cidr-overlap:
        type: gcp:compute:Network
        properties:
          name: net-cidr-overlap
          autoCreateSubnetworks: false
    

    Subnetwork Reserved Internal Range

    import * as pulumi from "@pulumi/pulumi";
    import * as gcp from "@pulumi/gcp";
    
    const _default = new gcp.compute.Network("default", {
        name: "network-reserved-internal-range",
        autoCreateSubnetworks: false,
    });
    const reserved = new gcp.networkconnectivity.InternalRange("reserved", {
        name: "reserved",
        network: _default.id,
        usage: "FOR_VPC",
        peering: "FOR_SELF",
        prefixLength: 24,
        targetCidrRanges: ["10.0.0.0/8"],
    });
    const subnetwork_reserved_internal_range = new gcp.compute.Subnetwork("subnetwork-reserved-internal-range", {
        name: "subnetwork-reserved-internal-range",
        region: "us-central1",
        network: _default.id,
        reservedInternalRange: pulumi.interpolate`networkconnectivity.googleapis.com/${reserved.id}`,
    });
    
    import pulumi
    import pulumi_gcp as gcp
    
    default = gcp.compute.Network("default",
        name="network-reserved-internal-range",
        auto_create_subnetworks=False)
    reserved = gcp.networkconnectivity.InternalRange("reserved",
        name="reserved",
        network=default.id,
        usage="FOR_VPC",
        peering="FOR_SELF",
        prefix_length=24,
        target_cidr_ranges=["10.0.0.0/8"])
    subnetwork_reserved_internal_range = gcp.compute.Subnetwork("subnetwork-reserved-internal-range",
        name="subnetwork-reserved-internal-range",
        region="us-central1",
        network=default.id,
        reserved_internal_range=reserved.id.apply(lambda id: f"networkconnectivity.googleapis.com/{id}"))
    
    package main
    
    import (
    	"fmt"
    
    	"github.com/pulumi/pulumi-gcp/sdk/v8/go/gcp/compute"
    	"github.com/pulumi/pulumi-gcp/sdk/v8/go/gcp/networkconnectivity"
    	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
    )
    
    func main() {
    	pulumi.Run(func(ctx *pulumi.Context) error {
    		_, err := compute.NewNetwork(ctx, "default", &compute.NetworkArgs{
    			Name:                  pulumi.String("network-reserved-internal-range"),
    			AutoCreateSubnetworks: pulumi.Bool(false),
    		})
    		if err != nil {
    			return err
    		}
    		reserved, err := networkconnectivity.NewInternalRange(ctx, "reserved", &networkconnectivity.InternalRangeArgs{
    			Name:         pulumi.String("reserved"),
    			Network:      _default.ID(),
    			Usage:        pulumi.String("FOR_VPC"),
    			Peering:      pulumi.String("FOR_SELF"),
    			PrefixLength: pulumi.Int(24),
    			TargetCidrRanges: pulumi.StringArray{
    				pulumi.String("10.0.0.0/8"),
    			},
    		})
    		if err != nil {
    			return err
    		}
    		_, err = compute.NewSubnetwork(ctx, "subnetwork-reserved-internal-range", &compute.SubnetworkArgs{
    			Name:    pulumi.String("subnetwork-reserved-internal-range"),
    			Region:  pulumi.String("us-central1"),
    			Network: _default.ID(),
    			ReservedInternalRange: reserved.ID().ApplyT(func(id string) (string, error) {
    				return fmt.Sprintf("networkconnectivity.googleapis.com/%v", id), nil
    			}).(pulumi.StringOutput),
    		})
    		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 @default = new Gcp.Compute.Network("default", new()
        {
            Name = "network-reserved-internal-range",
            AutoCreateSubnetworks = false,
        });
    
        var reserved = new Gcp.NetworkConnectivity.InternalRange("reserved", new()
        {
            Name = "reserved",
            Network = @default.Id,
            Usage = "FOR_VPC",
            Peering = "FOR_SELF",
            PrefixLength = 24,
            TargetCidrRanges = new[]
            {
                "10.0.0.0/8",
            },
        });
    
        var subnetwork_reserved_internal_range = new Gcp.Compute.Subnetwork("subnetwork-reserved-internal-range", new()
        {
            Name = "subnetwork-reserved-internal-range",
            Region = "us-central1",
            Network = @default.Id,
            ReservedInternalRange = reserved.Id.Apply(id => $"networkconnectivity.googleapis.com/{id}"),
        });
    
    });
    
    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.networkconnectivity.InternalRange;
    import com.pulumi.gcp.networkconnectivity.InternalRangeArgs;
    import com.pulumi.gcp.compute.Subnetwork;
    import com.pulumi.gcp.compute.SubnetworkArgs;
    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 default_ = new Network("default", NetworkArgs.builder()
                .name("network-reserved-internal-range")
                .autoCreateSubnetworks(false)
                .build());
    
            var reserved = new InternalRange("reserved", InternalRangeArgs.builder()
                .name("reserved")
                .network(default_.id())
                .usage("FOR_VPC")
                .peering("FOR_SELF")
                .prefixLength(24)
                .targetCidrRanges("10.0.0.0/8")
                .build());
    
            var subnetwork_reserved_internal_range = new Subnetwork("subnetwork-reserved-internal-range", SubnetworkArgs.builder()
                .name("subnetwork-reserved-internal-range")
                .region("us-central1")
                .network(default_.id())
                .reservedInternalRange(reserved.id().applyValue(id -> String.format("networkconnectivity.googleapis.com/%s", id)))
                .build());
    
        }
    }
    
    resources:
      subnetwork-reserved-internal-range:
        type: gcp:compute:Subnetwork
        properties:
          name: subnetwork-reserved-internal-range
          region: us-central1
          network: ${default.id}
          reservedInternalRange: networkconnectivity.googleapis.com/${reserved.id}
      default:
        type: gcp:compute:Network
        properties:
          name: network-reserved-internal-range
          autoCreateSubnetworks: false
      reserved:
        type: gcp:networkconnectivity:InternalRange
        properties:
          name: reserved
          network: ${default.id}
          usage: FOR_VPC
          peering: FOR_SELF
          prefixLength: 24
          targetCidrRanges:
            - 10.0.0.0/8
    

    Subnetwork Reserved Secondary Range

    import * as pulumi from "@pulumi/pulumi";
    import * as gcp from "@pulumi/gcp";
    
    const _default = new gcp.compute.Network("default", {
        name: "network-reserved-secondary-range",
        autoCreateSubnetworks: false,
    });
    const reserved = new gcp.networkconnectivity.InternalRange("reserved", {
        name: "reserved-primary",
        network: _default.id,
        usage: "FOR_VPC",
        peering: "FOR_SELF",
        prefixLength: 24,
        targetCidrRanges: ["10.0.0.0/8"],
    });
    const reservedSecondary = new gcp.networkconnectivity.InternalRange("reserved_secondary", {
        name: "reserved-secondary",
        network: _default.id,
        usage: "FOR_VPC",
        peering: "FOR_SELF",
        prefixLength: 16,
        targetCidrRanges: ["10.0.0.0/8"],
    });
    const subnetwork_reserved_secondary_range = new gcp.compute.Subnetwork("subnetwork-reserved-secondary-range", {
        name: "subnetwork-reserved-secondary-range",
        region: "us-central1",
        network: _default.id,
        reservedInternalRange: pulumi.interpolate`networkconnectivity.googleapis.com/${reserved.id}`,
        secondaryIpRanges: [{
            rangeName: "secondary",
            reservedInternalRange: pulumi.interpolate`networkconnectivity.googleapis.com/${reservedSecondary.id}`,
        }],
    });
    
    import pulumi
    import pulumi_gcp as gcp
    
    default = gcp.compute.Network("default",
        name="network-reserved-secondary-range",
        auto_create_subnetworks=False)
    reserved = gcp.networkconnectivity.InternalRange("reserved",
        name="reserved-primary",
        network=default.id,
        usage="FOR_VPC",
        peering="FOR_SELF",
        prefix_length=24,
        target_cidr_ranges=["10.0.0.0/8"])
    reserved_secondary = gcp.networkconnectivity.InternalRange("reserved_secondary",
        name="reserved-secondary",
        network=default.id,
        usage="FOR_VPC",
        peering="FOR_SELF",
        prefix_length=16,
        target_cidr_ranges=["10.0.0.0/8"])
    subnetwork_reserved_secondary_range = gcp.compute.Subnetwork("subnetwork-reserved-secondary-range",
        name="subnetwork-reserved-secondary-range",
        region="us-central1",
        network=default.id,
        reserved_internal_range=reserved.id.apply(lambda id: f"networkconnectivity.googleapis.com/{id}"),
        secondary_ip_ranges=[{
            "range_name": "secondary",
            "reserved_internal_range": reserved_secondary.id.apply(lambda id: f"networkconnectivity.googleapis.com/{id}"),
        }])
    
    package main
    
    import (
    	"fmt"
    
    	"github.com/pulumi/pulumi-gcp/sdk/v8/go/gcp/compute"
    	"github.com/pulumi/pulumi-gcp/sdk/v8/go/gcp/networkconnectivity"
    	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
    )
    
    func main() {
    	pulumi.Run(func(ctx *pulumi.Context) error {
    		_, err := compute.NewNetwork(ctx, "default", &compute.NetworkArgs{
    			Name:                  pulumi.String("network-reserved-secondary-range"),
    			AutoCreateSubnetworks: pulumi.Bool(false),
    		})
    		if err != nil {
    			return err
    		}
    		reserved, err := networkconnectivity.NewInternalRange(ctx, "reserved", &networkconnectivity.InternalRangeArgs{
    			Name:         pulumi.String("reserved-primary"),
    			Network:      _default.ID(),
    			Usage:        pulumi.String("FOR_VPC"),
    			Peering:      pulumi.String("FOR_SELF"),
    			PrefixLength: pulumi.Int(24),
    			TargetCidrRanges: pulumi.StringArray{
    				pulumi.String("10.0.0.0/8"),
    			},
    		})
    		if err != nil {
    			return err
    		}
    		reservedSecondary, err := networkconnectivity.NewInternalRange(ctx, "reserved_secondary", &networkconnectivity.InternalRangeArgs{
    			Name:         pulumi.String("reserved-secondary"),
    			Network:      _default.ID(),
    			Usage:        pulumi.String("FOR_VPC"),
    			Peering:      pulumi.String("FOR_SELF"),
    			PrefixLength: pulumi.Int(16),
    			TargetCidrRanges: pulumi.StringArray{
    				pulumi.String("10.0.0.0/8"),
    			},
    		})
    		if err != nil {
    			return err
    		}
    		_, err = compute.NewSubnetwork(ctx, "subnetwork-reserved-secondary-range", &compute.SubnetworkArgs{
    			Name:    pulumi.String("subnetwork-reserved-secondary-range"),
    			Region:  pulumi.String("us-central1"),
    			Network: _default.ID(),
    			ReservedInternalRange: reserved.ID().ApplyT(func(id string) (string, error) {
    				return fmt.Sprintf("networkconnectivity.googleapis.com/%v", id), nil
    			}).(pulumi.StringOutput),
    			SecondaryIpRanges: compute.SubnetworkSecondaryIpRangeArray{
    				&compute.SubnetworkSecondaryIpRangeArgs{
    					RangeName: pulumi.String("secondary"),
    					ReservedInternalRange: reservedSecondary.ID().ApplyT(func(id string) (string, error) {
    						return fmt.Sprintf("networkconnectivity.googleapis.com/%v", id), nil
    					}).(pulumi.StringOutput),
    				},
    			},
    		})
    		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 @default = new Gcp.Compute.Network("default", new()
        {
            Name = "network-reserved-secondary-range",
            AutoCreateSubnetworks = false,
        });
    
        var reserved = new Gcp.NetworkConnectivity.InternalRange("reserved", new()
        {
            Name = "reserved-primary",
            Network = @default.Id,
            Usage = "FOR_VPC",
            Peering = "FOR_SELF",
            PrefixLength = 24,
            TargetCidrRanges = new[]
            {
                "10.0.0.0/8",
            },
        });
    
        var reservedSecondary = new Gcp.NetworkConnectivity.InternalRange("reserved_secondary", new()
        {
            Name = "reserved-secondary",
            Network = @default.Id,
            Usage = "FOR_VPC",
            Peering = "FOR_SELF",
            PrefixLength = 16,
            TargetCidrRanges = new[]
            {
                "10.0.0.0/8",
            },
        });
    
        var subnetwork_reserved_secondary_range = new Gcp.Compute.Subnetwork("subnetwork-reserved-secondary-range", new()
        {
            Name = "subnetwork-reserved-secondary-range",
            Region = "us-central1",
            Network = @default.Id,
            ReservedInternalRange = reserved.Id.Apply(id => $"networkconnectivity.googleapis.com/{id}"),
            SecondaryIpRanges = new[]
            {
                new Gcp.Compute.Inputs.SubnetworkSecondaryIpRangeArgs
                {
                    RangeName = "secondary",
                    ReservedInternalRange = reservedSecondary.Id.Apply(id => $"networkconnectivity.googleapis.com/{id}"),
                },
            },
        });
    
    });
    
    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.networkconnectivity.InternalRange;
    import com.pulumi.gcp.networkconnectivity.InternalRangeArgs;
    import com.pulumi.gcp.compute.Subnetwork;
    import com.pulumi.gcp.compute.SubnetworkArgs;
    import com.pulumi.gcp.compute.inputs.SubnetworkSecondaryIpRangeArgs;
    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 default_ = new Network("default", NetworkArgs.builder()
                .name("network-reserved-secondary-range")
                .autoCreateSubnetworks(false)
                .build());
    
            var reserved = new InternalRange("reserved", InternalRangeArgs.builder()
                .name("reserved-primary")
                .network(default_.id())
                .usage("FOR_VPC")
                .peering("FOR_SELF")
                .prefixLength(24)
                .targetCidrRanges("10.0.0.0/8")
                .build());
    
            var reservedSecondary = new InternalRange("reservedSecondary", InternalRangeArgs.builder()
                .name("reserved-secondary")
                .network(default_.id())
                .usage("FOR_VPC")
                .peering("FOR_SELF")
                .prefixLength(16)
                .targetCidrRanges("10.0.0.0/8")
                .build());
    
            var subnetwork_reserved_secondary_range = new Subnetwork("subnetwork-reserved-secondary-range", SubnetworkArgs.builder()
                .name("subnetwork-reserved-secondary-range")
                .region("us-central1")
                .network(default_.id())
                .reservedInternalRange(reserved.id().applyValue(id -> String.format("networkconnectivity.googleapis.com/%s", id)))
                .secondaryIpRanges(SubnetworkSecondaryIpRangeArgs.builder()
                    .rangeName("secondary")
                    .reservedInternalRange(reservedSecondary.id().applyValue(id -> String.format("networkconnectivity.googleapis.com/%s", id)))
                    .build())
                .build());
    
        }
    }
    
    resources:
      subnetwork-reserved-secondary-range:
        type: gcp:compute:Subnetwork
        properties:
          name: subnetwork-reserved-secondary-range
          region: us-central1
          network: ${default.id}
          reservedInternalRange: networkconnectivity.googleapis.com/${reserved.id}
          secondaryIpRanges:
            - rangeName: secondary
              reservedInternalRange: networkconnectivity.googleapis.com/${reservedSecondary.id}
      default:
        type: gcp:compute:Network
        properties:
          name: network-reserved-secondary-range
          autoCreateSubnetworks: false
      reserved:
        type: gcp:networkconnectivity:InternalRange
        properties:
          name: reserved-primary
          network: ${default.id}
          usage: FOR_VPC
          peering: FOR_SELF
          prefixLength: 24
          targetCidrRanges:
            - 10.0.0.0/8
      reservedSecondary:
        type: gcp:networkconnectivity:InternalRange
        name: reserved_secondary
        properties:
          name: reserved-secondary
          network: ${default.id}
          usage: FOR_VPC
          peering: FOR_SELF
          prefixLength: 16
          targetCidrRanges:
            - 10.0.0.0/8
    

    Create Subnetwork Resource

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

    Constructor syntax

    new Subnetwork(name: string, args: SubnetworkArgs, opts?: CustomResourceOptions);
    @overload
    def Subnetwork(resource_name: str,
                   args: SubnetworkArgs,
                   opts: Optional[ResourceOptions] = None)
    
    @overload
    def Subnetwork(resource_name: str,
                   opts: Optional[ResourceOptions] = None,
                   network: Optional[str] = None,
                   private_ip_google_access: Optional[bool] = None,
                   log_config: Optional[SubnetworkLogConfigArgs] = None,
                   private_ipv6_google_access: Optional[str] = None,
                   ipv6_access_type: Optional[str] = None,
                   project: Optional[str] = None,
                   name: Optional[str] = None,
                   description: Optional[str] = None,
                   purpose: Optional[str] = None,
                   ip_cidr_range: Optional[str] = None,
                   external_ipv6_prefix: Optional[str] = None,
                   allow_subnet_cidr_routes_overlap: Optional[bool] = None,
                   region: Optional[str] = None,
                   reserved_internal_range: Optional[str] = None,
                   role: Optional[str] = None,
                   secondary_ip_ranges: Optional[Sequence[SubnetworkSecondaryIpRangeArgs]] = None,
                   send_secondary_ip_range_if_empty: Optional[bool] = None,
                   stack_type: Optional[str] = None)
    func NewSubnetwork(ctx *Context, name string, args SubnetworkArgs, opts ...ResourceOption) (*Subnetwork, error)
    public Subnetwork(string name, SubnetworkArgs args, CustomResourceOptions? opts = null)
    public Subnetwork(String name, SubnetworkArgs args)
    public Subnetwork(String name, SubnetworkArgs args, CustomResourceOptions options)
    
    type: gcp:compute:Subnetwork
    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 SubnetworkArgs
    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 SubnetworkArgs
    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 SubnetworkArgs
    The arguments to resource properties.
    opts ResourceOption
    Bag of options to control resource's behavior.
    name string
    The unique name of the resource.
    args SubnetworkArgs
    The arguments to resource properties.
    opts CustomResourceOptions
    Bag of options to control resource's behavior.
    name String
    The unique name of the resource.
    args SubnetworkArgs
    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 subnetworkResource = new Gcp.Compute.Subnetwork("subnetworkResource", new()
    {
        Network = "string",
        PrivateIpGoogleAccess = false,
        LogConfig = new Gcp.Compute.Inputs.SubnetworkLogConfigArgs
        {
            AggregationInterval = "string",
            FilterExpr = "string",
            FlowSampling = 0,
            Metadata = "string",
            MetadataFields = new[]
            {
                "string",
            },
        },
        PrivateIpv6GoogleAccess = "string",
        Ipv6AccessType = "string",
        Project = "string",
        Name = "string",
        Description = "string",
        Purpose = "string",
        IpCidrRange = "string",
        ExternalIpv6Prefix = "string",
        AllowSubnetCidrRoutesOverlap = false,
        Region = "string",
        ReservedInternalRange = "string",
        Role = "string",
        SecondaryIpRanges = new[]
        {
            new Gcp.Compute.Inputs.SubnetworkSecondaryIpRangeArgs
            {
                RangeName = "string",
                IpCidrRange = "string",
                ReservedInternalRange = "string",
            },
        },
        SendSecondaryIpRangeIfEmpty = false,
        StackType = "string",
    });
    
    example, err := compute.NewSubnetwork(ctx, "subnetworkResource", &compute.SubnetworkArgs{
    	Network:               pulumi.String("string"),
    	PrivateIpGoogleAccess: pulumi.Bool(false),
    	LogConfig: &compute.SubnetworkLogConfigArgs{
    		AggregationInterval: pulumi.String("string"),
    		FilterExpr:          pulumi.String("string"),
    		FlowSampling:        pulumi.Float64(0),
    		Metadata:            pulumi.String("string"),
    		MetadataFields: pulumi.StringArray{
    			pulumi.String("string"),
    		},
    	},
    	PrivateIpv6GoogleAccess:      pulumi.String("string"),
    	Ipv6AccessType:               pulumi.String("string"),
    	Project:                      pulumi.String("string"),
    	Name:                         pulumi.String("string"),
    	Description:                  pulumi.String("string"),
    	Purpose:                      pulumi.String("string"),
    	IpCidrRange:                  pulumi.String("string"),
    	ExternalIpv6Prefix:           pulumi.String("string"),
    	AllowSubnetCidrRoutesOverlap: pulumi.Bool(false),
    	Region:                       pulumi.String("string"),
    	ReservedInternalRange:        pulumi.String("string"),
    	Role:                         pulumi.String("string"),
    	SecondaryIpRanges: compute.SubnetworkSecondaryIpRangeArray{
    		&compute.SubnetworkSecondaryIpRangeArgs{
    			RangeName:             pulumi.String("string"),
    			IpCidrRange:           pulumi.String("string"),
    			ReservedInternalRange: pulumi.String("string"),
    		},
    	},
    	SendSecondaryIpRangeIfEmpty: pulumi.Bool(false),
    	StackType:                   pulumi.String("string"),
    })
    
    var subnetworkResource = new Subnetwork("subnetworkResource", SubnetworkArgs.builder()
        .network("string")
        .privateIpGoogleAccess(false)
        .logConfig(SubnetworkLogConfigArgs.builder()
            .aggregationInterval("string")
            .filterExpr("string")
            .flowSampling(0)
            .metadata("string")
            .metadataFields("string")
            .build())
        .privateIpv6GoogleAccess("string")
        .ipv6AccessType("string")
        .project("string")
        .name("string")
        .description("string")
        .purpose("string")
        .ipCidrRange("string")
        .externalIpv6Prefix("string")
        .allowSubnetCidrRoutesOverlap(false)
        .region("string")
        .reservedInternalRange("string")
        .role("string")
        .secondaryIpRanges(SubnetworkSecondaryIpRangeArgs.builder()
            .rangeName("string")
            .ipCidrRange("string")
            .reservedInternalRange("string")
            .build())
        .sendSecondaryIpRangeIfEmpty(false)
        .stackType("string")
        .build());
    
    subnetwork_resource = gcp.compute.Subnetwork("subnetworkResource",
        network="string",
        private_ip_google_access=False,
        log_config={
            "aggregationInterval": "string",
            "filterExpr": "string",
            "flowSampling": 0,
            "metadata": "string",
            "metadataFields": ["string"],
        },
        private_ipv6_google_access="string",
        ipv6_access_type="string",
        project="string",
        name="string",
        description="string",
        purpose="string",
        ip_cidr_range="string",
        external_ipv6_prefix="string",
        allow_subnet_cidr_routes_overlap=False,
        region="string",
        reserved_internal_range="string",
        role="string",
        secondary_ip_ranges=[{
            "rangeName": "string",
            "ipCidrRange": "string",
            "reservedInternalRange": "string",
        }],
        send_secondary_ip_range_if_empty=False,
        stack_type="string")
    
    const subnetworkResource = new gcp.compute.Subnetwork("subnetworkResource", {
        network: "string",
        privateIpGoogleAccess: false,
        logConfig: {
            aggregationInterval: "string",
            filterExpr: "string",
            flowSampling: 0,
            metadata: "string",
            metadataFields: ["string"],
        },
        privateIpv6GoogleAccess: "string",
        ipv6AccessType: "string",
        project: "string",
        name: "string",
        description: "string",
        purpose: "string",
        ipCidrRange: "string",
        externalIpv6Prefix: "string",
        allowSubnetCidrRoutesOverlap: false,
        region: "string",
        reservedInternalRange: "string",
        role: "string",
        secondaryIpRanges: [{
            rangeName: "string",
            ipCidrRange: "string",
            reservedInternalRange: "string",
        }],
        sendSecondaryIpRangeIfEmpty: false,
        stackType: "string",
    });
    
    type: gcp:compute:Subnetwork
    properties:
        allowSubnetCidrRoutesOverlap: false
        description: string
        externalIpv6Prefix: string
        ipCidrRange: string
        ipv6AccessType: string
        logConfig:
            aggregationInterval: string
            filterExpr: string
            flowSampling: 0
            metadata: string
            metadataFields:
                - string
        name: string
        network: string
        privateIpGoogleAccess: false
        privateIpv6GoogleAccess: string
        project: string
        purpose: string
        region: string
        reservedInternalRange: string
        role: string
        secondaryIpRanges:
            - ipCidrRange: string
              rangeName: string
              reservedInternalRange: string
        sendSecondaryIpRangeIfEmpty: false
        stackType: string
    

    Subnetwork 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 Subnetwork resource accepts the following input properties:

    Network string
    The network this subnet belongs to. Only networks that are in the distributed mode can have subnetworks.


    AllowSubnetCidrRoutesOverlap bool
    Typically packets destined to IPs within the subnetwork range that do not match existing resources are dropped and prevented from leaving the VPC. Setting this field to true will allow these packets to match dynamic routes injected via BGP even if their destinations match existing subnet ranges.
    Description string
    An optional description of this resource. Provide this property when you create the resource. This field can be set only at resource creation time.
    ExternalIpv6Prefix string
    The range of external IPv6 addresses that are owned by this subnetwork.
    IpCidrRange string
    The range of internal addresses that are owned by this subnetwork. Provide this property when you create the subnetwork. For example, 10.0.0.0/8 or 192.168.0.0/16. Ranges must be unique and non-overlapping within a network. Only IPv4 is supported. Field is optional when reserved_internal_range is defined, otherwise required.
    Ipv6AccessType string
    The access type of IPv6 address this subnet holds. It's immutable and can only be specified during creation or the first time the subnet is updated into IPV4_IPV6 dual stack. If the ipv6_type is EXTERNAL then this subnet cannot enable direct path. Possible values are: EXTERNAL, INTERNAL.
    LogConfig SubnetworkLogConfig
    This field denotes the VPC flow logging options for this subnetwork. If logging is enabled, logs are exported to Cloud Logging. Flow logging isn't supported if the subnet purpose field is set to subnetwork is REGIONAL_MANAGED_PROXY or GLOBAL_MANAGED_PROXY. Structure is documented below.
    Name string
    The name of the resource, provided by the client when initially creating the resource. The name must be 1-63 characters long, and comply with RFC1035. Specifically, the name must be 1-63 characters long and match the regular expression a-z? which means the first character must be a lowercase letter, and all following characters must be a dash, lowercase letter, or digit, except the last character, which cannot be a dash.
    PrivateIpGoogleAccess bool
    When enabled, VMs in this subnetwork without external IP addresses can access Google APIs and services by using Private Google Access.
    PrivateIpv6GoogleAccess string
    The private IPv6 google access type for the VMs in this subnet.
    Project string
    The ID of the project in which the resource belongs. If it is not provided, the provider project is used.
    Purpose string
    The purpose of the resource. This field can be either PRIVATE, REGIONAL_MANAGED_PROXY, GLOBAL_MANAGED_PROXY, PRIVATE_SERVICE_CONNECT or PRIVATE_NAT. A subnet with purpose set to REGIONAL_MANAGED_PROXY is a user-created subnetwork that is reserved for regional Envoy-based load balancers. A subnetwork in a given region with purpose set to GLOBAL_MANAGED_PROXY is a proxy-only subnet and is shared between all the cross-regional Envoy-based load balancers. A subnetwork with purpose set to PRIVATE_SERVICE_CONNECT reserves the subnet for hosting a Private Service Connect published service. A subnetwork with purpose set to PRIVATE_NAT is used as source range for Private NAT gateways. Note that REGIONAL_MANAGED_PROXY is the preferred setting for all regional Envoy load balancers. If unspecified, the purpose defaults to PRIVATE.
    Region string
    The GCP region for this subnetwork.
    ReservedInternalRange string
    The ID of the reserved internal range. Must be prefixed with networkconnectivity.googleapis.com E.g. networkconnectivity.googleapis.com/projects/{project}/locations/global/internalRanges/{rangeId}
    Role string
    The role of subnetwork. Currently, this field is only used when purpose is REGIONAL_MANAGED_PROXY. The value can be set to ACTIVE or BACKUP. An ACTIVE subnetwork is one that is currently being used for Envoy-based load balancers in a region. A BACKUP subnetwork is one that is ready to be promoted to ACTIVE or is currently draining. Possible values are: ACTIVE, BACKUP.
    SecondaryIpRanges List<SubnetworkSecondaryIpRange>
    An array of configurations for secondary IP ranges for VM instances contained in this subnetwork. The primary IP of such VM must belong to the primary ipCidrRange of the subnetwork. The alias IPs may belong to either primary or secondary ranges. Structure is documented below.
    SendSecondaryIpRangeIfEmpty bool
    Controls the removal behavior of secondary_ip_range. When false, removing secondary_ip_range from config will not produce a diff as the provider will default to the API's value. When true, the provider will treat removing secondary_ip_range as sending an empty list of secondary IP ranges to the API. Defaults to false.
    StackType string
    The stack type for this subnet to identify whether the IPv6 feature is enabled or not. If not specified IPV4_ONLY will be used. Possible values are: IPV4_ONLY, IPV4_IPV6.
    Network string
    The network this subnet belongs to. Only networks that are in the distributed mode can have subnetworks.


    AllowSubnetCidrRoutesOverlap bool
    Typically packets destined to IPs within the subnetwork range that do not match existing resources are dropped and prevented from leaving the VPC. Setting this field to true will allow these packets to match dynamic routes injected via BGP even if their destinations match existing subnet ranges.
    Description string
    An optional description of this resource. Provide this property when you create the resource. This field can be set only at resource creation time.
    ExternalIpv6Prefix string
    The range of external IPv6 addresses that are owned by this subnetwork.
    IpCidrRange string
    The range of internal addresses that are owned by this subnetwork. Provide this property when you create the subnetwork. For example, 10.0.0.0/8 or 192.168.0.0/16. Ranges must be unique and non-overlapping within a network. Only IPv4 is supported. Field is optional when reserved_internal_range is defined, otherwise required.
    Ipv6AccessType string
    The access type of IPv6 address this subnet holds. It's immutable and can only be specified during creation or the first time the subnet is updated into IPV4_IPV6 dual stack. If the ipv6_type is EXTERNAL then this subnet cannot enable direct path. Possible values are: EXTERNAL, INTERNAL.
    LogConfig SubnetworkLogConfigArgs
    This field denotes the VPC flow logging options for this subnetwork. If logging is enabled, logs are exported to Cloud Logging. Flow logging isn't supported if the subnet purpose field is set to subnetwork is REGIONAL_MANAGED_PROXY or GLOBAL_MANAGED_PROXY. Structure is documented below.
    Name string
    The name of the resource, provided by the client when initially creating the resource. The name must be 1-63 characters long, and comply with RFC1035. Specifically, the name must be 1-63 characters long and match the regular expression a-z? which means the first character must be a lowercase letter, and all following characters must be a dash, lowercase letter, or digit, except the last character, which cannot be a dash.
    PrivateIpGoogleAccess bool
    When enabled, VMs in this subnetwork without external IP addresses can access Google APIs and services by using Private Google Access.
    PrivateIpv6GoogleAccess string
    The private IPv6 google access type for the VMs in this subnet.
    Project string
    The ID of the project in which the resource belongs. If it is not provided, the provider project is used.
    Purpose string
    The purpose of the resource. This field can be either PRIVATE, REGIONAL_MANAGED_PROXY, GLOBAL_MANAGED_PROXY, PRIVATE_SERVICE_CONNECT or PRIVATE_NAT. A subnet with purpose set to REGIONAL_MANAGED_PROXY is a user-created subnetwork that is reserved for regional Envoy-based load balancers. A subnetwork in a given region with purpose set to GLOBAL_MANAGED_PROXY is a proxy-only subnet and is shared between all the cross-regional Envoy-based load balancers. A subnetwork with purpose set to PRIVATE_SERVICE_CONNECT reserves the subnet for hosting a Private Service Connect published service. A subnetwork with purpose set to PRIVATE_NAT is used as source range for Private NAT gateways. Note that REGIONAL_MANAGED_PROXY is the preferred setting for all regional Envoy load balancers. If unspecified, the purpose defaults to PRIVATE.
    Region string
    The GCP region for this subnetwork.
    ReservedInternalRange string
    The ID of the reserved internal range. Must be prefixed with networkconnectivity.googleapis.com E.g. networkconnectivity.googleapis.com/projects/{project}/locations/global/internalRanges/{rangeId}
    Role string
    The role of subnetwork. Currently, this field is only used when purpose is REGIONAL_MANAGED_PROXY. The value can be set to ACTIVE or BACKUP. An ACTIVE subnetwork is one that is currently being used for Envoy-based load balancers in a region. A BACKUP subnetwork is one that is ready to be promoted to ACTIVE or is currently draining. Possible values are: ACTIVE, BACKUP.
    SecondaryIpRanges []SubnetworkSecondaryIpRangeArgs
    An array of configurations for secondary IP ranges for VM instances contained in this subnetwork. The primary IP of such VM must belong to the primary ipCidrRange of the subnetwork. The alias IPs may belong to either primary or secondary ranges. Structure is documented below.
    SendSecondaryIpRangeIfEmpty bool
    Controls the removal behavior of secondary_ip_range. When false, removing secondary_ip_range from config will not produce a diff as the provider will default to the API's value. When true, the provider will treat removing secondary_ip_range as sending an empty list of secondary IP ranges to the API. Defaults to false.
    StackType string
    The stack type for this subnet to identify whether the IPv6 feature is enabled or not. If not specified IPV4_ONLY will be used. Possible values are: IPV4_ONLY, IPV4_IPV6.
    network String
    The network this subnet belongs to. Only networks that are in the distributed mode can have subnetworks.


    allowSubnetCidrRoutesOverlap Boolean
    Typically packets destined to IPs within the subnetwork range that do not match existing resources are dropped and prevented from leaving the VPC. Setting this field to true will allow these packets to match dynamic routes injected via BGP even if their destinations match existing subnet ranges.
    description String
    An optional description of this resource. Provide this property when you create the resource. This field can be set only at resource creation time.
    externalIpv6Prefix String
    The range of external IPv6 addresses that are owned by this subnetwork.
    ipCidrRange String
    The range of internal addresses that are owned by this subnetwork. Provide this property when you create the subnetwork. For example, 10.0.0.0/8 or 192.168.0.0/16. Ranges must be unique and non-overlapping within a network. Only IPv4 is supported. Field is optional when reserved_internal_range is defined, otherwise required.
    ipv6AccessType String
    The access type of IPv6 address this subnet holds. It's immutable and can only be specified during creation or the first time the subnet is updated into IPV4_IPV6 dual stack. If the ipv6_type is EXTERNAL then this subnet cannot enable direct path. Possible values are: EXTERNAL, INTERNAL.
    logConfig SubnetworkLogConfig
    This field denotes the VPC flow logging options for this subnetwork. If logging is enabled, logs are exported to Cloud Logging. Flow logging isn't supported if the subnet purpose field is set to subnetwork is REGIONAL_MANAGED_PROXY or GLOBAL_MANAGED_PROXY. Structure is documented below.
    name String
    The name of the resource, provided by the client when initially creating the resource. The name must be 1-63 characters long, and comply with RFC1035. Specifically, the name must be 1-63 characters long and match the regular expression a-z? which means the first character must be a lowercase letter, and all following characters must be a dash, lowercase letter, or digit, except the last character, which cannot be a dash.
    privateIpGoogleAccess Boolean
    When enabled, VMs in this subnetwork without external IP addresses can access Google APIs and services by using Private Google Access.
    privateIpv6GoogleAccess String
    The private IPv6 google access type for the VMs in this subnet.
    project String
    The ID of the project in which the resource belongs. If it is not provided, the provider project is used.
    purpose String
    The purpose of the resource. This field can be either PRIVATE, REGIONAL_MANAGED_PROXY, GLOBAL_MANAGED_PROXY, PRIVATE_SERVICE_CONNECT or PRIVATE_NAT. A subnet with purpose set to REGIONAL_MANAGED_PROXY is a user-created subnetwork that is reserved for regional Envoy-based load balancers. A subnetwork in a given region with purpose set to GLOBAL_MANAGED_PROXY is a proxy-only subnet and is shared between all the cross-regional Envoy-based load balancers. A subnetwork with purpose set to PRIVATE_SERVICE_CONNECT reserves the subnet for hosting a Private Service Connect published service. A subnetwork with purpose set to PRIVATE_NAT is used as source range for Private NAT gateways. Note that REGIONAL_MANAGED_PROXY is the preferred setting for all regional Envoy load balancers. If unspecified, the purpose defaults to PRIVATE.
    region String
    The GCP region for this subnetwork.
    reservedInternalRange String
    The ID of the reserved internal range. Must be prefixed with networkconnectivity.googleapis.com E.g. networkconnectivity.googleapis.com/projects/{project}/locations/global/internalRanges/{rangeId}
    role String
    The role of subnetwork. Currently, this field is only used when purpose is REGIONAL_MANAGED_PROXY. The value can be set to ACTIVE or BACKUP. An ACTIVE subnetwork is one that is currently being used for Envoy-based load balancers in a region. A BACKUP subnetwork is one that is ready to be promoted to ACTIVE or is currently draining. Possible values are: ACTIVE, BACKUP.
    secondaryIpRanges List<SubnetworkSecondaryIpRange>
    An array of configurations for secondary IP ranges for VM instances contained in this subnetwork. The primary IP of such VM must belong to the primary ipCidrRange of the subnetwork. The alias IPs may belong to either primary or secondary ranges. Structure is documented below.
    sendSecondaryIpRangeIfEmpty Boolean
    Controls the removal behavior of secondary_ip_range. When false, removing secondary_ip_range from config will not produce a diff as the provider will default to the API's value. When true, the provider will treat removing secondary_ip_range as sending an empty list of secondary IP ranges to the API. Defaults to false.
    stackType String
    The stack type for this subnet to identify whether the IPv6 feature is enabled or not. If not specified IPV4_ONLY will be used. Possible values are: IPV4_ONLY, IPV4_IPV6.
    network string
    The network this subnet belongs to. Only networks that are in the distributed mode can have subnetworks.


    allowSubnetCidrRoutesOverlap boolean
    Typically packets destined to IPs within the subnetwork range that do not match existing resources are dropped and prevented from leaving the VPC. Setting this field to true will allow these packets to match dynamic routes injected via BGP even if their destinations match existing subnet ranges.
    description string
    An optional description of this resource. Provide this property when you create the resource. This field can be set only at resource creation time.
    externalIpv6Prefix string
    The range of external IPv6 addresses that are owned by this subnetwork.
    ipCidrRange string
    The range of internal addresses that are owned by this subnetwork. Provide this property when you create the subnetwork. For example, 10.0.0.0/8 or 192.168.0.0/16. Ranges must be unique and non-overlapping within a network. Only IPv4 is supported. Field is optional when reserved_internal_range is defined, otherwise required.
    ipv6AccessType string
    The access type of IPv6 address this subnet holds. It's immutable and can only be specified during creation or the first time the subnet is updated into IPV4_IPV6 dual stack. If the ipv6_type is EXTERNAL then this subnet cannot enable direct path. Possible values are: EXTERNAL, INTERNAL.
    logConfig SubnetworkLogConfig
    This field denotes the VPC flow logging options for this subnetwork. If logging is enabled, logs are exported to Cloud Logging. Flow logging isn't supported if the subnet purpose field is set to subnetwork is REGIONAL_MANAGED_PROXY or GLOBAL_MANAGED_PROXY. Structure is documented below.
    name string
    The name of the resource, provided by the client when initially creating the resource. The name must be 1-63 characters long, and comply with RFC1035. Specifically, the name must be 1-63 characters long and match the regular expression a-z? which means the first character must be a lowercase letter, and all following characters must be a dash, lowercase letter, or digit, except the last character, which cannot be a dash.
    privateIpGoogleAccess boolean
    When enabled, VMs in this subnetwork without external IP addresses can access Google APIs and services by using Private Google Access.
    privateIpv6GoogleAccess string
    The private IPv6 google access type for the VMs in this subnet.
    project string
    The ID of the project in which the resource belongs. If it is not provided, the provider project is used.
    purpose string
    The purpose of the resource. This field can be either PRIVATE, REGIONAL_MANAGED_PROXY, GLOBAL_MANAGED_PROXY, PRIVATE_SERVICE_CONNECT or PRIVATE_NAT. A subnet with purpose set to REGIONAL_MANAGED_PROXY is a user-created subnetwork that is reserved for regional Envoy-based load balancers. A subnetwork in a given region with purpose set to GLOBAL_MANAGED_PROXY is a proxy-only subnet and is shared between all the cross-regional Envoy-based load balancers. A subnetwork with purpose set to PRIVATE_SERVICE_CONNECT reserves the subnet for hosting a Private Service Connect published service. A subnetwork with purpose set to PRIVATE_NAT is used as source range for Private NAT gateways. Note that REGIONAL_MANAGED_PROXY is the preferred setting for all regional Envoy load balancers. If unspecified, the purpose defaults to PRIVATE.
    region string
    The GCP region for this subnetwork.
    reservedInternalRange string
    The ID of the reserved internal range. Must be prefixed with networkconnectivity.googleapis.com E.g. networkconnectivity.googleapis.com/projects/{project}/locations/global/internalRanges/{rangeId}
    role string
    The role of subnetwork. Currently, this field is only used when purpose is REGIONAL_MANAGED_PROXY. The value can be set to ACTIVE or BACKUP. An ACTIVE subnetwork is one that is currently being used for Envoy-based load balancers in a region. A BACKUP subnetwork is one that is ready to be promoted to ACTIVE or is currently draining. Possible values are: ACTIVE, BACKUP.
    secondaryIpRanges SubnetworkSecondaryIpRange[]
    An array of configurations for secondary IP ranges for VM instances contained in this subnetwork. The primary IP of such VM must belong to the primary ipCidrRange of the subnetwork. The alias IPs may belong to either primary or secondary ranges. Structure is documented below.
    sendSecondaryIpRangeIfEmpty boolean
    Controls the removal behavior of secondary_ip_range. When false, removing secondary_ip_range from config will not produce a diff as the provider will default to the API's value. When true, the provider will treat removing secondary_ip_range as sending an empty list of secondary IP ranges to the API. Defaults to false.
    stackType string
    The stack type for this subnet to identify whether the IPv6 feature is enabled or not. If not specified IPV4_ONLY will be used. Possible values are: IPV4_ONLY, IPV4_IPV6.
    network str
    The network this subnet belongs to. Only networks that are in the distributed mode can have subnetworks.


    allow_subnet_cidr_routes_overlap bool
    Typically packets destined to IPs within the subnetwork range that do not match existing resources are dropped and prevented from leaving the VPC. Setting this field to true will allow these packets to match dynamic routes injected via BGP even if their destinations match existing subnet ranges.
    description str
    An optional description of this resource. Provide this property when you create the resource. This field can be set only at resource creation time.
    external_ipv6_prefix str
    The range of external IPv6 addresses that are owned by this subnetwork.
    ip_cidr_range str
    The range of internal addresses that are owned by this subnetwork. Provide this property when you create the subnetwork. For example, 10.0.0.0/8 or 192.168.0.0/16. Ranges must be unique and non-overlapping within a network. Only IPv4 is supported. Field is optional when reserved_internal_range is defined, otherwise required.
    ipv6_access_type str
    The access type of IPv6 address this subnet holds. It's immutable and can only be specified during creation or the first time the subnet is updated into IPV4_IPV6 dual stack. If the ipv6_type is EXTERNAL then this subnet cannot enable direct path. Possible values are: EXTERNAL, INTERNAL.
    log_config SubnetworkLogConfigArgs
    This field denotes the VPC flow logging options for this subnetwork. If logging is enabled, logs are exported to Cloud Logging. Flow logging isn't supported if the subnet purpose field is set to subnetwork is REGIONAL_MANAGED_PROXY or GLOBAL_MANAGED_PROXY. Structure is documented below.
    name str
    The name of the resource, provided by the client when initially creating the resource. The name must be 1-63 characters long, and comply with RFC1035. Specifically, the name must be 1-63 characters long and match the regular expression a-z? which means the first character must be a lowercase letter, and all following characters must be a dash, lowercase letter, or digit, except the last character, which cannot be a dash.
    private_ip_google_access bool
    When enabled, VMs in this subnetwork without external IP addresses can access Google APIs and services by using Private Google Access.
    private_ipv6_google_access str
    The private IPv6 google access type for the VMs in this subnet.
    project str
    The ID of the project in which the resource belongs. If it is not provided, the provider project is used.
    purpose str
    The purpose of the resource. This field can be either PRIVATE, REGIONAL_MANAGED_PROXY, GLOBAL_MANAGED_PROXY, PRIVATE_SERVICE_CONNECT or PRIVATE_NAT. A subnet with purpose set to REGIONAL_MANAGED_PROXY is a user-created subnetwork that is reserved for regional Envoy-based load balancers. A subnetwork in a given region with purpose set to GLOBAL_MANAGED_PROXY is a proxy-only subnet and is shared between all the cross-regional Envoy-based load balancers. A subnetwork with purpose set to PRIVATE_SERVICE_CONNECT reserves the subnet for hosting a Private Service Connect published service. A subnetwork with purpose set to PRIVATE_NAT is used as source range for Private NAT gateways. Note that REGIONAL_MANAGED_PROXY is the preferred setting for all regional Envoy load balancers. If unspecified, the purpose defaults to PRIVATE.
    region str
    The GCP region for this subnetwork.
    reserved_internal_range str
    The ID of the reserved internal range. Must be prefixed with networkconnectivity.googleapis.com E.g. networkconnectivity.googleapis.com/projects/{project}/locations/global/internalRanges/{rangeId}
    role str
    The role of subnetwork. Currently, this field is only used when purpose is REGIONAL_MANAGED_PROXY. The value can be set to ACTIVE or BACKUP. An ACTIVE subnetwork is one that is currently being used for Envoy-based load balancers in a region. A BACKUP subnetwork is one that is ready to be promoted to ACTIVE or is currently draining. Possible values are: ACTIVE, BACKUP.
    secondary_ip_ranges Sequence[SubnetworkSecondaryIpRangeArgs]
    An array of configurations for secondary IP ranges for VM instances contained in this subnetwork. The primary IP of such VM must belong to the primary ipCidrRange of the subnetwork. The alias IPs may belong to either primary or secondary ranges. Structure is documented below.
    send_secondary_ip_range_if_empty bool
    Controls the removal behavior of secondary_ip_range. When false, removing secondary_ip_range from config will not produce a diff as the provider will default to the API's value. When true, the provider will treat removing secondary_ip_range as sending an empty list of secondary IP ranges to the API. Defaults to false.
    stack_type str
    The stack type for this subnet to identify whether the IPv6 feature is enabled or not. If not specified IPV4_ONLY will be used. Possible values are: IPV4_ONLY, IPV4_IPV6.
    network String
    The network this subnet belongs to. Only networks that are in the distributed mode can have subnetworks.


    allowSubnetCidrRoutesOverlap Boolean
    Typically packets destined to IPs within the subnetwork range that do not match existing resources are dropped and prevented from leaving the VPC. Setting this field to true will allow these packets to match dynamic routes injected via BGP even if their destinations match existing subnet ranges.
    description String
    An optional description of this resource. Provide this property when you create the resource. This field can be set only at resource creation time.
    externalIpv6Prefix String
    The range of external IPv6 addresses that are owned by this subnetwork.
    ipCidrRange String
    The range of internal addresses that are owned by this subnetwork. Provide this property when you create the subnetwork. For example, 10.0.0.0/8 or 192.168.0.0/16. Ranges must be unique and non-overlapping within a network. Only IPv4 is supported. Field is optional when reserved_internal_range is defined, otherwise required.
    ipv6AccessType String
    The access type of IPv6 address this subnet holds. It's immutable and can only be specified during creation or the first time the subnet is updated into IPV4_IPV6 dual stack. If the ipv6_type is EXTERNAL then this subnet cannot enable direct path. Possible values are: EXTERNAL, INTERNAL.
    logConfig Property Map
    This field denotes the VPC flow logging options for this subnetwork. If logging is enabled, logs are exported to Cloud Logging. Flow logging isn't supported if the subnet purpose field is set to subnetwork is REGIONAL_MANAGED_PROXY or GLOBAL_MANAGED_PROXY. Structure is documented below.
    name String
    The name of the resource, provided by the client when initially creating the resource. The name must be 1-63 characters long, and comply with RFC1035. Specifically, the name must be 1-63 characters long and match the regular expression a-z? which means the first character must be a lowercase letter, and all following characters must be a dash, lowercase letter, or digit, except the last character, which cannot be a dash.
    privateIpGoogleAccess Boolean
    When enabled, VMs in this subnetwork without external IP addresses can access Google APIs and services by using Private Google Access.
    privateIpv6GoogleAccess String
    The private IPv6 google access type for the VMs in this subnet.
    project String
    The ID of the project in which the resource belongs. If it is not provided, the provider project is used.
    purpose String
    The purpose of the resource. This field can be either PRIVATE, REGIONAL_MANAGED_PROXY, GLOBAL_MANAGED_PROXY, PRIVATE_SERVICE_CONNECT or PRIVATE_NAT. A subnet with purpose set to REGIONAL_MANAGED_PROXY is a user-created subnetwork that is reserved for regional Envoy-based load balancers. A subnetwork in a given region with purpose set to GLOBAL_MANAGED_PROXY is a proxy-only subnet and is shared between all the cross-regional Envoy-based load balancers. A subnetwork with purpose set to PRIVATE_SERVICE_CONNECT reserves the subnet for hosting a Private Service Connect published service. A subnetwork with purpose set to PRIVATE_NAT is used as source range for Private NAT gateways. Note that REGIONAL_MANAGED_PROXY is the preferred setting for all regional Envoy load balancers. If unspecified, the purpose defaults to PRIVATE.
    region String
    The GCP region for this subnetwork.
    reservedInternalRange String
    The ID of the reserved internal range. Must be prefixed with networkconnectivity.googleapis.com E.g. networkconnectivity.googleapis.com/projects/{project}/locations/global/internalRanges/{rangeId}
    role String
    The role of subnetwork. Currently, this field is only used when purpose is REGIONAL_MANAGED_PROXY. The value can be set to ACTIVE or BACKUP. An ACTIVE subnetwork is one that is currently being used for Envoy-based load balancers in a region. A BACKUP subnetwork is one that is ready to be promoted to ACTIVE or is currently draining. Possible values are: ACTIVE, BACKUP.
    secondaryIpRanges List<Property Map>
    An array of configurations for secondary IP ranges for VM instances contained in this subnetwork. The primary IP of such VM must belong to the primary ipCidrRange of the subnetwork. The alias IPs may belong to either primary or secondary ranges. Structure is documented below.
    sendSecondaryIpRangeIfEmpty Boolean
    Controls the removal behavior of secondary_ip_range. When false, removing secondary_ip_range from config will not produce a diff as the provider will default to the API's value. When true, the provider will treat removing secondary_ip_range as sending an empty list of secondary IP ranges to the API. Defaults to false.
    stackType String
    The stack type for this subnet to identify whether the IPv6 feature is enabled or not. If not specified IPV4_ONLY will be used. Possible values are: IPV4_ONLY, IPV4_IPV6.

    Outputs

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

    CreationTimestamp string
    Creation timestamp in RFC3339 text format.
    Fingerprint string
    Fingerprint of this resource. This field is used internally during updates of this resource.

    Deprecated: This field is not useful for users, and has been removed as an output.

    GatewayAddress string
    The gateway address for default routes to reach destination addresses outside this subnetwork.
    Id string
    The provider-assigned unique ID for this managed resource.
    InternalIpv6Prefix string
    The internal IPv6 address range that is assigned to this subnetwork.
    Ipv6CidrRange string
    The range of internal IPv6 addresses that are owned by this subnetwork.
    SelfLink string
    The URI of the created resource.
    CreationTimestamp string
    Creation timestamp in RFC3339 text format.
    Fingerprint string
    Fingerprint of this resource. This field is used internally during updates of this resource.

    Deprecated: This field is not useful for users, and has been removed as an output.

    GatewayAddress string
    The gateway address for default routes to reach destination addresses outside this subnetwork.
    Id string
    The provider-assigned unique ID for this managed resource.
    InternalIpv6Prefix string
    The internal IPv6 address range that is assigned to this subnetwork.
    Ipv6CidrRange string
    The range of internal IPv6 addresses that are owned by this subnetwork.
    SelfLink string
    The URI of the created resource.
    creationTimestamp String
    Creation timestamp in RFC3339 text format.
    fingerprint String
    Fingerprint of this resource. This field is used internally during updates of this resource.

    Deprecated: This field is not useful for users, and has been removed as an output.

    gatewayAddress String
    The gateway address for default routes to reach destination addresses outside this subnetwork.
    id String
    The provider-assigned unique ID for this managed resource.
    internalIpv6Prefix String
    The internal IPv6 address range that is assigned to this subnetwork.
    ipv6CidrRange String
    The range of internal IPv6 addresses that are owned by this subnetwork.
    selfLink String
    The URI of the created resource.
    creationTimestamp string
    Creation timestamp in RFC3339 text format.
    fingerprint string
    Fingerprint of this resource. This field is used internally during updates of this resource.

    Deprecated: This field is not useful for users, and has been removed as an output.

    gatewayAddress string
    The gateway address for default routes to reach destination addresses outside this subnetwork.
    id string
    The provider-assigned unique ID for this managed resource.
    internalIpv6Prefix string
    The internal IPv6 address range that is assigned to this subnetwork.
    ipv6CidrRange string
    The range of internal IPv6 addresses that are owned by this subnetwork.
    selfLink string
    The URI of the created resource.
    creation_timestamp str
    Creation timestamp in RFC3339 text format.
    fingerprint str
    Fingerprint of this resource. This field is used internally during updates of this resource.

    Deprecated: This field is not useful for users, and has been removed as an output.

    gateway_address str
    The gateway address for default routes to reach destination addresses outside this subnetwork.
    id str
    The provider-assigned unique ID for this managed resource.
    internal_ipv6_prefix str
    The internal IPv6 address range that is assigned to this subnetwork.
    ipv6_cidr_range str
    The range of internal IPv6 addresses that are owned by this subnetwork.
    self_link str
    The URI of the created resource.
    creationTimestamp String
    Creation timestamp in RFC3339 text format.
    fingerprint String
    Fingerprint of this resource. This field is used internally during updates of this resource.

    Deprecated: This field is not useful for users, and has been removed as an output.

    gatewayAddress String
    The gateway address for default routes to reach destination addresses outside this subnetwork.
    id String
    The provider-assigned unique ID for this managed resource.
    internalIpv6Prefix String
    The internal IPv6 address range that is assigned to this subnetwork.
    ipv6CidrRange String
    The range of internal IPv6 addresses that are owned by this subnetwork.
    selfLink String
    The URI of the created resource.

    Look up Existing Subnetwork Resource

    Get an existing Subnetwork 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?: SubnetworkState, opts?: CustomResourceOptions): Subnetwork
    @staticmethod
    def get(resource_name: str,
            id: str,
            opts: Optional[ResourceOptions] = None,
            allow_subnet_cidr_routes_overlap: Optional[bool] = None,
            creation_timestamp: Optional[str] = None,
            description: Optional[str] = None,
            external_ipv6_prefix: Optional[str] = None,
            fingerprint: Optional[str] = None,
            gateway_address: Optional[str] = None,
            internal_ipv6_prefix: Optional[str] = None,
            ip_cidr_range: Optional[str] = None,
            ipv6_access_type: Optional[str] = None,
            ipv6_cidr_range: Optional[str] = None,
            log_config: Optional[SubnetworkLogConfigArgs] = None,
            name: Optional[str] = None,
            network: Optional[str] = None,
            private_ip_google_access: Optional[bool] = None,
            private_ipv6_google_access: Optional[str] = None,
            project: Optional[str] = None,
            purpose: Optional[str] = None,
            region: Optional[str] = None,
            reserved_internal_range: Optional[str] = None,
            role: Optional[str] = None,
            secondary_ip_ranges: Optional[Sequence[SubnetworkSecondaryIpRangeArgs]] = None,
            self_link: Optional[str] = None,
            send_secondary_ip_range_if_empty: Optional[bool] = None,
            stack_type: Optional[str] = None) -> Subnetwork
    func GetSubnetwork(ctx *Context, name string, id IDInput, state *SubnetworkState, opts ...ResourceOption) (*Subnetwork, error)
    public static Subnetwork Get(string name, Input<string> id, SubnetworkState? state, CustomResourceOptions? opts = null)
    public static Subnetwork get(String name, Output<String> id, SubnetworkState 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:
    AllowSubnetCidrRoutesOverlap bool
    Typically packets destined to IPs within the subnetwork range that do not match existing resources are dropped and prevented from leaving the VPC. Setting this field to true will allow these packets to match dynamic routes injected via BGP even if their destinations match existing subnet ranges.
    CreationTimestamp string
    Creation timestamp in RFC3339 text format.
    Description string
    An optional description of this resource. Provide this property when you create the resource. This field can be set only at resource creation time.
    ExternalIpv6Prefix string
    The range of external IPv6 addresses that are owned by this subnetwork.
    Fingerprint string
    Fingerprint of this resource. This field is used internally during updates of this resource.

    Deprecated: This field is not useful for users, and has been removed as an output.

    GatewayAddress string
    The gateway address for default routes to reach destination addresses outside this subnetwork.
    InternalIpv6Prefix string
    The internal IPv6 address range that is assigned to this subnetwork.
    IpCidrRange string
    The range of internal addresses that are owned by this subnetwork. Provide this property when you create the subnetwork. For example, 10.0.0.0/8 or 192.168.0.0/16. Ranges must be unique and non-overlapping within a network. Only IPv4 is supported. Field is optional when reserved_internal_range is defined, otherwise required.
    Ipv6AccessType string
    The access type of IPv6 address this subnet holds. It's immutable and can only be specified during creation or the first time the subnet is updated into IPV4_IPV6 dual stack. If the ipv6_type is EXTERNAL then this subnet cannot enable direct path. Possible values are: EXTERNAL, INTERNAL.
    Ipv6CidrRange string
    The range of internal IPv6 addresses that are owned by this subnetwork.
    LogConfig SubnetworkLogConfig
    This field denotes the VPC flow logging options for this subnetwork. If logging is enabled, logs are exported to Cloud Logging. Flow logging isn't supported if the subnet purpose field is set to subnetwork is REGIONAL_MANAGED_PROXY or GLOBAL_MANAGED_PROXY. Structure is documented below.
    Name string
    The name of the resource, provided by the client when initially creating the resource. The name must be 1-63 characters long, and comply with RFC1035. Specifically, the name must be 1-63 characters long and match the regular expression a-z? which means the first character must be a lowercase letter, and all following characters must be a dash, lowercase letter, or digit, except the last character, which cannot be a dash.
    Network string
    The network this subnet belongs to. Only networks that are in the distributed mode can have subnetworks.


    PrivateIpGoogleAccess bool
    When enabled, VMs in this subnetwork without external IP addresses can access Google APIs and services by using Private Google Access.
    PrivateIpv6GoogleAccess string
    The private IPv6 google access type for the VMs in this subnet.
    Project string
    The ID of the project in which the resource belongs. If it is not provided, the provider project is used.
    Purpose string
    The purpose of the resource. This field can be either PRIVATE, REGIONAL_MANAGED_PROXY, GLOBAL_MANAGED_PROXY, PRIVATE_SERVICE_CONNECT or PRIVATE_NAT. A subnet with purpose set to REGIONAL_MANAGED_PROXY is a user-created subnetwork that is reserved for regional Envoy-based load balancers. A subnetwork in a given region with purpose set to GLOBAL_MANAGED_PROXY is a proxy-only subnet and is shared between all the cross-regional Envoy-based load balancers. A subnetwork with purpose set to PRIVATE_SERVICE_CONNECT reserves the subnet for hosting a Private Service Connect published service. A subnetwork with purpose set to PRIVATE_NAT is used as source range for Private NAT gateways. Note that REGIONAL_MANAGED_PROXY is the preferred setting for all regional Envoy load balancers. If unspecified, the purpose defaults to PRIVATE.
    Region string
    The GCP region for this subnetwork.
    ReservedInternalRange string
    The ID of the reserved internal range. Must be prefixed with networkconnectivity.googleapis.com E.g. networkconnectivity.googleapis.com/projects/{project}/locations/global/internalRanges/{rangeId}
    Role string
    The role of subnetwork. Currently, this field is only used when purpose is REGIONAL_MANAGED_PROXY. The value can be set to ACTIVE or BACKUP. An ACTIVE subnetwork is one that is currently being used for Envoy-based load balancers in a region. A BACKUP subnetwork is one that is ready to be promoted to ACTIVE or is currently draining. Possible values are: ACTIVE, BACKUP.
    SecondaryIpRanges List<SubnetworkSecondaryIpRange>
    An array of configurations for secondary IP ranges for VM instances contained in this subnetwork. The primary IP of such VM must belong to the primary ipCidrRange of the subnetwork. The alias IPs may belong to either primary or secondary ranges. Structure is documented below.
    SelfLink string
    The URI of the created resource.
    SendSecondaryIpRangeIfEmpty bool
    Controls the removal behavior of secondary_ip_range. When false, removing secondary_ip_range from config will not produce a diff as the provider will default to the API's value. When true, the provider will treat removing secondary_ip_range as sending an empty list of secondary IP ranges to the API. Defaults to false.
    StackType string
    The stack type for this subnet to identify whether the IPv6 feature is enabled or not. If not specified IPV4_ONLY will be used. Possible values are: IPV4_ONLY, IPV4_IPV6.
    AllowSubnetCidrRoutesOverlap bool
    Typically packets destined to IPs within the subnetwork range that do not match existing resources are dropped and prevented from leaving the VPC. Setting this field to true will allow these packets to match dynamic routes injected via BGP even if their destinations match existing subnet ranges.
    CreationTimestamp string
    Creation timestamp in RFC3339 text format.
    Description string
    An optional description of this resource. Provide this property when you create the resource. This field can be set only at resource creation time.
    ExternalIpv6Prefix string
    The range of external IPv6 addresses that are owned by this subnetwork.
    Fingerprint string
    Fingerprint of this resource. This field is used internally during updates of this resource.

    Deprecated: This field is not useful for users, and has been removed as an output.

    GatewayAddress string
    The gateway address for default routes to reach destination addresses outside this subnetwork.
    InternalIpv6Prefix string
    The internal IPv6 address range that is assigned to this subnetwork.
    IpCidrRange string
    The range of internal addresses that are owned by this subnetwork. Provide this property when you create the subnetwork. For example, 10.0.0.0/8 or 192.168.0.0/16. Ranges must be unique and non-overlapping within a network. Only IPv4 is supported. Field is optional when reserved_internal_range is defined, otherwise required.
    Ipv6AccessType string
    The access type of IPv6 address this subnet holds. It's immutable and can only be specified during creation or the first time the subnet is updated into IPV4_IPV6 dual stack. If the ipv6_type is EXTERNAL then this subnet cannot enable direct path. Possible values are: EXTERNAL, INTERNAL.
    Ipv6CidrRange string
    The range of internal IPv6 addresses that are owned by this subnetwork.
    LogConfig SubnetworkLogConfigArgs
    This field denotes the VPC flow logging options for this subnetwork. If logging is enabled, logs are exported to Cloud Logging. Flow logging isn't supported if the subnet purpose field is set to subnetwork is REGIONAL_MANAGED_PROXY or GLOBAL_MANAGED_PROXY. Structure is documented below.
    Name string
    The name of the resource, provided by the client when initially creating the resource. The name must be 1-63 characters long, and comply with RFC1035. Specifically, the name must be 1-63 characters long and match the regular expression a-z? which means the first character must be a lowercase letter, and all following characters must be a dash, lowercase letter, or digit, except the last character, which cannot be a dash.
    Network string
    The network this subnet belongs to. Only networks that are in the distributed mode can have subnetworks.


    PrivateIpGoogleAccess bool
    When enabled, VMs in this subnetwork without external IP addresses can access Google APIs and services by using Private Google Access.
    PrivateIpv6GoogleAccess string
    The private IPv6 google access type for the VMs in this subnet.
    Project string
    The ID of the project in which the resource belongs. If it is not provided, the provider project is used.
    Purpose string
    The purpose of the resource. This field can be either PRIVATE, REGIONAL_MANAGED_PROXY, GLOBAL_MANAGED_PROXY, PRIVATE_SERVICE_CONNECT or PRIVATE_NAT. A subnet with purpose set to REGIONAL_MANAGED_PROXY is a user-created subnetwork that is reserved for regional Envoy-based load balancers. A subnetwork in a given region with purpose set to GLOBAL_MANAGED_PROXY is a proxy-only subnet and is shared between all the cross-regional Envoy-based load balancers. A subnetwork with purpose set to PRIVATE_SERVICE_CONNECT reserves the subnet for hosting a Private Service Connect published service. A subnetwork with purpose set to PRIVATE_NAT is used as source range for Private NAT gateways. Note that REGIONAL_MANAGED_PROXY is the preferred setting for all regional Envoy load balancers. If unspecified, the purpose defaults to PRIVATE.
    Region string
    The GCP region for this subnetwork.
    ReservedInternalRange string
    The ID of the reserved internal range. Must be prefixed with networkconnectivity.googleapis.com E.g. networkconnectivity.googleapis.com/projects/{project}/locations/global/internalRanges/{rangeId}
    Role string
    The role of subnetwork. Currently, this field is only used when purpose is REGIONAL_MANAGED_PROXY. The value can be set to ACTIVE or BACKUP. An ACTIVE subnetwork is one that is currently being used for Envoy-based load balancers in a region. A BACKUP subnetwork is one that is ready to be promoted to ACTIVE or is currently draining. Possible values are: ACTIVE, BACKUP.
    SecondaryIpRanges []SubnetworkSecondaryIpRangeArgs
    An array of configurations for secondary IP ranges for VM instances contained in this subnetwork. The primary IP of such VM must belong to the primary ipCidrRange of the subnetwork. The alias IPs may belong to either primary or secondary ranges. Structure is documented below.
    SelfLink string
    The URI of the created resource.
    SendSecondaryIpRangeIfEmpty bool
    Controls the removal behavior of secondary_ip_range. When false, removing secondary_ip_range from config will not produce a diff as the provider will default to the API's value. When true, the provider will treat removing secondary_ip_range as sending an empty list of secondary IP ranges to the API. Defaults to false.
    StackType string
    The stack type for this subnet to identify whether the IPv6 feature is enabled or not. If not specified IPV4_ONLY will be used. Possible values are: IPV4_ONLY, IPV4_IPV6.
    allowSubnetCidrRoutesOverlap Boolean
    Typically packets destined to IPs within the subnetwork range that do not match existing resources are dropped and prevented from leaving the VPC. Setting this field to true will allow these packets to match dynamic routes injected via BGP even if their destinations match existing subnet ranges.
    creationTimestamp String
    Creation timestamp in RFC3339 text format.
    description String
    An optional description of this resource. Provide this property when you create the resource. This field can be set only at resource creation time.
    externalIpv6Prefix String
    The range of external IPv6 addresses that are owned by this subnetwork.
    fingerprint String
    Fingerprint of this resource. This field is used internally during updates of this resource.

    Deprecated: This field is not useful for users, and has been removed as an output.

    gatewayAddress String
    The gateway address for default routes to reach destination addresses outside this subnetwork.
    internalIpv6Prefix String
    The internal IPv6 address range that is assigned to this subnetwork.
    ipCidrRange String
    The range of internal addresses that are owned by this subnetwork. Provide this property when you create the subnetwork. For example, 10.0.0.0/8 or 192.168.0.0/16. Ranges must be unique and non-overlapping within a network. Only IPv4 is supported. Field is optional when reserved_internal_range is defined, otherwise required.
    ipv6AccessType String
    The access type of IPv6 address this subnet holds. It's immutable and can only be specified during creation or the first time the subnet is updated into IPV4_IPV6 dual stack. If the ipv6_type is EXTERNAL then this subnet cannot enable direct path. Possible values are: EXTERNAL, INTERNAL.
    ipv6CidrRange String
    The range of internal IPv6 addresses that are owned by this subnetwork.
    logConfig SubnetworkLogConfig
    This field denotes the VPC flow logging options for this subnetwork. If logging is enabled, logs are exported to Cloud Logging. Flow logging isn't supported if the subnet purpose field is set to subnetwork is REGIONAL_MANAGED_PROXY or GLOBAL_MANAGED_PROXY. Structure is documented below.
    name String
    The name of the resource, provided by the client when initially creating the resource. The name must be 1-63 characters long, and comply with RFC1035. Specifically, the name must be 1-63 characters long and match the regular expression a-z? which means the first character must be a lowercase letter, and all following characters must be a dash, lowercase letter, or digit, except the last character, which cannot be a dash.
    network String
    The network this subnet belongs to. Only networks that are in the distributed mode can have subnetworks.


    privateIpGoogleAccess Boolean
    When enabled, VMs in this subnetwork without external IP addresses can access Google APIs and services by using Private Google Access.
    privateIpv6GoogleAccess String
    The private IPv6 google access type for the VMs in this subnet.
    project String
    The ID of the project in which the resource belongs. If it is not provided, the provider project is used.
    purpose String
    The purpose of the resource. This field can be either PRIVATE, REGIONAL_MANAGED_PROXY, GLOBAL_MANAGED_PROXY, PRIVATE_SERVICE_CONNECT or PRIVATE_NAT. A subnet with purpose set to REGIONAL_MANAGED_PROXY is a user-created subnetwork that is reserved for regional Envoy-based load balancers. A subnetwork in a given region with purpose set to GLOBAL_MANAGED_PROXY is a proxy-only subnet and is shared between all the cross-regional Envoy-based load balancers. A subnetwork with purpose set to PRIVATE_SERVICE_CONNECT reserves the subnet for hosting a Private Service Connect published service. A subnetwork with purpose set to PRIVATE_NAT is used as source range for Private NAT gateways. Note that REGIONAL_MANAGED_PROXY is the preferred setting for all regional Envoy load balancers. If unspecified, the purpose defaults to PRIVATE.
    region String
    The GCP region for this subnetwork.
    reservedInternalRange String
    The ID of the reserved internal range. Must be prefixed with networkconnectivity.googleapis.com E.g. networkconnectivity.googleapis.com/projects/{project}/locations/global/internalRanges/{rangeId}
    role String
    The role of subnetwork. Currently, this field is only used when purpose is REGIONAL_MANAGED_PROXY. The value can be set to ACTIVE or BACKUP. An ACTIVE subnetwork is one that is currently being used for Envoy-based load balancers in a region. A BACKUP subnetwork is one that is ready to be promoted to ACTIVE or is currently draining. Possible values are: ACTIVE, BACKUP.
    secondaryIpRanges List<SubnetworkSecondaryIpRange>
    An array of configurations for secondary IP ranges for VM instances contained in this subnetwork. The primary IP of such VM must belong to the primary ipCidrRange of the subnetwork. The alias IPs may belong to either primary or secondary ranges. Structure is documented below.
    selfLink String
    The URI of the created resource.
    sendSecondaryIpRangeIfEmpty Boolean
    Controls the removal behavior of secondary_ip_range. When false, removing secondary_ip_range from config will not produce a diff as the provider will default to the API's value. When true, the provider will treat removing secondary_ip_range as sending an empty list of secondary IP ranges to the API. Defaults to false.
    stackType String
    The stack type for this subnet to identify whether the IPv6 feature is enabled or not. If not specified IPV4_ONLY will be used. Possible values are: IPV4_ONLY, IPV4_IPV6.
    allowSubnetCidrRoutesOverlap boolean
    Typically packets destined to IPs within the subnetwork range that do not match existing resources are dropped and prevented from leaving the VPC. Setting this field to true will allow these packets to match dynamic routes injected via BGP even if their destinations match existing subnet ranges.
    creationTimestamp string
    Creation timestamp in RFC3339 text format.
    description string
    An optional description of this resource. Provide this property when you create the resource. This field can be set only at resource creation time.
    externalIpv6Prefix string
    The range of external IPv6 addresses that are owned by this subnetwork.
    fingerprint string
    Fingerprint of this resource. This field is used internally during updates of this resource.

    Deprecated: This field is not useful for users, and has been removed as an output.

    gatewayAddress string
    The gateway address for default routes to reach destination addresses outside this subnetwork.
    internalIpv6Prefix string
    The internal IPv6 address range that is assigned to this subnetwork.
    ipCidrRange string
    The range of internal addresses that are owned by this subnetwork. Provide this property when you create the subnetwork. For example, 10.0.0.0/8 or 192.168.0.0/16. Ranges must be unique and non-overlapping within a network. Only IPv4 is supported. Field is optional when reserved_internal_range is defined, otherwise required.
    ipv6AccessType string
    The access type of IPv6 address this subnet holds. It's immutable and can only be specified during creation or the first time the subnet is updated into IPV4_IPV6 dual stack. If the ipv6_type is EXTERNAL then this subnet cannot enable direct path. Possible values are: EXTERNAL, INTERNAL.
    ipv6CidrRange string
    The range of internal IPv6 addresses that are owned by this subnetwork.
    logConfig SubnetworkLogConfig
    This field denotes the VPC flow logging options for this subnetwork. If logging is enabled, logs are exported to Cloud Logging. Flow logging isn't supported if the subnet purpose field is set to subnetwork is REGIONAL_MANAGED_PROXY or GLOBAL_MANAGED_PROXY. Structure is documented below.
    name string
    The name of the resource, provided by the client when initially creating the resource. The name must be 1-63 characters long, and comply with RFC1035. Specifically, the name must be 1-63 characters long and match the regular expression a-z? which means the first character must be a lowercase letter, and all following characters must be a dash, lowercase letter, or digit, except the last character, which cannot be a dash.
    network string
    The network this subnet belongs to. Only networks that are in the distributed mode can have subnetworks.


    privateIpGoogleAccess boolean
    When enabled, VMs in this subnetwork without external IP addresses can access Google APIs and services by using Private Google Access.
    privateIpv6GoogleAccess string
    The private IPv6 google access type for the VMs in this subnet.
    project string
    The ID of the project in which the resource belongs. If it is not provided, the provider project is used.
    purpose string
    The purpose of the resource. This field can be either PRIVATE, REGIONAL_MANAGED_PROXY, GLOBAL_MANAGED_PROXY, PRIVATE_SERVICE_CONNECT or PRIVATE_NAT. A subnet with purpose set to REGIONAL_MANAGED_PROXY is a user-created subnetwork that is reserved for regional Envoy-based load balancers. A subnetwork in a given region with purpose set to GLOBAL_MANAGED_PROXY is a proxy-only subnet and is shared between all the cross-regional Envoy-based load balancers. A subnetwork with purpose set to PRIVATE_SERVICE_CONNECT reserves the subnet for hosting a Private Service Connect published service. A subnetwork with purpose set to PRIVATE_NAT is used as source range for Private NAT gateways. Note that REGIONAL_MANAGED_PROXY is the preferred setting for all regional Envoy load balancers. If unspecified, the purpose defaults to PRIVATE.
    region string
    The GCP region for this subnetwork.
    reservedInternalRange string
    The ID of the reserved internal range. Must be prefixed with networkconnectivity.googleapis.com E.g. networkconnectivity.googleapis.com/projects/{project}/locations/global/internalRanges/{rangeId}
    role string
    The role of subnetwork. Currently, this field is only used when purpose is REGIONAL_MANAGED_PROXY. The value can be set to ACTIVE or BACKUP. An ACTIVE subnetwork is one that is currently being used for Envoy-based load balancers in a region. A BACKUP subnetwork is one that is ready to be promoted to ACTIVE or is currently draining. Possible values are: ACTIVE, BACKUP.
    secondaryIpRanges SubnetworkSecondaryIpRange[]
    An array of configurations for secondary IP ranges for VM instances contained in this subnetwork. The primary IP of such VM must belong to the primary ipCidrRange of the subnetwork. The alias IPs may belong to either primary or secondary ranges. Structure is documented below.
    selfLink string
    The URI of the created resource.
    sendSecondaryIpRangeIfEmpty boolean
    Controls the removal behavior of secondary_ip_range. When false, removing secondary_ip_range from config will not produce a diff as the provider will default to the API's value. When true, the provider will treat removing secondary_ip_range as sending an empty list of secondary IP ranges to the API. Defaults to false.
    stackType string
    The stack type for this subnet to identify whether the IPv6 feature is enabled or not. If not specified IPV4_ONLY will be used. Possible values are: IPV4_ONLY, IPV4_IPV6.
    allow_subnet_cidr_routes_overlap bool
    Typically packets destined to IPs within the subnetwork range that do not match existing resources are dropped and prevented from leaving the VPC. Setting this field to true will allow these packets to match dynamic routes injected via BGP even if their destinations match existing subnet ranges.
    creation_timestamp str
    Creation timestamp in RFC3339 text format.
    description str
    An optional description of this resource. Provide this property when you create the resource. This field can be set only at resource creation time.
    external_ipv6_prefix str
    The range of external IPv6 addresses that are owned by this subnetwork.
    fingerprint str
    Fingerprint of this resource. This field is used internally during updates of this resource.

    Deprecated: This field is not useful for users, and has been removed as an output.

    gateway_address str
    The gateway address for default routes to reach destination addresses outside this subnetwork.
    internal_ipv6_prefix str
    The internal IPv6 address range that is assigned to this subnetwork.
    ip_cidr_range str
    The range of internal addresses that are owned by this subnetwork. Provide this property when you create the subnetwork. For example, 10.0.0.0/8 or 192.168.0.0/16. Ranges must be unique and non-overlapping within a network. Only IPv4 is supported. Field is optional when reserved_internal_range is defined, otherwise required.
    ipv6_access_type str
    The access type of IPv6 address this subnet holds. It's immutable and can only be specified during creation or the first time the subnet is updated into IPV4_IPV6 dual stack. If the ipv6_type is EXTERNAL then this subnet cannot enable direct path. Possible values are: EXTERNAL, INTERNAL.
    ipv6_cidr_range str
    The range of internal IPv6 addresses that are owned by this subnetwork.
    log_config SubnetworkLogConfigArgs
    This field denotes the VPC flow logging options for this subnetwork. If logging is enabled, logs are exported to Cloud Logging. Flow logging isn't supported if the subnet purpose field is set to subnetwork is REGIONAL_MANAGED_PROXY or GLOBAL_MANAGED_PROXY. Structure is documented below.
    name str
    The name of the resource, provided by the client when initially creating the resource. The name must be 1-63 characters long, and comply with RFC1035. Specifically, the name must be 1-63 characters long and match the regular expression a-z? which means the first character must be a lowercase letter, and all following characters must be a dash, lowercase letter, or digit, except the last character, which cannot be a dash.
    network str
    The network this subnet belongs to. Only networks that are in the distributed mode can have subnetworks.


    private_ip_google_access bool
    When enabled, VMs in this subnetwork without external IP addresses can access Google APIs and services by using Private Google Access.
    private_ipv6_google_access str
    The private IPv6 google access type for the VMs in this subnet.
    project str
    The ID of the project in which the resource belongs. If it is not provided, the provider project is used.
    purpose str
    The purpose of the resource. This field can be either PRIVATE, REGIONAL_MANAGED_PROXY, GLOBAL_MANAGED_PROXY, PRIVATE_SERVICE_CONNECT or PRIVATE_NAT. A subnet with purpose set to REGIONAL_MANAGED_PROXY is a user-created subnetwork that is reserved for regional Envoy-based load balancers. A subnetwork in a given region with purpose set to GLOBAL_MANAGED_PROXY is a proxy-only subnet and is shared between all the cross-regional Envoy-based load balancers. A subnetwork with purpose set to PRIVATE_SERVICE_CONNECT reserves the subnet for hosting a Private Service Connect published service. A subnetwork with purpose set to PRIVATE_NAT is used as source range for Private NAT gateways. Note that REGIONAL_MANAGED_PROXY is the preferred setting for all regional Envoy load balancers. If unspecified, the purpose defaults to PRIVATE.
    region str
    The GCP region for this subnetwork.
    reserved_internal_range str
    The ID of the reserved internal range. Must be prefixed with networkconnectivity.googleapis.com E.g. networkconnectivity.googleapis.com/projects/{project}/locations/global/internalRanges/{rangeId}
    role str
    The role of subnetwork. Currently, this field is only used when purpose is REGIONAL_MANAGED_PROXY. The value can be set to ACTIVE or BACKUP. An ACTIVE subnetwork is one that is currently being used for Envoy-based load balancers in a region. A BACKUP subnetwork is one that is ready to be promoted to ACTIVE or is currently draining. Possible values are: ACTIVE, BACKUP.
    secondary_ip_ranges Sequence[SubnetworkSecondaryIpRangeArgs]
    An array of configurations for secondary IP ranges for VM instances contained in this subnetwork. The primary IP of such VM must belong to the primary ipCidrRange of the subnetwork. The alias IPs may belong to either primary or secondary ranges. Structure is documented below.
    self_link str
    The URI of the created resource.
    send_secondary_ip_range_if_empty bool
    Controls the removal behavior of secondary_ip_range. When false, removing secondary_ip_range from config will not produce a diff as the provider will default to the API's value. When true, the provider will treat removing secondary_ip_range as sending an empty list of secondary IP ranges to the API. Defaults to false.
    stack_type str
    The stack type for this subnet to identify whether the IPv6 feature is enabled or not. If not specified IPV4_ONLY will be used. Possible values are: IPV4_ONLY, IPV4_IPV6.
    allowSubnetCidrRoutesOverlap Boolean
    Typically packets destined to IPs within the subnetwork range that do not match existing resources are dropped and prevented from leaving the VPC. Setting this field to true will allow these packets to match dynamic routes injected via BGP even if their destinations match existing subnet ranges.
    creationTimestamp String
    Creation timestamp in RFC3339 text format.
    description String
    An optional description of this resource. Provide this property when you create the resource. This field can be set only at resource creation time.
    externalIpv6Prefix String
    The range of external IPv6 addresses that are owned by this subnetwork.
    fingerprint String
    Fingerprint of this resource. This field is used internally during updates of this resource.

    Deprecated: This field is not useful for users, and has been removed as an output.

    gatewayAddress String
    The gateway address for default routes to reach destination addresses outside this subnetwork.
    internalIpv6Prefix String
    The internal IPv6 address range that is assigned to this subnetwork.
    ipCidrRange String
    The range of internal addresses that are owned by this subnetwork. Provide this property when you create the subnetwork. For example, 10.0.0.0/8 or 192.168.0.0/16. Ranges must be unique and non-overlapping within a network. Only IPv4 is supported. Field is optional when reserved_internal_range is defined, otherwise required.
    ipv6AccessType String
    The access type of IPv6 address this subnet holds. It's immutable and can only be specified during creation or the first time the subnet is updated into IPV4_IPV6 dual stack. If the ipv6_type is EXTERNAL then this subnet cannot enable direct path. Possible values are: EXTERNAL, INTERNAL.
    ipv6CidrRange String
    The range of internal IPv6 addresses that are owned by this subnetwork.
    logConfig Property Map
    This field denotes the VPC flow logging options for this subnetwork. If logging is enabled, logs are exported to Cloud Logging. Flow logging isn't supported if the subnet purpose field is set to subnetwork is REGIONAL_MANAGED_PROXY or GLOBAL_MANAGED_PROXY. Structure is documented below.
    name String
    The name of the resource, provided by the client when initially creating the resource. The name must be 1-63 characters long, and comply with RFC1035. Specifically, the name must be 1-63 characters long and match the regular expression a-z? which means the first character must be a lowercase letter, and all following characters must be a dash, lowercase letter, or digit, except the last character, which cannot be a dash.
    network String
    The network this subnet belongs to. Only networks that are in the distributed mode can have subnetworks.


    privateIpGoogleAccess Boolean
    When enabled, VMs in this subnetwork without external IP addresses can access Google APIs and services by using Private Google Access.
    privateIpv6GoogleAccess String
    The private IPv6 google access type for the VMs in this subnet.
    project String
    The ID of the project in which the resource belongs. If it is not provided, the provider project is used.
    purpose String
    The purpose of the resource. This field can be either PRIVATE, REGIONAL_MANAGED_PROXY, GLOBAL_MANAGED_PROXY, PRIVATE_SERVICE_CONNECT or PRIVATE_NAT. A subnet with purpose set to REGIONAL_MANAGED_PROXY is a user-created subnetwork that is reserved for regional Envoy-based load balancers. A subnetwork in a given region with purpose set to GLOBAL_MANAGED_PROXY is a proxy-only subnet and is shared between all the cross-regional Envoy-based load balancers. A subnetwork with purpose set to PRIVATE_SERVICE_CONNECT reserves the subnet for hosting a Private Service Connect published service. A subnetwork with purpose set to PRIVATE_NAT is used as source range for Private NAT gateways. Note that REGIONAL_MANAGED_PROXY is the preferred setting for all regional Envoy load balancers. If unspecified, the purpose defaults to PRIVATE.
    region String
    The GCP region for this subnetwork.
    reservedInternalRange String
    The ID of the reserved internal range. Must be prefixed with networkconnectivity.googleapis.com E.g. networkconnectivity.googleapis.com/projects/{project}/locations/global/internalRanges/{rangeId}
    role String
    The role of subnetwork. Currently, this field is only used when purpose is REGIONAL_MANAGED_PROXY. The value can be set to ACTIVE or BACKUP. An ACTIVE subnetwork is one that is currently being used for Envoy-based load balancers in a region. A BACKUP subnetwork is one that is ready to be promoted to ACTIVE or is currently draining. Possible values are: ACTIVE, BACKUP.
    secondaryIpRanges List<Property Map>
    An array of configurations for secondary IP ranges for VM instances contained in this subnetwork. The primary IP of such VM must belong to the primary ipCidrRange of the subnetwork. The alias IPs may belong to either primary or secondary ranges. Structure is documented below.
    selfLink String
    The URI of the created resource.
    sendSecondaryIpRangeIfEmpty Boolean
    Controls the removal behavior of secondary_ip_range. When false, removing secondary_ip_range from config will not produce a diff as the provider will default to the API's value. When true, the provider will treat removing secondary_ip_range as sending an empty list of secondary IP ranges to the API. Defaults to false.
    stackType String
    The stack type for this subnet to identify whether the IPv6 feature is enabled or not. If not specified IPV4_ONLY will be used. Possible values are: IPV4_ONLY, IPV4_IPV6.

    Supporting Types

    SubnetworkLogConfig, SubnetworkLogConfigArgs

    AggregationInterval string
    Can only be specified if VPC flow logging for this subnetwork is enabled. Toggles the aggregation interval for collecting flow logs. Increasing the interval time will reduce the amount of generated flow logs for long lasting connections. Default is an interval of 5 seconds per connection. Default value is INTERVAL_5_SEC. Possible values are: INTERVAL_5_SEC, INTERVAL_30_SEC, INTERVAL_1_MIN, INTERVAL_5_MIN, INTERVAL_10_MIN, INTERVAL_15_MIN.
    FilterExpr string
    Export filter used to define which VPC flow logs should be logged, as as CEL expression. See https://cloud.google.com/vpc/docs/flow-logs#filtering for details on how to format this field. The default value is 'true', which evaluates to include everything.
    FlowSampling double
    Can only be specified if VPC flow logging for this subnetwork is enabled. The value of the field must be in [0, 1]. Set the sampling rate of VPC flow logs within the subnetwork where 1.0 means all collected logs are reported and 0.0 means no logs are reported. Default is 0.5 which means half of all collected logs are reported.
    Metadata string
    Can only be specified if VPC flow logging for this subnetwork is enabled. Configures whether metadata fields should be added to the reported VPC flow logs. Default value is INCLUDE_ALL_METADATA. Possible values are: EXCLUDE_ALL_METADATA, INCLUDE_ALL_METADATA, CUSTOM_METADATA.
    MetadataFields List<string>
    List of metadata fields that should be added to reported logs. Can only be specified if VPC flow logs for this subnetwork is enabled and "metadata" is set to CUSTOM_METADATA.
    AggregationInterval string
    Can only be specified if VPC flow logging for this subnetwork is enabled. Toggles the aggregation interval for collecting flow logs. Increasing the interval time will reduce the amount of generated flow logs for long lasting connections. Default is an interval of 5 seconds per connection. Default value is INTERVAL_5_SEC. Possible values are: INTERVAL_5_SEC, INTERVAL_30_SEC, INTERVAL_1_MIN, INTERVAL_5_MIN, INTERVAL_10_MIN, INTERVAL_15_MIN.
    FilterExpr string
    Export filter used to define which VPC flow logs should be logged, as as CEL expression. See https://cloud.google.com/vpc/docs/flow-logs#filtering for details on how to format this field. The default value is 'true', which evaluates to include everything.
    FlowSampling float64
    Can only be specified if VPC flow logging for this subnetwork is enabled. The value of the field must be in [0, 1]. Set the sampling rate of VPC flow logs within the subnetwork where 1.0 means all collected logs are reported and 0.0 means no logs are reported. Default is 0.5 which means half of all collected logs are reported.
    Metadata string
    Can only be specified if VPC flow logging for this subnetwork is enabled. Configures whether metadata fields should be added to the reported VPC flow logs. Default value is INCLUDE_ALL_METADATA. Possible values are: EXCLUDE_ALL_METADATA, INCLUDE_ALL_METADATA, CUSTOM_METADATA.
    MetadataFields []string
    List of metadata fields that should be added to reported logs. Can only be specified if VPC flow logs for this subnetwork is enabled and "metadata" is set to CUSTOM_METADATA.
    aggregationInterval String
    Can only be specified if VPC flow logging for this subnetwork is enabled. Toggles the aggregation interval for collecting flow logs. Increasing the interval time will reduce the amount of generated flow logs for long lasting connections. Default is an interval of 5 seconds per connection. Default value is INTERVAL_5_SEC. Possible values are: INTERVAL_5_SEC, INTERVAL_30_SEC, INTERVAL_1_MIN, INTERVAL_5_MIN, INTERVAL_10_MIN, INTERVAL_15_MIN.
    filterExpr String
    Export filter used to define which VPC flow logs should be logged, as as CEL expression. See https://cloud.google.com/vpc/docs/flow-logs#filtering for details on how to format this field. The default value is 'true', which evaluates to include everything.
    flowSampling Double
    Can only be specified if VPC flow logging for this subnetwork is enabled. The value of the field must be in [0, 1]. Set the sampling rate of VPC flow logs within the subnetwork where 1.0 means all collected logs are reported and 0.0 means no logs are reported. Default is 0.5 which means half of all collected logs are reported.
    metadata String
    Can only be specified if VPC flow logging for this subnetwork is enabled. Configures whether metadata fields should be added to the reported VPC flow logs. Default value is INCLUDE_ALL_METADATA. Possible values are: EXCLUDE_ALL_METADATA, INCLUDE_ALL_METADATA, CUSTOM_METADATA.
    metadataFields List<String>
    List of metadata fields that should be added to reported logs. Can only be specified if VPC flow logs for this subnetwork is enabled and "metadata" is set to CUSTOM_METADATA.
    aggregationInterval string
    Can only be specified if VPC flow logging for this subnetwork is enabled. Toggles the aggregation interval for collecting flow logs. Increasing the interval time will reduce the amount of generated flow logs for long lasting connections. Default is an interval of 5 seconds per connection. Default value is INTERVAL_5_SEC. Possible values are: INTERVAL_5_SEC, INTERVAL_30_SEC, INTERVAL_1_MIN, INTERVAL_5_MIN, INTERVAL_10_MIN, INTERVAL_15_MIN.
    filterExpr string
    Export filter used to define which VPC flow logs should be logged, as as CEL expression. See https://cloud.google.com/vpc/docs/flow-logs#filtering for details on how to format this field. The default value is 'true', which evaluates to include everything.
    flowSampling number
    Can only be specified if VPC flow logging for this subnetwork is enabled. The value of the field must be in [0, 1]. Set the sampling rate of VPC flow logs within the subnetwork where 1.0 means all collected logs are reported and 0.0 means no logs are reported. Default is 0.5 which means half of all collected logs are reported.
    metadata string
    Can only be specified if VPC flow logging for this subnetwork is enabled. Configures whether metadata fields should be added to the reported VPC flow logs. Default value is INCLUDE_ALL_METADATA. Possible values are: EXCLUDE_ALL_METADATA, INCLUDE_ALL_METADATA, CUSTOM_METADATA.
    metadataFields string[]
    List of metadata fields that should be added to reported logs. Can only be specified if VPC flow logs for this subnetwork is enabled and "metadata" is set to CUSTOM_METADATA.
    aggregation_interval str
    Can only be specified if VPC flow logging for this subnetwork is enabled. Toggles the aggregation interval for collecting flow logs. Increasing the interval time will reduce the amount of generated flow logs for long lasting connections. Default is an interval of 5 seconds per connection. Default value is INTERVAL_5_SEC. Possible values are: INTERVAL_5_SEC, INTERVAL_30_SEC, INTERVAL_1_MIN, INTERVAL_5_MIN, INTERVAL_10_MIN, INTERVAL_15_MIN.
    filter_expr str
    Export filter used to define which VPC flow logs should be logged, as as CEL expression. See https://cloud.google.com/vpc/docs/flow-logs#filtering for details on how to format this field. The default value is 'true', which evaluates to include everything.
    flow_sampling float
    Can only be specified if VPC flow logging for this subnetwork is enabled. The value of the field must be in [0, 1]. Set the sampling rate of VPC flow logs within the subnetwork where 1.0 means all collected logs are reported and 0.0 means no logs are reported. Default is 0.5 which means half of all collected logs are reported.
    metadata str
    Can only be specified if VPC flow logging for this subnetwork is enabled. Configures whether metadata fields should be added to the reported VPC flow logs. Default value is INCLUDE_ALL_METADATA. Possible values are: EXCLUDE_ALL_METADATA, INCLUDE_ALL_METADATA, CUSTOM_METADATA.
    metadata_fields Sequence[str]
    List of metadata fields that should be added to reported logs. Can only be specified if VPC flow logs for this subnetwork is enabled and "metadata" is set to CUSTOM_METADATA.
    aggregationInterval String
    Can only be specified if VPC flow logging for this subnetwork is enabled. Toggles the aggregation interval for collecting flow logs. Increasing the interval time will reduce the amount of generated flow logs for long lasting connections. Default is an interval of 5 seconds per connection. Default value is INTERVAL_5_SEC. Possible values are: INTERVAL_5_SEC, INTERVAL_30_SEC, INTERVAL_1_MIN, INTERVAL_5_MIN, INTERVAL_10_MIN, INTERVAL_15_MIN.
    filterExpr String
    Export filter used to define which VPC flow logs should be logged, as as CEL expression. See https://cloud.google.com/vpc/docs/flow-logs#filtering for details on how to format this field. The default value is 'true', which evaluates to include everything.
    flowSampling Number
    Can only be specified if VPC flow logging for this subnetwork is enabled. The value of the field must be in [0, 1]. Set the sampling rate of VPC flow logs within the subnetwork where 1.0 means all collected logs are reported and 0.0 means no logs are reported. Default is 0.5 which means half of all collected logs are reported.
    metadata String
    Can only be specified if VPC flow logging for this subnetwork is enabled. Configures whether metadata fields should be added to the reported VPC flow logs. Default value is INCLUDE_ALL_METADATA. Possible values are: EXCLUDE_ALL_METADATA, INCLUDE_ALL_METADATA, CUSTOM_METADATA.
    metadataFields List<String>
    List of metadata fields that should be added to reported logs. Can only be specified if VPC flow logs for this subnetwork is enabled and "metadata" is set to CUSTOM_METADATA.

    SubnetworkSecondaryIpRange, SubnetworkSecondaryIpRangeArgs

    RangeName string
    The name associated with this subnetwork secondary range, used when adding an alias IP range to a VM instance. The name must be 1-63 characters long, and comply with RFC1035. The name must be unique within the subnetwork.
    IpCidrRange string
    The range of IP addresses belonging to this subnetwork secondary range. Provide this property when you create the subnetwork. Ranges must be unique and non-overlapping with all primary and secondary IP ranges within a network. Only IPv4 is supported. Field is optional when reserved_internal_range is defined, otherwise required.
    ReservedInternalRange string
    The ID of the reserved internal range. Must be prefixed with networkconnectivity.googleapis.com E.g. networkconnectivity.googleapis.com/projects/{project}/locations/global/internalRanges/{rangeId}
    RangeName string
    The name associated with this subnetwork secondary range, used when adding an alias IP range to a VM instance. The name must be 1-63 characters long, and comply with RFC1035. The name must be unique within the subnetwork.
    IpCidrRange string
    The range of IP addresses belonging to this subnetwork secondary range. Provide this property when you create the subnetwork. Ranges must be unique and non-overlapping with all primary and secondary IP ranges within a network. Only IPv4 is supported. Field is optional when reserved_internal_range is defined, otherwise required.
    ReservedInternalRange string
    The ID of the reserved internal range. Must be prefixed with networkconnectivity.googleapis.com E.g. networkconnectivity.googleapis.com/projects/{project}/locations/global/internalRanges/{rangeId}
    rangeName String
    The name associated with this subnetwork secondary range, used when adding an alias IP range to a VM instance. The name must be 1-63 characters long, and comply with RFC1035. The name must be unique within the subnetwork.
    ipCidrRange String
    The range of IP addresses belonging to this subnetwork secondary range. Provide this property when you create the subnetwork. Ranges must be unique and non-overlapping with all primary and secondary IP ranges within a network. Only IPv4 is supported. Field is optional when reserved_internal_range is defined, otherwise required.
    reservedInternalRange String
    The ID of the reserved internal range. Must be prefixed with networkconnectivity.googleapis.com E.g. networkconnectivity.googleapis.com/projects/{project}/locations/global/internalRanges/{rangeId}
    rangeName string
    The name associated with this subnetwork secondary range, used when adding an alias IP range to a VM instance. The name must be 1-63 characters long, and comply with RFC1035. The name must be unique within the subnetwork.
    ipCidrRange string
    The range of IP addresses belonging to this subnetwork secondary range. Provide this property when you create the subnetwork. Ranges must be unique and non-overlapping with all primary and secondary IP ranges within a network. Only IPv4 is supported. Field is optional when reserved_internal_range is defined, otherwise required.
    reservedInternalRange string
    The ID of the reserved internal range. Must be prefixed with networkconnectivity.googleapis.com E.g. networkconnectivity.googleapis.com/projects/{project}/locations/global/internalRanges/{rangeId}
    range_name str
    The name associated with this subnetwork secondary range, used when adding an alias IP range to a VM instance. The name must be 1-63 characters long, and comply with RFC1035. The name must be unique within the subnetwork.
    ip_cidr_range str
    The range of IP addresses belonging to this subnetwork secondary range. Provide this property when you create the subnetwork. Ranges must be unique and non-overlapping with all primary and secondary IP ranges within a network. Only IPv4 is supported. Field is optional when reserved_internal_range is defined, otherwise required.
    reserved_internal_range str
    The ID of the reserved internal range. Must be prefixed with networkconnectivity.googleapis.com E.g. networkconnectivity.googleapis.com/projects/{project}/locations/global/internalRanges/{rangeId}
    rangeName String
    The name associated with this subnetwork secondary range, used when adding an alias IP range to a VM instance. The name must be 1-63 characters long, and comply with RFC1035. The name must be unique within the subnetwork.
    ipCidrRange String
    The range of IP addresses belonging to this subnetwork secondary range. Provide this property when you create the subnetwork. Ranges must be unique and non-overlapping with all primary and secondary IP ranges within a network. Only IPv4 is supported. Field is optional when reserved_internal_range is defined, otherwise required.
    reservedInternalRange String
    The ID of the reserved internal range. Must be prefixed with networkconnectivity.googleapis.com E.g. networkconnectivity.googleapis.com/projects/{project}/locations/global/internalRanges/{rangeId}

    Import

    Subnetwork can be imported using any of these accepted formats:

    • projects/{{project}}/regions/{{region}}/subnetworks/{{name}}

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

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

    • {{name}}

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

    $ pulumi import gcp:compute/subnetwork:Subnetwork default projects/{{project}}/regions/{{region}}/subnetworks/{{name}}
    
    $ pulumi import gcp:compute/subnetwork:Subnetwork default {{project}}/{{region}}/{{name}}
    
    $ pulumi import gcp:compute/subnetwork:Subnetwork default {{region}}/{{name}}
    
    $ pulumi import gcp:compute/subnetwork:Subnetwork default {{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 v8.7.0 published on Tuesday, Oct 29, 2024 by Pulumi