1. Packages
  2. Yandex
  3. API Docs
  4. getVpcSubnet
Yandex v0.13.0 published on Tuesday, Feb 22, 2022 by Pulumi

yandex.getVpcSubnet

Explore with Pulumi AI

yandex logo
Yandex v0.13.0 published on Tuesday, Feb 22, 2022 by Pulumi

    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)
    }
    public static CompletableFuture<GetVpcSubnetResult> getVpcSubnet(GetVpcSubnetArgs args, InvokeOptions options)
    // Output-based functions aren't available in Java yet
    
    fn::invoke:
      function: yandex:index/getVpcSubnet:getVpcSubnet
      arguments:
        # arguments dictionary

    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.
    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.
    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.

    getVpcSubnet Result

    The following output properties are available:

    CreatedAt string
    Creation timestamp of this subnet.
    Description string
    Description of the subnet.
    DhcpOptions List<GetVpcSubnetDhcpOption>
    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 []GetVpcSubnetDhcpOption
    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 List<GetVpcSubnetDhcpOption>
    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 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 GetVpcSubnetDhcpOption[]
    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 Sequence[GetVpcSubnetDhcpOption]
    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.
    createdAt String
    Creation timestamp of this subnet.
    description String
    Description of the subnet.
    dhcpOptions List<Property Map>
    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>
    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.

    Supporting Types

    GetVpcSubnetDhcpOption

    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 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.
    domain_name str
    Domain name.
    domain_name_servers Sequence[str]
    Domain name server IP addresses.
    ntp_servers Sequence[str]
    NTP server IP addresses.
    domainName String
    Domain name.
    domainNameServers List<String>
    Domain name server IP addresses.
    ntpServers List<String>
    NTP server IP addresses.

    Package Details

    Repository
    Yandex pulumi/pulumi-yandex
    License
    Apache-2.0
    Notes
    This Pulumi package is based on the yandex Terraform Provider.
    yandex logo
    Yandex v0.13.0 published on Tuesday, Feb 22, 2022 by Pulumi