1. Registry
  2. Packages
  3. Linode Provider
  4. API Docs
  5. getVpcSubnet
Viewing docs for Linode v6.7.0
published on Wednesday, Sep 30, 2026 by Pulumi
linode logo linode logo
Viewing docs for Linode v6.7.0
published on Wednesday, Sep 30, 2026 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;
    
    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/v6/go/linode"
    	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
    )
    
    func main() {
    	pulumi.Run(func(ctx *pulumi.Context) error {
    		foo, err := linode.GetVpcSubnet(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.ArrayList;
    import java.util.Arrays;
    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);
        }
    }
    
    variables:
      foo:
        fn::invoke:
          function: linode:getVpcSubnet
          arguments:
            vpcId: 123
            id: 12345
    outputs:
      vpcSubnet: ${foo}
    
    pulumi {
      required_providers {
        linode = {
          source = "pulumi/linode"
        }
      }
    }
    
    data "linode_getvpcsubnet" "foo" {
      vpc_id = 123
      id     = 12345
    }
    
    output "vpcSubnet" {
      value = data.linode_getvpcsubnet.foo
    }
    

    IPv6

    Limited Availability IPv6 VPCs may not currently be available to all users.

    The following attributes are exported under each entry of the ipv6 field:

    • range - An IPv6 range allocated to this subnet in CIDR format.

    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?: InvokeOutputOptions): 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: pulumi.Input[Optional[str]] = None,
                       vpc_id: pulumi.Input[Optional[int]] = None,
                       opts: Optional[InvokeOutputOptions] = 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 Output<GetVpcSubnetResult> Invoke(GetVpcSubnetInvokeArgs args, InvokeOutputOptions opts)
    }
    public static CompletableFuture<GetVpcSubnetResult> getVpcSubnet(GetVpcSubnetArgs args, InvokeOptions options)
    public static Output<GetVpcSubnetResult> getVpcSubnet(GetVpcSubnetArgs args, InvokeOptions options)
    public static Output<GetVpcSubnetResult> getVpcSubnet(GetVpcSubnetArgs args, InvokeOutputOptions options)
    
    fn::invoke:
      function: linode:index/getVpcSubnet:getVpcSubnet
      arguments:
        # arguments dictionary
    data "linode_get_vpc_subnet" "name" {
        # arguments
    }

    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.
    vpc_id number
    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.
    Databases List<GetVpcSubnetDatabase>
    (Read-Only Object List) A list of Managed databases assigned to the VPC Subnet. Referenced with an index (e.g. databases.0.id).
    Id string
    ID of a NodeBalancer assigned to the VPC Subnet.
    Ipv4 string
    The IPv4 range of this subnet in CIDR format.
    Ipv6s List<GetVpcSubnetIpv6>
    Label string
    The label of the VPC subnet.
    Linodes List<GetVpcSubnetLinode>
    (Read-Only Object List) A list of Linodes added to this subnet. Referenced with an index (e.g. linodes.0.id).
    Nodebalancers List<GetVpcSubnetNodebalancer>
    (Read-Only Object List) A list of NodeBalancers assigned to the VPC Subnet. Referenced with an index (e.g. nodebalancers.0.id).
    Updated string
    The date and time when the VPC Subnet was last updated.
    VpcId int
    VpcType string
    The type of the parent VPC (regular or rdma). Omitted if the requesting account does not have access to the GPUDirect RDMA functionality.
    Created string
    The date and time when the VPC Subnet was created.
    Databases []GetVpcSubnetDatabase
    (Read-Only Object List) A list of Managed databases assigned to the VPC Subnet. Referenced with an index (e.g. databases.0.id).
    Id string
    ID of a NodeBalancer assigned to the VPC Subnet.
    Ipv4 string
    The IPv4 range of this subnet in CIDR format.
    Ipv6s []GetVpcSubnetIpv6
    Label string
    The label of the VPC subnet.
    Linodes []GetVpcSubnetLinode
    (Read-Only Object List) A list of Linodes added to this subnet. Referenced with an index (e.g. linodes.0.id).
    Nodebalancers []GetVpcSubnetNodebalancer
    (Read-Only Object List) A list of NodeBalancers assigned to the VPC Subnet. Referenced with an index (e.g. nodebalancers.0.id).
    Updated string
    The date and time when the VPC Subnet was last updated.
    VpcId int
    VpcType string
    The type of the parent VPC (regular or rdma). Omitted if the requesting account does not have access to the GPUDirect RDMA functionality.
    created string
    The date and time when the VPC Subnet was created.
    databases list(object)
    (Read-Only Object List) A list of Managed databases assigned to the VPC Subnet. Referenced with an index (e.g. databases.0.id).
    id string
    ID of a NodeBalancer assigned to the VPC Subnet.
    ipv4 string
    The IPv4 range of this subnet in CIDR format.
    ipv6s list(object)
    label string
    The label of the VPC subnet.
    linodes list(object)
    (Read-Only Object List) A list of Linodes added to this subnet. Referenced with an index (e.g. linodes.0.id).
    nodebalancers list(object)
    (Read-Only Object List) A list of NodeBalancers assigned to the VPC Subnet. Referenced with an index (e.g. nodebalancers.0.id).
    updated string
    The date and time when the VPC Subnet was last updated.
    vpc_id number
    vpc_type string
    The type of the parent VPC (regular or rdma). Omitted if the requesting account does not have access to the GPUDirect RDMA functionality.
    created String
    The date and time when the VPC Subnet was created.
    databases List<GetVpcSubnetDatabase>
    (Read-Only Object List) A list of Managed databases assigned to the VPC Subnet. Referenced with an index (e.g. databases.0.id).
    id String
    ID of a NodeBalancer assigned to the VPC Subnet.
    ipv4 String
    The IPv4 range of this subnet in CIDR format.
    ipv6s List<GetVpcSubnetIpv6>
    label String
    The label of the VPC subnet.
    linodes List<GetVpcSubnetLinode>
    (Read-Only Object List) A list of Linodes added to this subnet. Referenced with an index (e.g. linodes.0.id).
    nodebalancers List<GetVpcSubnetNodebalancer>
    (Read-Only Object List) A list of NodeBalancers assigned to the VPC Subnet. Referenced with an index (e.g. nodebalancers.0.id).
    updated String
    The date and time when the VPC Subnet was last updated.
    vpcId Integer
    vpcType String
    The type of the parent VPC (regular or rdma). Omitted if the requesting account does not have access to the GPUDirect RDMA functionality.
    created string
    The date and time when the VPC Subnet was created.
    databases GetVpcSubnetDatabase[]
    (Read-Only Object List) A list of Managed databases assigned to the VPC Subnet. Referenced with an index (e.g. databases.0.id).
    id string
    ID of a NodeBalancer assigned to the VPC Subnet.
    ipv4 string
    The IPv4 range of this subnet in CIDR format.
    ipv6s GetVpcSubnetIpv6[]
    label string
    The label of the VPC subnet.
    linodes GetVpcSubnetLinode[]
    (Read-Only Object List) A list of Linodes added to this subnet. Referenced with an index (e.g. linodes.0.id).
    nodebalancers GetVpcSubnetNodebalancer[]
    (Read-Only Object List) A list of NodeBalancers assigned to the VPC Subnet. Referenced with an index (e.g. nodebalancers.0.id).
    updated string
    The date and time when the VPC Subnet was last updated.
    vpcId number
    vpcType string
    The type of the parent VPC (regular or rdma). Omitted if the requesting account does not have access to the GPUDirect RDMA functionality.
    created str
    The date and time when the VPC Subnet was created.
    databases Sequence[GetVpcSubnetDatabase]
    (Read-Only Object List) A list of Managed databases assigned to the VPC Subnet. Referenced with an index (e.g. databases.0.id).
    id str
    ID of a NodeBalancer assigned to the VPC Subnet.
    ipv4 str
    The IPv4 range of this subnet in CIDR format.
    ipv6s Sequence[GetVpcSubnetIpv6]
    label str
    The label of the VPC subnet.
    linodes Sequence[GetVpcSubnetLinode]
    (Read-Only Object List) A list of Linodes added to this subnet. Referenced with an index (e.g. linodes.0.id).
    nodebalancers Sequence[GetVpcSubnetNodebalancer]
    (Read-Only Object List) A list of NodeBalancers assigned to the VPC Subnet. Referenced with an index (e.g. nodebalancers.0.id).
    updated str
    The date and time when the VPC Subnet was last updated.
    vpc_id int
    vpc_type str
    The type of the parent VPC (regular or rdma). Omitted if the requesting account does not have access to the GPUDirect RDMA functionality.
    created String
    The date and time when the VPC Subnet was created.
    databases List<Property Map>
    (Read-Only Object List) A list of Managed databases assigned to the VPC Subnet. Referenced with an index (e.g. databases.0.id).
    id String
    ID of a NodeBalancer assigned to the VPC Subnet.
    ipv4 String
    The IPv4 range of this subnet in CIDR format.
    ipv6s List<Property Map>
    label String
    The label of the VPC subnet.
    linodes List<Property Map>
    (Read-Only Object List) A list of Linodes added to this subnet. Referenced with an index (e.g. linodes.0.id).
    nodebalancers List<Property Map>
    (Read-Only Object List) A list of NodeBalancers assigned to the VPC Subnet. Referenced with an index (e.g. nodebalancers.0.id).
    updated String
    The date and time when the VPC Subnet was last updated.
    vpcId Number
    vpcType String
    The type of the parent VPC (regular or rdma). Omitted if the requesting account does not have access to the GPUDirect RDMA functionality.

    Supporting Types

    GetVpcSubnetDatabase

    Id int
    The unique id of this VPC subnet.
    Ipv4Range string
    IPv4 range assigned to the NodeBalancer.
    Ipv6Ranges List<GetVpcSubnetDatabaseIpv6Range>
    (Read-Only Object List) A list of IPv6 ranges assigned to the NodeBalancer. Referenced with an index (e.g. nodebalancers.0.ipv6_ranges.0.range).
    Id int
    The unique id of this VPC subnet.
    Ipv4Range string
    IPv4 range assigned to the NodeBalancer.
    Ipv6Ranges []GetVpcSubnetDatabaseIpv6Range
    (Read-Only Object List) A list of IPv6 ranges assigned to the NodeBalancer. Referenced with an index (e.g. nodebalancers.0.ipv6_ranges.0.range).
    id number
    The unique id of this VPC subnet.
    ipv4_range string
    IPv4 range assigned to the NodeBalancer.
    ipv6_ranges list(object)
    (Read-Only Object List) A list of IPv6 ranges assigned to the NodeBalancer. Referenced with an index (e.g. nodebalancers.0.ipv6_ranges.0.range).
    id Integer
    The unique id of this VPC subnet.
    ipv4Range String
    IPv4 range assigned to the NodeBalancer.
    ipv6Ranges List<GetVpcSubnetDatabaseIpv6Range>
    (Read-Only Object List) A list of IPv6 ranges assigned to the NodeBalancer. Referenced with an index (e.g. nodebalancers.0.ipv6_ranges.0.range).
    id number
    The unique id of this VPC subnet.
    ipv4Range string
    IPv4 range assigned to the NodeBalancer.
    ipv6Ranges GetVpcSubnetDatabaseIpv6Range[]
    (Read-Only Object List) A list of IPv6 ranges assigned to the NodeBalancer. Referenced with an index (e.g. nodebalancers.0.ipv6_ranges.0.range).
    id int
    The unique id of this VPC subnet.
    ipv4_range str
    IPv4 range assigned to the NodeBalancer.
    ipv6_ranges Sequence[GetVpcSubnetDatabaseIpv6Range]
    (Read-Only Object List) A list of IPv6 ranges assigned to the NodeBalancer. Referenced with an index (e.g. nodebalancers.0.ipv6_ranges.0.range).
    id Number
    The unique id of this VPC subnet.
    ipv4Range String
    IPv4 range assigned to the NodeBalancer.
    ipv6Ranges List<Property Map>
    (Read-Only Object List) A list of IPv6 ranges assigned to the NodeBalancer. Referenced with an index (e.g. nodebalancers.0.ipv6_ranges.0.range).

    GetVpcSubnetDatabaseIpv6Range

    Range string
    An IPv6 address range in CIDR notation.
    Range string
    An IPv6 address range in CIDR notation.
    range string
    An IPv6 address range in CIDR notation.
    range String
    An IPv6 address range in CIDR notation.
    range string
    An IPv6 address range in CIDR notation.
    range str
    An IPv6 address range in CIDR notation.
    range String
    An IPv6 address range in CIDR notation.

    GetVpcSubnetIpv6

    Range string
    An IPv6 address range in CIDR notation.
    Range string
    An IPv6 address range in CIDR notation.
    range string
    An IPv6 address range in CIDR notation.
    range String
    An IPv6 address range in CIDR notation.
    range string
    An IPv6 address range in CIDR notation.
    range str
    An IPv6 address range in CIDR notation.
    range String
    An IPv6 address range in CIDR notation.

    GetVpcSubnetLinode

    Id int
    The unique id of this VPC subnet.
    Interfaces List<GetVpcSubnetLinodeInterface>
    (Read-Only Object List) A list of networking interfaces objects. Referenced with an index (e.g. linodes.0.interfaces.0.id).
    Id int
    The unique id of this VPC subnet.
    Interfaces []GetVpcSubnetLinodeInterface
    (Read-Only Object List) A list of networking interfaces objects. Referenced with an index (e.g. linodes.0.interfaces.0.id).
    id number
    The unique id of this VPC subnet.
    interfaces list(object)
    (Read-Only Object List) A list of networking interfaces objects. Referenced with an index (e.g. linodes.0.interfaces.0.id).
    id Integer
    The unique id of this VPC subnet.
    interfaces List<GetVpcSubnetLinodeInterface>
    (Read-Only Object List) A list of networking interfaces objects. Referenced with an index (e.g. linodes.0.interfaces.0.id).
    id number
    The unique id of this VPC subnet.
    interfaces GetVpcSubnetLinodeInterface[]
    (Read-Only Object List) A list of networking interfaces objects. Referenced with an index (e.g. linodes.0.interfaces.0.id).
    id int
    The unique id of this VPC subnet.
    interfaces Sequence[GetVpcSubnetLinodeInterface]
    (Read-Only Object List) A list of networking interfaces objects. Referenced with an index (e.g. linodes.0.interfaces.0.id).
    id Number
    The unique id of this VPC subnet.
    interfaces List<Property Map>
    (Read-Only Object List) A list of networking interfaces objects. Referenced with an index (e.g. linodes.0.interfaces.0.id).

    GetVpcSubnetLinodeInterface

    Active bool
    Whether the Interface is actively in use.
    ConfigId int
    ID of Linode Config that the interface is associated with. null for a Linode Interface.
    Id int
    The unique id of this VPC subnet.
    Active bool
    Whether the Interface is actively in use.
    ConfigId int
    ID of Linode Config that the interface is associated with. null for a Linode Interface.
    Id int
    The unique id of this VPC subnet.
    active bool
    Whether the Interface is actively in use.
    config_id number
    ID of Linode Config that the interface is associated with. null for a Linode Interface.
    id number
    The unique id of this VPC subnet.
    active Boolean
    Whether the Interface is actively in use.
    configId Integer
    ID of Linode Config that the interface is associated with. null for a Linode Interface.
    id Integer
    The unique id of this VPC subnet.
    active boolean
    Whether the Interface is actively in use.
    configId number
    ID of Linode Config that the interface is associated with. null for a Linode Interface.
    id number
    The unique id of this VPC subnet.
    active bool
    Whether the Interface is actively in use.
    config_id int
    ID of Linode Config that the interface is associated with. null for a Linode Interface.
    id int
    The unique id of this VPC subnet.
    active Boolean
    Whether the Interface is actively in use.
    configId Number
    ID of Linode Config that the interface is associated with. null for a Linode Interface.
    id Number
    The unique id of this VPC subnet.

    GetVpcSubnetNodebalancer

    Id int
    The unique id of this VPC subnet.
    Ipv4Range string
    IPv4 range assigned to the NodeBalancer.
    Ipv6Ranges List<GetVpcSubnetNodebalancerIpv6Range>
    (Read-Only Object List) A list of IPv6 ranges assigned to the NodeBalancer. Referenced with an index (e.g. nodebalancers.0.ipv6_ranges.0.range).
    Id int
    The unique id of this VPC subnet.
    Ipv4Range string
    IPv4 range assigned to the NodeBalancer.
    Ipv6Ranges []GetVpcSubnetNodebalancerIpv6Range
    (Read-Only Object List) A list of IPv6 ranges assigned to the NodeBalancer. Referenced with an index (e.g. nodebalancers.0.ipv6_ranges.0.range).
    id number
    The unique id of this VPC subnet.
    ipv4_range string
    IPv4 range assigned to the NodeBalancer.
    ipv6_ranges list(object)
    (Read-Only Object List) A list of IPv6 ranges assigned to the NodeBalancer. Referenced with an index (e.g. nodebalancers.0.ipv6_ranges.0.range).
    id Integer
    The unique id of this VPC subnet.
    ipv4Range String
    IPv4 range assigned to the NodeBalancer.
    ipv6Ranges List<GetVpcSubnetNodebalancerIpv6Range>
    (Read-Only Object List) A list of IPv6 ranges assigned to the NodeBalancer. Referenced with an index (e.g. nodebalancers.0.ipv6_ranges.0.range).
    id number
    The unique id of this VPC subnet.
    ipv4Range string
    IPv4 range assigned to the NodeBalancer.
    ipv6Ranges GetVpcSubnetNodebalancerIpv6Range[]
    (Read-Only Object List) A list of IPv6 ranges assigned to the NodeBalancer. Referenced with an index (e.g. nodebalancers.0.ipv6_ranges.0.range).
    id int
    The unique id of this VPC subnet.
    ipv4_range str
    IPv4 range assigned to the NodeBalancer.
    ipv6_ranges Sequence[GetVpcSubnetNodebalancerIpv6Range]
    (Read-Only Object List) A list of IPv6 ranges assigned to the NodeBalancer. Referenced with an index (e.g. nodebalancers.0.ipv6_ranges.0.range).
    id Number
    The unique id of this VPC subnet.
    ipv4Range String
    IPv4 range assigned to the NodeBalancer.
    ipv6Ranges List<Property Map>
    (Read-Only Object List) A list of IPv6 ranges assigned to the NodeBalancer. Referenced with an index (e.g. nodebalancers.0.ipv6_ranges.0.range).

    GetVpcSubnetNodebalancerIpv6Range

    Range string
    An IPv6 address range in CIDR notation.
    Range string
    An IPv6 address range in CIDR notation.
    range string
    An IPv6 address range in CIDR notation.
    range String
    An IPv6 address range in CIDR notation.
    range string
    An IPv6 address range in CIDR notation.
    range str
    An IPv6 address range in CIDR notation.
    range String
    An IPv6 address range in CIDR notation.

    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 logo
    Viewing docs for Linode v6.7.0
    published on Wednesday, Sep 30, 2026 by Pulumi

      Try Pulumi Cloud free.
      Your team will thank you.

      Start free trial