1. Packages
  2. Linode Provider
  3. API Docs
  4. getVpcSubnet
Linode v4.36.0 published on Thursday, Mar 27, 2025 by Pulumi

linode.getVpcSubnet

Explore with Pulumi AI

Linode v4.36.0 published on Thursday, Mar 27, 2025 by Pulumi

Provides information about a Linode VPC subnet. For more information, see the Linode APIv4 docs.

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;
Copy
import pulumi
import pulumi_linode as linode

foo = linode.get_vpc_subnet(vpc_id=123,
    id="12345")
pulumi.export("vpcSubnet", foo)
Copy
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
	})
}
Copy
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,
    };
});
Copy
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));
    }
}
Copy
variables:
  foo:
    fn::invoke:
      function: linode:getVpcSubnet
      arguments:
        vpcId: 123
        id: 12345
outputs:
  vpcSubnet: ${foo}
Copy

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>
Copy
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]
Copy
func LookupVpcSubnet(ctx *Context, args *LookupVpcSubnetArgs, opts ...InvokeOption) (*LookupVpcSubnetResult, error)
func LookupVpcSubnetOutput(ctx *Context, args *LookupVpcSubnetOutputArgs, opts ...InvokeOption) LookupVpcSubnetResultOutput
Copy

> 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)
}
Copy
public static CompletableFuture<GetVpcSubnetResult> getVpcSubnet(GetVpcSubnetArgs args, InvokeOptions options)
public static Output<GetVpcSubnetResult> getVpcSubnet(GetVpcSubnetArgs args, InvokeOptions options)
Copy
fn::invoke:
  function: linode:index/getVpcSubnet:getVpcSubnet
  arguments:
    # arguments dictionary
Copy

The following arguments are supported:

Id This property is required. string
The unique id of this VPC subnet.
VpcId This property is required. int
The id of the parent VPC for this VPC Subnet.
Id This property is required. string
The unique id of this VPC subnet.
VpcId This property is required. int
The id of the parent VPC for this VPC Subnet.
id This property is required. String
The unique id of this VPC subnet.
vpcId This property is required. Integer
The id of the parent VPC for this VPC Subnet.
id This property is required. string
The unique id of this VPC subnet.
vpcId This property is required. number
The id of the parent VPC for this VPC Subnet.
id This property is required. str
The unique id of this VPC subnet.
vpc_id This property is required. int
The id of the parent VPC for this VPC Subnet.
id This property is required. String
The unique id of this VPC subnet.
vpcId This property is required. 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 This property is required. int
The unique id of this VPC subnet.
Interfaces This property is required. List<GetVpcSubnetLinodeInterface>
Id This property is required. int
The unique id of this VPC subnet.
Interfaces This property is required. []GetVpcSubnetLinodeInterface
id This property is required. Integer
The unique id of this VPC subnet.
interfaces This property is required. List<GetVpcSubnetLinodeInterface>
id This property is required. number
The unique id of this VPC subnet.
interfaces This property is required. GetVpcSubnetLinodeInterface[]
id This property is required. int
The unique id of this VPC subnet.
interfaces This property is required. Sequence[GetVpcSubnetLinodeInterface]
id This property is required. Number
The unique id of this VPC subnet.
interfaces This property is required. List<Property Map>

GetVpcSubnetLinodeInterface

Active This property is required. bool
Id This property is required. int
The unique id of this VPC subnet.
Active This property is required. bool
Id This property is required. int
The unique id of this VPC subnet.
active This property is required. Boolean
id This property is required. Integer
The unique id of this VPC subnet.
active This property is required. boolean
id This property is required. number
The unique id of this VPC subnet.
active This property is required. bool
id This property is required. int
The unique id of this VPC subnet.
active This property is required. Boolean
id This property is required. 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 v4.36.0 published on Thursday, Mar 27, 2025 by Pulumi