Vultr v2.21.1 published on Monday, Jul 22, 2024 by dirien
vultr.getVpc
Explore with Pulumi AI
Get information about a Vultr VPC.
Example Usage
Get the information for a VPC by description
:
import * as pulumi from "@pulumi/pulumi";
import * as vultr from "@pulumi/vultr";
const myVpc = vultr.getVpc({
filters: [{
name: "description",
values: ["my-vpc-description"],
}],
});
import pulumi
import pulumi_vultr as vultr
my_vpc = vultr.get_vpc(filters=[vultr.GetVpcFilterArgs(
name="description",
values=["my-vpc-description"],
)])
package main
import (
"github.com/dirien/pulumi-vultr/sdk/v2/go/vultr"
"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)
func main() {
pulumi.Run(func(ctx *pulumi.Context) error {
_, err := vultr.LookupVpc(ctx, &vultr.LookupVpcArgs{
Filters: []vultr.GetVpcFilter{
{
Name: "description",
Values: []string{
"my-vpc-description",
},
},
},
}, nil)
if err != nil {
return err
}
return nil
})
}
using System.Collections.Generic;
using System.Linq;
using Pulumi;
using Vultr = Pulumi.Vultr;
return await Deployment.RunAsync(() =>
{
var myVpc = Vultr.GetVpc.Invoke(new()
{
Filters = new[]
{
new Vultr.Inputs.GetVpcFilterInputArgs
{
Name = "description",
Values = new[]
{
"my-vpc-description",
},
},
},
});
});
package generated_program;
import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.vultr.VultrFunctions;
import com.pulumi.vultr.inputs.GetVpcArgs;
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 myVpc = VultrFunctions.getVpc(GetVpcArgs.builder()
.filters(GetVpcFilterArgs.builder()
.name("description")
.values("my-vpc-description")
.build())
.build());
}
}
variables:
myVpc:
fn::invoke:
Function: vultr:getVpc
Arguments:
filters:
- name: description
values:
- my-vpc-description
Using getVpc
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 getVpc(args: GetVpcArgs, opts?: InvokeOptions): Promise<GetVpcResult>
function getVpcOutput(args: GetVpcOutputArgs, opts?: InvokeOptions): Output<GetVpcResult>
def get_vpc(filters: Optional[Sequence[GetVpcFilter]] = None,
opts: Optional[InvokeOptions] = None) -> GetVpcResult
def get_vpc_output(filters: Optional[pulumi.Input[Sequence[pulumi.Input[GetVpcFilterArgs]]]] = None,
opts: Optional[InvokeOptions] = None) -> Output[GetVpcResult]
func LookupVpc(ctx *Context, args *LookupVpcArgs, opts ...InvokeOption) (*LookupVpcResult, error)
func LookupVpcOutput(ctx *Context, args *LookupVpcOutputArgs, opts ...InvokeOption) LookupVpcResultOutput
> Note: This function is named LookupVpc
in the Go SDK.
public static class GetVpc
{
public static Task<GetVpcResult> InvokeAsync(GetVpcArgs args, InvokeOptions? opts = null)
public static Output<GetVpcResult> Invoke(GetVpcInvokeArgs args, InvokeOptions? opts = null)
}
public static CompletableFuture<GetVpcResult> getVpc(GetVpcArgs args, InvokeOptions options)
// Output-based functions aren't available in Java yet
fn::invoke:
function: vultr:index/getVpc:getVpc
arguments:
# arguments dictionary
The following arguments are supported:
- Filters
List<ediri.
Vultr. Inputs. Get Vpc Filter> - Query parameters for finding VPCs.
- Filters
[]Get
Vpc Filter - Query parameters for finding VPCs.
- filters
List<Get
Vpc Filter> - Query parameters for finding VPCs.
- filters
Get
Vpc Filter[] - Query parameters for finding VPCs.
- filters
Sequence[Get
Vpc Filter] - Query parameters for finding VPCs.
- filters List<Property Map>
- Query parameters for finding VPCs.
getVpc Result
The following output properties are available:
- Date
Created string - The date the VPC was added to your Vultr account.
- Description string
- The VPC's description.
- Id string
- The provider-assigned unique ID for this managed resource.
- Region string
- The ID of the region that the VPC is in.
- V4Subnet string
- The IPv4 network address. For example: 10.1.1.0.
- V4Subnet
Mask int - The number of bits for the netmask in CIDR notation. Example: 20
- Filters
List<ediri.
Vultr. Outputs. Get Vpc Filter>
- Date
Created string - The date the VPC was added to your Vultr account.
- Description string
- The VPC's description.
- Id string
- The provider-assigned unique ID for this managed resource.
- Region string
- The ID of the region that the VPC is in.
- V4Subnet string
- The IPv4 network address. For example: 10.1.1.0.
- V4Subnet
Mask int - The number of bits for the netmask in CIDR notation. Example: 20
- Filters
[]Get
Vpc Filter
- date
Created String - The date the VPC was added to your Vultr account.
- description String
- The VPC's description.
- id String
- The provider-assigned unique ID for this managed resource.
- region String
- The ID of the region that the VPC is in.
- v4Subnet String
- The IPv4 network address. For example: 10.1.1.0.
- v4Subnet
Mask Integer - The number of bits for the netmask in CIDR notation. Example: 20
- filters
List<Get
Vpc Filter>
- date
Created string - The date the VPC was added to your Vultr account.
- description string
- The VPC's description.
- id string
- The provider-assigned unique ID for this managed resource.
- region string
- The ID of the region that the VPC is in.
- v4Subnet string
- The IPv4 network address. For example: 10.1.1.0.
- v4Subnet
Mask number - The number of bits for the netmask in CIDR notation. Example: 20
- filters
Get
Vpc Filter[]
- date_
created str - The date the VPC was added to your Vultr account.
- description str
- The VPC's description.
- id str
- The provider-assigned unique ID for this managed resource.
- region str
- The ID of the region that the VPC is in.
- v4_
subnet str - The IPv4 network address. For example: 10.1.1.0.
- v4_
subnet_ intmask - The number of bits for the netmask in CIDR notation. Example: 20
- filters
Sequence[Get
Vpc Filter]
- date
Created String - The date the VPC was added to your Vultr account.
- description String
- The VPC's description.
- id String
- The provider-assigned unique ID for this managed resource.
- region String
- The ID of the region that the VPC is in.
- v4Subnet String
- The IPv4 network address. For example: 10.1.1.0.
- v4Subnet
Mask Number - The number of bits for the netmask in CIDR notation. Example: 20
- filters List<Property Map>
Supporting Types
GetVpcFilter
Package Details
- Repository
- vultr dirien/pulumi-vultr
- License
- Apache-2.0
- Notes
- This Pulumi package is based on the
vultr
Terraform Provider.