1. Packages
  2. Google Cloud (GCP) Classic
  3. API Docs
  4. compute
  5. Subnetwork
Google Cloud Classic v7.16.0 published on Wednesday, Mar 27, 2024 by Pulumi

gcp.compute.Subnetwork

Explore with Pulumi AI

gcp logo
Google Cloud Classic v7.16.0 published on Wednesday, Mar 27, 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=[gcp.compute.SubnetworkSecondaryIpRangeArgs(
            range_name="tf-test-secondary-range-update1",
            ip_cidr_range="192.168.10.0/24",
        )])
    
    package main
    
    import (
    	"github.com/pulumi/pulumi-gcp/sdk/v7/go/gcp/compute"
    	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
    )
    
    func main() {
    	pulumi.Run(func(ctx *pulumi.Context) error {
    		_, 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=gcp.compute.SubnetworkLogConfigArgs(
            aggregation_interval="INTERVAL_10_MIN",
            flow_sampling=0.5,
            metadata="INCLUDE_ALL_METADATA",
        ))
    
    package main
    
    import (
    	"github.com/pulumi/pulumi-gcp/sdk/v7/go/gcp/compute"
    	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
    )
    
    func main() {
    	pulumi.Run(func(ctx *pulumi.Context) error {
    		_, 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/v7/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/v7/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/v7/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/v7/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/v7/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
    

    Create Subnetwork Resource

    new Subnetwork(name: string, args: SubnetworkArgs, opts?: CustomResourceOptions);
    @overload
    def Subnetwork(resource_name: str,
                   opts: Optional[ResourceOptions] = None,
                   allow_subnet_cidr_routes_overlap: Optional[bool] = None,
                   description: Optional[str] = None,
                   external_ipv6_prefix: Optional[str] = None,
                   ip_cidr_range: Optional[str] = None,
                   ipv6_access_type: 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,
                   role: Optional[str] = None,
                   secondary_ip_ranges: Optional[Sequence[SubnetworkSecondaryIpRangeArgs]] = None,
                   stack_type: Optional[str] = None)
    @overload
    def Subnetwork(resource_name: str,
                   args: SubnetworkArgs,
                   opts: Optional[ResourceOptions] = 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.
    
    
    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.

    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:

    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.
    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.
    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_RFC_1918, 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_RFC_1918.
    Region string
    The GCP region for this subnetwork.
    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.
    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.
    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.
    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.
    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_RFC_1918, 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_RFC_1918.
    Region string
    The GCP region for this subnetwork.
    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.
    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.
    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.
    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.
    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_RFC_1918, 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_RFC_1918.
    region String
    The GCP region for this subnetwork.
    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.
    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.
    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.
    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.
    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_RFC_1918, 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_RFC_1918.
    region string
    The GCP region for this subnetwork.
    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.
    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.
    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.
    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.
    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_RFC_1918, 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_RFC_1918.
    region str
    The GCP region for this subnetwork.
    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.
    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.
    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.
    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.
    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_RFC_1918, 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_RFC_1918.
    region String
    The GCP region for this subnetwork.
    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.
    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,
            role: Optional[str] = None,
            secondary_ip_ranges: Optional[Sequence[SubnetworkSecondaryIpRangeArgs]] = None,
            self_link: Optional[str] = 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.
    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_RFC_1918, 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_RFC_1918.
    Region string
    The GCP region for this subnetwork.
    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.
    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.
    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_RFC_1918, 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_RFC_1918.
    Region string
    The GCP region for this subnetwork.
    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.
    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.
    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_RFC_1918, 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_RFC_1918.
    region String
    The GCP region for this subnetwork.
    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.
    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.
    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_RFC_1918, 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_RFC_1918.
    region string
    The GCP region for this subnetwork.
    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.
    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.
    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_RFC_1918, 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_RFC_1918.
    region str
    The GCP region for this subnetwork.
    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.
    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.
    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_RFC_1918, 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_RFC_1918.
    region String
    The GCP region for this subnetwork.
    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.
    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

    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.
    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.
    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.
    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.
    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.
    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.
    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.
    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.
    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.

    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}}
    

    Package Details

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