Linode v4.30.0 published on Friday, Nov 8, 2024 by Pulumi
linode.getVpcSubnets
Explore with Pulumi AI
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/v4/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.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}
Filterable Fields
id
label
ipv4
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,
vpc_subnets: Optional[Sequence[GetVpcSubnetsVpcSubnet]] = None,
opts: Optional[InvokeOptions] = None) -> GetVpcSubnetsResult
def get_vpc_subnets_output(filters: Optional[pulumi.Input[Sequence[pulumi.Input[GetVpcSubnetsFilterArgs]]]] = None,
vpc_id: Optional[pulumi.Input[int]] = None,
vpc_subnets: Optional[pulumi.Input[Sequence[pulumi.Input[GetVpcSubnetsVpcSubnetArgs]]]] = 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)
// Output-based functions aren't available in Java yet
fn::invoke:
function: linode:index/getVpcSubnets:getVpcSubnets
arguments:
# arguments dictionary
The 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
Subnets List<GetVpc Subnets Vpc Subnet>
- 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
Subnets []GetVpc Subnets Vpc Subnet
- 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
Subnets List<GetVpc Subnets Vpc Subnet>
- 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
Subnets GetVpc Subnets Vpc Subnet[]
- 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_
subnets Sequence[GetVpc Subnets Vpc Subnet]
- 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>
- vpc
Subnets List<Property Map>
getVpcSubnets Result
The following output properties are available:
- Id string
- The unique id of the VPC subnet.
- Vpc
Id int - Filters
List<Get
Vpc Subnets Filter> - Vpc
Subnets List<GetVpc Subnets Vpc Subnet>
- Id string
- The unique id of the VPC subnet.
- Vpc
Id int - Filters
[]Get
Vpc Subnets Filter - Vpc
Subnets []GetVpc Subnets Vpc Subnet
- id String
- The unique id of the VPC subnet.
- vpc
Id Integer - filters
List<Get
Vpc Subnets Filter> - vpc
Subnets List<GetVpc Subnets Vpc Subnet>
- id string
- The unique id of the VPC subnet.
- vpc
Id number - filters
Get
Vpc Subnets Filter[] - vpc
Subnets GetVpc Subnets Vpc Subnet[]
- id str
- The unique id of the VPC subnet.
- vpc_
id int - filters
Sequence[Get
Vpc Subnets Filter] - vpc_
subnets Sequence[GetVpc Subnets Vpc Subnet]
- id String
- The unique id of the VPC subnet.
- vpc
Id Number - filters List<Property Map>
- vpc
Subnets 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.
- Id int
- The unique id of the VPC subnet.
- Ipv4 string
- The IPv4 range of this subnet in CIDR format.
- Label string
- The label of the VPC subnet.
- Linodes
List<Get
Vpc Subnets Vpc Subnet Linode> - A list of Linode IDs that 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.
- Id int
- The unique id of the VPC subnet.
- Ipv4 string
- The IPv4 range of this subnet in CIDR format.
- Label string
- The label of the VPC subnet.
- Linodes
[]Get
Vpc Subnets Vpc Subnet Linode - A list of Linode IDs that 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.
- id Integer
- The unique id of the VPC subnet.
- ipv4 String
- The IPv4 range of this subnet in CIDR format.
- label String
- The label of the VPC subnet.
- linodes
List<Get
Vpc Subnets Vpc Subnet Linode> - A list of Linode IDs that 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.
- id number
- The unique id of the VPC subnet.
- ipv4 string
- The IPv4 range of this subnet in CIDR format.
- label string
- The label of the VPC subnet.
- linodes
Get
Vpc Subnets Vpc Subnet Linode[] - A list of Linode IDs that 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.
- id int
- The unique id of the VPC subnet.
- ipv4 str
- The IPv4 range of this subnet in CIDR format.
- label str
- The label of the VPC subnet.
- linodes
Sequence[Get
Vpc Subnets Vpc Subnet Linode] - A list of Linode IDs that 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.
- id Number
- The unique id of the VPC subnet.
- 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.
GetVpcSubnetsVpcSubnetLinode
- Id int
- The unique id of the VPC subnet.
- Interfaces
List<Get
Vpc Subnets Vpc Subnet Linode Interface>
- Id int
- The unique id of the VPC subnet.
- Interfaces
[]Get
Vpc Subnets Vpc Subnet Linode Interface
- id Integer
- The unique id of the VPC subnet.
- interfaces
List<Get
Vpc Subnets Vpc Subnet Linode Interface>
- id number
- The unique id of the VPC subnet.
- interfaces
Get
Vpc Subnets Vpc Subnet Linode Interface[]
- id int
- The unique id of the VPC subnet.
- interfaces
Sequence[Get
Vpc Subnets Vpc Subnet Linode Interface]
- id Number
- The unique id of the VPC subnet.
- interfaces List<Property Map>
GetVpcSubnetsVpcSubnetLinodeInterface
Package Details
- Repository
- Linode pulumi/pulumi-linode
- License
- Apache-2.0
- Notes
- This Pulumi package is based on the
linode
Terraform Provider.