1. Packages
  2. Edgecenter Provider
  3. API Docs
  4. getSubnet
edgecenter 0.7.34 published on Monday, Apr 14, 2025 by edge-center

edgecenter.getSubnet

Explore with Pulumi AI

edgecenter 0.7.34 published on Monday, Apr 14, 2025 by edge-center

Example Usage

import * as pulumi from "@pulumi/pulumi";
import * as edgecenter from "@pulumi/edgecenter";

const pr = edgecenter.getProject({
    name: "test",
});
const rg = edgecenter.getRegion({
    name: "ED-10 Preprod",
});
const tsn = Promise.all([rg, pr]).then(([rg, pr]) => edgecenter.getSubnet({
    name: "subtest",
    regionId: rg.id,
    projectId: pr.id,
}));
export const view = tsn;
Copy
import pulumi
import pulumi_edgecenter as edgecenter

pr = edgecenter.get_project(name="test")
rg = edgecenter.get_region(name="ED-10 Preprod")
tsn = edgecenter.get_subnet(name="subtest",
    region_id=rg.id,
    project_id=pr.id)
pulumi.export("view", tsn)
Copy
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 {
		pr, err := edgecenter.LookupProject(ctx, &edgecenter.LookupProjectArgs{
			Name: pulumi.StringRef("test"),
		}, nil)
		if err != nil {
			return err
		}
		rg, err := edgecenter.GetRegion(ctx, &edgecenter.GetRegionArgs{
			Name: "ED-10 Preprod",
		}, nil)
		if err != nil {
			return err
		}
		tsn, err := edgecenter.LookupSubnet(ctx, &edgecenter.LookupSubnetArgs{
			Name:      "subtest",
			RegionId:  pulumi.Float64Ref(rg.Id),
			ProjectId: pulumi.Float64Ref(pr.Id),
		}, nil)
		if err != nil {
			return err
		}
		ctx.Export("view", tsn)
		return nil
	})
}
Copy
using System.Collections.Generic;
using System.Linq;
using Pulumi;
using Edgecenter = Pulumi.Edgecenter;

return await Deployment.RunAsync(() => 
{
    var pr = Edgecenter.GetProject.Invoke(new()
    {
        Name = "test",
    });

    var rg = Edgecenter.GetRegion.Invoke(new()
    {
        Name = "ED-10 Preprod",
    });

    var tsn = Edgecenter.GetSubnet.Invoke(new()
    {
        Name = "subtest",
        RegionId = rg.Apply(getRegionResult => getRegionResult.Id),
        ProjectId = pr.Apply(getProjectResult => getProjectResult.Id),
    });

    return new Dictionary<string, object?>
    {
        ["view"] = tsn,
    };
});
Copy
package generated_program;

import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.edgecenter.EdgecenterFunctions;
import com.pulumi.edgecenter.inputs.GetProjectArgs;
import com.pulumi.edgecenter.inputs.GetRegionArgs;
import com.pulumi.edgecenter.inputs.GetSubnetArgs;
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) {
        final var pr = EdgecenterFunctions.getProject(GetProjectArgs.builder()
            .name("test")
            .build());

        final var rg = EdgecenterFunctions.getRegion(GetRegionArgs.builder()
            .name("ED-10 Preprod")
            .build());

        final var tsn = EdgecenterFunctions.getSubnet(GetSubnetArgs.builder()
            .name("subtest")
            .regionId(rg.applyValue(getRegionResult -> getRegionResult.id()))
            .projectId(pr.applyValue(getProjectResult -> getProjectResult.id()))
            .build());

        ctx.export("view", tsn.applyValue(getSubnetResult -> getSubnetResult));
    }
}
Copy
variables:
  pr:
    fn::invoke:
      function: edgecenter:getProject
      arguments:
        name: test
  rg:
    fn::invoke:
      function: edgecenter:getRegion
      arguments:
        name: ED-10 Preprod
  tsn:
    fn::invoke:
      function: edgecenter:getSubnet
      arguments:
        name: subtest
        regionId: ${rg.id}
        projectId: ${pr.id}
outputs:
  view: ${tsn}
Copy

Using getSubnet

Two invocation forms are available. The direct form accepts plain arguments and either blocks until the result value is available, or returns a Promise-wrapped result. The output form accepts Input-wrapped arguments and returns an Output-wrapped result.

function getSubnet(args: GetSubnetArgs, opts?: InvokeOptions): Promise<GetSubnetResult>
function getSubnetOutput(args: GetSubnetOutputArgs, opts?: InvokeOptions): Output<GetSubnetResult>
Copy
def get_subnet(id: Optional[str] = None,
               metadata_k: Optional[str] = None,
               metadata_kv: Optional[Mapping[str, str]] = 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,
               opts: Optional[InvokeOptions] = None) -> GetSubnetResult
def get_subnet_output(id: Optional[pulumi.Input[str]] = None,
               metadata_k: Optional[pulumi.Input[str]] = None,
               metadata_kv: Optional[pulumi.Input[Mapping[str, pulumi.Input[str]]]] = None,
               name: Optional[pulumi.Input[str]] = None,
               network_id: Optional[pulumi.Input[str]] = None,
               project_id: Optional[pulumi.Input[float]] = None,
               project_name: Optional[pulumi.Input[str]] = None,
               region_id: Optional[pulumi.Input[float]] = None,
               region_name: Optional[pulumi.Input[str]] = None,
               opts: Optional[InvokeOptions] = None) -> Output[GetSubnetResult]
Copy
func LookupSubnet(ctx *Context, args *LookupSubnetArgs, opts ...InvokeOption) (*LookupSubnetResult, error)
func LookupSubnetOutput(ctx *Context, args *LookupSubnetOutputArgs, opts ...InvokeOption) LookupSubnetResultOutput
Copy

> Note: This function is named LookupSubnet in the Go SDK.

public static class GetSubnet 
{
    public static Task<GetSubnetResult> InvokeAsync(GetSubnetArgs args, InvokeOptions? opts = null)
    public static Output<GetSubnetResult> Invoke(GetSubnetInvokeArgs args, InvokeOptions? opts = null)
}
Copy
public static CompletableFuture<GetSubnetResult> getSubnet(GetSubnetArgs args, InvokeOptions options)
public static Output<GetSubnetResult> getSubnet(GetSubnetArgs args, InvokeOptions options)
Copy
fn::invoke:
  function: edgecenter:index/getSubnet:getSubnet
  arguments:
    # arguments dictionary
Copy

The following arguments are supported:

Name This property is required. string
The name of the subnet.
Id string
The ID of this resource.
MetadataK string
Filtration query opts (only key).
MetadataKv Dictionary<string, string>
Filtration query opts, for example, {offset = "10", limit = "10"}
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.
Name This property is required. string
The name of the subnet.
Id string
The ID of this resource.
MetadataK string
Filtration query opts (only key).
MetadataKv map[string]string
Filtration query opts, for example, {offset = "10", limit = "10"}
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.
name This property is required. String
The name of the subnet.
id String
The ID of this resource.
metadataK String
Filtration query opts (only key).
metadataKv Map<String,String>
Filtration query opts, for example, {offset = "10", limit = "10"}
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.
name This property is required. string
The name of the subnet.
id string
The ID of this resource.
metadataK string
Filtration query opts (only key).
metadataKv {[key: string]: string}
Filtration query opts, for example, {offset = "10", limit = "10"}
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.
name This property is required. str
The name of the subnet.
id str
The ID of this resource.
metadata_k str
Filtration query opts (only key).
metadata_kv Mapping[str, str]
Filtration query opts, for example, {offset = "10", limit = "10"}
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.
name This property is required. String
The name of the subnet.
id String
The ID of this resource.
metadataK String
Filtration query opts (only key).
metadataKv Map<String>
Filtration query opts, for example, {offset = "10", limit = "10"}
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.

getSubnet Result

The following output properties are available:

AllocationPools List<GetSubnetAllocationPool>
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.
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.
HostRoutes List<GetSubnetHostRoute>
List of additional routes to be added to instances that are part of this subnet.
Id string
The ID of this resource.
MetadataReadOnlies List<GetSubnetMetadataReadOnly>
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.
MetadataK string
Filtration query opts (only key).
MetadataKv Dictionary<string, string>
Filtration query opts, for example, {offset = "10", limit = "10"}
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.
AllocationPools []GetSubnetAllocationPool
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.
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.
HostRoutes []GetSubnetHostRoute
List of additional routes to be added to instances that are part of this subnet.
Id string
The ID of this resource.
MetadataReadOnlies []GetSubnetMetadataReadOnly
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.
MetadataK string
Filtration query opts (only key).
MetadataKv map[string]string
Filtration query opts, for example, {offset = "10", limit = "10"}
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.
allocationPools List<GetSubnetAllocationPool>
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.
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.
hostRoutes List<GetSubnetHostRoute>
List of additional routes to be added to instances that are part of this subnet.
id String
The ID of this resource.
metadataReadOnlies List<GetSubnetMetadataReadOnly>
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.
metadataK String
Filtration query opts (only key).
metadataKv Map<String,String>
Filtration query opts, for example, {offset = "10", limit = "10"}
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.
allocationPools GetSubnetAllocationPool[]
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.
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.
hostRoutes GetSubnetHostRoute[]
List of additional routes to be added to instances that are part of this subnet.
id string
The ID of this resource.
metadataReadOnlies GetSubnetMetadataReadOnly[]
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.
metadataK string
Filtration query opts (only key).
metadataKv {[key: string]: string}
Filtration query opts, for example, {offset = "10", limit = "10"}
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.
allocation_pools Sequence[GetSubnetAllocationPool]
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.
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.
host_routes Sequence[GetSubnetHostRoute]
List of additional routes to be added to instances that are part of this subnet.
id str
The ID of this resource.
metadata_read_onlies Sequence[GetSubnetMetadataReadOnly]
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.
metadata_k str
Filtration query opts (only key).
metadata_kv Mapping[str, str]
Filtration query opts, for example, {offset = "10", limit = "10"}
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.
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.
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.
hostRoutes List<Property Map>
List of additional routes to be added to instances that are part of this subnet.
id String
The ID of this resource.
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.
metadataK String
Filtration query opts (only key).
metadataKv Map<String>
Filtration query opts, for example, {offset = "10", limit = "10"}
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.

Supporting Types

GetSubnetAllocationPool

End This property is required. string
Start This property is required. string
End This property is required. string
Start This property is required. string
end This property is required. String
start This property is required. String
end This property is required. string
start This property is required. string
end This property is required. str
start This property is required. str
end This property is required. String
start This property is required. String

GetSubnetHostRoute

Destination This property is required. string
Nexthop This property is required. string
Destination This property is required. string
Nexthop This property is required. string
destination This property is required. String
nexthop This property is required. String
destination This property is required. string
nexthop This property is required. string
destination This property is required. str
nexthop This property is required. str
destination This property is required. String
nexthop This property is required. String

GetSubnetMetadataReadOnly

Key This property is required. string
ReadOnly This property is required. bool
Value This property is required. string
Key This property is required. string
ReadOnly This property is required. bool
Value This property is required. string
key This property is required. String
readOnly This property is required. Boolean
value This property is required. String
key This property is required. string
readOnly This property is required. boolean
value This property is required. string
key This property is required. str
read_only This property is required. bool
value This property is required. str
key This property is required. String
readOnly This property is required. Boolean
value This property is required. String

Package Details

Repository
edgecenter edge-center/terraform-provider-edgecenter
License
Notes
This Pulumi package is based on the edgecenter Terraform Provider.
edgecenter 0.7.34 published on Monday, Apr 14, 2025 by edge-center