Welcome to Pulumi Registry, your window into the cloud. Read the announcement.

Yandex

v0.10.0 published on Thursday, Nov 18, 2021 by Pulumi

getVpcSubnet

Get information about a Yandex VPC subnet. For more information, see Yandex.Cloud VPC.

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

const admin = pulumi.output(yandex.getVpcSubnet({
    subnetId: "my-subnet-id",
}));
import pulumi
import pulumi_yandex as yandex

admin = yandex.get_vpc_subnet(subnet_id="my-subnet-id")
using Pulumi;
using Yandex = Pulumi.Yandex;

class MyStack : Stack
{
    public MyStack()
    {
        var admin = Output.Create(Yandex.GetVpcSubnet.InvokeAsync(new Yandex.GetVpcSubnetArgs
        {
            SubnetId = "my-subnet-id",
        }));
    }

}
package main

import (
	"github.com/pulumi/pulumi-yandex/sdk/go/yandex"
	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)

func main() {
	pulumi.Run(func(ctx *pulumi.Context) error {
		opt0 := "my-subnet-id"
		_, err := yandex.LookupVpcSubnet(ctx, &GetVpcSubnetArgs{
			SubnetId: &opt0,
		}, nil)
		if err != nil {
			return err
		}
		return nil
	})
}

This data source is used to define [VPC Subnets] that can be used by other resources.

Using getVpcSubnet

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 getVpcSubnet(args: GetVpcSubnetArgs, opts?: InvokeOptions): Promise<GetVpcSubnetResult>
function getVpcSubnetOutput(args: GetVpcSubnetOutputArgs, opts?: InvokeOptions): Output<GetVpcSubnetResult>
def get_vpc_subnet(folder_id: Optional[str] = None,
                   name: Optional[str] = None,
                   subnet_id: Optional[str] = None,
                   opts: Optional[InvokeOptions] = None) -> GetVpcSubnetResult
def get_vpc_subnet_output(folder_id: Optional[pulumi.Input[str]] = None,
                   name: Optional[pulumi.Input[str]] = None,
                   subnet_id: Optional[pulumi.Input[str]] = None,
                   opts: Optional[InvokeOptions] = None) -> Output[GetVpcSubnetResult]
func LookupVpcSubnet(ctx *Context, args *LookupVpcSubnetArgs, opts ...InvokeOption) (*LookupVpcSubnetResult, error)
func LookupVpcSubnetOutput(ctx *Context, args *LookupVpcSubnetOutputArgs, opts ...InvokeOption) LookupVpcSubnetResultOutput

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

public static class GetVpcSubnet 
{
    public static Task<GetVpcSubnetResult> InvokeAsync(GetVpcSubnetArgs args, InvokeOptions? opts = null)
    public static Output<GetVpcSubnetResult> Invoke(GetVpcSubnetInvokeArgs args, InvokeOptions? opts = null)
}

The following arguments are supported:

FolderId string
Folder that the resource belongs to. If value is omitted, the default provider folder is used.
Name string
  • Name of the subnet.
SubnetId string
Subnet ID.
FolderId string
Folder that the resource belongs to. If value is omitted, the default provider folder is used.
Name string
  • Name of the subnet.
SubnetId string
Subnet ID.
folderId string
Folder that the resource belongs to. If value is omitted, the default provider folder is used.
name string
  • Name of the subnet.
subnetId string
Subnet ID.
folder_id str
Folder that the resource belongs to. If value is omitted, the default provider folder is used.
name str
  • Name of the subnet.
subnet_id str
Subnet ID.

getVpcSubnet Result

The following output properties are available:

CreatedAt string
Creation timestamp of this subnet.
Description string
Description of the subnet.
DhcpOptions GetVpcSubnetDhcpOptions
Options for DHCP client. The structure is documented below.
FolderId string
Id string
The provider-assigned unique ID for this managed resource.
Labels Dictionary<string, string>
Labels to assign to this subnet.
Name string
NetworkId string
ID of the network this subnet belongs to.
RouteTableId string
ID of the route table to assign to this subnet.
SubnetId string
V4CidrBlocks List<string>
The blocks of internal IPv4 addresses owned by this subnet.
V6CidrBlocks List<string>
The blocks of internal IPv6 addresses owned by this subnet.
Zone string
Name of the availability zone for this subnet.
CreatedAt string
Creation timestamp of this subnet.
Description string
Description of the subnet.
DhcpOptions GetVpcSubnetDhcpOptions
Options for DHCP client. The structure is documented below.
FolderId string
Id string
The provider-assigned unique ID for this managed resource.
Labels map[string]string
Labels to assign to this subnet.
Name string
NetworkId string
ID of the network this subnet belongs to.
RouteTableId string
ID of the route table to assign to this subnet.
SubnetId string
V4CidrBlocks []string
The blocks of internal IPv4 addresses owned by this subnet.
V6CidrBlocks []string
The blocks of internal IPv6 addresses owned by this subnet.
Zone string
Name of the availability zone for this subnet.
createdAt string
Creation timestamp of this subnet.
description string
Description of the subnet.
dhcpOptions GetVpcSubnetDhcpOptions
Options for DHCP client. The structure is documented below.
folderId string
id string
The provider-assigned unique ID for this managed resource.
labels {[key: string]: string}
Labels to assign to this subnet.
name string
networkId string
ID of the network this subnet belongs to.
routeTableId string
ID of the route table to assign to this subnet.
subnetId string
v4CidrBlocks string[]
The blocks of internal IPv4 addresses owned by this subnet.
v6CidrBlocks string[]
The blocks of internal IPv6 addresses owned by this subnet.
zone string
Name of the availability zone for this subnet.
created_at str
Creation timestamp of this subnet.
description str
Description of the subnet.
dhcp_options GetVpcSubnetDhcpOptions
Options for DHCP client. The structure is documented below.
folder_id str
id str
The provider-assigned unique ID for this managed resource.
labels Mapping[str, str]
Labels to assign to this subnet.
name str
network_id str
ID of the network this subnet belongs to.
route_table_id str
ID of the route table to assign to this subnet.
subnet_id str
v4_cidr_blocks Sequence[str]
The blocks of internal IPv4 addresses owned by this subnet.
v6_cidr_blocks Sequence[str]
The blocks of internal IPv6 addresses owned by this subnet.
zone str
Name of the availability zone for this subnet.

Supporting Types

GetVpcSubnetDhcpOptions

DomainName string
Domain name.
DomainNameServers List<string>
Domain name server IP addresses.
NtpServers List<string>
NTP server IP addresses.
DomainName string
Domain name.
DomainNameServers []string
Domain name server IP addresses.
NtpServers []string
NTP server IP addresses.
domainName string
Domain name.
domainNameServers string[]
Domain name server IP addresses.
ntpServers string[]
NTP server IP addresses.
domain_name str
Domain name.
domain_name_servers Sequence[str]
Domain name server IP addresses.
ntp_servers Sequence[str]
NTP server IP addresses.

Package Details

Repository
https://github.com/pulumi/pulumi-yandex
License
Apache-2.0
Notes
This Pulumi package is based on the yandex Terraform Provider.