gcp.edgenetwork.Subnet
Explore with Pulumi AI
A Distributed Cloud Edge subnet, which provides L2 isolation within a network.
To get more information about Subnet, see:
- API documentation
- How-to Guides
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/v8/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/v8/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.
Constructor 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
In Python, inputs that are objects can be passed either as argument classes or as dictionary literals.
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. - Note: This field is non-authoritative, and will only manage the labels present in your configuration. Please refer to the field - effective_labelsfor all of the labels present on the 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. - Note: This field is non-authoritative, and will only manage the labels present in your configuration. Please refer to the field - effective_labelsfor all of the labels present on the 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. - Note: This field is non-authoritative, and will only manage the labels present in your configuration. Please refer to the field - effective_labelsfor all of the labels present on the 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. - Note: This field is non-authoritative, and will only manage the labels present in your configuration. Please refer to the field - effective_labelsfor all of the labels present on the 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. - Note: This field is non-authoritative, and will only manage the labels present in your configuration. Please refer to the field - effective_labelsfor all of the labels present on the 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. - Note: This field is non-authoritative, and will only manage the labels present in your configuration. Please refer to the field - effective_labelsfor all of the labels present on the 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:23Zand2014-10-02T15:01:23.045123456Z.
- EffectiveLabels Dictionary<string, string>
- All of labels (key/value pairs) present on the resource in GCP, including the labels configured through Pulumi, other clients and services.
- 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}}
- PulumiLabels Dictionary<string, string>
- The combination of labels configured directly on the resource and default labels configured on the provider.
- 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:23Zand2014-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:23Zand2014-10-02T15:01:23.045123456Z.
- EffectiveLabels map[string]string
- All of labels (key/value pairs) present on the resource in GCP, including the labels configured through Pulumi, other clients and services.
- 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}}
- PulumiLabels map[string]string
- The combination of labels configured directly on the resource and default labels configured on the provider.
- 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:23Zand2014-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:23Zand2014-10-02T15:01:23.045123456Z.
- effectiveLabels Map<String,String>
- All of labels (key/value pairs) present on the resource in GCP, including the labels configured through Pulumi, other clients and services.
- 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}}
- pulumiLabels Map<String,String>
- The combination of labels configured directly on the resource and default labels configured on the provider.
- 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:23Zand2014-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:23Zand2014-10-02T15:01:23.045123456Z.
- effectiveLabels {[key: string]: string}
- All of labels (key/value pairs) present on the resource in GCP, including the labels configured through Pulumi, other clients and services.
- 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}}
- pulumiLabels {[key: string]: string}
- The combination of labels configured directly on the resource and default labels configured on the provider.
- 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:23Zand2014-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:23Zand2014-10-02T15:01:23.045123456Z.
- effective_labels Mapping[str, str]
- All of labels (key/value pairs) present on the resource in GCP, including the labels configured through Pulumi, other clients and services.
- 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}}
- pulumi_labels Mapping[str, str]
- The combination of labels configured directly on the resource and default labels configured on the provider.
- 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:23Zand2014-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:23Zand2014-10-02T15:01:23.045123456Z.
- effectiveLabels Map<String>
- All of labels (key/value pairs) present on the resource in GCP, including the labels configured through Pulumi, other clients and services.
- 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}}
- pulumiLabels Map<String>
- The combination of labels configured directly on the resource and default labels configured on the provider.
- 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:23Zand2014-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,
        effective_labels: Optional[Mapping[str, 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,
        pulumi_labels: Optional[Mapping[str, 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) -> Subnetfunc 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)resources:  _:    type: gcp:edgenetwork:Subnet    get:      id: ${id}- 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.
- 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:23Zand2014-10-02T15:01:23.045123456Z.
- Description string
- A free-text description of the resource. Max length 1024 characters.
- EffectiveLabels Dictionary<string, string>
- All of labels (key/value pairs) present on the resource in GCP, including the labels configured through Pulumi, other clients and services.
- 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. - Note: This field is non-authoritative, and will only manage the labels present in your configuration. Please refer to the field - effective_labelsfor all of the labels present on the 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.
- PulumiLabels Dictionary<string, string>
- The combination of labels configured directly on the resource and default labels configured on the provider.
- 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:23Zand2014-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:23Zand2014-10-02T15:01:23.045123456Z.
- Description string
- A free-text description of the resource. Max length 1024 characters.
- EffectiveLabels map[string]string
- All of labels (key/value pairs) present on the resource in GCP, including the labels configured through Pulumi, other clients and services.
- 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. - Note: This field is non-authoritative, and will only manage the labels present in your configuration. Please refer to the field - effective_labelsfor all of the labels present on the 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.
- PulumiLabels map[string]string
- The combination of labels configured directly on the resource and default labels configured on the provider.
- 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:23Zand2014-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:23Zand2014-10-02T15:01:23.045123456Z.
- description String
- A free-text description of the resource. Max length 1024 characters.
- effectiveLabels Map<String,String>
- All of labels (key/value pairs) present on the resource in GCP, including the labels configured through Pulumi, other clients and services.
- 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. - Note: This field is non-authoritative, and will only manage the labels present in your configuration. Please refer to the field - effective_labelsfor all of the labels present on the 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.
- pulumiLabels Map<String,String>
- The combination of labels configured directly on the resource and default labels configured on the provider.
- 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:23Zand2014-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:23Zand2014-10-02T15:01:23.045123456Z.
- description string
- A free-text description of the resource. Max length 1024 characters.
- effectiveLabels {[key: string]: string}
- All of labels (key/value pairs) present on the resource in GCP, including the labels configured through Pulumi, other clients and services.
- 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. - Note: This field is non-authoritative, and will only manage the labels present in your configuration. Please refer to the field - effective_labelsfor all of the labels present on the 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.
- pulumiLabels {[key: string]: string}
- The combination of labels configured directly on the resource and default labels configured on the provider.
- 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:23Zand2014-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:23Zand2014-10-02T15:01:23.045123456Z.
- description str
- A free-text description of the resource. Max length 1024 characters.
- effective_labels Mapping[str, str]
- All of labels (key/value pairs) present on the resource in GCP, including the labels configured through Pulumi, other clients and services.
- 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. - Note: This field is non-authoritative, and will only manage the labels present in your configuration. Please refer to the field - effective_labelsfor all of the labels present on the 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.
- pulumi_labels Mapping[str, str]
- The combination of labels configured directly on the resource and default labels configured on the provider.
- 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:23Zand2014-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:23Zand2014-10-02T15:01:23.045123456Z.
- description String
- A free-text description of the resource. Max length 1024 characters.
- effectiveLabels Map<String>
- All of labels (key/value pairs) present on the resource in GCP, including the labels configured through Pulumi, other clients and services.
- 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. - Note: This field is non-authoritative, and will only manage the labels present in your configuration. Please refer to the field - effective_labelsfor all of the labels present on the 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.
- pulumiLabels Map<String>
- The combination of labels configured directly on the resource and default labels configured on the provider.
- 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:23Zand2014-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-betaTerraform Provider.