1. Packages
  2. Edgecenter Provider
  3. API Docs
  4. Subnet
edgecenter 0.8.0 published on Wednesday, Apr 30, 2025 by edge-center

edgecenter.Subnet

Explore with Pulumi AI

edgecenter logo
edgecenter 0.8.0 published on Wednesday, Apr 30, 2025 by edge-center

    Represent subnets. Subnetwork is a range of IP addresses in a cloud network. Addresses from this range will be assigned to machines in the cloud.

    Example Usage

    import * as pulumi from "@pulumi/pulumi";
    import * as edgecenter from "@pulumi/edgecenter";
    
    const network = new edgecenter.Network("network", {
        type: "vxlan",
        regionId: 1,
        projectId: 1,
    });
    const subnet = new edgecenter.Subnet("subnet", {
        cidr: "192.168.10.0/24",
        networkId: network.networkId,
        dnsNameservers: [
            "8.8.4.4",
            "1.1.1.1",
        ],
        enableDhcp: true,
        hostRoutes: [
            {
                destination: "10.0.3.0/24",
                nexthop: "10.0.0.13",
            },
            {
                destination: "10.0.4.0/24",
                nexthop: "10.0.0.14",
            },
        ],
        allocationPools: [{
            start: "192.168.10.20",
            end: "192.168.10.50",
        }],
        gatewayIp: "192.168.10.1",
        regionId: 1,
        projectId: 1,
    });
    
    import pulumi
    import pulumi_edgecenter as edgecenter
    
    network = edgecenter.Network("network",
        type="vxlan",
        region_id=1,
        project_id=1)
    subnet = edgecenter.Subnet("subnet",
        cidr="192.168.10.0/24",
        network_id=network.network_id,
        dns_nameservers=[
            "8.8.4.4",
            "1.1.1.1",
        ],
        enable_dhcp=True,
        host_routes=[
            {
                "destination": "10.0.3.0/24",
                "nexthop": "10.0.0.13",
            },
            {
                "destination": "10.0.4.0/24",
                "nexthop": "10.0.0.14",
            },
        ],
        allocation_pools=[{
            "start": "192.168.10.20",
            "end": "192.168.10.50",
        }],
        gateway_ip="192.168.10.1",
        region_id=1,
        project_id=1)
    
    package main
    
    import (
    	"github.com/pulumi/pulumi-terraform-provider/sdks/go/edgecenter/edgecenter"
    	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
    )
    
    func main() {
    	pulumi.Run(func(ctx *pulumi.Context) error {
    		network, err := edgecenter.NewNetwork(ctx, "network", &edgecenter.NetworkArgs{
    			Type:      pulumi.String("vxlan"),
    			RegionId:  pulumi.Float64(1),
    			ProjectId: pulumi.Float64(1),
    		})
    		if err != nil {
    			return err
    		}
    		_, err = edgecenter.NewSubnet(ctx, "subnet", &edgecenter.SubnetArgs{
    			Cidr:      pulumi.String("192.168.10.0/24"),
    			NetworkId: network.NetworkId,
    			DnsNameservers: pulumi.StringArray{
    				pulumi.String("8.8.4.4"),
    				pulumi.String("1.1.1.1"),
    			},
    			EnableDhcp: pulumi.Bool(true),
    			HostRoutes: edgecenter.SubnetHostRouteArray{
    				&edgecenter.SubnetHostRouteArgs{
    					Destination: pulumi.String("10.0.3.0/24"),
    					Nexthop:     pulumi.String("10.0.0.13"),
    				},
    				&edgecenter.SubnetHostRouteArgs{
    					Destination: pulumi.String("10.0.4.0/24"),
    					Nexthop:     pulumi.String("10.0.0.14"),
    				},
    			},
    			AllocationPools: edgecenter.SubnetAllocationPoolArray{
    				&edgecenter.SubnetAllocationPoolArgs{
    					Start: pulumi.String("192.168.10.20"),
    					End:   pulumi.String("192.168.10.50"),
    				},
    			},
    			GatewayIp: pulumi.String("192.168.10.1"),
    			RegionId:  pulumi.Float64(1),
    			ProjectId: pulumi.Float64(1),
    		})
    		if err != nil {
    			return err
    		}
    		return nil
    	})
    }
    
    using System.Collections.Generic;
    using System.Linq;
    using Pulumi;
    using Edgecenter = Pulumi.Edgecenter;
    
    return await Deployment.RunAsync(() => 
    {
        var network = new Edgecenter.Network("network", new()
        {
            Type = "vxlan",
            RegionId = 1,
            ProjectId = 1,
        });
    
        var subnet = new Edgecenter.Subnet("subnet", new()
        {
            Cidr = "192.168.10.0/24",
            NetworkId = network.NetworkId,
            DnsNameservers = new[]
            {
                "8.8.4.4",
                "1.1.1.1",
            },
            EnableDhcp = true,
            HostRoutes = new[]
            {
                new Edgecenter.Inputs.SubnetHostRouteArgs
                {
                    Destination = "10.0.3.0/24",
                    Nexthop = "10.0.0.13",
                },
                new Edgecenter.Inputs.SubnetHostRouteArgs
                {
                    Destination = "10.0.4.0/24",
                    Nexthop = "10.0.0.14",
                },
            },
            AllocationPools = new[]
            {
                new Edgecenter.Inputs.SubnetAllocationPoolArgs
                {
                    Start = "192.168.10.20",
                    End = "192.168.10.50",
                },
            },
            GatewayIp = "192.168.10.1",
            RegionId = 1,
            ProjectId = 1,
        });
    
    });
    
    package generated_program;
    
    import com.pulumi.Context;
    import com.pulumi.Pulumi;
    import com.pulumi.core.Output;
    import com.pulumi.edgecenter.Network;
    import com.pulumi.edgecenter.NetworkArgs;
    import com.pulumi.edgecenter.Subnet;
    import com.pulumi.edgecenter.SubnetArgs;
    import com.pulumi.edgecenter.inputs.SubnetHostRouteArgs;
    import com.pulumi.edgecenter.inputs.SubnetAllocationPoolArgs;
    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 network = new Network("network", NetworkArgs.builder()
                .type("vxlan")
                .regionId(1)
                .projectId(1)
                .build());
    
            var subnet = new Subnet("subnet", SubnetArgs.builder()
                .cidr("192.168.10.0/24")
                .networkId(network.networkId())
                .dnsNameservers(            
                    "8.8.4.4",
                    "1.1.1.1")
                .enableDhcp(true)
                .hostRoutes(            
                    SubnetHostRouteArgs.builder()
                        .destination("10.0.3.0/24")
                        .nexthop("10.0.0.13")
                        .build(),
                    SubnetHostRouteArgs.builder()
                        .destination("10.0.4.0/24")
                        .nexthop("10.0.0.14")
                        .build())
                .allocationPools(SubnetAllocationPoolArgs.builder()
                    .start("192.168.10.20")
                    .end("192.168.10.50")
                    .build())
                .gatewayIp("192.168.10.1")
                .regionId(1)
                .projectId(1)
                .build());
    
        }
    }
    
    resources:
      network:
        type: edgecenter:Network
        properties:
          type: vxlan
          regionId: 1
          projectId: 1
      subnet:
        type: edgecenter:Subnet
        properties:
          cidr: 192.168.10.0/24
          networkId: ${network.networkId}
          dnsNameservers:
            - 8.8.4.4
            - 1.1.1.1
          enableDhcp: true
          hostRoutes:
            - destination: 10.0.3.0/24
              nexthop: 10.0.0.13
            - destination: 10.0.4.0/24
              nexthop: 10.0.0.14
          allocationPools:
            - start: 192.168.10.20
              end: 192.168.10.50
          gatewayIp: 192.168.10.1
          regionId: 1
          projectId: 1
    

    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,
               network_id: Optional[str] = None,
               cidr: Optional[str] = None,
               dns_nameservers: Optional[Sequence[str]] = None,
               allocation_pools: Optional[Sequence[SubnetAllocationPoolArgs]] = None,
               enable_dhcp: Optional[bool] = None,
               gateway_ip: Optional[str] = None,
               host_routes: Optional[Sequence[SubnetHostRouteArgs]] = None,
               metadata_map: Optional[Mapping[str, str]] = None,
               name: Optional[str] = None,
               connect_to_network_router: Optional[bool] = None,
               project_id: Optional[float] = None,
               project_name: Optional[str] = None,
               region_id: Optional[float] = None,
               region_name: Optional[str] = None,
               subnet_id: Optional[str] = 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: edgecenter: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 Edgecenter.Subnet("subnetResource", new()
    {
        NetworkId = "string",
        Cidr = "string",
        DnsNameservers = new[]
        {
            "string",
        },
        AllocationPools = new[]
        {
            new Edgecenter.Inputs.SubnetAllocationPoolArgs
            {
                End = "string",
                Start = "string",
            },
        },
        EnableDhcp = false,
        GatewayIp = "string",
        HostRoutes = new[]
        {
            new Edgecenter.Inputs.SubnetHostRouteArgs
            {
                Destination = "string",
                Nexthop = "string",
            },
        },
        MetadataMap = 
        {
            { "string", "string" },
        },
        Name = "string",
        ConnectToNetworkRouter = false,
        ProjectId = 0,
        ProjectName = "string",
        RegionId = 0,
        RegionName = "string",
        SubnetId = "string",
    });
    
    example, err := edgecenter.NewSubnet(ctx, "subnetResource", &edgecenter.SubnetArgs{
    	NetworkId: pulumi.String("string"),
    	Cidr:      pulumi.String("string"),
    	DnsNameservers: pulumi.StringArray{
    		pulumi.String("string"),
    	},
    	AllocationPools: edgecenter.SubnetAllocationPoolArray{
    		&edgecenter.SubnetAllocationPoolArgs{
    			End:   pulumi.String("string"),
    			Start: pulumi.String("string"),
    		},
    	},
    	EnableDhcp: pulumi.Bool(false),
    	GatewayIp:  pulumi.String("string"),
    	HostRoutes: edgecenter.SubnetHostRouteArray{
    		&edgecenter.SubnetHostRouteArgs{
    			Destination: pulumi.String("string"),
    			Nexthop:     pulumi.String("string"),
    		},
    	},
    	MetadataMap: pulumi.StringMap{
    		"string": pulumi.String("string"),
    	},
    	Name:                   pulumi.String("string"),
    	ConnectToNetworkRouter: pulumi.Bool(false),
    	ProjectId:              pulumi.Float64(0),
    	ProjectName:            pulumi.String("string"),
    	RegionId:               pulumi.Float64(0),
    	RegionName:             pulumi.String("string"),
    	SubnetId:               pulumi.String("string"),
    })
    
    var subnetResource = new Subnet("subnetResource", SubnetArgs.builder()
        .networkId("string")
        .cidr("string")
        .dnsNameservers("string")
        .allocationPools(SubnetAllocationPoolArgs.builder()
            .end("string")
            .start("string")
            .build())
        .enableDhcp(false)
        .gatewayIp("string")
        .hostRoutes(SubnetHostRouteArgs.builder()
            .destination("string")
            .nexthop("string")
            .build())
        .metadataMap(Map.of("string", "string"))
        .name("string")
        .connectToNetworkRouter(false)
        .projectId(0)
        .projectName("string")
        .regionId(0)
        .regionName("string")
        .subnetId("string")
        .build());
    
    subnet_resource = edgecenter.Subnet("subnetResource",
        network_id="string",
        cidr="string",
        dns_nameservers=["string"],
        allocation_pools=[{
            "end": "string",
            "start": "string",
        }],
        enable_dhcp=False,
        gateway_ip="string",
        host_routes=[{
            "destination": "string",
            "nexthop": "string",
        }],
        metadata_map={
            "string": "string",
        },
        name="string",
        connect_to_network_router=False,
        project_id=0,
        project_name="string",
        region_id=0,
        region_name="string",
        subnet_id="string")
    
    const subnetResource = new edgecenter.Subnet("subnetResource", {
        networkId: "string",
        cidr: "string",
        dnsNameservers: ["string"],
        allocationPools: [{
            end: "string",
            start: "string",
        }],
        enableDhcp: false,
        gatewayIp: "string",
        hostRoutes: [{
            destination: "string",
            nexthop: "string",
        }],
        metadataMap: {
            string: "string",
        },
        name: "string",
        connectToNetworkRouter: false,
        projectId: 0,
        projectName: "string",
        regionId: 0,
        regionName: "string",
        subnetId: "string",
    });
    
    type: edgecenter:Subnet
    properties:
        allocationPools:
            - end: string
              start: string
        cidr: string
        connectToNetworkRouter: false
        dnsNameservers:
            - string
        enableDhcp: false
        gatewayIp: string
        hostRoutes:
            - destination: string
              nexthop: string
        metadataMap:
            string: string
        name: string
        networkId: string
        projectId: 0
        projectName: string
        regionId: 0
        regionName: string
        subnetId: 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:

    Cidr string
    Represents the IP address range of the subnet.
    NetworkId string
    The ID of the network to which this subnet belongs.
    AllocationPools List<SubnetAllocationPool>
    A list of allocation pools for DHCP. If omitted but DHCP or gateway settings are changed on update, pools are automatically reassigned.
    ConnectToNetworkRouter bool
    True if the network's router should get a gateway in this subnet. Must be explicitly 'false' when gateway_ip is null. Default true.
    DnsNameservers List<string>
    List of DNS name servers for the subnet.
    EnableDhcp bool
    Enable DHCP for this subnet. If true, DHCP will be used to assign IP addresses to instances within this subnet.
    GatewayIp string
    The IP address of the gateway for this subnet. The subnet will be recreated if the gateway IP is changed.
    HostRoutes List<SubnetHostRoute>
    List of additional routes to be added to instances that are part of this subnet.
    MetadataMap Dictionary<string, string>
    A map containing metadata, for example tags.
    Name string
    The name of the subnet.
    ProjectId double
    The uuid of the project. Either 'projectid' or 'projectname' must be specified.
    ProjectName string
    The name of the project. Either 'projectid' or 'projectname' must be specified.
    RegionId double
    The uuid of the region. Either 'regionid' or 'regionname' must be specified.
    RegionName string
    The name of the region. Either 'regionid' or 'regionname' must be specified.
    SubnetId string
    The ID of this resource.
    Cidr string
    Represents the IP address range of the subnet.
    NetworkId string
    The ID of the network to which this subnet belongs.
    AllocationPools []SubnetAllocationPoolArgs
    A list of allocation pools for DHCP. If omitted but DHCP or gateway settings are changed on update, pools are automatically reassigned.
    ConnectToNetworkRouter bool
    True if the network's router should get a gateway in this subnet. Must be explicitly 'false' when gateway_ip is null. Default true.
    DnsNameservers []string
    List of DNS name servers for the subnet.
    EnableDhcp bool
    Enable DHCP for this subnet. If true, DHCP will be used to assign IP addresses to instances within this subnet.
    GatewayIp string
    The IP address of the gateway for this subnet. The subnet will be recreated if the gateway IP is changed.
    HostRoutes []SubnetHostRouteArgs
    List of additional routes to be added to instances that are part of this subnet.
    MetadataMap map[string]string
    A map containing metadata, for example tags.
    Name string
    The name of the subnet.
    ProjectId float64
    The uuid of the project. Either 'projectid' or 'projectname' must be specified.
    ProjectName string
    The name of the project. Either 'projectid' or 'projectname' must be specified.
    RegionId float64
    The uuid of the region. Either 'regionid' or 'regionname' must be specified.
    RegionName string
    The name of the region. Either 'regionid' or 'regionname' must be specified.
    SubnetId string
    The ID of this resource.
    cidr String
    Represents the IP address range of the subnet.
    networkId String
    The ID of the network to which this subnet belongs.
    allocationPools List<SubnetAllocationPool>
    A list of allocation pools for DHCP. If omitted but DHCP or gateway settings are changed on update, pools are automatically reassigned.
    connectToNetworkRouter Boolean
    True if the network's router should get a gateway in this subnet. Must be explicitly 'false' when gateway_ip is null. Default true.
    dnsNameservers List<String>
    List of DNS name servers for the subnet.
    enableDhcp Boolean
    Enable DHCP for this subnet. If true, DHCP will be used to assign IP addresses to instances within this subnet.
    gatewayIp String
    The IP address of the gateway for this subnet. The subnet will be recreated if the gateway IP is changed.
    hostRoutes List<SubnetHostRoute>
    List of additional routes to be added to instances that are part of this subnet.
    metadataMap Map<String,String>
    A map containing metadata, for example tags.
    name String
    The name of the subnet.
    projectId Double
    The uuid of the project. Either 'projectid' or 'projectname' must be specified.
    projectName String
    The name of the project. Either 'projectid' or 'projectname' must be specified.
    regionId Double
    The uuid of the region. Either 'regionid' or 'regionname' must be specified.
    regionName String
    The name of the region. Either 'regionid' or 'regionname' must be specified.
    subnetId String
    The ID of this resource.
    cidr string
    Represents the IP address range of the subnet.
    networkId string
    The ID of the network to which this subnet belongs.
    allocationPools SubnetAllocationPool[]
    A list of allocation pools for DHCP. If omitted but DHCP or gateway settings are changed on update, pools are automatically reassigned.
    connectToNetworkRouter boolean
    True if the network's router should get a gateway in this subnet. Must be explicitly 'false' when gateway_ip is null. Default true.
    dnsNameservers string[]
    List of DNS name servers for the subnet.
    enableDhcp boolean
    Enable DHCP for this subnet. If true, DHCP will be used to assign IP addresses to instances within this subnet.
    gatewayIp string
    The IP address of the gateway for this subnet. The subnet will be recreated if the gateway IP is changed.
    hostRoutes SubnetHostRoute[]
    List of additional routes to be added to instances that are part of this subnet.
    metadataMap {[key: string]: string}
    A map containing metadata, for example tags.
    name string
    The name of the subnet.
    projectId number
    The uuid of the project. Either 'projectid' or 'projectname' must be specified.
    projectName string
    The name of the project. Either 'projectid' or 'projectname' must be specified.
    regionId number
    The uuid of the region. Either 'regionid' or 'regionname' must be specified.
    regionName string
    The name of the region. Either 'regionid' or 'regionname' must be specified.
    subnetId string
    The ID of this resource.
    cidr str
    Represents the IP address range of the subnet.
    network_id str
    The ID of the network to which this subnet belongs.
    allocation_pools Sequence[SubnetAllocationPoolArgs]
    A list of allocation pools for DHCP. If omitted but DHCP or gateway settings are changed on update, pools are automatically reassigned.
    connect_to_network_router bool
    True if the network's router should get a gateway in this subnet. Must be explicitly 'false' when gateway_ip is null. Default true.
    dns_nameservers Sequence[str]
    List of DNS name servers for the subnet.
    enable_dhcp bool
    Enable DHCP for this subnet. If true, DHCP will be used to assign IP addresses to instances within this subnet.
    gateway_ip str
    The IP address of the gateway for this subnet. The subnet will be recreated if the gateway IP is changed.
    host_routes Sequence[SubnetHostRouteArgs]
    List of additional routes to be added to instances that are part of this subnet.
    metadata_map Mapping[str, str]
    A map containing metadata, for example tags.
    name str
    The name of the subnet.
    project_id float
    The uuid of the project. Either 'projectid' or 'projectname' must be specified.
    project_name str
    The name of the project. Either 'projectid' or 'projectname' must be specified.
    region_id float
    The uuid of the region. Either 'regionid' or 'regionname' must be specified.
    region_name str
    The name of the region. Either 'regionid' or 'regionname' must be specified.
    subnet_id str
    The ID of this resource.
    cidr String
    Represents the IP address range of the subnet.
    networkId String
    The ID of the network to which this subnet belongs.
    allocationPools List<Property Map>
    A list of allocation pools for DHCP. If omitted but DHCP or gateway settings are changed on update, pools are automatically reassigned.
    connectToNetworkRouter Boolean
    True if the network's router should get a gateway in this subnet. Must be explicitly 'false' when gateway_ip is null. Default true.
    dnsNameservers List<String>
    List of DNS name servers for the subnet.
    enableDhcp Boolean
    Enable DHCP for this subnet. If true, DHCP will be used to assign IP addresses to instances within this subnet.
    gatewayIp String
    The IP address of the gateway for this subnet. The subnet will be recreated if the gateway IP is changed.
    hostRoutes List<Property Map>
    List of additional routes to be added to instances that are part of this subnet.
    metadataMap Map<String>
    A map containing metadata, for example tags.
    name String
    The name of the subnet.
    projectId Number
    The uuid of the project. Either 'projectid' or 'projectname' must be specified.
    projectName String
    The name of the project. Either 'projectid' or 'projectname' must be specified.
    regionId Number
    The uuid of the region. Either 'regionid' or 'regionname' must be specified.
    regionName String
    The name of the region. Either 'regionid' or 'regionname' must be specified.
    subnetId String
    The ID of this resource.

    Outputs

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

    Id string
    The provider-assigned unique ID for this managed resource.
    LastUpdated string
    The timestamp of the last update (use with update context).
    MetadataReadOnlies List<SubnetMetadataReadOnly>
    A list of read-only metadata items, e.g. tags.
    Id string
    The provider-assigned unique ID for this managed resource.
    LastUpdated string
    The timestamp of the last update (use with update context).
    MetadataReadOnlies []SubnetMetadataReadOnly
    A list of read-only metadata items, e.g. tags.
    id String
    The provider-assigned unique ID for this managed resource.
    lastUpdated String
    The timestamp of the last update (use with update context).
    metadataReadOnlies List<SubnetMetadataReadOnly>
    A list of read-only metadata items, e.g. tags.
    id string
    The provider-assigned unique ID for this managed resource.
    lastUpdated string
    The timestamp of the last update (use with update context).
    metadataReadOnlies SubnetMetadataReadOnly[]
    A list of read-only metadata items, e.g. tags.
    id str
    The provider-assigned unique ID for this managed resource.
    last_updated str
    The timestamp of the last update (use with update context).
    metadata_read_onlies Sequence[SubnetMetadataReadOnly]
    A list of read-only metadata items, e.g. tags.
    id String
    The provider-assigned unique ID for this managed resource.
    lastUpdated String
    The timestamp of the last update (use with update context).
    metadataReadOnlies List<Property Map>
    A list of read-only metadata items, e.g. tags.

    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,
            allocation_pools: Optional[Sequence[SubnetAllocationPoolArgs]] = None,
            cidr: Optional[str] = None,
            connect_to_network_router: Optional[bool] = None,
            dns_nameservers: Optional[Sequence[str]] = None,
            enable_dhcp: Optional[bool] = None,
            gateway_ip: Optional[str] = None,
            host_routes: Optional[Sequence[SubnetHostRouteArgs]] = None,
            last_updated: Optional[str] = None,
            metadata_map: Optional[Mapping[str, str]] = None,
            metadata_read_onlies: Optional[Sequence[SubnetMetadataReadOnlyArgs]] = None,
            name: Optional[str] = None,
            network_id: Optional[str] = None,
            project_id: Optional[float] = None,
            project_name: Optional[str] = None,
            region_id: Optional[float] = None,
            region_name: Optional[str] = None,
            subnet_id: 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)
    resources:  _:    type: edgecenter: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.
    The following state arguments are supported:
    AllocationPools List<SubnetAllocationPool>
    A list of allocation pools for DHCP. If omitted but DHCP or gateway settings are changed on update, pools are automatically reassigned.
    Cidr string
    Represents the IP address range of the subnet.
    ConnectToNetworkRouter bool
    True if the network's router should get a gateway in this subnet. Must be explicitly 'false' when gateway_ip is null. Default true.
    DnsNameservers List<string>
    List of DNS name servers for the subnet.
    EnableDhcp bool
    Enable DHCP for this subnet. If true, DHCP will be used to assign IP addresses to instances within this subnet.
    GatewayIp string
    The IP address of the gateway for this subnet. The subnet will be recreated if the gateway IP is changed.
    HostRoutes List<SubnetHostRoute>
    List of additional routes to be added to instances that are part of this subnet.
    LastUpdated string
    The timestamp of the last update (use with update context).
    MetadataMap Dictionary<string, string>
    A map containing metadata, for example tags.
    MetadataReadOnlies List<SubnetMetadataReadOnly>
    A list of read-only metadata items, e.g. tags.
    Name string
    The name of the subnet.
    NetworkId string
    The ID of the network to which this subnet belongs.
    ProjectId double
    The uuid of the project. Either 'projectid' or 'projectname' must be specified.
    ProjectName string
    The name of the project. Either 'projectid' or 'projectname' must be specified.
    RegionId double
    The uuid of the region. Either 'regionid' or 'regionname' must be specified.
    RegionName string
    The name of the region. Either 'regionid' or 'regionname' must be specified.
    SubnetId string
    The ID of this resource.
    AllocationPools []SubnetAllocationPoolArgs
    A list of allocation pools for DHCP. If omitted but DHCP or gateway settings are changed on update, pools are automatically reassigned.
    Cidr string
    Represents the IP address range of the subnet.
    ConnectToNetworkRouter bool
    True if the network's router should get a gateway in this subnet. Must be explicitly 'false' when gateway_ip is null. Default true.
    DnsNameservers []string
    List of DNS name servers for the subnet.
    EnableDhcp bool
    Enable DHCP for this subnet. If true, DHCP will be used to assign IP addresses to instances within this subnet.
    GatewayIp string
    The IP address of the gateway for this subnet. The subnet will be recreated if the gateway IP is changed.
    HostRoutes []SubnetHostRouteArgs
    List of additional routes to be added to instances that are part of this subnet.
    LastUpdated string
    The timestamp of the last update (use with update context).
    MetadataMap map[string]string
    A map containing metadata, for example tags.
    MetadataReadOnlies []SubnetMetadataReadOnlyArgs
    A list of read-only metadata items, e.g. tags.
    Name string
    The name of the subnet.
    NetworkId string
    The ID of the network to which this subnet belongs.
    ProjectId float64
    The uuid of the project. Either 'projectid' or 'projectname' must be specified.
    ProjectName string
    The name of the project. Either 'projectid' or 'projectname' must be specified.
    RegionId float64
    The uuid of the region. Either 'regionid' or 'regionname' must be specified.
    RegionName string
    The name of the region. Either 'regionid' or 'regionname' must be specified.
    SubnetId string
    The ID of this resource.
    allocationPools List<SubnetAllocationPool>
    A list of allocation pools for DHCP. If omitted but DHCP or gateway settings are changed on update, pools are automatically reassigned.
    cidr String
    Represents the IP address range of the subnet.
    connectToNetworkRouter Boolean
    True if the network's router should get a gateway in this subnet. Must be explicitly 'false' when gateway_ip is null. Default true.
    dnsNameservers List<String>
    List of DNS name servers for the subnet.
    enableDhcp Boolean
    Enable DHCP for this subnet. If true, DHCP will be used to assign IP addresses to instances within this subnet.
    gatewayIp String
    The IP address of the gateway for this subnet. The subnet will be recreated if the gateway IP is changed.
    hostRoutes List<SubnetHostRoute>
    List of additional routes to be added to instances that are part of this subnet.
    lastUpdated String
    The timestamp of the last update (use with update context).
    metadataMap Map<String,String>
    A map containing metadata, for example tags.
    metadataReadOnlies List<SubnetMetadataReadOnly>
    A list of read-only metadata items, e.g. tags.
    name String
    The name of the subnet.
    networkId String
    The ID of the network to which this subnet belongs.
    projectId Double
    The uuid of the project. Either 'projectid' or 'projectname' must be specified.
    projectName String
    The name of the project. Either 'projectid' or 'projectname' must be specified.
    regionId Double
    The uuid of the region. Either 'regionid' or 'regionname' must be specified.
    regionName String
    The name of the region. Either 'regionid' or 'regionname' must be specified.
    subnetId String
    The ID of this resource.
    allocationPools SubnetAllocationPool[]
    A list of allocation pools for DHCP. If omitted but DHCP or gateway settings are changed on update, pools are automatically reassigned.
    cidr string
    Represents the IP address range of the subnet.
    connectToNetworkRouter boolean
    True if the network's router should get a gateway in this subnet. Must be explicitly 'false' when gateway_ip is null. Default true.
    dnsNameservers string[]
    List of DNS name servers for the subnet.
    enableDhcp boolean
    Enable DHCP for this subnet. If true, DHCP will be used to assign IP addresses to instances within this subnet.
    gatewayIp string
    The IP address of the gateway for this subnet. The subnet will be recreated if the gateway IP is changed.
    hostRoutes SubnetHostRoute[]
    List of additional routes to be added to instances that are part of this subnet.
    lastUpdated string
    The timestamp of the last update (use with update context).
    metadataMap {[key: string]: string}
    A map containing metadata, for example tags.
    metadataReadOnlies SubnetMetadataReadOnly[]
    A list of read-only metadata items, e.g. tags.
    name string
    The name of the subnet.
    networkId string
    The ID of the network to which this subnet belongs.
    projectId number
    The uuid of the project. Either 'projectid' or 'projectname' must be specified.
    projectName string
    The name of the project. Either 'projectid' or 'projectname' must be specified.
    regionId number
    The uuid of the region. Either 'regionid' or 'regionname' must be specified.
    regionName string
    The name of the region. Either 'regionid' or 'regionname' must be specified.
    subnetId string
    The ID of this resource.
    allocation_pools Sequence[SubnetAllocationPoolArgs]
    A list of allocation pools for DHCP. If omitted but DHCP or gateway settings are changed on update, pools are automatically reassigned.
    cidr str
    Represents the IP address range of the subnet.
    connect_to_network_router bool
    True if the network's router should get a gateway in this subnet. Must be explicitly 'false' when gateway_ip is null. Default true.
    dns_nameservers Sequence[str]
    List of DNS name servers for the subnet.
    enable_dhcp bool
    Enable DHCP for this subnet. If true, DHCP will be used to assign IP addresses to instances within this subnet.
    gateway_ip str
    The IP address of the gateway for this subnet. The subnet will be recreated if the gateway IP is changed.
    host_routes Sequence[SubnetHostRouteArgs]
    List of additional routes to be added to instances that are part of this subnet.
    last_updated str
    The timestamp of the last update (use with update context).
    metadata_map Mapping[str, str]
    A map containing metadata, for example tags.
    metadata_read_onlies Sequence[SubnetMetadataReadOnlyArgs]
    A list of read-only metadata items, e.g. tags.
    name str
    The name of the subnet.
    network_id str
    The ID of the network to which this subnet belongs.
    project_id float
    The uuid of the project. Either 'projectid' or 'projectname' must be specified.
    project_name str
    The name of the project. Either 'projectid' or 'projectname' must be specified.
    region_id float
    The uuid of the region. Either 'regionid' or 'regionname' must be specified.
    region_name str
    The name of the region. Either 'regionid' or 'regionname' must be specified.
    subnet_id str
    The ID of this resource.
    allocationPools List<Property Map>
    A list of allocation pools for DHCP. If omitted but DHCP or gateway settings are changed on update, pools are automatically reassigned.
    cidr String
    Represents the IP address range of the subnet.
    connectToNetworkRouter Boolean
    True if the network's router should get a gateway in this subnet. Must be explicitly 'false' when gateway_ip is null. Default true.
    dnsNameservers List<String>
    List of DNS name servers for the subnet.
    enableDhcp Boolean
    Enable DHCP for this subnet. If true, DHCP will be used to assign IP addresses to instances within this subnet.
    gatewayIp String
    The IP address of the gateway for this subnet. The subnet will be recreated if the gateway IP is changed.
    hostRoutes List<Property Map>
    List of additional routes to be added to instances that are part of this subnet.
    lastUpdated String
    The timestamp of the last update (use with update context).
    metadataMap Map<String>
    A map containing metadata, for example tags.
    metadataReadOnlies List<Property Map>
    A list of read-only metadata items, e.g. tags.
    name String
    The name of the subnet.
    networkId String
    The ID of the network to which this subnet belongs.
    projectId Number
    The uuid of the project. Either 'projectid' or 'projectname' must be specified.
    projectName String
    The name of the project. Either 'projectid' or 'projectname' must be specified.
    regionId Number
    The uuid of the region. Either 'regionid' or 'regionname' must be specified.
    regionName String
    The name of the region. Either 'regionid' or 'regionname' must be specified.
    subnetId String
    The ID of this resource.

    Supporting Types

    SubnetAllocationPool, SubnetAllocationPoolArgs

    End string
    End IP address.
    Start string
    Start IP address.
    End string
    End IP address.
    Start string
    Start IP address.
    end String
    End IP address.
    start String
    Start IP address.
    end string
    End IP address.
    start string
    Start IP address.
    end str
    End IP address.
    start str
    Start IP address.
    end String
    End IP address.
    start String
    Start IP address.

    SubnetHostRoute, SubnetHostRouteArgs

    Destination string
    The CIDR of the destination IPv4 subnet
    Nexthop string
    IPv4 address to forward traffic to if it's destination IP matches 'destination' CIDR
    Destination string
    The CIDR of the destination IPv4 subnet
    Nexthop string
    IPv4 address to forward traffic to if it's destination IP matches 'destination' CIDR
    destination String
    The CIDR of the destination IPv4 subnet
    nexthop String
    IPv4 address to forward traffic to if it's destination IP matches 'destination' CIDR
    destination string
    The CIDR of the destination IPv4 subnet
    nexthop string
    IPv4 address to forward traffic to if it's destination IP matches 'destination' CIDR
    destination str
    The CIDR of the destination IPv4 subnet
    nexthop str
    IPv4 address to forward traffic to if it's destination IP matches 'destination' CIDR
    destination String
    The CIDR of the destination IPv4 subnet
    nexthop String
    IPv4 address to forward traffic to if it's destination IP matches 'destination' CIDR

    SubnetMetadataReadOnly, SubnetMetadataReadOnlyArgs

    Key string
    ReadOnly bool
    Value string
    Key string
    ReadOnly bool
    Value string
    key String
    readOnly Boolean
    value String
    key string
    readOnly boolean
    value string
    key str
    read_only bool
    value str
    key String
    readOnly Boolean
    value String

    Import

    import using <project_id>:<region_id>:<subnet_id> format

    $ pulumi import edgecenter:index/subnet:Subnet subnet1 1:6:447d2959-8ae0-4ca0-8d47-9f050a3637d7
    

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

    Package Details

    Repository
    edgecenter edge-center/terraform-provider-edgecenter
    License
    Notes
    This Pulumi package is based on the edgecenter Terraform Provider.
    edgecenter logo
    edgecenter 0.8.0 published on Wednesday, Apr 30, 2025 by edge-center