1. Packages
  2. Vultr
  3. API Docs
  4. getVpc
Vultr v2.23.1 published on Tuesday, Dec 10, 2024 by dirien

vultr.getVpc

Explore with Pulumi AI

Vultr v2.23.1 published on Tuesday, Dec 10, 2024 by dirien

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"],
    }],
});
Copy
import pulumi
import pulumi_vultr as vultr

my_vpc = vultr.get_vpc(filters=[{
    "name": "description",
    "values": ["my-vpc-description"],
}])
Copy
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
	})
}
Copy
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",
                },
            },
        },
    });

});
Copy
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());

    }
}
Copy
variables:
  myVpc:
    fn::invoke:
      Function: vultr:getVpc
      Arguments:
        filters:
          - name: description
            values:
              - my-vpc-description
Copy

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>
Copy
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]
Copy
func LookupVpc(ctx *Context, args *LookupVpcArgs, opts ...InvokeOption) (*LookupVpcResult, error)
func LookupVpcOutput(ctx *Context, args *LookupVpcOutputArgs, opts ...InvokeOption) LookupVpcResultOutput
Copy

> 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)
}
Copy
public static CompletableFuture<GetVpcResult> getVpc(GetVpcArgs args, InvokeOptions options)
public static Output<GetVpcResult> getVpc(GetVpcArgs args, InvokeOptions options)
Copy
fn::invoke:
  function: vultr:index/getVpc:getVpc
  arguments:
    # arguments dictionary
Copy

The following arguments are supported:

Filters Changes to this property will trigger replacement. List<ediri.Vultr.Inputs.GetVpcFilter>
Query parameters for finding VPCs.
Filters Changes to this property will trigger replacement. []GetVpcFilter
Query parameters for finding VPCs.
filters Changes to this property will trigger replacement. List<GetVpcFilter>
Query parameters for finding VPCs.
filters Changes to this property will trigger replacement. GetVpcFilter[]
Query parameters for finding VPCs.
filters Changes to this property will trigger replacement. Sequence[GetVpcFilter]
Query parameters for finding VPCs.
filters Changes to this property will trigger replacement. List<Property Map>
Query parameters for finding VPCs.

getVpc Result

The following output properties are available:

DateCreated 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.
V4SubnetMask int
The number of bits for the netmask in CIDR notation. Example: 20
Filters List<ediri.Vultr.Outputs.GetVpcFilter>
DateCreated 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.
V4SubnetMask int
The number of bits for the netmask in CIDR notation. Example: 20
Filters []GetVpcFilter
dateCreated 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.
v4SubnetMask Integer
The number of bits for the netmask in CIDR notation. Example: 20
filters List<GetVpcFilter>
dateCreated 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.
v4SubnetMask number
The number of bits for the netmask in CIDR notation. Example: 20
filters GetVpcFilter[]
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_mask int
The number of bits for the netmask in CIDR notation. Example: 20
filters Sequence[GetVpcFilter]
dateCreated 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.
v4SubnetMask Number
The number of bits for the netmask in CIDR notation. Example: 20
filters List<Property Map>

Supporting Types

GetVpcFilter

Name This property is required. string
Attribute name to filter with.
Values This property is required. List<string>
One or more values filter with.
Name This property is required. string
Attribute name to filter with.
Values This property is required. []string
One or more values filter with.
name This property is required. String
Attribute name to filter with.
values This property is required. List<String>
One or more values filter with.
name This property is required. string
Attribute name to filter with.
values This property is required. string[]
One or more values filter with.
name This property is required. str
Attribute name to filter with.
values This property is required. Sequence[str]
One or more values filter with.
name This property is required. String
Attribute name to filter with.
values This property is required. List<String>
One or more values filter with.

Package Details

Repository
vultr dirien/pulumi-vultr
License
Apache-2.0
Notes
This Pulumi package is based on the vultr Terraform Provider.
Vultr v2.23.1 published on Tuesday, Dec 10, 2024 by dirien