1. Registry
  2. Packages
  3. Opentelekomcloud Provider
  4. API Docs
  5. getVpcSubnetV1
Viewing docs for opentelekomcloud 1.37.8
published on Thursday, Sep 10, 2026 by opentelekomcloud
Viewing docs for opentelekomcloud 1.37.8
published on Thursday, Sep 10, 2026 by opentelekomcloud

    Up-to-date reference of API arguments for VPC subnet you can get at documentation portal

    Use this data source to get details about a specific VPC subnet.

    This data source can prove useful when a module accepts a subnet id as an input variable and needs to, for example, determine the id of the VPC that the subnet belongs to.

    Example Usage

    import * as pulumi from "@pulumi/pulumi";
    import * as opentelekomcloud from "@pulumi/opentelekomcloud";
    
    const subnetV1 = opentelekomcloud.getVpcSubnetV1({
        id: subnetId,
    });
    export const subnetVpcId = subnetV1.then(subnetV1 => subnetV1.vpcId);
    
    import pulumi
    import pulumi_opentelekomcloud as opentelekomcloud
    
    subnet_v1 = opentelekomcloud.get_vpc_subnet_v1(id=subnet_id)
    pulumi.export("subnetVpcId", subnet_v1.vpc_id)
    
    package main
    
    import (
    	"github.com/pulumi/pulumi-terraform-provider/sdks/go/opentelekomcloud/opentelekomcloud"
    	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
    )
    
    func main() {
    	pulumi.Run(func(ctx *pulumi.Context) error {
    		subnetV1, err := opentelekomcloud.LookupVpcSubnetV1(ctx, &opentelekomcloud.LookupVpcSubnetV1Args{
    			Id: pulumi.StringRef(subnetId),
    		}, nil)
    		if err != nil {
    			return err
    		}
    		ctx.Export("subnetVpcId", subnetV1.VpcId)
    		return nil
    	})
    }
    
    using System.Collections.Generic;
    using System.Linq;
    using Pulumi;
    using Opentelekomcloud = Pulumi.Opentelekomcloud;
    
    return await Deployment.RunAsync(() => 
    {
        var subnetV1 = Opentelekomcloud.GetVpcSubnetV1.Invoke(new()
        {
            Id = subnetId,
        });
    
        return new Dictionary<string, object?>
        {
            ["subnetVpcId"] = subnetV1.Apply(getVpcSubnetV1Result => getVpcSubnetV1Result.VpcId),
        };
    });
    
    package generated_program;
    
    import com.pulumi.Context;
    import com.pulumi.Pulumi;
    import com.pulumi.core.Output;
    import com.pulumi.opentelekomcloud.OpentelekomcloudFunctions;
    import com.pulumi.opentelekomcloud.inputs.GetVpcSubnetV1Args;
    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 subnetV1 = OpentelekomcloudFunctions.getVpcSubnetV1(GetVpcSubnetV1Args.builder()
                .id(subnetId)
                .build());
    
            ctx.export("subnetVpcId", subnetV1.vpcId());
        }
    }
    
    variables:
      subnetV1:
        fn::invoke:
          function: opentelekomcloud:getVpcSubnetV1
          arguments:
            id: ${subnetId}
    outputs:
      subnetVpcId: ${subnetV1.vpcId}
    
    Example coming soon!
    

    Using getVpcSubnetV1

    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 getVpcSubnetV1(args: GetVpcSubnetV1Args, opts?: InvokeOptions): Promise<GetVpcSubnetV1Result>
    function getVpcSubnetV1Output(args: GetVpcSubnetV1OutputArgs, opts?: InvokeOutputOptions): Output<GetVpcSubnetV1Result>
    def get_vpc_subnet_v1(availability_zone: Optional[str] = None,
                          cidr: Optional[str] = None,
                          description: Optional[str] = None,
                          gateway_ip: Optional[str] = None,
                          id: Optional[str] = None,
                          name: Optional[str] = None,
                          ntp_addresses: Optional[str] = None,
                          primary_dns: Optional[str] = None,
                          region: Optional[str] = None,
                          scope: Optional[str] = None,
                          secondary_dns: Optional[str] = None,
                          status: Optional[str] = None,
                          vpc_id: Optional[str] = None,
                          opts: Optional[InvokeOptions] = None) -> GetVpcSubnetV1Result
    def get_vpc_subnet_v1_output(availability_zone: pulumi.Input[Optional[str]] = None,
                          cidr: pulumi.Input[Optional[str]] = None,
                          description: pulumi.Input[Optional[str]] = None,
                          gateway_ip: pulumi.Input[Optional[str]] = None,
                          id: pulumi.Input[Optional[str]] = None,
                          name: pulumi.Input[Optional[str]] = None,
                          ntp_addresses: pulumi.Input[Optional[str]] = None,
                          primary_dns: pulumi.Input[Optional[str]] = None,
                          region: pulumi.Input[Optional[str]] = None,
                          scope: pulumi.Input[Optional[str]] = None,
                          secondary_dns: pulumi.Input[Optional[str]] = None,
                          status: pulumi.Input[Optional[str]] = None,
                          vpc_id: pulumi.Input[Optional[str]] = None,
                          opts: Optional[InvokeOutputOptions] = None) -> Output[GetVpcSubnetV1Result]
    func LookupVpcSubnetV1(ctx *Context, args *LookupVpcSubnetV1Args, opts ...InvokeOption) (*LookupVpcSubnetV1Result, error)
    func LookupVpcSubnetV1Output(ctx *Context, args *LookupVpcSubnetV1OutputArgs, opts ...InvokeOption) LookupVpcSubnetV1ResultOutput

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

    public static class GetVpcSubnetV1 
    {
        public static Task<GetVpcSubnetV1Result> InvokeAsync(GetVpcSubnetV1Args args, InvokeOptions? opts = null)
        public static Output<GetVpcSubnetV1Result> Invoke(GetVpcSubnetV1InvokeArgs args, InvokeOptions? opts = null)
        public static Output<GetVpcSubnetV1Result> Invoke(GetVpcSubnetV1InvokeArgs args, InvokeOutputOptions opts)
    }
    public static CompletableFuture<GetVpcSubnetV1Result> getVpcSubnetV1(GetVpcSubnetV1Args args, InvokeOptions options)
    public static Output<GetVpcSubnetV1Result> getVpcSubnetV1(GetVpcSubnetV1Args args, InvokeOptions options)
    public static Output<GetVpcSubnetV1Result> getVpcSubnetV1(GetVpcSubnetV1Args args, InvokeOutputOptions options)
    
    fn::invoke:
      function: opentelekomcloud:index/getVpcSubnetV1:getVpcSubnetV1
      arguments:
        # arguments dictionary
    data "opentelekomcloud_get_vpc_subnet_v1" "name" {
        # arguments
    }

    The following arguments are supported:

    AvailabilityZone string
    The availability zone (AZ) to which the subnet should belong.
    Cidr string
    The network segment of specific subnet to retrieve. The value must be in CIDR format.
    Description string
    The description of the specific subnet to retrieve.
    GatewayIp string
    The subnet gateway address of specific subnet.
    Id string
    Specifies a resource ID in UUID format.
    Name string
    The name of the specific subnet to retrieve.
    NtpAddresses string
    The comma-separated NTP server addresses configured for the subnet.
    PrimaryDns string
    The IP address of DNS server 1 on the specific subnet.
    Region string
    Scope string
    The subnet usage scope, such as center.
    SecondaryDns string
    The IP address of DNS server 2 on the specific subnet.
    Status string
    The value can be ACTIVE, DOWN, UNKNOWN, or ERROR.
    VpcId string
    The id of the VPC that the desired subnet belongs to.
    AvailabilityZone string
    The availability zone (AZ) to which the subnet should belong.
    Cidr string
    The network segment of specific subnet to retrieve. The value must be in CIDR format.
    Description string
    The description of the specific subnet to retrieve.
    GatewayIp string
    The subnet gateway address of specific subnet.
    Id string
    Specifies a resource ID in UUID format.
    Name string
    The name of the specific subnet to retrieve.
    NtpAddresses string
    The comma-separated NTP server addresses configured for the subnet.
    PrimaryDns string
    The IP address of DNS server 1 on the specific subnet.
    Region string
    Scope string
    The subnet usage scope, such as center.
    SecondaryDns string
    The IP address of DNS server 2 on the specific subnet.
    Status string
    The value can be ACTIVE, DOWN, UNKNOWN, or ERROR.
    VpcId string
    The id of the VPC that the desired subnet belongs to.
    availability_zone string
    The availability zone (AZ) to which the subnet should belong.
    cidr string
    The network segment of specific subnet to retrieve. The value must be in CIDR format.
    description string
    The description of the specific subnet to retrieve.
    gateway_ip string
    The subnet gateway address of specific subnet.
    id string
    Specifies a resource ID in UUID format.
    name string
    The name of the specific subnet to retrieve.
    ntp_addresses string
    The comma-separated NTP server addresses configured for the subnet.
    primary_dns string
    The IP address of DNS server 1 on the specific subnet.
    region string
    scope string
    The subnet usage scope, such as center.
    secondary_dns string
    The IP address of DNS server 2 on the specific subnet.
    status string
    The value can be ACTIVE, DOWN, UNKNOWN, or ERROR.
    vpc_id string
    The id of the VPC that the desired subnet belongs to.
    availabilityZone String
    The availability zone (AZ) to which the subnet should belong.
    cidr String
    The network segment of specific subnet to retrieve. The value must be in CIDR format.
    description String
    The description of the specific subnet to retrieve.
    gatewayIp String
    The subnet gateway address of specific subnet.
    id String
    Specifies a resource ID in UUID format.
    name String
    The name of the specific subnet to retrieve.
    ntpAddresses String
    The comma-separated NTP server addresses configured for the subnet.
    primaryDns String
    The IP address of DNS server 1 on the specific subnet.
    region String
    scope String
    The subnet usage scope, such as center.
    secondaryDns String
    The IP address of DNS server 2 on the specific subnet.
    status String
    The value can be ACTIVE, DOWN, UNKNOWN, or ERROR.
    vpcId String
    The id of the VPC that the desired subnet belongs to.
    availabilityZone string
    The availability zone (AZ) to which the subnet should belong.
    cidr string
    The network segment of specific subnet to retrieve. The value must be in CIDR format.
    description string
    The description of the specific subnet to retrieve.
    gatewayIp string
    The subnet gateway address of specific subnet.
    id string
    Specifies a resource ID in UUID format.
    name string
    The name of the specific subnet to retrieve.
    ntpAddresses string
    The comma-separated NTP server addresses configured for the subnet.
    primaryDns string
    The IP address of DNS server 1 on the specific subnet.
    region string
    scope string
    The subnet usage scope, such as center.
    secondaryDns string
    The IP address of DNS server 2 on the specific subnet.
    status string
    The value can be ACTIVE, DOWN, UNKNOWN, or ERROR.
    vpcId string
    The id of the VPC that the desired subnet belongs to.
    availability_zone str
    The availability zone (AZ) to which the subnet should belong.
    cidr str
    The network segment of specific subnet to retrieve. The value must be in CIDR format.
    description str
    The description of the specific subnet to retrieve.
    gateway_ip str
    The subnet gateway address of specific subnet.
    id str
    Specifies a resource ID in UUID format.
    name str
    The name of the specific subnet to retrieve.
    ntp_addresses str
    The comma-separated NTP server addresses configured for the subnet.
    primary_dns str
    The IP address of DNS server 1 on the specific subnet.
    region str
    scope str
    The subnet usage scope, such as center.
    secondary_dns str
    The IP address of DNS server 2 on the specific subnet.
    status str
    The value can be ACTIVE, DOWN, UNKNOWN, or ERROR.
    vpc_id str
    The id of the VPC that the desired subnet belongs to.
    availabilityZone String
    The availability zone (AZ) to which the subnet should belong.
    cidr String
    The network segment of specific subnet to retrieve. The value must be in CIDR format.
    description String
    The description of the specific subnet to retrieve.
    gatewayIp String
    The subnet gateway address of specific subnet.
    id String
    Specifies a resource ID in UUID format.
    name String
    The name of the specific subnet to retrieve.
    ntpAddresses String
    The comma-separated NTP server addresses configured for the subnet.
    primaryDns String
    The IP address of DNS server 1 on the specific subnet.
    region String
    scope String
    The subnet usage scope, such as center.
    secondaryDns String
    The IP address of DNS server 2 on the specific subnet.
    status String
    The value can be ACTIVE, DOWN, UNKNOWN, or ERROR.
    vpcId String
    The id of the VPC that the desired subnet belongs to.

    getVpcSubnetV1 Result

    The following output properties are available:

    AvailabilityZone string
    Cidr string
    CidrIpv6 string
    CreatedAt string
    The UTC creation timestamp.
    Description string
    DhcpEnable bool
    DHCP function for the subnet.
    DnsLists List<string>
    The IP address list of DNS servers on the subnet.
    GatewayIp string
    GatewayIpv6 string
    Id string
    Ipv6Enable bool
    Name string
    NetworkId string
    Specifies the OpenStack network ID.
    NtpAddresses string
    PrimaryDns string
    Region string
    Scope string
    SecondaryDns string
    Status string
    SubnetId string
    Specifies the OpenStack subnet ID.
    SubnetIdV6 string
    Specifies the OpenStack IPv6 subnet ID. Only returned if subnet is IPV6 enabled.
    TenantId string
    The project ID that owns the subnet.
    UpdatedAt string
    The UTC last-update timestamp.
    VpcId string
    AvailabilityZone string
    Cidr string
    CidrIpv6 string
    CreatedAt string
    The UTC creation timestamp.
    Description string
    DhcpEnable bool
    DHCP function for the subnet.
    DnsLists []string
    The IP address list of DNS servers on the subnet.
    GatewayIp string
    GatewayIpv6 string
    Id string
    Ipv6Enable bool
    Name string
    NetworkId string
    Specifies the OpenStack network ID.
    NtpAddresses string
    PrimaryDns string
    Region string
    Scope string
    SecondaryDns string
    Status string
    SubnetId string
    Specifies the OpenStack subnet ID.
    SubnetIdV6 string
    Specifies the OpenStack IPv6 subnet ID. Only returned if subnet is IPV6 enabled.
    TenantId string
    The project ID that owns the subnet.
    UpdatedAt string
    The UTC last-update timestamp.
    VpcId string
    availability_zone string
    cidr string
    cidr_ipv6 string
    created_at string
    The UTC creation timestamp.
    description string
    dhcp_enable bool
    DHCP function for the subnet.
    dns_lists list(string)
    The IP address list of DNS servers on the subnet.
    gateway_ip string
    gateway_ipv6 string
    id string
    ipv6_enable bool
    name string
    network_id string
    Specifies the OpenStack network ID.
    ntp_addresses string
    primary_dns string
    region string
    scope string
    secondary_dns string
    status string
    subnet_id string
    Specifies the OpenStack subnet ID.
    subnet_id_v6 string
    Specifies the OpenStack IPv6 subnet ID. Only returned if subnet is IPV6 enabled.
    tenant_id string
    The project ID that owns the subnet.
    updated_at string
    The UTC last-update timestamp.
    vpc_id string
    availabilityZone String
    cidr String
    cidrIpv6 String
    createdAt String
    The UTC creation timestamp.
    description String
    dhcpEnable Boolean
    DHCP function for the subnet.
    dnsLists List<String>
    The IP address list of DNS servers on the subnet.
    gatewayIp String
    gatewayIpv6 String
    id String
    ipv6Enable Boolean
    name String
    networkId String
    Specifies the OpenStack network ID.
    ntpAddresses String
    primaryDns String
    region String
    scope String
    secondaryDns String
    status String
    subnetId String
    Specifies the OpenStack subnet ID.
    subnetIdV6 String
    Specifies the OpenStack IPv6 subnet ID. Only returned if subnet is IPV6 enabled.
    tenantId String
    The project ID that owns the subnet.
    updatedAt String
    The UTC last-update timestamp.
    vpcId String
    availabilityZone string
    cidr string
    cidrIpv6 string
    createdAt string
    The UTC creation timestamp.
    description string
    dhcpEnable boolean
    DHCP function for the subnet.
    dnsLists string[]
    The IP address list of DNS servers on the subnet.
    gatewayIp string
    gatewayIpv6 string
    id string
    ipv6Enable boolean
    name string
    networkId string
    Specifies the OpenStack network ID.
    ntpAddresses string
    primaryDns string
    region string
    scope string
    secondaryDns string
    status string
    subnetId string
    Specifies the OpenStack subnet ID.
    subnetIdV6 string
    Specifies the OpenStack IPv6 subnet ID. Only returned if subnet is IPV6 enabled.
    tenantId string
    The project ID that owns the subnet.
    updatedAt string
    The UTC last-update timestamp.
    vpcId string
    availability_zone str
    cidr str
    cidr_ipv6 str
    created_at str
    The UTC creation timestamp.
    description str
    dhcp_enable bool
    DHCP function for the subnet.
    dns_lists Sequence[str]
    The IP address list of DNS servers on the subnet.
    gateway_ip str
    gateway_ipv6 str
    id str
    ipv6_enable bool
    name str
    network_id str
    Specifies the OpenStack network ID.
    ntp_addresses str
    primary_dns str
    region str
    scope str
    secondary_dns str
    status str
    subnet_id str
    Specifies the OpenStack subnet ID.
    subnet_id_v6 str
    Specifies the OpenStack IPv6 subnet ID. Only returned if subnet is IPV6 enabled.
    tenant_id str
    The project ID that owns the subnet.
    updated_at str
    The UTC last-update timestamp.
    vpc_id str
    availabilityZone String
    cidr String
    cidrIpv6 String
    createdAt String
    The UTC creation timestamp.
    description String
    dhcpEnable Boolean
    DHCP function for the subnet.
    dnsLists List<String>
    The IP address list of DNS servers on the subnet.
    gatewayIp String
    gatewayIpv6 String
    id String
    ipv6Enable Boolean
    name String
    networkId String
    Specifies the OpenStack network ID.
    ntpAddresses String
    primaryDns String
    region String
    scope String
    secondaryDns String
    status String
    subnetId String
    Specifies the OpenStack subnet ID.
    subnetIdV6 String
    Specifies the OpenStack IPv6 subnet ID. Only returned if subnet is IPV6 enabled.
    tenantId String
    The project ID that owns the subnet.
    updatedAt String
    The UTC last-update timestamp.
    vpcId String

    Package Details

    Repository
    opentelekomcloud opentelekomcloud/terraform-provider-opentelekomcloud
    License
    Notes
    This Pulumi package is based on the opentelekomcloud Terraform Provider.
    Viewing docs for opentelekomcloud 1.37.8
    published on Thursday, Sep 10, 2026 by opentelekomcloud

      Try Pulumi Cloud free.
      Your team will thank you.

      Start free trial