1. Packages
  2. Google Cloud (GCP) Classic
  3. API Docs
  4. edgenetwork
  5. Subnet
Google Cloud Classic v7.23.0 published on Wednesday, May 15, 2024 by Pulumi

gcp.edgenetwork.Subnet

Explore with Pulumi AI

gcp logo
Google Cloud Classic v7.23.0 published on Wednesday, May 15, 2024 by Pulumi

    A Distributed Cloud Edge subnet, which provides L2 isolation within a network.

    To get more information about Subnet, see:

    Example Usage

    Edgenetwork Subnet

    import * as pulumi from "@pulumi/pulumi";
    import * as gcp from "@pulumi/gcp";
    
    const exampleNetwork = new gcp.edgenetwork.Network("example_network", {
        networkId: "example-network",
        location: "us-west1",
        zone: "",
        description: "Example network.",
        mtu: 9000,
    });
    const exampleSubnet = new gcp.edgenetwork.Subnet("example_subnet", {
        subnetId: "example-subnet",
        location: "us-west1",
        zone: "",
        description: "Example subnet.",
        network: exampleNetwork.id,
        ipv4Cidrs: ["4.4.4.1/24"],
        labels: {
            environment: "dev",
        },
    });
    
    import pulumi
    import pulumi_gcp as gcp
    
    example_network = gcp.edgenetwork.Network("example_network",
        network_id="example-network",
        location="us-west1",
        zone="",
        description="Example network.",
        mtu=9000)
    example_subnet = gcp.edgenetwork.Subnet("example_subnet",
        subnet_id="example-subnet",
        location="us-west1",
        zone="",
        description="Example subnet.",
        network=example_network.id,
        ipv4_cidrs=["4.4.4.1/24"],
        labels={
            "environment": "dev",
        })
    
    package main
    
    import (
    	"github.com/pulumi/pulumi-gcp/sdk/v7/go/gcp/edgenetwork"
    	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
    )
    
    func main() {
    	pulumi.Run(func(ctx *pulumi.Context) error {
    		exampleNetwork, err := edgenetwork.NewNetwork(ctx, "example_network", &edgenetwork.NetworkArgs{
    			NetworkId:   pulumi.String("example-network"),
    			Location:    pulumi.String("us-west1"),
    			Zone:        pulumi.String(""),
    			Description: pulumi.String("Example network."),
    			Mtu:         pulumi.Int(9000),
    		})
    		if err != nil {
    			return err
    		}
    		_, err = edgenetwork.NewSubnet(ctx, "example_subnet", &edgenetwork.SubnetArgs{
    			SubnetId:    pulumi.String("example-subnet"),
    			Location:    pulumi.String("us-west1"),
    			Zone:        pulumi.String(""),
    			Description: pulumi.String("Example subnet."),
    			Network:     exampleNetwork.ID(),
    			Ipv4Cidrs: pulumi.StringArray{
    				pulumi.String("4.4.4.1/24"),
    			},
    			Labels: pulumi.StringMap{
    				"environment": pulumi.String("dev"),
    			},
    		})
    		if err != nil {
    			return err
    		}
    		return nil
    	})
    }
    
    using System.Collections.Generic;
    using System.Linq;
    using Pulumi;
    using Gcp = Pulumi.Gcp;
    
    return await Deployment.RunAsync(() => 
    {
        var exampleNetwork = new Gcp.EdgeNetwork.Network("example_network", new()
        {
            NetworkId = "example-network",
            Location = "us-west1",
            Zone = "",
            Description = "Example network.",
            Mtu = 9000,
        });
    
        var exampleSubnet = new Gcp.EdgeNetwork.Subnet("example_subnet", new()
        {
            SubnetId = "example-subnet",
            Location = "us-west1",
            Zone = "",
            Description = "Example subnet.",
            Network = exampleNetwork.Id,
            Ipv4Cidrs = new[]
            {
                "4.4.4.1/24",
            },
            Labels = 
            {
                { "environment", "dev" },
            },
        });
    
    });
    
    package generated_program;
    
    import com.pulumi.Context;
    import com.pulumi.Pulumi;
    import com.pulumi.core.Output;
    import com.pulumi.gcp.edgenetwork.Network;
    import com.pulumi.gcp.edgenetwork.NetworkArgs;
    import com.pulumi.gcp.edgenetwork.Subnet;
    import com.pulumi.gcp.edgenetwork.SubnetArgs;
    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 exampleNetwork = new Network("exampleNetwork", NetworkArgs.builder()        
                .networkId("example-network")
                .location("us-west1")
                .zone("")
                .description("Example network.")
                .mtu(9000)
                .build());
    
            var exampleSubnet = new Subnet("exampleSubnet", SubnetArgs.builder()        
                .subnetId("example-subnet")
                .location("us-west1")
                .zone("")
                .description("Example subnet.")
                .network(exampleNetwork.id())
                .ipv4Cidrs("4.4.4.1/24")
                .labels(Map.of("environment", "dev"))
                .build());
    
        }
    }
    
    resources:
      exampleSubnet:
        type: gcp:edgenetwork:Subnet
        name: example_subnet
        properties:
          subnetId: example-subnet
          location: us-west1
          zone:
          description: Example subnet.
          network: ${exampleNetwork.id}
          ipv4Cidrs:
            - 4.4.4.1/24
          labels:
            environment: dev
      exampleNetwork:
        type: gcp:edgenetwork:Network
        name: example_network
        properties:
          networkId: example-network
          location: us-west1
          zone:
          description: Example network.
          mtu: 9000
    

    Edgenetwork Subnet With Vlan Id

    import * as pulumi from "@pulumi/pulumi";
    import * as gcp from "@pulumi/gcp";
    
    const exampleNetwork = new gcp.edgenetwork.Network("example_network", {
        networkId: "example-network",
        location: "us-west1",
        zone: "",
        description: "Example network.",
        mtu: 9000,
    });
    const exampleSubnetWithVlanId = new gcp.edgenetwork.Subnet("example_subnet_with_vlan_id", {
        subnetId: "example-subnet-with-vlan-id",
        location: "us-west1",
        zone: "",
        description: "Example subnet with VLAN ID.",
        network: exampleNetwork.id,
        ipv6Cidrs: ["4444:4444:4444:4444::1/64"],
        vlanId: 44,
        labels: {
            environment: "dev",
        },
    });
    
    import pulumi
    import pulumi_gcp as gcp
    
    example_network = gcp.edgenetwork.Network("example_network",
        network_id="example-network",
        location="us-west1",
        zone="",
        description="Example network.",
        mtu=9000)
    example_subnet_with_vlan_id = gcp.edgenetwork.Subnet("example_subnet_with_vlan_id",
        subnet_id="example-subnet-with-vlan-id",
        location="us-west1",
        zone="",
        description="Example subnet with VLAN ID.",
        network=example_network.id,
        ipv6_cidrs=["4444:4444:4444:4444::1/64"],
        vlan_id=44,
        labels={
            "environment": "dev",
        })
    
    package main
    
    import (
    	"github.com/pulumi/pulumi-gcp/sdk/v7/go/gcp/edgenetwork"
    	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
    )
    
    func main() {
    	pulumi.Run(func(ctx *pulumi.Context) error {
    		exampleNetwork, err := edgenetwork.NewNetwork(ctx, "example_network", &edgenetwork.NetworkArgs{
    			NetworkId:   pulumi.String("example-network"),
    			Location:    pulumi.String("us-west1"),
    			Zone:        pulumi.String(""),
    			Description: pulumi.String("Example network."),
    			Mtu:         pulumi.Int(9000),
    		})
    		if err != nil {
    			return err
    		}
    		_, err = edgenetwork.NewSubnet(ctx, "example_subnet_with_vlan_id", &edgenetwork.SubnetArgs{
    			SubnetId:    pulumi.String("example-subnet-with-vlan-id"),
    			Location:    pulumi.String("us-west1"),
    			Zone:        pulumi.String(""),
    			Description: pulumi.String("Example subnet with VLAN ID."),
    			Network:     exampleNetwork.ID(),
    			Ipv6Cidrs: pulumi.StringArray{
    				pulumi.String("4444:4444:4444:4444::1/64"),
    			},
    			VlanId: pulumi.Int(44),
    			Labels: pulumi.StringMap{
    				"environment": pulumi.String("dev"),
    			},
    		})
    		if err != nil {
    			return err
    		}
    		return nil
    	})
    }
    
    using System.Collections.Generic;
    using System.Linq;
    using Pulumi;
    using Gcp = Pulumi.Gcp;
    
    return await Deployment.RunAsync(() => 
    {
        var exampleNetwork = new Gcp.EdgeNetwork.Network("example_network", new()
        {
            NetworkId = "example-network",
            Location = "us-west1",
            Zone = "",
            Description = "Example network.",
            Mtu = 9000,
        });
    
        var exampleSubnetWithVlanId = new Gcp.EdgeNetwork.Subnet("example_subnet_with_vlan_id", new()
        {
            SubnetId = "example-subnet-with-vlan-id",
            Location = "us-west1",
            Zone = "",
            Description = "Example subnet with VLAN ID.",
            Network = exampleNetwork.Id,
            Ipv6Cidrs = new[]
            {
                "4444:4444:4444:4444::1/64",
            },
            VlanId = 44,
            Labels = 
            {
                { "environment", "dev" },
            },
        });
    
    });
    
    package generated_program;
    
    import com.pulumi.Context;
    import com.pulumi.Pulumi;
    import com.pulumi.core.Output;
    import com.pulumi.gcp.edgenetwork.Network;
    import com.pulumi.gcp.edgenetwork.NetworkArgs;
    import com.pulumi.gcp.edgenetwork.Subnet;
    import com.pulumi.gcp.edgenetwork.SubnetArgs;
    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 exampleNetwork = new Network("exampleNetwork", NetworkArgs.builder()        
                .networkId("example-network")
                .location("us-west1")
                .zone("")
                .description("Example network.")
                .mtu(9000)
                .build());
    
            var exampleSubnetWithVlanId = new Subnet("exampleSubnetWithVlanId", SubnetArgs.builder()        
                .subnetId("example-subnet-with-vlan-id")
                .location("us-west1")
                .zone("")
                .description("Example subnet with VLAN ID.")
                .network(exampleNetwork.id())
                .ipv6Cidrs("4444:4444:4444:4444::1/64")
                .vlanId(44)
                .labels(Map.of("environment", "dev"))
                .build());
    
        }
    }
    
    resources:
      exampleSubnetWithVlanId:
        type: gcp:edgenetwork:Subnet
        name: example_subnet_with_vlan_id
        properties:
          subnetId: example-subnet-with-vlan-id
          location: us-west1
          zone:
          description: Example subnet with VLAN ID.
          network: ${exampleNetwork.id}
          ipv6Cidrs:
            - 4444:4444:4444:4444::1/64
          vlanId: 44
          labels:
            environment: dev
      exampleNetwork:
        type: gcp:edgenetwork:Network
        name: example_network
        properties:
          networkId: example-network
          location: us-west1
          zone:
          description: Example network.
          mtu: 9000
    

    Create Subnet Resource

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

    Constructor syntax

    new Subnet(name: string, args: SubnetArgs, opts?: CustomResourceOptions);
    @overload
    def Subnet(resource_name: str,
               args: SubnetArgs,
               opts: Optional[ResourceOptions] = None)
    
    @overload
    def Subnet(resource_name: str,
               opts: Optional[ResourceOptions] = None,
               location: Optional[str] = None,
               network: Optional[str] = None,
               subnet_id: Optional[str] = None,
               zone: Optional[str] = None,
               description: Optional[str] = None,
               ipv4_cidrs: Optional[Sequence[str]] = None,
               ipv6_cidrs: Optional[Sequence[str]] = None,
               labels: Optional[Mapping[str, str]] = None,
               project: Optional[str] = None,
               vlan_id: Optional[int] = None)
    func NewSubnet(ctx *Context, name string, args SubnetArgs, opts ...ResourceOption) (*Subnet, error)
    public Subnet(string name, SubnetArgs args, CustomResourceOptions? opts = null)
    public Subnet(String name, SubnetArgs args)
    public Subnet(String name, SubnetArgs args, CustomResourceOptions options)
    
    type: gcp:edgenetwork:Subnet
    properties: # The arguments to resource properties.
    options: # Bag of options to control resource's behavior.
    
    

    Parameters

    name string
    The unique name of the resource.
    args SubnetArgs
    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 SubnetArgs
    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 SubnetArgs
    The arguments to resource properties.
    opts ResourceOption
    Bag of options to control resource's behavior.
    name string
    The unique name of the resource.
    args SubnetArgs
    The arguments to resource properties.
    opts CustomResourceOptions
    Bag of options to control resource's behavior.
    name String
    The unique name of the resource.
    args SubnetArgs
    The arguments to resource properties.
    options CustomResourceOptions
    Bag of options to control resource's behavior.

    Example

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

    var subnetResource = new Gcp.EdgeNetwork.Subnet("subnetResource", new()
    {
        Location = "string",
        Network = "string",
        SubnetId = "string",
        Zone = "string",
        Description = "string",
        Ipv4Cidrs = new[]
        {
            "string",
        },
        Ipv6Cidrs = new[]
        {
            "string",
        },
        Labels = 
        {
            { "string", "string" },
        },
        Project = "string",
        VlanId = 0,
    });
    
    example, err := edgenetwork.NewSubnet(ctx, "subnetResource", &edgenetwork.SubnetArgs{
    	Location:    pulumi.String("string"),
    	Network:     pulumi.String("string"),
    	SubnetId:    pulumi.String("string"),
    	Zone:        pulumi.String("string"),
    	Description: pulumi.String("string"),
    	Ipv4Cidrs: pulumi.StringArray{
    		pulumi.String("string"),
    	},
    	Ipv6Cidrs: pulumi.StringArray{
    		pulumi.String("string"),
    	},
    	Labels: pulumi.StringMap{
    		"string": pulumi.String("string"),
    	},
    	Project: pulumi.String("string"),
    	VlanId:  pulumi.Int(0),
    })
    
    var subnetResource = new Subnet("subnetResource", SubnetArgs.builder()        
        .location("string")
        .network("string")
        .subnetId("string")
        .zone("string")
        .description("string")
        .ipv4Cidrs("string")
        .ipv6Cidrs("string")
        .labels(Map.of("string", "string"))
        .project("string")
        .vlanId(0)
        .build());
    
    subnet_resource = gcp.edgenetwork.Subnet("subnetResource",
        location="string",
        network="string",
        subnet_id="string",
        zone="string",
        description="string",
        ipv4_cidrs=["string"],
        ipv6_cidrs=["string"],
        labels={
            "string": "string",
        },
        project="string",
        vlan_id=0)
    
    const subnetResource = new gcp.edgenetwork.Subnet("subnetResource", {
        location: "string",
        network: "string",
        subnetId: "string",
        zone: "string",
        description: "string",
        ipv4Cidrs: ["string"],
        ipv6Cidrs: ["string"],
        labels: {
            string: "string",
        },
        project: "string",
        vlanId: 0,
    });
    
    type: gcp:edgenetwork:Subnet
    properties:
        description: string
        ipv4Cidrs:
            - string
        ipv6Cidrs:
            - string
        labels:
            string: string
        location: string
        network: string
        project: string
        subnetId: string
        vlanId: 0
        zone: string
    

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

    Location string
    The Google Cloud region to which the target Distributed Cloud Edge zone belongs.
    Network string
    The ID of the network to which this router belongs. Must be of the form: projects/{{project}}/locations/{{location}}/zones/{{zone}}/networks/{{network_id}}
    SubnetId string
    A unique ID that identifies this subnet.


    Zone string
    The name of the target Distributed Cloud Edge zone.
    Description string
    A free-text description of the resource. Max length 1024 characters.
    Ipv4Cidrs List<string>
    The ranges of ipv4 addresses that are owned by this subnetwork, in CIDR format.
    Ipv6Cidrs List<string>
    The ranges of ipv6 addresses that are owned by this subnetwork, in CIDR format.
    Labels Dictionary<string, string>
    Labels associated with this resource.
    Project string
    The ID of the project in which the resource belongs. If it is not provided, the provider project is used.
    VlanId int
    VLAN ID for this subnetwork. If not specified, one is assigned automatically.
    Location string
    The Google Cloud region to which the target Distributed Cloud Edge zone belongs.
    Network string
    The ID of the network to which this router belongs. Must be of the form: projects/{{project}}/locations/{{location}}/zones/{{zone}}/networks/{{network_id}}
    SubnetId string
    A unique ID that identifies this subnet.


    Zone string
    The name of the target Distributed Cloud Edge zone.
    Description string
    A free-text description of the resource. Max length 1024 characters.
    Ipv4Cidrs []string
    The ranges of ipv4 addresses that are owned by this subnetwork, in CIDR format.
    Ipv6Cidrs []string
    The ranges of ipv6 addresses that are owned by this subnetwork, in CIDR format.
    Labels map[string]string
    Labels associated with this resource.
    Project string
    The ID of the project in which the resource belongs. If it is not provided, the provider project is used.
    VlanId int
    VLAN ID for this subnetwork. If not specified, one is assigned automatically.
    location String
    The Google Cloud region to which the target Distributed Cloud Edge zone belongs.
    network String
    The ID of the network to which this router belongs. Must be of the form: projects/{{project}}/locations/{{location}}/zones/{{zone}}/networks/{{network_id}}
    subnetId String
    A unique ID that identifies this subnet.


    zone String
    The name of the target Distributed Cloud Edge zone.
    description String
    A free-text description of the resource. Max length 1024 characters.
    ipv4Cidrs List<String>
    The ranges of ipv4 addresses that are owned by this subnetwork, in CIDR format.
    ipv6Cidrs List<String>
    The ranges of ipv6 addresses that are owned by this subnetwork, in CIDR format.
    labels Map<String,String>
    Labels associated with this resource.
    project String
    The ID of the project in which the resource belongs. If it is not provided, the provider project is used.
    vlanId Integer
    VLAN ID for this subnetwork. If not specified, one is assigned automatically.
    location string
    The Google Cloud region to which the target Distributed Cloud Edge zone belongs.
    network string
    The ID of the network to which this router belongs. Must be of the form: projects/{{project}}/locations/{{location}}/zones/{{zone}}/networks/{{network_id}}
    subnetId string
    A unique ID that identifies this subnet.


    zone string
    The name of the target Distributed Cloud Edge zone.
    description string
    A free-text description of the resource. Max length 1024 characters.
    ipv4Cidrs string[]
    The ranges of ipv4 addresses that are owned by this subnetwork, in CIDR format.
    ipv6Cidrs string[]
    The ranges of ipv6 addresses that are owned by this subnetwork, in CIDR format.
    labels {[key: string]: string}
    Labels associated with this resource.
    project string
    The ID of the project in which the resource belongs. If it is not provided, the provider project is used.
    vlanId number
    VLAN ID for this subnetwork. If not specified, one is assigned automatically.
    location str
    The Google Cloud region to which the target Distributed Cloud Edge zone belongs.
    network str
    The ID of the network to which this router belongs. Must be of the form: projects/{{project}}/locations/{{location}}/zones/{{zone}}/networks/{{network_id}}
    subnet_id str
    A unique ID that identifies this subnet.


    zone str
    The name of the target Distributed Cloud Edge zone.
    description str
    A free-text description of the resource. Max length 1024 characters.
    ipv4_cidrs Sequence[str]
    The ranges of ipv4 addresses that are owned by this subnetwork, in CIDR format.
    ipv6_cidrs Sequence[str]
    The ranges of ipv6 addresses that are owned by this subnetwork, in CIDR format.
    labels Mapping[str, str]
    Labels associated with this resource.
    project str
    The ID of the project in which the resource belongs. If it is not provided, the provider project is used.
    vlan_id int
    VLAN ID for this subnetwork. If not specified, one is assigned automatically.
    location String
    The Google Cloud region to which the target Distributed Cloud Edge zone belongs.
    network String
    The ID of the network to which this router belongs. Must be of the form: projects/{{project}}/locations/{{location}}/zones/{{zone}}/networks/{{network_id}}
    subnetId String
    A unique ID that identifies this subnet.


    zone String
    The name of the target Distributed Cloud Edge zone.
    description String
    A free-text description of the resource. Max length 1024 characters.
    ipv4Cidrs List<String>
    The ranges of ipv4 addresses that are owned by this subnetwork, in CIDR format.
    ipv6Cidrs List<String>
    The ranges of ipv6 addresses that are owned by this subnetwork, in CIDR format.
    labels Map<String>
    Labels associated with this resource.
    project String
    The ID of the project in which the resource belongs. If it is not provided, the provider project is used.
    vlanId Number
    VLAN ID for this subnetwork. If not specified, one is assigned automatically.

    Outputs

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

    CreateTime string
    The time when the subnet was created. A timestamp in RFC3339 UTC "Zulu" format, with nanosecond resolution and up to nine fractional digits. Examples: 2014-10-02T15:01:23Z and 2014-10-02T15:01:23.045123456Z.
    Id string
    The provider-assigned unique ID for this managed resource.
    Name string
    The canonical name of this resource, with format projects/{{project}}/locations/{{location}}/zones/{{zone}}/subnets/{{subnet_id}}
    State string
    Current stage of the resource to the device by config push.
    UpdateTime string
    The time when the subnet was last updated. A timestamp in RFC3339 UTC "Zulu" format, with nanosecond resolution and up to nine fractional digits. Examples: 2014-10-02T15:01:23Z and 2014-10-02T15:01:23.045123456Z.
    CreateTime string
    The time when the subnet was created. A timestamp in RFC3339 UTC "Zulu" format, with nanosecond resolution and up to nine fractional digits. Examples: 2014-10-02T15:01:23Z and 2014-10-02T15:01:23.045123456Z.
    Id string
    The provider-assigned unique ID for this managed resource.
    Name string
    The canonical name of this resource, with format projects/{{project}}/locations/{{location}}/zones/{{zone}}/subnets/{{subnet_id}}
    State string
    Current stage of the resource to the device by config push.
    UpdateTime string
    The time when the subnet was last updated. A timestamp in RFC3339 UTC "Zulu" format, with nanosecond resolution and up to nine fractional digits. Examples: 2014-10-02T15:01:23Z and 2014-10-02T15:01:23.045123456Z.
    createTime String
    The time when the subnet was created. A timestamp in RFC3339 UTC "Zulu" format, with nanosecond resolution and up to nine fractional digits. Examples: 2014-10-02T15:01:23Z and 2014-10-02T15:01:23.045123456Z.
    id String
    The provider-assigned unique ID for this managed resource.
    name String
    The canonical name of this resource, with format projects/{{project}}/locations/{{location}}/zones/{{zone}}/subnets/{{subnet_id}}
    state String
    Current stage of the resource to the device by config push.
    updateTime String
    The time when the subnet was last updated. A timestamp in RFC3339 UTC "Zulu" format, with nanosecond resolution and up to nine fractional digits. Examples: 2014-10-02T15:01:23Z and 2014-10-02T15:01:23.045123456Z.
    createTime string
    The time when the subnet was created. A timestamp in RFC3339 UTC "Zulu" format, with nanosecond resolution and up to nine fractional digits. Examples: 2014-10-02T15:01:23Z and 2014-10-02T15:01:23.045123456Z.
    id string
    The provider-assigned unique ID for this managed resource.
    name string
    The canonical name of this resource, with format projects/{{project}}/locations/{{location}}/zones/{{zone}}/subnets/{{subnet_id}}
    state string
    Current stage of the resource to the device by config push.
    updateTime string
    The time when the subnet was last updated. A timestamp in RFC3339 UTC "Zulu" format, with nanosecond resolution and up to nine fractional digits. Examples: 2014-10-02T15:01:23Z and 2014-10-02T15:01:23.045123456Z.
    create_time str
    The time when the subnet was created. A timestamp in RFC3339 UTC "Zulu" format, with nanosecond resolution and up to nine fractional digits. Examples: 2014-10-02T15:01:23Z and 2014-10-02T15:01:23.045123456Z.
    id str
    The provider-assigned unique ID for this managed resource.
    name str
    The canonical name of this resource, with format projects/{{project}}/locations/{{location}}/zones/{{zone}}/subnets/{{subnet_id}}
    state str
    Current stage of the resource to the device by config push.
    update_time str
    The time when the subnet was last updated. A timestamp in RFC3339 UTC "Zulu" format, with nanosecond resolution and up to nine fractional digits. Examples: 2014-10-02T15:01:23Z and 2014-10-02T15:01:23.045123456Z.
    createTime String
    The time when the subnet was created. A timestamp in RFC3339 UTC "Zulu" format, with nanosecond resolution and up to nine fractional digits. Examples: 2014-10-02T15:01:23Z and 2014-10-02T15:01:23.045123456Z.
    id String
    The provider-assigned unique ID for this managed resource.
    name String
    The canonical name of this resource, with format projects/{{project}}/locations/{{location}}/zones/{{zone}}/subnets/{{subnet_id}}
    state String
    Current stage of the resource to the device by config push.
    updateTime String
    The time when the subnet was last updated. A timestamp in RFC3339 UTC "Zulu" format, with nanosecond resolution and up to nine fractional digits. Examples: 2014-10-02T15:01:23Z and 2014-10-02T15:01:23.045123456Z.

    Look up Existing Subnet Resource

    Get an existing Subnet 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?: SubnetState, opts?: CustomResourceOptions): Subnet
    @staticmethod
    def get(resource_name: str,
            id: str,
            opts: Optional[ResourceOptions] = None,
            create_time: Optional[str] = None,
            description: Optional[str] = None,
            ipv4_cidrs: Optional[Sequence[str]] = None,
            ipv6_cidrs: Optional[Sequence[str]] = None,
            labels: Optional[Mapping[str, str]] = None,
            location: Optional[str] = None,
            name: Optional[str] = None,
            network: Optional[str] = None,
            project: Optional[str] = None,
            state: Optional[str] = None,
            subnet_id: Optional[str] = None,
            update_time: Optional[str] = None,
            vlan_id: Optional[int] = None,
            zone: Optional[str] = None) -> Subnet
    func GetSubnet(ctx *Context, name string, id IDInput, state *SubnetState, opts ...ResourceOption) (*Subnet, error)
    public static Subnet Get(string name, Input<string> id, SubnetState? state, CustomResourceOptions? opts = null)
    public static Subnet get(String name, Output<String> id, SubnetState 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:
    CreateTime string
    The time when the subnet was created. A timestamp in RFC3339 UTC "Zulu" format, with nanosecond resolution and up to nine fractional digits. Examples: 2014-10-02T15:01:23Z and 2014-10-02T15:01:23.045123456Z.
    Description string
    A free-text description of the resource. Max length 1024 characters.
    Ipv4Cidrs List<string>
    The ranges of ipv4 addresses that are owned by this subnetwork, in CIDR format.
    Ipv6Cidrs List<string>
    The ranges of ipv6 addresses that are owned by this subnetwork, in CIDR format.
    Labels Dictionary<string, string>
    Labels associated with this resource.
    Location string
    The Google Cloud region to which the target Distributed Cloud Edge zone belongs.
    Name string
    The canonical name of this resource, with format projects/{{project}}/locations/{{location}}/zones/{{zone}}/subnets/{{subnet_id}}
    Network string
    The ID of the network to which this router belongs. Must be of the form: projects/{{project}}/locations/{{location}}/zones/{{zone}}/networks/{{network_id}}
    Project string
    The ID of the project in which the resource belongs. If it is not provided, the provider project is used.
    State string
    Current stage of the resource to the device by config push.
    SubnetId string
    A unique ID that identifies this subnet.


    UpdateTime string
    The time when the subnet was last updated. A timestamp in RFC3339 UTC "Zulu" format, with nanosecond resolution and up to nine fractional digits. Examples: 2014-10-02T15:01:23Z and 2014-10-02T15:01:23.045123456Z.
    VlanId int
    VLAN ID for this subnetwork. If not specified, one is assigned automatically.
    Zone string
    The name of the target Distributed Cloud Edge zone.
    CreateTime string
    The time when the subnet was created. A timestamp in RFC3339 UTC "Zulu" format, with nanosecond resolution and up to nine fractional digits. Examples: 2014-10-02T15:01:23Z and 2014-10-02T15:01:23.045123456Z.
    Description string
    A free-text description of the resource. Max length 1024 characters.
    Ipv4Cidrs []string
    The ranges of ipv4 addresses that are owned by this subnetwork, in CIDR format.
    Ipv6Cidrs []string
    The ranges of ipv6 addresses that are owned by this subnetwork, in CIDR format.
    Labels map[string]string
    Labels associated with this resource.
    Location string
    The Google Cloud region to which the target Distributed Cloud Edge zone belongs.
    Name string
    The canonical name of this resource, with format projects/{{project}}/locations/{{location}}/zones/{{zone}}/subnets/{{subnet_id}}
    Network string
    The ID of the network to which this router belongs. Must be of the form: projects/{{project}}/locations/{{location}}/zones/{{zone}}/networks/{{network_id}}
    Project string
    The ID of the project in which the resource belongs. If it is not provided, the provider project is used.
    State string
    Current stage of the resource to the device by config push.
    SubnetId string
    A unique ID that identifies this subnet.


    UpdateTime string
    The time when the subnet was last updated. A timestamp in RFC3339 UTC "Zulu" format, with nanosecond resolution and up to nine fractional digits. Examples: 2014-10-02T15:01:23Z and 2014-10-02T15:01:23.045123456Z.
    VlanId int
    VLAN ID for this subnetwork. If not specified, one is assigned automatically.
    Zone string
    The name of the target Distributed Cloud Edge zone.
    createTime String
    The time when the subnet was created. A timestamp in RFC3339 UTC "Zulu" format, with nanosecond resolution and up to nine fractional digits. Examples: 2014-10-02T15:01:23Z and 2014-10-02T15:01:23.045123456Z.
    description String
    A free-text description of the resource. Max length 1024 characters.
    ipv4Cidrs List<String>
    The ranges of ipv4 addresses that are owned by this subnetwork, in CIDR format.
    ipv6Cidrs List<String>
    The ranges of ipv6 addresses that are owned by this subnetwork, in CIDR format.
    labels Map<String,String>
    Labels associated with this resource.
    location String
    The Google Cloud region to which the target Distributed Cloud Edge zone belongs.
    name String
    The canonical name of this resource, with format projects/{{project}}/locations/{{location}}/zones/{{zone}}/subnets/{{subnet_id}}
    network String
    The ID of the network to which this router belongs. Must be of the form: projects/{{project}}/locations/{{location}}/zones/{{zone}}/networks/{{network_id}}
    project String
    The ID of the project in which the resource belongs. If it is not provided, the provider project is used.
    state String
    Current stage of the resource to the device by config push.
    subnetId String
    A unique ID that identifies this subnet.


    updateTime String
    The time when the subnet was last updated. A timestamp in RFC3339 UTC "Zulu" format, with nanosecond resolution and up to nine fractional digits. Examples: 2014-10-02T15:01:23Z and 2014-10-02T15:01:23.045123456Z.
    vlanId Integer
    VLAN ID for this subnetwork. If not specified, one is assigned automatically.
    zone String
    The name of the target Distributed Cloud Edge zone.
    createTime string
    The time when the subnet was created. A timestamp in RFC3339 UTC "Zulu" format, with nanosecond resolution and up to nine fractional digits. Examples: 2014-10-02T15:01:23Z and 2014-10-02T15:01:23.045123456Z.
    description string
    A free-text description of the resource. Max length 1024 characters.
    ipv4Cidrs string[]
    The ranges of ipv4 addresses that are owned by this subnetwork, in CIDR format.
    ipv6Cidrs string[]
    The ranges of ipv6 addresses that are owned by this subnetwork, in CIDR format.
    labels {[key: string]: string}
    Labels associated with this resource.
    location string
    The Google Cloud region to which the target Distributed Cloud Edge zone belongs.
    name string
    The canonical name of this resource, with format projects/{{project}}/locations/{{location}}/zones/{{zone}}/subnets/{{subnet_id}}
    network string
    The ID of the network to which this router belongs. Must be of the form: projects/{{project}}/locations/{{location}}/zones/{{zone}}/networks/{{network_id}}
    project string
    The ID of the project in which the resource belongs. If it is not provided, the provider project is used.
    state string
    Current stage of the resource to the device by config push.
    subnetId string
    A unique ID that identifies this subnet.


    updateTime string
    The time when the subnet was last updated. A timestamp in RFC3339 UTC "Zulu" format, with nanosecond resolution and up to nine fractional digits. Examples: 2014-10-02T15:01:23Z and 2014-10-02T15:01:23.045123456Z.
    vlanId number
    VLAN ID for this subnetwork. If not specified, one is assigned automatically.
    zone string
    The name of the target Distributed Cloud Edge zone.
    create_time str
    The time when the subnet was created. A timestamp in RFC3339 UTC "Zulu" format, with nanosecond resolution and up to nine fractional digits. Examples: 2014-10-02T15:01:23Z and 2014-10-02T15:01:23.045123456Z.
    description str
    A free-text description of the resource. Max length 1024 characters.
    ipv4_cidrs Sequence[str]
    The ranges of ipv4 addresses that are owned by this subnetwork, in CIDR format.
    ipv6_cidrs Sequence[str]
    The ranges of ipv6 addresses that are owned by this subnetwork, in CIDR format.
    labels Mapping[str, str]
    Labels associated with this resource.
    location str
    The Google Cloud region to which the target Distributed Cloud Edge zone belongs.
    name str
    The canonical name of this resource, with format projects/{{project}}/locations/{{location}}/zones/{{zone}}/subnets/{{subnet_id}}
    network str
    The ID of the network to which this router belongs. Must be of the form: projects/{{project}}/locations/{{location}}/zones/{{zone}}/networks/{{network_id}}
    project str
    The ID of the project in which the resource belongs. If it is not provided, the provider project is used.
    state str
    Current stage of the resource to the device by config push.
    subnet_id str
    A unique ID that identifies this subnet.


    update_time str
    The time when the subnet was last updated. A timestamp in RFC3339 UTC "Zulu" format, with nanosecond resolution and up to nine fractional digits. Examples: 2014-10-02T15:01:23Z and 2014-10-02T15:01:23.045123456Z.
    vlan_id int
    VLAN ID for this subnetwork. If not specified, one is assigned automatically.
    zone str
    The name of the target Distributed Cloud Edge zone.
    createTime String
    The time when the subnet was created. A timestamp in RFC3339 UTC "Zulu" format, with nanosecond resolution and up to nine fractional digits. Examples: 2014-10-02T15:01:23Z and 2014-10-02T15:01:23.045123456Z.
    description String
    A free-text description of the resource. Max length 1024 characters.
    ipv4Cidrs List<String>
    The ranges of ipv4 addresses that are owned by this subnetwork, in CIDR format.
    ipv6Cidrs List<String>
    The ranges of ipv6 addresses that are owned by this subnetwork, in CIDR format.
    labels Map<String>
    Labels associated with this resource.
    location String
    The Google Cloud region to which the target Distributed Cloud Edge zone belongs.
    name String
    The canonical name of this resource, with format projects/{{project}}/locations/{{location}}/zones/{{zone}}/subnets/{{subnet_id}}
    network String
    The ID of the network to which this router belongs. Must be of the form: projects/{{project}}/locations/{{location}}/zones/{{zone}}/networks/{{network_id}}
    project String
    The ID of the project in which the resource belongs. If it is not provided, the provider project is used.
    state String
    Current stage of the resource to the device by config push.
    subnetId String
    A unique ID that identifies this subnet.


    updateTime String
    The time when the subnet was last updated. A timestamp in RFC3339 UTC "Zulu" format, with nanosecond resolution and up to nine fractional digits. Examples: 2014-10-02T15:01:23Z and 2014-10-02T15:01:23.045123456Z.
    vlanId Number
    VLAN ID for this subnetwork. If not specified, one is assigned automatically.
    zone String
    The name of the target Distributed Cloud Edge zone.

    Import

    Subnet can be imported using any of these accepted formats:

    • projects/{{project}}/locations/{{location}}/zones/{{zone}}/subnets/{{subnet_id}}

    • {{project}}/{{location}}/{{zone}}/{{subnet_id}}

    • {{location}}/{{zone}}/{{subnet_id}}

    • {{location}}/{{subnet_id}}

    • {{name}}

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

    $ pulumi import gcp:edgenetwork/subnet:Subnet default projects/{{project}}/locations/{{location}}/zones/{{zone}}/subnets/{{subnet_id}}
    
    $ pulumi import gcp:edgenetwork/subnet:Subnet default {{project}}/{{location}}/{{zone}}/{{subnet_id}}
    
    $ pulumi import gcp:edgenetwork/subnet:Subnet default {{location}}/{{zone}}/{{subnet_id}}
    
    $ pulumi import gcp:edgenetwork/subnet:Subnet default {{location}}/{{subnet_id}}
    
    $ pulumi import gcp:edgenetwork/subnet:Subnet default {{name}}
    

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

    Package Details

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