linode.getVpcs
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/v5/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}
IPv6
Limited Availability IPv6 VPCs may not currently be available to all users.
Contains information about a single IPv6 allocation under a VPC.
range- The allocated range in CIDR format.
Filterable Fields
idlabeldescriptionregion
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)
public static Output<GetVpcsResult> getVpcs(GetVpcsArgs args, InvokeOptions options)
fn::invoke:
function: linode:index/getVpcs:getVpcs
arguments:
# arguments dictionaryThe 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
- Created string
- The date and time when the VPC was created.
- Description string
- The user-defined description of this VPC.
- Id string
- The unique id of this VPC.
- Ipv6s
List<Get
Vpcs Vpc Ipv6> - A list of IPv6 allocations under this VPC.
- Label string
- The label of the VPC.
- Region string
- The region where the VPC is deployed.
- Updated string
- The date and time when the VPC was last updated.
- Created string
- The date and time when the VPC was created.
- Description string
- The user-defined description of this VPC.
- Id string
- The unique id of this VPC.
- Ipv6s
[]Get
Vpcs Vpc Ipv6 - A list of IPv6 allocations under this VPC.
- Label string
- The label of the VPC.
- Region string
- The region where the VPC is deployed.
- Updated string
- The date and time when the VPC was last updated.
- created String
- The date and time when the VPC was created.
- description String
- The user-defined description of this VPC.
- id String
- The unique id of this VPC.
- ipv6s
List<Get
Vpcs Vpc Ipv6> - A list of IPv6 allocations under this VPC.
- label String
- The label of the VPC.
- region String
- The region where the VPC is deployed.
- updated String
- The date and time when the VPC was last updated.
- created string
- The date and time when the VPC was created.
- description string
- The user-defined description of this VPC.
- id string
- The unique id of this VPC.
- ipv6s
Get
Vpcs Vpc Ipv6[] - A list of IPv6 allocations under this VPC.
- label string
- The label of the VPC.
- region string
- The region where the VPC is deployed.
- updated string
- The date and time when the VPC was last updated.
- created str
- The date and time when the VPC was created.
- description str
- The user-defined description of this VPC.
- id str
- The unique id of this VPC.
- ipv6s
Sequence[Get
Vpcs Vpc Ipv6] - A list of IPv6 allocations under this VPC.
- label str
- The label of the VPC.
- region str
- The region where the VPC is deployed.
- updated str
- The date and time when the VPC was last updated.
- created String
- The date and time when the VPC was created.
- description String
- The user-defined description of this VPC.
- id String
- The unique id of this VPC.
- ipv6s List<Property Map>
- A list of IPv6 allocations under this VPC.
- label String
- The label of the VPC.
- region String
- The region where the VPC is deployed.
- updated String
- The date and time when the VPC was last updated.
GetVpcsVpcIpv6
- Range string
- The IPv6 range assigned to this VPC.
- Range string
- The IPv6 range assigned to this VPC.
- range String
- The IPv6 range assigned to this VPC.
- range string
- The IPv6 range assigned to this VPC.
- range str
- The IPv6 range assigned to this VPC.
- range String
- The IPv6 range assigned to this VPC.
Package Details
- Repository
- Linode pulumi/pulumi-linode
- License
- Apache-2.0
- Notes
- This Pulumi package is based on the
linodeTerraform Provider.
