1. Packages
  2. Linode
  3. API Docs
  4. getVpcSubnet
Linode v4.22.1 published on Wednesday, Jul 3, 2024 by Pulumi

linode.getVpcSubnet

Explore with Pulumi AI

linode logo
Linode v4.22.1 published on Wednesday, Jul 3, 2024 by Pulumi

    Provides information about a Linode VPC subnet.

    Example Usage

    The following example shows how one might use this data source to access information about a Linode VPC subnet.

    import * as pulumi from "@pulumi/pulumi";
    import * as linode from "@pulumi/linode";
    
    const foo = linode.getVpcSubnet({
        vpcId: 123,
        id: "12345",
    });
    export const vpcSubnet = foo;
    
    import pulumi
    import pulumi_linode as linode
    
    foo = linode.get_vpc_subnet(vpc_id=123,
        id="12345")
    pulumi.export("vpcSubnet", foo)
    
    package main
    
    import (
    	"github.com/pulumi/pulumi-linode/sdk/v4/go/linode"
    	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
    )
    
    func main() {
    	pulumi.Run(func(ctx *pulumi.Context) error {
    		foo, err := linode.LookupVpcSubnet(ctx, &linode.LookupVpcSubnetArgs{
    			VpcId: 123,
    			Id:    "12345",
    		}, nil)
    		if err != nil {
    			return err
    		}
    		ctx.Export("vpcSubnet", foo)
    		return nil
    	})
    }
    
    using System.Collections.Generic;
    using System.Linq;
    using Pulumi;
    using Linode = Pulumi.Linode;
    
    return await Deployment.RunAsync(() => 
    {
        var foo = Linode.GetVpcSubnet.Invoke(new()
        {
            VpcId = 123,
            Id = "12345",
        });
    
        return new Dictionary<string, object?>
        {
            ["vpcSubnet"] = foo,
        };
    });
    
    package generated_program;
    
    import com.pulumi.Context;
    import com.pulumi.Pulumi;
    import com.pulumi.core.Output;
    import com.pulumi.linode.LinodeFunctions;
    import com.pulumi.linode.inputs.GetVpcSubnetArgs;
    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 foo = LinodeFunctions.getVpcSubnet(GetVpcSubnetArgs.builder()
                .vpcId(123)
                .id(12345)
                .build());
    
            ctx.export("vpcSubnet", foo.applyValue(getVpcSubnetResult -> getVpcSubnetResult));
        }
    }
    
    variables:
      foo:
        fn::invoke:
          Function: linode:getVpcSubnet
          Arguments:
            vpcId: 123
            id: 12345
    outputs:
      vpcSubnet: ${foo}
    

    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(id: Optional[str] = None,
                       vpc_id: Optional[int] = None,
                       opts: Optional[InvokeOptions] = None) -> GetVpcSubnetResult
    def get_vpc_subnet_output(id: Optional[pulumi.Input[str]] = None,
                       vpc_id: Optional[pulumi.Input[int]] = 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: linode:index/getVpcSubnet:getVpcSubnet
      arguments:
        # arguments dictionary

    The following arguments are supported:

    Id string
    The unique id of this VPC subnet.
    VpcId int
    The id of the parent VPC for this VPC Subnet.
    Id string
    The unique id of this VPC subnet.
    VpcId int
    The id of the parent VPC for this VPC Subnet.
    id String
    The unique id of this VPC subnet.
    vpcId Integer
    The id of the parent VPC for this VPC Subnet.
    id string
    The unique id of this VPC subnet.
    vpcId number
    The id of the parent VPC for this VPC Subnet.
    id str
    The unique id of this VPC subnet.
    vpc_id int
    The id of the parent VPC for this VPC Subnet.
    id String
    The unique id of this VPC subnet.
    vpcId Number
    The id of the parent VPC for this VPC Subnet.

    getVpcSubnet Result

    The following output properties are available:

    Created string
    The date and time when the VPC Subnet was created.
    Id string
    Ipv4 string
    The IPv4 range of this subnet in CIDR format.
    Label string
    The label of the VPC subnet.
    Linodes List<GetVpcSubnetLinode>
    A list of Linode IDs that added to this subnet.
    Updated string
    The date and time when the VPC Subnet was last updated.
    VpcId int
    Created string
    The date and time when the VPC Subnet was created.
    Id string
    Ipv4 string
    The IPv4 range of this subnet in CIDR format.
    Label string
    The label of the VPC subnet.
    Linodes []GetVpcSubnetLinode
    A list of Linode IDs that added to this subnet.
    Updated string
    The date and time when the VPC Subnet was last updated.
    VpcId int
    created String
    The date and time when the VPC Subnet was created.
    id String
    ipv4 String
    The IPv4 range of this subnet in CIDR format.
    label String
    The label of the VPC subnet.
    linodes List<GetVpcSubnetLinode>
    A list of Linode IDs that added to this subnet.
    updated String
    The date and time when the VPC Subnet was last updated.
    vpcId Integer
    created string
    The date and time when the VPC Subnet was created.
    id string
    ipv4 string
    The IPv4 range of this subnet in CIDR format.
    label string
    The label of the VPC subnet.
    linodes GetVpcSubnetLinode[]
    A list of Linode IDs that added to this subnet.
    updated string
    The date and time when the VPC Subnet was last updated.
    vpcId number
    created str
    The date and time when the VPC Subnet was created.
    id str
    ipv4 str
    The IPv4 range of this subnet in CIDR format.
    label str
    The label of the VPC subnet.
    linodes Sequence[GetVpcSubnetLinode]
    A list of Linode IDs that added to this subnet.
    updated str
    The date and time when the VPC Subnet was last updated.
    vpc_id int
    created String
    The date and time when the VPC Subnet was created.
    id String
    ipv4 String
    The IPv4 range of this subnet in CIDR format.
    label String
    The label of the VPC subnet.
    linodes List<Property Map>
    A list of Linode IDs that added to this subnet.
    updated String
    The date and time when the VPC Subnet was last updated.
    vpcId Number

    Supporting Types

    GetVpcSubnetLinode

    Id int
    The unique id of this VPC subnet.
    Interfaces List<GetVpcSubnetLinodeInterface>
    Id int
    The unique id of this VPC subnet.
    Interfaces []GetVpcSubnetLinodeInterface
    id Integer
    The unique id of this VPC subnet.
    interfaces List<GetVpcSubnetLinodeInterface>
    id number
    The unique id of this VPC subnet.
    interfaces GetVpcSubnetLinodeInterface[]
    id int
    The unique id of this VPC subnet.
    interfaces Sequence[GetVpcSubnetLinodeInterface]
    id Number
    The unique id of this VPC subnet.
    interfaces List<Property Map>

    GetVpcSubnetLinodeInterface

    Active bool
    Id int
    The unique id of this VPC subnet.
    Active bool
    Id int
    The unique id of this VPC subnet.
    active Boolean
    id Integer
    The unique id of this VPC subnet.
    active boolean
    id number
    The unique id of this VPC subnet.
    active bool
    id int
    The unique id of this VPC subnet.
    active Boolean
    id Number
    The unique id of this VPC subnet.

    Package Details

    Repository
    Linode pulumi/pulumi-linode
    License
    Apache-2.0
    Notes
    This Pulumi package is based on the linode Terraform Provider.
    linode logo
    Linode v4.22.1 published on Wednesday, Jul 3, 2024 by Pulumi