Linode v4.30.0 published on Friday, Nov 8, 2024 by Pulumi
linode.getVpcs
Explore with Pulumi AI
Provides information about a list of Linode VPCs 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 VPCs.
import * as pulumi from "@pulumi/pulumi";
import * as linode from "@pulumi/linode";
const filtered-vpcs = linode.getVpcs({
filters: [{
name: "label",
values: ["test"],
}],
});
export const vpcs = filtered_vpcs.then(filtered_vpcs => filtered_vpcs.vpcs);
import pulumi
import pulumi_linode as linode
filtered_vpcs = linode.get_vpcs(filters=[{
"name": "label",
"values": ["test"],
}])
pulumi.export("vpcs", filtered_vpcs.vpcs)
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_vpcs, err := linode.GetVpcs(ctx, &linode.GetVpcsArgs{
Filters: []linode.GetVpcsFilter{
{
Name: "label",
Values: []string{
"test",
},
},
},
}, nil)
if err != nil {
return err
}
ctx.Export("vpcs", filtered_vpcs.Vpcs)
return nil
})
}
using System.Collections.Generic;
using System.Linq;
using Pulumi;
using Linode = Pulumi.Linode;
return await Deployment.RunAsync(() =>
{
var filtered_vpcs = Linode.GetVpcs.Invoke(new()
{
Filters = new[]
{
new Linode.Inputs.GetVpcsFilterInputArgs
{
Name = "label",
Values = new[]
{
"test",
},
},
},
});
return new Dictionary<string, object?>
{
["vpcs"] = filtered_vpcs.Apply(filtered_vpcs => filtered_vpcs.Apply(getVpcsResult => getVpcsResult.Vpcs)),
};
});
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.GetVpcsArgs;
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-vpcs = LinodeFunctions.getVpcs(GetVpcsArgs.builder()
.filters(GetVpcsFilterArgs.builder()
.name("label")
.values("test")
.build())
.build());
ctx.export("vpcs", filtered_vpcs.vpcs());
}
}
variables:
filtered-vpcs:
fn::invoke:
Function: linode:getVpcs
Arguments:
filters:
- name: label
values:
- test
outputs:
vpcs: ${["filtered-vpcs"].vpcs}
Filterable Fields
id
label
description
region
Using getVpcs
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 getVpcs(args: GetVpcsArgs, opts?: InvokeOptions): Promise<GetVpcsResult>
function getVpcsOutput(args: GetVpcsOutputArgs, opts?: InvokeOptions): Output<GetVpcsResult>
def get_vpcs(filters: Optional[Sequence[GetVpcsFilter]] = None,
vpcs: Optional[Sequence[GetVpcsVpc]] = None,
opts: Optional[InvokeOptions] = None) -> GetVpcsResult
def get_vpcs_output(filters: Optional[pulumi.Input[Sequence[pulumi.Input[GetVpcsFilterArgs]]]] = None,
vpcs: Optional[pulumi.Input[Sequence[pulumi.Input[GetVpcsVpcArgs]]]] = None,
opts: Optional[InvokeOptions] = None) -> Output[GetVpcsResult]
func GetVpcs(ctx *Context, args *GetVpcsArgs, opts ...InvokeOption) (*GetVpcsResult, error)
func GetVpcsOutput(ctx *Context, args *GetVpcsOutputArgs, opts ...InvokeOption) GetVpcsResultOutput
> Note: This function is named GetVpcs
in the Go SDK.
public static class GetVpcs
{
public static Task<GetVpcsResult> InvokeAsync(GetVpcsArgs args, InvokeOptions? opts = null)
public static Output<GetVpcsResult> Invoke(GetVpcsInvokeArgs args, InvokeOptions? opts = null)
}
public static CompletableFuture<GetVpcsResult> getVpcs(GetVpcsArgs args, InvokeOptions options)
// Output-based functions aren't available in Java yet
fn::invoke:
function: linode:index/getVpcs:getVpcs
arguments:
# arguments dictionary
The following arguments are supported:
getVpcs Result
The following output properties are available:
- Id string
- The unique id of this VPC.
- Filters
List<Get
Vpcs Filter> - Vpcs
List<Get
Vpcs Vpc>
- Id string
- The unique id of this VPC.
- Filters
[]Get
Vpcs Filter - Vpcs
[]Get
Vpcs Vpc
- id String
- The unique id of this VPC.
- filters
List<Get
Vpcs Filter> - vpcs
List<Get
Vpcs Vpc>
- id string
- The unique id of this VPC.
- filters
Get
Vpcs Filter[] - vpcs
Get
Vpcs Vpc[]
- id str
- The unique id of this VPC.
- filters
Sequence[Get
Vpcs Filter] - vpcs
Sequence[Get
Vpcs Vpc]
- id String
- The unique id of this VPC.
- filters List<Property Map>
- vpcs List<Property Map>
Supporting Types
GetVpcsFilter
- 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
)
GetVpcsVpc
Package Details
- Repository
- Linode pulumi/pulumi-linode
- License
- Apache-2.0
- Notes
- This Pulumi package is based on the
linode
Terraform Provider.