1. Packages
  2. Vkcs Provider
  3. API Docs
  4. getNetworkingSubnet
vkcs 0.9.3 published on Tuesday, Apr 15, 2025 by vk-cs

vkcs.getNetworkingSubnet

Explore with Pulumi AI

vkcs logo
vkcs 0.9.3 published on Tuesday, Apr 15, 2025 by vk-cs

    Use this data source to get the ID of an available VKCS subnet.

    Example Usage

    import * as pulumi from "@pulumi/pulumi";
    import * as vkcs from "@pulumi/vkcs";
    
    const subnetOneOfInternal = vkcs.getNetworkingSubnet({
        cidr: "192.168.199.0/24",
        networkId: vkcs_networking_network.app.id,
    });
    
    import pulumi
    import pulumi_vkcs as vkcs
    
    subnet_one_of_internal = vkcs.get_networking_subnet(cidr="192.168.199.0/24",
        network_id=vkcs_networking_network["app"]["id"])
    
    package main
    
    import (
    	"github.com/pulumi/pulumi-terraform-provider/sdks/go/vkcs/vkcs"
    	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
    )
    
    func main() {
    	pulumi.Run(func(ctx *pulumi.Context) error {
    		_, err := vkcs.LookupNetworkingSubnet(ctx, &vkcs.LookupNetworkingSubnetArgs{
    			Cidr:      pulumi.StringRef("192.168.199.0/24"),
    			NetworkId: pulumi.StringRef(vkcs_networking_network.App.Id),
    		}, nil)
    		if err != nil {
    			return err
    		}
    		return nil
    	})
    }
    
    using System.Collections.Generic;
    using System.Linq;
    using Pulumi;
    using Vkcs = Pulumi.Vkcs;
    
    return await Deployment.RunAsync(() => 
    {
        var subnetOneOfInternal = Vkcs.GetNetworkingSubnet.Invoke(new()
        {
            Cidr = "192.168.199.0/24",
            NetworkId = vkcs_networking_network.App.Id,
        });
    
    });
    
    package generated_program;
    
    import com.pulumi.Context;
    import com.pulumi.Pulumi;
    import com.pulumi.core.Output;
    import com.pulumi.vkcs.VkcsFunctions;
    import com.pulumi.vkcs.inputs.GetNetworkingSubnetArgs;
    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 subnetOneOfInternal = VkcsFunctions.getNetworkingSubnet(GetNetworkingSubnetArgs.builder()
                .cidr("192.168.199.0/24")
                .networkId(vkcs_networking_network.app().id())
                .build());
    
        }
    }
    
    variables:
      subnetOneOfInternal:
        fn::invoke:
          function: vkcs:getNetworkingSubnet
          arguments:
            cidr: 192.168.199.0/24
            networkId: ${vkcs_networking_network.app.id}
    

    Using getNetworkingSubnet

    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 getNetworkingSubnet(args: GetNetworkingSubnetArgs, opts?: InvokeOptions): Promise<GetNetworkingSubnetResult>
    function getNetworkingSubnetOutput(args: GetNetworkingSubnetOutputArgs, opts?: InvokeOptions): Output<GetNetworkingSubnetResult>
    def get_networking_subnet(cidr: Optional[str] = None,
                              description: Optional[str] = None,
                              dhcp_enabled: Optional[bool] = None,
                              gateway_ip: Optional[str] = None,
                              id: Optional[str] = None,
                              name: Optional[str] = None,
                              network_id: Optional[str] = None,
                              region: Optional[str] = None,
                              sdn: Optional[str] = None,
                              subnet_id: Optional[str] = None,
                              subnetpool_id: Optional[str] = None,
                              tags: Optional[Sequence[str]] = None,
                              tenant_id: Optional[str] = None,
                              opts: Optional[InvokeOptions] = None) -> GetNetworkingSubnetResult
    def get_networking_subnet_output(cidr: Optional[pulumi.Input[str]] = None,
                              description: Optional[pulumi.Input[str]] = None,
                              dhcp_enabled: Optional[pulumi.Input[bool]] = None,
                              gateway_ip: Optional[pulumi.Input[str]] = None,
                              id: Optional[pulumi.Input[str]] = None,
                              name: Optional[pulumi.Input[str]] = None,
                              network_id: Optional[pulumi.Input[str]] = None,
                              region: Optional[pulumi.Input[str]] = None,
                              sdn: Optional[pulumi.Input[str]] = None,
                              subnet_id: Optional[pulumi.Input[str]] = None,
                              subnetpool_id: Optional[pulumi.Input[str]] = None,
                              tags: Optional[pulumi.Input[Sequence[pulumi.Input[str]]]] = None,
                              tenant_id: Optional[pulumi.Input[str]] = None,
                              opts: Optional[InvokeOptions] = None) -> Output[GetNetworkingSubnetResult]
    func LookupNetworkingSubnet(ctx *Context, args *LookupNetworkingSubnetArgs, opts ...InvokeOption) (*LookupNetworkingSubnetResult, error)
    func LookupNetworkingSubnetOutput(ctx *Context, args *LookupNetworkingSubnetOutputArgs, opts ...InvokeOption) LookupNetworkingSubnetResultOutput

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

    public static class GetNetworkingSubnet 
    {
        public static Task<GetNetworkingSubnetResult> InvokeAsync(GetNetworkingSubnetArgs args, InvokeOptions? opts = null)
        public static Output<GetNetworkingSubnetResult> Invoke(GetNetworkingSubnetInvokeArgs args, InvokeOptions? opts = null)
    }
    public static CompletableFuture<GetNetworkingSubnetResult> getNetworkingSubnet(GetNetworkingSubnetArgs args, InvokeOptions options)
    public static Output<GetNetworkingSubnetResult> getNetworkingSubnet(GetNetworkingSubnetArgs args, InvokeOptions options)
    
    fn::invoke:
      function: vkcs:index/getNetworkingSubnet:getNetworkingSubnet
      arguments:
        # arguments dictionary

    The following arguments are supported:

    Cidr string
    optional string → The CIDR of the subnet.
    Description string
    optional string → Human-readable description of the subnet.
    DhcpEnabled bool
    optional boolean → If the subnet has DHCP enabled.
    GatewayIp string
    optional string → The IP of the subnet's gateway.
    Id string
    optional string → The ID of the subnet.
    Name string
    optional string → The name of the subnet.
    NetworkId string
    optional string → The ID of the network the subnet belongs to.
    Region string
    optional string → The region in which to obtain the Network client. A Network client is needed to retrieve subnet ids. If omitted, the region argument of the provider is used.
    Sdn string
    optional string → SDN to use for this resource. Must be one of following: "neutron", "sprut". Default value is project's default SDN.
    SubnetId string
    optional deprecated string → The ID of the subnet. Deprecated This argument is deprecated, please, use the id attribute instead.

    Deprecated: Deprecated

    SubnetpoolId string
    optional string → The ID of the subnetpool associated with the subnet.
    Tags List<string>
    optional set of string → The list of subnet tags to filter.
    TenantId string
    optional string → The owner of the subnet.
    Cidr string
    optional string → The CIDR of the subnet.
    Description string
    optional string → Human-readable description of the subnet.
    DhcpEnabled bool
    optional boolean → If the subnet has DHCP enabled.
    GatewayIp string
    optional string → The IP of the subnet's gateway.
    Id string
    optional string → The ID of the subnet.
    Name string
    optional string → The name of the subnet.
    NetworkId string
    optional string → The ID of the network the subnet belongs to.
    Region string
    optional string → The region in which to obtain the Network client. A Network client is needed to retrieve subnet ids. If omitted, the region argument of the provider is used.
    Sdn string
    optional string → SDN to use for this resource. Must be one of following: "neutron", "sprut". Default value is project's default SDN.
    SubnetId string
    optional deprecated string → The ID of the subnet. Deprecated This argument is deprecated, please, use the id attribute instead.

    Deprecated: Deprecated

    SubnetpoolId string
    optional string → The ID of the subnetpool associated with the subnet.
    Tags []string
    optional set of string → The list of subnet tags to filter.
    TenantId string
    optional string → The owner of the subnet.
    cidr String
    optional string → The CIDR of the subnet.
    description String
    optional string → Human-readable description of the subnet.
    dhcpEnabled Boolean
    optional boolean → If the subnet has DHCP enabled.
    gatewayIp String
    optional string → The IP of the subnet's gateway.
    id String
    optional string → The ID of the subnet.
    name String
    optional string → The name of the subnet.
    networkId String
    optional string → The ID of the network the subnet belongs to.
    region String
    optional string → The region in which to obtain the Network client. A Network client is needed to retrieve subnet ids. If omitted, the region argument of the provider is used.
    sdn String
    optional string → SDN to use for this resource. Must be one of following: "neutron", "sprut". Default value is project's default SDN.
    subnetId String
    optional deprecated string → The ID of the subnet. Deprecated This argument is deprecated, please, use the id attribute instead.

    Deprecated: Deprecated

    subnetpoolId String
    optional string → The ID of the subnetpool associated with the subnet.
    tags List<String>
    optional set of string → The list of subnet tags to filter.
    tenantId String
    optional string → The owner of the subnet.
    cidr string
    optional string → The CIDR of the subnet.
    description string
    optional string → Human-readable description of the subnet.
    dhcpEnabled boolean
    optional boolean → If the subnet has DHCP enabled.
    gatewayIp string
    optional string → The IP of the subnet's gateway.
    id string
    optional string → The ID of the subnet.
    name string
    optional string → The name of the subnet.
    networkId string
    optional string → The ID of the network the subnet belongs to.
    region string
    optional string → The region in which to obtain the Network client. A Network client is needed to retrieve subnet ids. If omitted, the region argument of the provider is used.
    sdn string
    optional string → SDN to use for this resource. Must be one of following: "neutron", "sprut". Default value is project's default SDN.
    subnetId string
    optional deprecated string → The ID of the subnet. Deprecated This argument is deprecated, please, use the id attribute instead.

    Deprecated: Deprecated

    subnetpoolId string
    optional string → The ID of the subnetpool associated with the subnet.
    tags string[]
    optional set of string → The list of subnet tags to filter.
    tenantId string
    optional string → The owner of the subnet.
    cidr str
    optional string → The CIDR of the subnet.
    description str
    optional string → Human-readable description of the subnet.
    dhcp_enabled bool
    optional boolean → If the subnet has DHCP enabled.
    gateway_ip str
    optional string → The IP of the subnet's gateway.
    id str
    optional string → The ID of the subnet.
    name str
    optional string → The name of the subnet.
    network_id str
    optional string → The ID of the network the subnet belongs to.
    region str
    optional string → The region in which to obtain the Network client. A Network client is needed to retrieve subnet ids. If omitted, the region argument of the provider is used.
    sdn str
    optional string → SDN to use for this resource. Must be one of following: "neutron", "sprut". Default value is project's default SDN.
    subnet_id str
    optional deprecated string → The ID of the subnet. Deprecated This argument is deprecated, please, use the id attribute instead.

    Deprecated: Deprecated

    subnetpool_id str
    optional string → The ID of the subnetpool associated with the subnet.
    tags Sequence[str]
    optional set of string → The list of subnet tags to filter.
    tenant_id str
    optional string → The owner of the subnet.
    cidr String
    optional string → The CIDR of the subnet.
    description String
    optional string → Human-readable description of the subnet.
    dhcpEnabled Boolean
    optional boolean → If the subnet has DHCP enabled.
    gatewayIp String
    optional string → The IP of the subnet's gateway.
    id String
    optional string → The ID of the subnet.
    name String
    optional string → The name of the subnet.
    networkId String
    optional string → The ID of the network the subnet belongs to.
    region String
    optional string → The region in which to obtain the Network client. A Network client is needed to retrieve subnet ids. If omitted, the region argument of the provider is used.
    sdn String
    optional string → SDN to use for this resource. Must be one of following: "neutron", "sprut". Default value is project's default SDN.
    subnetId String
    optional deprecated string → The ID of the subnet. Deprecated This argument is deprecated, please, use the id attribute instead.

    Deprecated: Deprecated

    subnetpoolId String
    optional string → The ID of the subnetpool associated with the subnet.
    tags List<String>
    optional set of string → The list of subnet tags to filter.
    tenantId String
    optional string → The owner of the subnet.

    getNetworkingSubnet Result

    The following output properties are available:

    AllTags List<string>
    set of string → A set of string tags applied on the subnet.
    AllocationPools List<GetNetworkingSubnetAllocationPool>
    list → Allocation pools of the subnet.
    Cidr string
    Description string
    DnsNameservers List<string>
    set of string → DNS Nameservers of the subnet.
    EnableDhcp bool
    boolean → Whether the subnet has DHCP enabled or not.
    GatewayIp string
    HostRoutes List<GetNetworkingSubnetHostRoute>
    list → Host Routes of the subnet.
    Id string
    Name string
    NetworkId string
    Region string
    Sdn string
    SubnetId string

    Deprecated: Deprecated

    SubnetpoolId string
    TenantId string
    DhcpEnabled bool
    Tags List<string>
    AllTags []string
    set of string → A set of string tags applied on the subnet.
    AllocationPools []GetNetworkingSubnetAllocationPool
    list → Allocation pools of the subnet.
    Cidr string
    Description string
    DnsNameservers []string
    set of string → DNS Nameservers of the subnet.
    EnableDhcp bool
    boolean → Whether the subnet has DHCP enabled or not.
    GatewayIp string
    HostRoutes []GetNetworkingSubnetHostRoute
    list → Host Routes of the subnet.
    Id string
    Name string
    NetworkId string
    Region string
    Sdn string
    SubnetId string

    Deprecated: Deprecated

    SubnetpoolId string
    TenantId string
    DhcpEnabled bool
    Tags []string
    allTags List<String>
    set of string → A set of string tags applied on the subnet.
    allocationPools List<GetNetworkingSubnetAllocationPool>
    list → Allocation pools of the subnet.
    cidr String
    description String
    dnsNameservers List<String>
    set of string → DNS Nameservers of the subnet.
    enableDhcp Boolean
    boolean → Whether the subnet has DHCP enabled or not.
    gatewayIp String
    hostRoutes List<GetNetworkingSubnetHostRoute>
    list → Host Routes of the subnet.
    id String
    name String
    networkId String
    region String
    sdn String
    subnetId String

    Deprecated: Deprecated

    subnetpoolId String
    tenantId String
    dhcpEnabled Boolean
    tags List<String>
    allTags string[]
    set of string → A set of string tags applied on the subnet.
    allocationPools GetNetworkingSubnetAllocationPool[]
    list → Allocation pools of the subnet.
    cidr string
    description string
    dnsNameservers string[]
    set of string → DNS Nameservers of the subnet.
    enableDhcp boolean
    boolean → Whether the subnet has DHCP enabled or not.
    gatewayIp string
    hostRoutes GetNetworkingSubnetHostRoute[]
    list → Host Routes of the subnet.
    id string
    name string
    networkId string
    region string
    sdn string
    subnetId string

    Deprecated: Deprecated

    subnetpoolId string
    tenantId string
    dhcpEnabled boolean
    tags string[]
    all_tags Sequence[str]
    set of string → A set of string tags applied on the subnet.
    allocation_pools Sequence[GetNetworkingSubnetAllocationPool]
    list → Allocation pools of the subnet.
    cidr str
    description str
    dns_nameservers Sequence[str]
    set of string → DNS Nameservers of the subnet.
    enable_dhcp bool
    boolean → Whether the subnet has DHCP enabled or not.
    gateway_ip str
    host_routes Sequence[GetNetworkingSubnetHostRoute]
    list → Host Routes of the subnet.
    id str
    name str
    network_id str
    region str
    sdn str
    subnet_id str

    Deprecated: Deprecated

    subnetpool_id str
    tenant_id str
    dhcp_enabled bool
    tags Sequence[str]
    allTags List<String>
    set of string → A set of string tags applied on the subnet.
    allocationPools List<Property Map>
    list → Allocation pools of the subnet.
    cidr String
    description String
    dnsNameservers List<String>
    set of string → DNS Nameservers of the subnet.
    enableDhcp Boolean
    boolean → Whether the subnet has DHCP enabled or not.
    gatewayIp String
    hostRoutes List<Property Map>
    list → Host Routes of the subnet.
    id String
    name String
    networkId String
    region String
    sdn String
    subnetId String

    Deprecated: Deprecated

    subnetpoolId String
    tenantId String
    dhcpEnabled Boolean
    tags List<String>

    Supporting Types

    GetNetworkingSubnetAllocationPool

    End string
    string → The ending address.
    Start string
    string → The starting address.
    End string
    string → The ending address.
    Start string
    string → The starting address.
    end String
    string → The ending address.
    start String
    string → The starting address.
    end string
    string → The ending address.
    start string
    string → The starting address.
    end str
    string → The ending address.
    start str
    string → The starting address.
    end String
    string → The ending address.
    start String
    string → The starting address.

    GetNetworkingSubnetHostRoute

    DestinationCidr string
    string
    NextHop string
    string
    DestinationCidr string
    string
    NextHop string
    string
    destinationCidr String
    string
    nextHop String
    string
    destinationCidr string
    string
    nextHop string
    string
    destination_cidr str
    string
    next_hop str
    string
    destinationCidr String
    string
    nextHop String
    string

    Package Details

    Repository
    vkcs vk-cs/terraform-provider-vkcs
    License
    Notes
    This Pulumi package is based on the vkcs Terraform Provider.
    vkcs logo
    vkcs 0.9.3 published on Tuesday, Apr 15, 2025 by vk-cs