1. Packages
  2. Google Cloud (GCP) Classic
  3. API Docs
  4. compute
  5. Subnetwork
Google Cloud Classic v6.57.0 published on Tuesday, May 30, 2023 by Pulumi

gcp.compute.Subnetwork

Explore with Pulumi AI

gcp logo
Google Cloud Classic v6.57.0 published on Tuesday, May 30, 2023 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

    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()
        {
            AutoCreateSubnetworks = false,
        });
    
        var network_with_private_secondary_ip_ranges = new Gcp.Compute.Subnetwork("network-with-private-secondary-ip-ranges", new()
        {
            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 main
    
    import (
    	"github.com/pulumi/pulumi-gcp/sdk/v6/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{
    			AutoCreateSubnetworks: pulumi.Bool(false),
    		})
    		if err != nil {
    			return err
    		}
    		_, err = compute.NewSubnetwork(ctx, "network-with-private-secondary-ip-ranges", &compute.SubnetworkArgs{
    			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
    	})
    }
    
    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()        
                .autoCreateSubnetworks(false)
                .build());
    
            var network_with_private_secondary_ip_ranges = new Subnetwork("network-with-private-secondary-ip-ranges", SubnetworkArgs.builder()        
                .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());
    
        }
    }
    
    import pulumi
    import pulumi_gcp as gcp
    
    custom_test = gcp.compute.Network("custom-test", auto_create_subnetworks=False)
    network_with_private_secondary_ip_ranges = gcp.compute.Subnetwork("network-with-private-secondary-ip-ranges",
        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",
        )])
    
    import * as pulumi from "@pulumi/pulumi";
    import * as gcp from "@pulumi/gcp";
    
    const custom_test = new gcp.compute.Network("custom-test", {autoCreateSubnetworks: false});
    const network_with_private_secondary_ip_ranges = new gcp.compute.Subnetwork("network-with-private-secondary-ip-ranges", {
        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",
        }],
    });
    
    resources:
      network-with-private-secondary-ip-ranges:
        type: gcp:compute:Subnetwork
        properties:
          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:
          autoCreateSubnetworks: false
    

    Subnetwork Logging Config

    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()
        {
            AutoCreateSubnetworks = false,
        });
    
        var subnet_with_logging = new Gcp.Compute.Subnetwork("subnet-with-logging", new()
        {
            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 main
    
    import (
    	"github.com/pulumi/pulumi-gcp/sdk/v6/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{
    			AutoCreateSubnetworks: pulumi.Bool(false),
    		})
    		if err != nil {
    			return err
    		}
    		_, err = compute.NewSubnetwork(ctx, "subnet-with-logging", &compute.SubnetworkArgs{
    			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
    	})
    }
    
    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()        
                .autoCreateSubnetworks(false)
                .build());
    
            var subnet_with_logging = new Subnetwork("subnet-with-logging", SubnetworkArgs.builder()        
                .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());
    
        }
    }
    
    import pulumi
    import pulumi_gcp as gcp
    
    custom_test = gcp.compute.Network("custom-test", auto_create_subnetworks=False)
    subnet_with_logging = gcp.compute.Subnetwork("subnet-with-logging",
        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",
        ))
    
    import * as pulumi from "@pulumi/pulumi";
    import * as gcp from "@pulumi/gcp";
    
    const custom_test = new gcp.compute.Network("custom-test", {autoCreateSubnetworks: false});
    const subnet_with_logging = new gcp.compute.Subnetwork("subnet-with-logging", {
        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",
        },
    });
    
    resources:
      subnet-with-logging:
        type: gcp:compute:Subnetwork
        properties:
          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:
          autoCreateSubnetworks: false
    

    Subnetwork Internal L7lb

    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()
        {
            AutoCreateSubnetworks = false,
        }, new CustomResourceOptions
        {
            Provider = google_beta,
        });
    
        var network_for_l7lb = new Gcp.Compute.Subnetwork("network-for-l7lb", new()
        {
            IpCidrRange = "10.0.0.0/22",
            Region = "us-central1",
            Purpose = "INTERNAL_HTTPS_LOAD_BALANCER",
            Role = "ACTIVE",
            Network = custom_test.Id,
        }, new CustomResourceOptions
        {
            Provider = google_beta,
        });
    
    });
    
    package main
    
    import (
    	"github.com/pulumi/pulumi-gcp/sdk/v6/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{
    			AutoCreateSubnetworks: pulumi.Bool(false),
    		}, pulumi.Provider(google_beta))
    		if err != nil {
    			return err
    		}
    		_, err = compute.NewSubnetwork(ctx, "network-for-l7lb", &compute.SubnetworkArgs{
    			IpCidrRange: pulumi.String("10.0.0.0/22"),
    			Region:      pulumi.String("us-central1"),
    			Purpose:     pulumi.String("INTERNAL_HTTPS_LOAD_BALANCER"),
    			Role:        pulumi.String("ACTIVE"),
    			Network:     custom_test.ID(),
    		}, pulumi.Provider(google_beta))
    		if err != nil {
    			return err
    		}
    		return nil
    	})
    }
    
    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.resources.CustomResourceOptions;
    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()        
                .autoCreateSubnetworks(false)
                .build(), CustomResourceOptions.builder()
                    .provider(google_beta)
                    .build());
    
            var network_for_l7lb = new Subnetwork("network-for-l7lb", SubnetworkArgs.builder()        
                .ipCidrRange("10.0.0.0/22")
                .region("us-central1")
                .purpose("INTERNAL_HTTPS_LOAD_BALANCER")
                .role("ACTIVE")
                .network(custom_test.id())
                .build(), CustomResourceOptions.builder()
                    .provider(google_beta)
                    .build());
    
        }
    }
    
    import pulumi
    import pulumi_gcp as gcp
    
    custom_test = gcp.compute.Network("custom-test", auto_create_subnetworks=False,
    opts=pulumi.ResourceOptions(provider=google_beta))
    network_for_l7lb = gcp.compute.Subnetwork("network-for-l7lb",
        ip_cidr_range="10.0.0.0/22",
        region="us-central1",
        purpose="INTERNAL_HTTPS_LOAD_BALANCER",
        role="ACTIVE",
        network=custom_test.id,
        opts=pulumi.ResourceOptions(provider=google_beta))
    
    import * as pulumi from "@pulumi/pulumi";
    import * as gcp from "@pulumi/gcp";
    
    const custom_test = new gcp.compute.Network("custom-test", {autoCreateSubnetworks: false}, {
        provider: google_beta,
    });
    const network_for_l7lb = new gcp.compute.Subnetwork("network-for-l7lb", {
        ipCidrRange: "10.0.0.0/22",
        region: "us-central1",
        purpose: "INTERNAL_HTTPS_LOAD_BALANCER",
        role: "ACTIVE",
        network: custom_test.id,
    }, {
        provider: google_beta,
    });
    
    resources:
      network-for-l7lb:
        type: gcp:compute:Subnetwork
        properties:
          ipCidrRange: 10.0.0.0/22
          region: us-central1
          purpose: INTERNAL_HTTPS_LOAD_BALANCER
          role: ACTIVE
          network: ${["custom-test"].id}
        options:
          provider: ${["google-beta"]}
      custom-test:
        type: gcp:compute:Network
        properties:
          autoCreateSubnetworks: false
        options:
          provider: ${["google-beta"]}
    

    Subnetwork Ipv6

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

    Subnetwork Internal Ipv6

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

    Create Subnetwork Resource

    new Subnetwork(name: string, args: SubnetworkArgs, opts?: CustomResourceOptions);
    @overload
    def Subnetwork(resource_name: str,
                   opts: Optional[ResourceOptions] = None,
                   description: 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.


    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.

    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

    Denotes the logging options for the subnetwork flow logs. If logging is enabled logs will be exported to Stackdriver. This field cannot be set if the purpose of this subnetwork is INTERNAL_HTTPS_LOAD_BALANCER 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, INTERNAL_HTTPS_LOAD_BALANCER or REGIONAL_MANAGED_PROXY. A subnetwork with purpose set to INTERNAL_HTTPS_LOAD_BALANCER is a user-created subnetwork that is reserved for Internal HTTP(S) Load Balancing. A subnetwork in a given region with purpose set to REGIONAL_MANAGED_PROXY is a proxy-only subnet and is shared between all the regional Envoy-based load balancers. If unspecified, the purpose defaults to PRIVATE_RFC_1918. The enableFlowLogs field isn't supported with the purpose field set to INTERNAL_HTTPS_LOAD_BALANCER.

    Region string

    The GCP region for this subnetwork.

    Role string

    The role of subnetwork. The value can be set to ACTIVE or BACKUP. An ACTIVE subnetwork is one that is currently being used. A BACKUP subnetwork is one that is ready to be promoted to ACTIVE or is currently draining. Subnetwork role must be specified when purpose is set to INTERNAL_HTTPS_LOAD_BALANCER or REGIONAL_MANAGED_PROXY. Possible values are: ACTIVE, BACKUP.

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


    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.

    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

    Denotes the logging options for the subnetwork flow logs. If logging is enabled logs will be exported to Stackdriver. This field cannot be set if the purpose of this subnetwork is INTERNAL_HTTPS_LOAD_BALANCER 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, INTERNAL_HTTPS_LOAD_BALANCER or REGIONAL_MANAGED_PROXY. A subnetwork with purpose set to INTERNAL_HTTPS_LOAD_BALANCER is a user-created subnetwork that is reserved for Internal HTTP(S) Load Balancing. A subnetwork in a given region with purpose set to REGIONAL_MANAGED_PROXY is a proxy-only subnet and is shared between all the regional Envoy-based load balancers. If unspecified, the purpose defaults to PRIVATE_RFC_1918. The enableFlowLogs field isn't supported with the purpose field set to INTERNAL_HTTPS_LOAD_BALANCER.

    Region string

    The GCP region for this subnetwork.

    Role string

    The role of subnetwork. The value can be set to ACTIVE or BACKUP. An ACTIVE subnetwork is one that is currently being used. A BACKUP subnetwork is one that is ready to be promoted to ACTIVE or is currently draining. Subnetwork role must be specified when purpose is set to INTERNAL_HTTPS_LOAD_BALANCER or REGIONAL_MANAGED_PROXY. 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.


    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.

    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

    Denotes the logging options for the subnetwork flow logs. If logging is enabled logs will be exported to Stackdriver. This field cannot be set if the purpose of this subnetwork is INTERNAL_HTTPS_LOAD_BALANCER 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, INTERNAL_HTTPS_LOAD_BALANCER or REGIONAL_MANAGED_PROXY. A subnetwork with purpose set to INTERNAL_HTTPS_LOAD_BALANCER is a user-created subnetwork that is reserved for Internal HTTP(S) Load Balancing. A subnetwork in a given region with purpose set to REGIONAL_MANAGED_PROXY is a proxy-only subnet and is shared between all the regional Envoy-based load balancers. If unspecified, the purpose defaults to PRIVATE_RFC_1918. The enableFlowLogs field isn't supported with the purpose field set to INTERNAL_HTTPS_LOAD_BALANCER.

    region String

    The GCP region for this subnetwork.

    role String

    The role of subnetwork. The value can be set to ACTIVE or BACKUP. An ACTIVE subnetwork is one that is currently being used. A BACKUP subnetwork is one that is ready to be promoted to ACTIVE or is currently draining. Subnetwork role must be specified when purpose is set to INTERNAL_HTTPS_LOAD_BALANCER or REGIONAL_MANAGED_PROXY. Possible values are: ACTIVE, BACKUP.

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


    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.

    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

    Denotes the logging options for the subnetwork flow logs. If logging is enabled logs will be exported to Stackdriver. This field cannot be set if the purpose of this subnetwork is INTERNAL_HTTPS_LOAD_BALANCER 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, INTERNAL_HTTPS_LOAD_BALANCER or REGIONAL_MANAGED_PROXY. A subnetwork with purpose set to INTERNAL_HTTPS_LOAD_BALANCER is a user-created subnetwork that is reserved for Internal HTTP(S) Load Balancing. A subnetwork in a given region with purpose set to REGIONAL_MANAGED_PROXY is a proxy-only subnet and is shared between all the regional Envoy-based load balancers. If unspecified, the purpose defaults to PRIVATE_RFC_1918. The enableFlowLogs field isn't supported with the purpose field set to INTERNAL_HTTPS_LOAD_BALANCER.

    region string

    The GCP region for this subnetwork.

    role string

    The role of subnetwork. The value can be set to ACTIVE or BACKUP. An ACTIVE subnetwork is one that is currently being used. A BACKUP subnetwork is one that is ready to be promoted to ACTIVE or is currently draining. Subnetwork role must be specified when purpose is set to INTERNAL_HTTPS_LOAD_BALANCER or REGIONAL_MANAGED_PROXY. 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.

    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.


    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.

    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

    Denotes the logging options for the subnetwork flow logs. If logging is enabled logs will be exported to Stackdriver. This field cannot be set if the purpose of this subnetwork is INTERNAL_HTTPS_LOAD_BALANCER 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, INTERNAL_HTTPS_LOAD_BALANCER or REGIONAL_MANAGED_PROXY. A subnetwork with purpose set to INTERNAL_HTTPS_LOAD_BALANCER is a user-created subnetwork that is reserved for Internal HTTP(S) Load Balancing. A subnetwork in a given region with purpose set to REGIONAL_MANAGED_PROXY is a proxy-only subnet and is shared between all the regional Envoy-based load balancers. If unspecified, the purpose defaults to PRIVATE_RFC_1918. The enableFlowLogs field isn't supported with the purpose field set to INTERNAL_HTTPS_LOAD_BALANCER.

    region str

    The GCP region for this subnetwork.

    role str

    The role of subnetwork. The value can be set to ACTIVE or BACKUP. An ACTIVE subnetwork is one that is currently being used. A BACKUP subnetwork is one that is ready to be promoted to ACTIVE or is currently draining. Subnetwork role must be specified when purpose is set to INTERNAL_HTTPS_LOAD_BALANCER or REGIONAL_MANAGED_PROXY. 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.


    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.

    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

    Denotes the logging options for the subnetwork flow logs. If logging is enabled logs will be exported to Stackdriver. This field cannot be set if the purpose of this subnetwork is INTERNAL_HTTPS_LOAD_BALANCER 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, INTERNAL_HTTPS_LOAD_BALANCER or REGIONAL_MANAGED_PROXY. A subnetwork with purpose set to INTERNAL_HTTPS_LOAD_BALANCER is a user-created subnetwork that is reserved for Internal HTTP(S) Load Balancing. A subnetwork in a given region with purpose set to REGIONAL_MANAGED_PROXY is a proxy-only subnet and is shared between all the regional Envoy-based load balancers. If unspecified, the purpose defaults to PRIVATE_RFC_1918. The enableFlowLogs field isn't supported with the purpose field set to INTERNAL_HTTPS_LOAD_BALANCER.

    region String

    The GCP region for this subnetwork.

    role String

    The role of subnetwork. The value can be set to ACTIVE or BACKUP. An ACTIVE subnetwork is one that is currently being used. A BACKUP subnetwork is one that is ready to be promoted to ACTIVE or is currently draining. Subnetwork role must be specified when purpose is set to INTERNAL_HTTPS_LOAD_BALANCER or REGIONAL_MANAGED_PROXY. 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.

    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.

    Id string

    The provider-assigned unique ID for this managed resource.

    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.

    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.

    Id string

    The provider-assigned unique ID for this managed resource.

    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.

    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.

    id String

    The provider-assigned unique ID for this managed resource.

    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.

    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.

    id string

    The provider-assigned unique ID for this managed resource.

    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.

    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.

    id str

    The provider-assigned unique ID for this managed resource.

    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.

    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.

    id String

    The provider-assigned unique ID for this managed resource.

    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,
            creation_timestamp: Optional[str] = None,
            description: Optional[str] = None,
            external_ipv6_prefix: Optional[str] = None,
            fingerprint: Optional[str] = None,
            gateway_address: 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:
    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.

    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

    Denotes the logging options for the subnetwork flow logs. If logging is enabled logs will be exported to Stackdriver. This field cannot be set if the purpose of this subnetwork is INTERNAL_HTTPS_LOAD_BALANCER 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, INTERNAL_HTTPS_LOAD_BALANCER or REGIONAL_MANAGED_PROXY. A subnetwork with purpose set to INTERNAL_HTTPS_LOAD_BALANCER is a user-created subnetwork that is reserved for Internal HTTP(S) Load Balancing. A subnetwork in a given region with purpose set to REGIONAL_MANAGED_PROXY is a proxy-only subnet and is shared between all the regional Envoy-based load balancers. If unspecified, the purpose defaults to PRIVATE_RFC_1918. The enableFlowLogs field isn't supported with the purpose field set to INTERNAL_HTTPS_LOAD_BALANCER.

    Region string

    The GCP region for this subnetwork.

    Role string

    The role of subnetwork. The value can be set to ACTIVE or BACKUP. An ACTIVE subnetwork is one that is currently being used. A BACKUP subnetwork is one that is ready to be promoted to ACTIVE or is currently draining. Subnetwork role must be specified when purpose is set to INTERNAL_HTTPS_LOAD_BALANCER or REGIONAL_MANAGED_PROXY. Possible values are: ACTIVE, BACKUP.

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

    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.

    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

    Denotes the logging options for the subnetwork flow logs. If logging is enabled logs will be exported to Stackdriver. This field cannot be set if the purpose of this subnetwork is INTERNAL_HTTPS_LOAD_BALANCER 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, INTERNAL_HTTPS_LOAD_BALANCER or REGIONAL_MANAGED_PROXY. A subnetwork with purpose set to INTERNAL_HTTPS_LOAD_BALANCER is a user-created subnetwork that is reserved for Internal HTTP(S) Load Balancing. A subnetwork in a given region with purpose set to REGIONAL_MANAGED_PROXY is a proxy-only subnet and is shared between all the regional Envoy-based load balancers. If unspecified, the purpose defaults to PRIVATE_RFC_1918. The enableFlowLogs field isn't supported with the purpose field set to INTERNAL_HTTPS_LOAD_BALANCER.

    Region string

    The GCP region for this subnetwork.

    Role string

    The role of subnetwork. The value can be set to ACTIVE or BACKUP. An ACTIVE subnetwork is one that is currently being used. A BACKUP subnetwork is one that is ready to be promoted to ACTIVE or is currently draining. Subnetwork role must be specified when purpose is set to INTERNAL_HTTPS_LOAD_BALANCER or REGIONAL_MANAGED_PROXY. 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.

    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.

    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

    Denotes the logging options for the subnetwork flow logs. If logging is enabled logs will be exported to Stackdriver. This field cannot be set if the purpose of this subnetwork is INTERNAL_HTTPS_LOAD_BALANCER 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, INTERNAL_HTTPS_LOAD_BALANCER or REGIONAL_MANAGED_PROXY. A subnetwork with purpose set to INTERNAL_HTTPS_LOAD_BALANCER is a user-created subnetwork that is reserved for Internal HTTP(S) Load Balancing. A subnetwork in a given region with purpose set to REGIONAL_MANAGED_PROXY is a proxy-only subnet and is shared between all the regional Envoy-based load balancers. If unspecified, the purpose defaults to PRIVATE_RFC_1918. The enableFlowLogs field isn't supported with the purpose field set to INTERNAL_HTTPS_LOAD_BALANCER.

    region String

    The GCP region for this subnetwork.

    role String

    The role of subnetwork. The value can be set to ACTIVE or BACKUP. An ACTIVE subnetwork is one that is currently being used. A BACKUP subnetwork is one that is ready to be promoted to ACTIVE or is currently draining. Subnetwork role must be specified when purpose is set to INTERNAL_HTTPS_LOAD_BALANCER or REGIONAL_MANAGED_PROXY. Possible values are: ACTIVE, BACKUP.

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

    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.

    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

    Denotes the logging options for the subnetwork flow logs. If logging is enabled logs will be exported to Stackdriver. This field cannot be set if the purpose of this subnetwork is INTERNAL_HTTPS_LOAD_BALANCER 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, INTERNAL_HTTPS_LOAD_BALANCER or REGIONAL_MANAGED_PROXY. A subnetwork with purpose set to INTERNAL_HTTPS_LOAD_BALANCER is a user-created subnetwork that is reserved for Internal HTTP(S) Load Balancing. A subnetwork in a given region with purpose set to REGIONAL_MANAGED_PROXY is a proxy-only subnet and is shared between all the regional Envoy-based load balancers. If unspecified, the purpose defaults to PRIVATE_RFC_1918. The enableFlowLogs field isn't supported with the purpose field set to INTERNAL_HTTPS_LOAD_BALANCER.

    region string

    The GCP region for this subnetwork.

    role string

    The role of subnetwork. The value can be set to ACTIVE or BACKUP. An ACTIVE subnetwork is one that is currently being used. A BACKUP subnetwork is one that is ready to be promoted to ACTIVE or is currently draining. Subnetwork role must be specified when purpose is set to INTERNAL_HTTPS_LOAD_BALANCER or REGIONAL_MANAGED_PROXY. 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.

    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.

    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

    Denotes the logging options for the subnetwork flow logs. If logging is enabled logs will be exported to Stackdriver. This field cannot be set if the purpose of this subnetwork is INTERNAL_HTTPS_LOAD_BALANCER 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, INTERNAL_HTTPS_LOAD_BALANCER or REGIONAL_MANAGED_PROXY. A subnetwork with purpose set to INTERNAL_HTTPS_LOAD_BALANCER is a user-created subnetwork that is reserved for Internal HTTP(S) Load Balancing. A subnetwork in a given region with purpose set to REGIONAL_MANAGED_PROXY is a proxy-only subnet and is shared between all the regional Envoy-based load balancers. If unspecified, the purpose defaults to PRIVATE_RFC_1918. The enableFlowLogs field isn't supported with the purpose field set to INTERNAL_HTTPS_LOAD_BALANCER.

    region str

    The GCP region for this subnetwork.

    role str

    The role of subnetwork. The value can be set to ACTIVE or BACKUP. An ACTIVE subnetwork is one that is currently being used. A BACKUP subnetwork is one that is ready to be promoted to ACTIVE or is currently draining. Subnetwork role must be specified when purpose is set to INTERNAL_HTTPS_LOAD_BALANCER or REGIONAL_MANAGED_PROXY. 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.

    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.

    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

    Denotes the logging options for the subnetwork flow logs. If logging is enabled logs will be exported to Stackdriver. This field cannot be set if the purpose of this subnetwork is INTERNAL_HTTPS_LOAD_BALANCER 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, INTERNAL_HTTPS_LOAD_BALANCER or REGIONAL_MANAGED_PROXY. A subnetwork with purpose set to INTERNAL_HTTPS_LOAD_BALANCER is a user-created subnetwork that is reserved for Internal HTTP(S) Load Balancing. A subnetwork in a given region with purpose set to REGIONAL_MANAGED_PROXY is a proxy-only subnet and is shared between all the regional Envoy-based load balancers. If unspecified, the purpose defaults to PRIVATE_RFC_1918. The enableFlowLogs field isn't supported with the purpose field set to INTERNAL_HTTPS_LOAD_BALANCER.

    region String

    The GCP region for this subnetwork.

    role String

    The role of subnetwork. The value can be set to ACTIVE or BACKUP. An ACTIVE subnetwork is one that is currently being used. A BACKUP subnetwork is one that is ready to be promoted to ACTIVE or is currently draining. Subnetwork role must be specified when purpose is set to INTERNAL_HTTPS_LOAD_BALANCER or REGIONAL_MANAGED_PROXY. 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

    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

    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

     $ 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 v6.57.0 published on Tuesday, May 30, 2023 by Pulumi