published on Wednesday, May 6, 2026 by Pulumi
published on Wednesday, May 6, 2026 by Pulumi
Provides information about a list of Linode VPC subnets that match a set of filters. For more information, see the Linode APIv4 docs.
Example Usage
The following example shows how one might use this data source to list VPC subnets.
import * as pulumi from "@pulumi/pulumi";
import * as linode from "@pulumi/linode";
const filtered_subnets = linode.getVpcSubnets({
vpcId: 123,
filters: [{
name: "label",
values: ["test"],
}],
});
export const vpcSubnets = filtered_subnets.then(filtered_subnets => filtered_subnets.vpcSubnets);
import pulumi
import pulumi_linode as linode
filtered_subnets = linode.get_vpc_subnets(vpc_id=123,
filters=[{
"name": "label",
"values": ["test"],
}])
pulumi.export("vpcSubnets", filtered_subnets.vpc_subnets)
package main
import (
"github.com/pulumi/pulumi-linode/sdk/v5/go/linode"
"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)
func main() {
pulumi.Run(func(ctx *pulumi.Context) error {
filtered_subnets, err := linode.GetVpcSubnets(ctx, &linode.GetVpcSubnetsArgs{
VpcId: 123,
Filters: []linode.GetVpcSubnetsFilter{
{
Name: "label",
Values: []string{
"test",
},
},
},
}, nil)
if err != nil {
return err
}
ctx.Export("vpcSubnets", filtered_subnets.VpcSubnets)
return nil
})
}
using System.Collections.Generic;
using System.Linq;
using Pulumi;
using Linode = Pulumi.Linode;
return await Deployment.RunAsync(() =>
{
var filtered_subnets = Linode.Index.GetVpcSubnets.Invoke(new()
{
VpcId = 123,
Filters = new[]
{
new Linode.Inputs.GetVpcSubnetsFilterInputArgs
{
Name = "label",
Values = new[]
{
"test",
},
},
},
});
return new Dictionary<string, object?>
{
["vpcSubnets"] = filtered_subnets.Apply(filtered_subnets => filtered_subnets.Apply(getVpcSubnetsResult => getVpcSubnetsResult.VpcSubnets)),
};
});
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.GetVpcSubnetsArgs;
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 filtered-subnets = LinodeFunctions.getVpcSubnets(GetVpcSubnetsArgs.builder()
.vpcId(123)
.filters(GetVpcSubnetsFilterArgs.builder()
.name("label")
.values("test")
.build())
.build());
ctx.export("vpcSubnets", filtered_subnets.vpcSubnets());
}
}
variables:
filtered-subnets:
fn::invoke:
function: linode:getVpcSubnets
arguments:
vpcId: 123
filters:
- name: label
values:
- test
outputs:
vpcSubnets: ${["filtered-subnets"].vpcSubnets}
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.
Filterable Fields
idlabelipv4
Using getVpcSubnets
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 getVpcSubnets(args: GetVpcSubnetsArgs, opts?: InvokeOptions): Promise<GetVpcSubnetsResult>
function getVpcSubnetsOutput(args: GetVpcSubnetsOutputArgs, opts?: InvokeOptions): Output<GetVpcSubnetsResult>def get_vpc_subnets(filters: Optional[Sequence[GetVpcSubnetsFilter]] = None,
vpc_id: Optional[int] = None,
opts: Optional[InvokeOptions] = None) -> GetVpcSubnetsResult
def get_vpc_subnets_output(filters: pulumi.Input[Optional[Sequence[pulumi.Input[GetVpcSubnetsFilterArgs]]]] = None,
vpc_id: pulumi.Input[Optional[int]] = None,
opts: Optional[InvokeOptions] = None) -> Output[GetVpcSubnetsResult]func GetVpcSubnets(ctx *Context, args *GetVpcSubnetsArgs, opts ...InvokeOption) (*GetVpcSubnetsResult, error)
func GetVpcSubnetsOutput(ctx *Context, args *GetVpcSubnetsOutputArgs, opts ...InvokeOption) GetVpcSubnetsResultOutput> Note: This function is named GetVpcSubnets in the Go SDK.
public static class GetVpcSubnets
{
public static Task<GetVpcSubnetsResult> InvokeAsync(GetVpcSubnetsArgs args, InvokeOptions? opts = null)
public static Output<GetVpcSubnetsResult> Invoke(GetVpcSubnetsInvokeArgs args, InvokeOptions? opts = null)
}public static CompletableFuture<GetVpcSubnetsResult> getVpcSubnets(GetVpcSubnetsArgs args, InvokeOptions options)
public static Output<GetVpcSubnetsResult> getVpcSubnets(GetVpcSubnetsArgs args, InvokeOptions options)
fn::invoke:
function: linode:index/getVpcSubnets:getVpcSubnets
arguments:
# arguments dictionaryThe following arguments are supported:
- Vpc
Id int - The id of the parent VPC for the list of VPCs.
filter- (Optional) A set of filters used to select Linode VPC subnets that meet certain requirements.
- Filters
List<Get
Vpc Subnets Filter>
- Vpc
Id int - The id of the parent VPC for the list of VPCs.
filter- (Optional) A set of filters used to select Linode VPC subnets that meet certain requirements.
- Filters
[]Get
Vpc Subnets Filter
- vpc
Id Integer - The id of the parent VPC for the list of VPCs.
filter- (Optional) A set of filters used to select Linode VPC subnets that meet certain requirements.
- filters
List<Get
Vpc Subnets Filter>
- vpc
Id number - The id of the parent VPC for the list of VPCs.
filter- (Optional) A set of filters used to select Linode VPC subnets that meet certain requirements.
- filters
Get
Vpc Subnets Filter[]
- vpc_
id int - The id of the parent VPC for the list of VPCs.
filter- (Optional) A set of filters used to select Linode VPC subnets that meet certain requirements.
- filters
Sequence[Get
Vpc Subnets Filter]
- vpc
Id Number - The id of the parent VPC for the list of VPCs.
filter- (Optional) A set of filters used to select Linode VPC subnets that meet certain requirements.
- filters List<Property Map>
getVpcSubnets Result
The following output properties are available:
- Id string
- ID of a managed database assigned to the VPC Subnet.
- Vpc
Id int - Vpc
Subnets List<GetVpc Subnets Vpc Subnet> - Filters
List<Get
Vpc Subnets Filter>
- Id string
- ID of a managed database assigned to the VPC Subnet.
- Vpc
Id int - Vpc
Subnets []GetVpc Subnets Vpc Subnet - Filters
[]Get
Vpc Subnets Filter
- id String
- ID of a managed database assigned to the VPC Subnet.
- vpc
Id Integer - vpc
Subnets List<GetVpc Subnets Vpc Subnet> - filters
List<Get
Vpc Subnets Filter>
- id string
- ID of a managed database assigned to the VPC Subnet.
- vpc
Id number - vpc
Subnets GetVpc Subnets Vpc Subnet[] - filters
Get
Vpc Subnets Filter[]
- id str
- ID of a managed database assigned to the VPC Subnet.
- vpc_
id int - vpc_
subnets Sequence[GetVpc Subnets Vpc Subnet] - filters
Sequence[Get
Vpc Subnets Filter]
- id String
- ID of a managed database assigned to the VPC Subnet.
- vpc
Id Number - vpc
Subnets List<Property Map> - filters List<Property Map>
Supporting Types
GetVpcSubnetsFilter
- Name string
- The name of the field to filter by. See the Filterable Fields section for a complete list of filterable fields.
- Values List<string>
- A list of values for the filter to allow. These values should all be in string form.
- Match
By string - The method to match the field by. (
exact,regex,substring; defaultexact)
- Name string
- The name of the field to filter by. See the Filterable Fields section for a complete list of filterable fields.
- Values []string
- A list of values for the filter to allow. These values should all be in string form.
- Match
By string - The method to match the field by. (
exact,regex,substring; defaultexact)
- name String
- The name of the field to filter by. See the Filterable Fields section for a complete list of filterable fields.
- values List<String>
- A list of values for the filter to allow. These values should all be in string form.
- match
By String - The method to match the field by. (
exact,regex,substring; defaultexact)
- name string
- The name of the field to filter by. See the Filterable Fields section for a complete list of filterable fields.
- values string[]
- A list of values for the filter to allow. These values should all be in string form.
- match
By string - The method to match the field by. (
exact,regex,substring; defaultexact)
- name str
- The name of the field to filter by. See the Filterable Fields section for a complete list of filterable fields.
- values Sequence[str]
- A list of values for the filter to allow. These values should all be in string form.
- match_
by str - The method to match the field by. (
exact,regex,substring; defaultexact)
- name String
- The name of the field to filter by. See the Filterable Fields section for a complete list of filterable fields.
- values List<String>
- A list of values for the filter to allow. These values should all be in string form.
- match
By String - The method to match the field by. (
exact,regex,substring; defaultexact)
GetVpcSubnetsVpcSubnet
- Created string
- The date and time when the VPC Subnet was created.
- Databases
List<Get
Vpc Subnets Vpc Subnet Database> - A list of Managed databases assigned to the VPC Subnet.
- Id int
- ID of a managed database assigned to the VPC Subnet.
- Ipv4 string
- The IPv4 range of this subnet in CIDR format.
- Ipv6s
List<Get
Vpc Subnets Vpc Subnet Ipv6> - The IPv6 ranges of this subnet.
- Label string
- The label of the VPC subnet.
- Linodes
List<Get
Vpc Subnets Vpc Subnet Linode> - A list of Linodes added to this subnet.
- Updated string
- The date and time when the VPC Subnet was last updated.
- Created string
- The date and time when the VPC Subnet was created.
- Databases
[]Get
Vpc Subnets Vpc Subnet Database - A list of Managed databases assigned to the VPC Subnet.
- Id int
- ID of a managed database assigned to the VPC Subnet.
- Ipv4 string
- The IPv4 range of this subnet in CIDR format.
- Ipv6s
[]Get
Vpc Subnets Vpc Subnet Ipv6 - The IPv6 ranges of this subnet.
- Label string
- The label of the VPC subnet.
- Linodes
[]Get
Vpc Subnets Vpc Subnet Linode - A list of Linodes added to this subnet.
- Updated string
- The date and time when the VPC Subnet was last updated.
- created String
- The date and time when the VPC Subnet was created.
- databases
List<Get
Vpc Subnets Vpc Subnet Database> - A list of Managed databases assigned to the VPC Subnet.
- id Integer
- ID of a managed database assigned to the VPC Subnet.
- ipv4 String
- The IPv4 range of this subnet in CIDR format.
- ipv6s
List<Get
Vpc Subnets Vpc Subnet Ipv6> - The IPv6 ranges of this subnet.
- label String
- The label of the VPC subnet.
- linodes
List<Get
Vpc Subnets Vpc Subnet Linode> - A list of Linodes added to this subnet.
- updated String
- The date and time when the VPC Subnet was last updated.
- created string
- The date and time when the VPC Subnet was created.
- databases
Get
Vpc Subnets Vpc Subnet Database[] - A list of Managed databases assigned to the VPC Subnet.
- id number
- ID of a managed database assigned to the VPC Subnet.
- ipv4 string
- The IPv4 range of this subnet in CIDR format.
- ipv6s
Get
Vpc Subnets Vpc Subnet Ipv6[] - The IPv6 ranges of this subnet.
- label string
- The label of the VPC subnet.
- linodes
Get
Vpc Subnets Vpc Subnet Linode[] - A list of Linodes added to this subnet.
- updated string
- The date and time when the VPC Subnet was last updated.
- created str
- The date and time when the VPC Subnet was created.
- databases
Sequence[Get
Vpc Subnets Vpc Subnet Database] - A list of Managed databases assigned to the VPC Subnet.
- id int
- ID of a managed database assigned to the VPC Subnet.
- ipv4 str
- The IPv4 range of this subnet in CIDR format.
- ipv6s
Sequence[Get
Vpc Subnets Vpc Subnet Ipv6] - The IPv6 ranges of this subnet.
- label str
- The label of the VPC subnet.
- linodes
Sequence[Get
Vpc Subnets Vpc Subnet Linode] - A list of Linodes added to this subnet.
- updated str
- The date and time when the VPC Subnet was last updated.
- created String
- The date and time when the VPC Subnet was created.
- databases List<Property Map>
- A list of Managed databases assigned to the VPC Subnet.
- id Number
- ID of a managed database assigned to the VPC Subnet.
- ipv4 String
- The IPv4 range of this subnet in CIDR format.
- ipv6s List<Property Map>
- The IPv6 ranges of this subnet.
- label String
- The label of the VPC subnet.
- linodes List<Property Map>
- A list of Linodes added to this subnet.
- updated String
- The date and time when the VPC Subnet was last updated.
GetVpcSubnetsVpcSubnetDatabase
- Id int
- ID of a managed database assigned to the VPC Subnet.
- Ipv4Range string
- IPv4 range assigned to the database.
- Ipv6Ranges
List<Get
Vpc Subnets Vpc Subnet Database Ipv6Range> - A list of IPv6 ranges assigned to the database.
- Id int
- ID of a managed database assigned to the VPC Subnet.
- Ipv4Range string
- IPv4 range assigned to the database.
- Ipv6Ranges
[]Get
Vpc Subnets Vpc Subnet Database Ipv6Range - A list of IPv6 ranges assigned to the database.
- id Integer
- ID of a managed database assigned to the VPC Subnet.
- ipv4Range String
- IPv4 range assigned to the database.
- ipv6Ranges
List<Get
Vpc Subnets Vpc Subnet Database Ipv6Range> - A list of IPv6 ranges assigned to the database.
- id number
- ID of a managed database assigned to the VPC Subnet.
- ipv4Range string
- IPv4 range assigned to the database.
- ipv6Ranges
Get
Vpc Subnets Vpc Subnet Database Ipv6Range[] - A list of IPv6 ranges assigned to the database.
- id int
- ID of a managed database assigned to the VPC Subnet.
- ipv4_
range str - IPv4 range assigned to the database.
- ipv6_
ranges Sequence[GetVpc Subnets Vpc Subnet Database Ipv6Range] - A list of IPv6 ranges assigned to the database.
- id Number
- ID of a managed database assigned to the VPC Subnet.
- ipv4Range String
- IPv4 range assigned to the database.
- ipv6Ranges List<Property Map>
- A list of IPv6 ranges assigned to the database.
GetVpcSubnetsVpcSubnetDatabaseIpv6Range
- 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.
GetVpcSubnetsVpcSubnetIpv6
- 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.
GetVpcSubnetsVpcSubnetLinode
- Id int
- ID of a managed database assigned to the VPC Subnet.
- Interfaces
List<Get
Vpc Subnets Vpc Subnet Linode Interface> - A list of networking interfaces objects.
- Id int
- ID of a managed database assigned to the VPC Subnet.
- Interfaces
[]Get
Vpc Subnets Vpc Subnet Linode Interface - A list of networking interfaces objects.
- id Integer
- ID of a managed database assigned to the VPC Subnet.
- interfaces
List<Get
Vpc Subnets Vpc Subnet Linode Interface> - A list of networking interfaces objects.
- id number
- ID of a managed database assigned to the VPC Subnet.
- interfaces
Get
Vpc Subnets Vpc Subnet Linode Interface[] - A list of networking interfaces objects.
- id int
- ID of a managed database assigned to the VPC Subnet.
- interfaces
Sequence[Get
Vpc Subnets Vpc Subnet Linode Interface] - A list of networking interfaces objects.
- id Number
- ID of a managed database assigned to the VPC Subnet.
- interfaces List<Property Map>
- A list of networking interfaces objects.
GetVpcSubnetsVpcSubnetLinodeInterface
Package Details
- Repository
- Linode pulumi/pulumi-linode
- License
- Apache-2.0
- Notes
- This Pulumi package is based on the
linodeTerraform Provider.
published on Wednesday, May 6, 2026 by Pulumi
