1. Packages
  2. Packages
  3. OVH
  4. API Docs
  5. getCloudNetworkPrivateVrackSubnet
Viewing docs for OVHCloud v2.17.0
published on Friday, Jul 17, 2026 by OVHcloud
ovh logo
Viewing docs for OVHCloud v2.17.0
published on Friday, Jul 17, 2026 by OVHcloud

    Use this data source to retrieve information about a subnet in a private network (vRack) of a public cloud project.

    Example Usage

    import * as pulumi from "@pulumi/pulumi";
    import * as ovh from "@ovhcloud/pulumi-ovh";
    
    const subnet = ovh.getCloudNetworkPrivateVrackSubnet({
        serviceName: "<public cloud project ID>",
        networkId: "<network ID>",
        id: "<subnet ID>",
    });
    export const subnetCidr = subnet.then(subnet => subnet.cidr);
    
    import pulumi
    import pulumi_ovh as ovh
    
    subnet = ovh.get_cloud_network_private_vrack_subnet(service_name="<public cloud project ID>",
        network_id="<network ID>",
        id="<subnet ID>")
    pulumi.export("subnetCidr", subnet.cidr)
    
    package main
    
    import (
    	"github.com/ovh/pulumi-ovh/sdk/v2/go/ovh"
    	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
    )
    
    func main() {
    	pulumi.Run(func(ctx *pulumi.Context) error {
    		subnet, err := ovh.LookupCloudNetworkPrivateVrackSubnet(ctx, &ovh.LookupCloudNetworkPrivateVrackSubnetArgs{
    			ServiceName: "<public cloud project ID>",
    			NetworkId:   "<network ID>",
    			Id:          "<subnet ID>",
    		}, nil)
    		if err != nil {
    			return err
    		}
    		ctx.Export("subnetCidr", subnet.Cidr)
    		return nil
    	})
    }
    
    using System.Collections.Generic;
    using System.Linq;
    using Pulumi;
    using Ovh = Pulumi.Ovh;
    
    return await Deployment.RunAsync(() => 
    {
        var subnet = Ovh.GetCloudNetworkPrivateVrackSubnet.Invoke(new()
        {
            ServiceName = "<public cloud project ID>",
            NetworkId = "<network ID>",
            Id = "<subnet ID>",
        });
    
        return new Dictionary<string, object?>
        {
            ["subnetCidr"] = subnet.Apply(getCloudNetworkPrivateVrackSubnetResult => getCloudNetworkPrivateVrackSubnetResult.Cidr),
        };
    });
    
    package generated_program;
    
    import com.pulumi.Context;
    import com.pulumi.Pulumi;
    import com.pulumi.core.Output;
    import com.pulumi.ovh.OvhFunctions;
    import com.pulumi.ovh.inputs.GetCloudNetworkPrivateVrackSubnetArgs;
    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 subnet = OvhFunctions.getCloudNetworkPrivateVrackSubnet(GetCloudNetworkPrivateVrackSubnetArgs.builder()
                .serviceName("<public cloud project ID>")
                .networkId("<network ID>")
                .id("<subnet ID>")
                .build());
    
            ctx.export("subnetCidr", subnet.cidr());
        }
    }
    
    variables:
      subnet:
        fn::invoke:
          function: ovh:getCloudNetworkPrivateVrackSubnet
          arguments:
            serviceName: <public cloud project ID>
            networkId: <network ID>
            id: <subnet ID>
    outputs:
      subnetCidr: ${subnet.cidr}
    
    Example coming soon!
    

    Using getCloudNetworkPrivateVrackSubnet

    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 getCloudNetworkPrivateVrackSubnet(args: GetCloudNetworkPrivateVrackSubnetArgs, opts?: InvokeOptions): Promise<GetCloudNetworkPrivateVrackSubnetResult>
    function getCloudNetworkPrivateVrackSubnetOutput(args: GetCloudNetworkPrivateVrackSubnetOutputArgs, opts?: InvokeOptions): Output<GetCloudNetworkPrivateVrackSubnetResult>
    def get_cloud_network_private_vrack_subnet(id: Optional[str] = None,
                                               network_id: Optional[str] = None,
                                               service_name: Optional[str] = None,
                                               opts: Optional[InvokeOptions] = None) -> GetCloudNetworkPrivateVrackSubnetResult
    def get_cloud_network_private_vrack_subnet_output(id: pulumi.Input[Optional[str]] = None,
                                               network_id: pulumi.Input[Optional[str]] = None,
                                               service_name: pulumi.Input[Optional[str]] = None,
                                               opts: Optional[InvokeOptions] = None) -> Output[GetCloudNetworkPrivateVrackSubnetResult]
    func LookupCloudNetworkPrivateVrackSubnet(ctx *Context, args *LookupCloudNetworkPrivateVrackSubnetArgs, opts ...InvokeOption) (*LookupCloudNetworkPrivateVrackSubnetResult, error)
    func LookupCloudNetworkPrivateVrackSubnetOutput(ctx *Context, args *LookupCloudNetworkPrivateVrackSubnetOutputArgs, opts ...InvokeOption) LookupCloudNetworkPrivateVrackSubnetResultOutput

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

    public static class GetCloudNetworkPrivateVrackSubnet 
    {
        public static Task<GetCloudNetworkPrivateVrackSubnetResult> InvokeAsync(GetCloudNetworkPrivateVrackSubnetArgs args, InvokeOptions? opts = null)
        public static Output<GetCloudNetworkPrivateVrackSubnetResult> Invoke(GetCloudNetworkPrivateVrackSubnetInvokeArgs args, InvokeOptions? opts = null)
    }
    public static CompletableFuture<GetCloudNetworkPrivateVrackSubnetResult> getCloudNetworkPrivateVrackSubnet(GetCloudNetworkPrivateVrackSubnetArgs args, InvokeOptions options)
    public static Output<GetCloudNetworkPrivateVrackSubnetResult> getCloudNetworkPrivateVrackSubnet(GetCloudNetworkPrivateVrackSubnetArgs args, InvokeOptions options)
    
    fn::invoke:
      function: ovh:index/getCloudNetworkPrivateVrackSubnet:getCloudNetworkPrivateVrackSubnet
      arguments:
        # arguments dictionary
    data "ovh_get_cloud_network_private_vrack_subnet" "name" {
        # arguments
    }

    The following arguments are supported:

    Id string
    Subnet ID.
    NetworkId string
    Network ID of the parent private network.
    ServiceName string
    Service name of the resource representing the id of the cloud project.
    Id string
    Subnet ID.
    NetworkId string
    Network ID of the parent private network.
    ServiceName string
    Service name of the resource representing the id of the cloud project.
    id string
    Subnet ID.
    network_id string
    Network ID of the parent private network.
    service_name string
    Service name of the resource representing the id of the cloud project.
    id String
    Subnet ID.
    networkId String
    Network ID of the parent private network.
    serviceName String
    Service name of the resource representing the id of the cloud project.
    id string
    Subnet ID.
    networkId string
    Network ID of the parent private network.
    serviceName string
    Service name of the resource representing the id of the cloud project.
    id str
    Subnet ID.
    network_id str
    Network ID of the parent private network.
    service_name str
    Service name of the resource representing the id of the cloud project.
    id String
    Subnet ID.
    networkId String
    Network ID of the parent private network.
    serviceName String
    Service name of the resource representing the id of the cloud project.

    getCloudNetworkPrivateVrackSubnet Result

    The following output properties are available:

    AllocationPools List<GetCloudNetworkPrivateVrackSubnetAllocationPool>
    IP address allocation pools:
    Checksum string
    Computed hash representing the current target specification value.
    Cidr string
    CIDR address range.
    CreatedAt string
    Creation date of the subnet.
    CurrentState GetCloudNetworkPrivateVrackSubnetCurrentState
    Current state of the subnet:
    Description string
    Subnet description.
    DhcpEnabled bool
    Whether DHCP is enabled.
    DnsNameservers List<string>
    Configured DNS nameservers.
    GatewayIp string
    Default gateway IP address.
    Id string
    Location GetCloudNetworkPrivateVrackSubnetLocation
    Location details:
    Name string
    Subnet name.
    NetworkId string
    ResourceStatus string
    Subnet readiness in the system (CREATING, DELETING, ERROR, OUT_OF_SYNC, READY, UPDATING).
    ServiceName string
    UpdatedAt string
    Last update date of the subnet.
    AllocationPools []GetCloudNetworkPrivateVrackSubnetAllocationPool
    IP address allocation pools:
    Checksum string
    Computed hash representing the current target specification value.
    Cidr string
    CIDR address range.
    CreatedAt string
    Creation date of the subnet.
    CurrentState GetCloudNetworkPrivateVrackSubnetCurrentState
    Current state of the subnet:
    Description string
    Subnet description.
    DhcpEnabled bool
    Whether DHCP is enabled.
    DnsNameservers []string
    Configured DNS nameservers.
    GatewayIp string
    Default gateway IP address.
    Id string
    Location GetCloudNetworkPrivateVrackSubnetLocation
    Location details:
    Name string
    Subnet name.
    NetworkId string
    ResourceStatus string
    Subnet readiness in the system (CREATING, DELETING, ERROR, OUT_OF_SYNC, READY, UPDATING).
    ServiceName string
    UpdatedAt string
    Last update date of the subnet.
    allocation_pools list(object)
    IP address allocation pools:
    checksum string
    Computed hash representing the current target specification value.
    cidr string
    CIDR address range.
    created_at string
    Creation date of the subnet.
    current_state object
    Current state of the subnet:
    description string
    Subnet description.
    dhcp_enabled bool
    Whether DHCP is enabled.
    dns_nameservers list(string)
    Configured DNS nameservers.
    gateway_ip string
    Default gateway IP address.
    id string
    location object
    Location details:
    name string
    Subnet name.
    network_id string
    resource_status string
    Subnet readiness in the system (CREATING, DELETING, ERROR, OUT_OF_SYNC, READY, UPDATING).
    service_name string
    updated_at string
    Last update date of the subnet.
    allocationPools List<GetCloudNetworkPrivateVrackSubnetAllocationPool>
    IP address allocation pools:
    checksum String
    Computed hash representing the current target specification value.
    cidr String
    CIDR address range.
    createdAt String
    Creation date of the subnet.
    currentState GetCloudNetworkPrivateVrackSubnetCurrentState
    Current state of the subnet:
    description String
    Subnet description.
    dhcpEnabled Boolean
    Whether DHCP is enabled.
    dnsNameservers List<String>
    Configured DNS nameservers.
    gatewayIp String
    Default gateway IP address.
    id String
    location GetCloudNetworkPrivateVrackSubnetLocation
    Location details:
    name String
    Subnet name.
    networkId String
    resourceStatus String
    Subnet readiness in the system (CREATING, DELETING, ERROR, OUT_OF_SYNC, READY, UPDATING).
    serviceName String
    updatedAt String
    Last update date of the subnet.
    allocationPools GetCloudNetworkPrivateVrackSubnetAllocationPool[]
    IP address allocation pools:
    checksum string
    Computed hash representing the current target specification value.
    cidr string
    CIDR address range.
    createdAt string
    Creation date of the subnet.
    currentState GetCloudNetworkPrivateVrackSubnetCurrentState
    Current state of the subnet:
    description string
    Subnet description.
    dhcpEnabled boolean
    Whether DHCP is enabled.
    dnsNameservers string[]
    Configured DNS nameservers.
    gatewayIp string
    Default gateway IP address.
    id string
    location GetCloudNetworkPrivateVrackSubnetLocation
    Location details:
    name string
    Subnet name.
    networkId string
    resourceStatus string
    Subnet readiness in the system (CREATING, DELETING, ERROR, OUT_OF_SYNC, READY, UPDATING).
    serviceName string
    updatedAt string
    Last update date of the subnet.
    allocation_pools Sequence[GetCloudNetworkPrivateVrackSubnetAllocationPool]
    IP address allocation pools:
    checksum str
    Computed hash representing the current target specification value.
    cidr str
    CIDR address range.
    created_at str
    Creation date of the subnet.
    current_state GetCloudNetworkPrivateVrackSubnetCurrentState
    Current state of the subnet:
    description str
    Subnet description.
    dhcp_enabled bool
    Whether DHCP is enabled.
    dns_nameservers Sequence[str]
    Configured DNS nameservers.
    gateway_ip str
    Default gateway IP address.
    id str
    location GetCloudNetworkPrivateVrackSubnetLocation
    Location details:
    name str
    Subnet name.
    network_id str
    resource_status str
    Subnet readiness in the system (CREATING, DELETING, ERROR, OUT_OF_SYNC, READY, UPDATING).
    service_name str
    updated_at str
    Last update date of the subnet.
    allocationPools List<Property Map>
    IP address allocation pools:
    checksum String
    Computed hash representing the current target specification value.
    cidr String
    CIDR address range.
    createdAt String
    Creation date of the subnet.
    currentState Property Map
    Current state of the subnet:
    description String
    Subnet description.
    dhcpEnabled Boolean
    Whether DHCP is enabled.
    dnsNameservers List<String>
    Configured DNS nameservers.
    gatewayIp String
    Default gateway IP address.
    id String
    location Property Map
    Location details:
    name String
    Subnet name.
    networkId String
    resourceStatus String
    Subnet readiness in the system (CREATING, DELETING, ERROR, OUT_OF_SYNC, READY, UPDATING).
    serviceName String
    updatedAt String
    Last update date of the subnet.

    Supporting Types

    GetCloudNetworkPrivateVrackSubnetAllocationPool

    End string
    End IP address of the pool.
    Start string
    Start IP address of the pool.
    End string
    End IP address of the pool.
    Start string
    Start IP address of the pool.
    end string
    End IP address of the pool.
    start string
    Start IP address of the pool.
    end String
    End IP address of the pool.
    start String
    Start IP address of the pool.
    end string
    End IP address of the pool.
    start string
    Start IP address of the pool.
    end str
    End IP address of the pool.
    start str
    Start IP address of the pool.
    end String
    End IP address of the pool.
    start String
    Start IP address of the pool.

    GetCloudNetworkPrivateVrackSubnetCurrentState

    AllocationPools List<GetCloudNetworkPrivateVrackSubnetCurrentStateAllocationPool>
    IP address allocation pools:
    Cidr string
    CIDR address range.
    Description string
    Subnet description.
    DhcpEnabled bool
    Whether DHCP is enabled.
    DnsNameservers List<string>
    Configured DNS nameservers.
    GatewayIp string
    Default gateway IP address.
    HostRoutes List<GetCloudNetworkPrivateVrackSubnetCurrentStateHostRoute>
    Static host routes:
    Location GetCloudNetworkPrivateVrackSubnetCurrentStateLocation
    Location details:
    Name string
    Subnet name.
    AllocationPools []GetCloudNetworkPrivateVrackSubnetCurrentStateAllocationPool
    IP address allocation pools:
    Cidr string
    CIDR address range.
    Description string
    Subnet description.
    DhcpEnabled bool
    Whether DHCP is enabled.
    DnsNameservers []string
    Configured DNS nameservers.
    GatewayIp string
    Default gateway IP address.
    HostRoutes []GetCloudNetworkPrivateVrackSubnetCurrentStateHostRoute
    Static host routes:
    Location GetCloudNetworkPrivateVrackSubnetCurrentStateLocation
    Location details:
    Name string
    Subnet name.
    allocation_pools list(object)
    IP address allocation pools:
    cidr string
    CIDR address range.
    description string
    Subnet description.
    dhcp_enabled bool
    Whether DHCP is enabled.
    dns_nameservers list(string)
    Configured DNS nameservers.
    gateway_ip string
    Default gateway IP address.
    host_routes list(object)
    Static host routes:
    location object
    Location details:
    name string
    Subnet name.
    allocationPools List<GetCloudNetworkPrivateVrackSubnetCurrentStateAllocationPool>
    IP address allocation pools:
    cidr String
    CIDR address range.
    description String
    Subnet description.
    dhcpEnabled Boolean
    Whether DHCP is enabled.
    dnsNameservers List<String>
    Configured DNS nameservers.
    gatewayIp String
    Default gateway IP address.
    hostRoutes List<GetCloudNetworkPrivateVrackSubnetCurrentStateHostRoute>
    Static host routes:
    location GetCloudNetworkPrivateVrackSubnetCurrentStateLocation
    Location details:
    name String
    Subnet name.
    allocationPools GetCloudNetworkPrivateVrackSubnetCurrentStateAllocationPool[]
    IP address allocation pools:
    cidr string
    CIDR address range.
    description string
    Subnet description.
    dhcpEnabled boolean
    Whether DHCP is enabled.
    dnsNameservers string[]
    Configured DNS nameservers.
    gatewayIp string
    Default gateway IP address.
    hostRoutes GetCloudNetworkPrivateVrackSubnetCurrentStateHostRoute[]
    Static host routes:
    location GetCloudNetworkPrivateVrackSubnetCurrentStateLocation
    Location details:
    name string
    Subnet name.
    allocation_pools Sequence[GetCloudNetworkPrivateVrackSubnetCurrentStateAllocationPool]
    IP address allocation pools:
    cidr str
    CIDR address range.
    description str
    Subnet description.
    dhcp_enabled bool
    Whether DHCP is enabled.
    dns_nameservers Sequence[str]
    Configured DNS nameservers.
    gateway_ip str
    Default gateway IP address.
    host_routes Sequence[GetCloudNetworkPrivateVrackSubnetCurrentStateHostRoute]
    Static host routes:
    location GetCloudNetworkPrivateVrackSubnetCurrentStateLocation
    Location details:
    name str
    Subnet name.
    allocationPools List<Property Map>
    IP address allocation pools:
    cidr String
    CIDR address range.
    description String
    Subnet description.
    dhcpEnabled Boolean
    Whether DHCP is enabled.
    dnsNameservers List<String>
    Configured DNS nameservers.
    gatewayIp String
    Default gateway IP address.
    hostRoutes List<Property Map>
    Static host routes:
    location Property Map
    Location details:
    name String
    Subnet name.

    GetCloudNetworkPrivateVrackSubnetCurrentStateAllocationPool

    End string
    End IP address of the pool.
    Start string
    Start IP address of the pool.
    End string
    End IP address of the pool.
    Start string
    Start IP address of the pool.
    end string
    End IP address of the pool.
    start string
    Start IP address of the pool.
    end String
    End IP address of the pool.
    start String
    Start IP address of the pool.
    end string
    End IP address of the pool.
    start string
    Start IP address of the pool.
    end str
    End IP address of the pool.
    start str
    Start IP address of the pool.
    end String
    End IP address of the pool.
    start String
    Start IP address of the pool.

    GetCloudNetworkPrivateVrackSubnetCurrentStateHostRoute

    Destination string
    Destination CIDR.
    NextHop string
    Next hop IP address.
    Destination string
    Destination CIDR.
    NextHop string
    Next hop IP address.
    destination string
    Destination CIDR.
    next_hop string
    Next hop IP address.
    destination String
    Destination CIDR.
    nextHop String
    Next hop IP address.
    destination string
    Destination CIDR.
    nextHop string
    Next hop IP address.
    destination str
    Destination CIDR.
    next_hop str
    Next hop IP address.
    destination String
    Destination CIDR.
    nextHop String
    Next hop IP address.

    GetCloudNetworkPrivateVrackSubnetCurrentStateLocation

    Region string
    Region code.
    Region string
    Region code.
    region string
    Region code.
    region String
    Region code.
    region string
    Region code.
    region str
    Region code.
    region String
    Region code.

    GetCloudNetworkPrivateVrackSubnetLocation

    Region string
    Region code.
    Region string
    Region code.
    region string
    Region code.
    region String
    Region code.
    region string
    Region code.
    region str
    Region code.
    region String
    Region code.

    Package Details

    Repository
    ovh ovh/pulumi-ovh
    License
    Apache-2.0
    Notes
    This Pulumi package is based on the ovh Terraform Provider.
    ovh logo
    Viewing docs for OVHCloud v2.17.0
    published on Friday, Jul 17, 2026 by OVHcloud

      Try Pulumi Cloud free.
      Your team will thank you.

      Start free trial