1. Packages
  2. Vultr
  3. API Docs
  4. getVpc2
Vultr v2.21.0 published on Wednesday, Jun 19, 2024 by dirien

vultr.getVpc2

Explore with Pulumi AI

vultr logo
Vultr v2.21.0 published on Wednesday, Jun 19, 2024 by dirien

    Get information about a Vultr VPC 2.0.

    Example Usage

    Get the information for a VPC 2.0 by description:

    import * as pulumi from "@pulumi/pulumi";
    import * as vultr from "@pulumi/vultr";
    
    const myVpc2 = vultr.getVpc2({
        filters: [{
            name: "description",
            values: ["my-vpc2-description"],
        }],
    });
    
    import pulumi
    import pulumi_vultr as vultr
    
    my_vpc2 = vultr.get_vpc2(filters=[vultr.GetVpc2FilterArgs(
        name="description",
        values=["my-vpc2-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.LookupVpc2(ctx, &vultr.LookupVpc2Args{
    			Filters: []vultr.GetVpc2Filter{
    				{
    					Name: "description",
    					Values: []string{
    						"my-vpc2-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 myVpc2 = Vultr.GetVpc2.Invoke(new()
        {
            Filters = new[]
            {
                new Vultr.Inputs.GetVpc2FilterInputArgs
                {
                    Name = "description",
                    Values = new[]
                    {
                        "my-vpc2-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.GetVpc2Args;
    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 myVpc2 = VultrFunctions.getVpc2(GetVpc2Args.builder()
                .filters(GetVpc2FilterArgs.builder()
                    .name("description")
                    .values("my-vpc2-description")
                    .build())
                .build());
    
        }
    }
    
    variables:
      myVpc2:
        fn::invoke:
          Function: vultr:getVpc2
          Arguments:
            filters:
              - name: description
                values:
                  - my-vpc2-description
    

    Using getVpc2

    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 getVpc2(args: GetVpc2Args, opts?: InvokeOptions): Promise<GetVpc2Result>
    function getVpc2Output(args: GetVpc2OutputArgs, opts?: InvokeOptions): Output<GetVpc2Result>
    def get_vpc2(filters: Optional[Sequence[GetVpc2Filter]] = None,
                 opts: Optional[InvokeOptions] = None) -> GetVpc2Result
    def get_vpc2_output(filters: Optional[pulumi.Input[Sequence[pulumi.Input[GetVpc2FilterArgs]]]] = None,
                 opts: Optional[InvokeOptions] = None) -> Output[GetVpc2Result]
    func LookupVpc2(ctx *Context, args *LookupVpc2Args, opts ...InvokeOption) (*LookupVpc2Result, error)
    func LookupVpc2Output(ctx *Context, args *LookupVpc2OutputArgs, opts ...InvokeOption) LookupVpc2ResultOutput

    > Note: This function is named LookupVpc2 in the Go SDK.

    public static class GetVpc2 
    {
        public static Task<GetVpc2Result> InvokeAsync(GetVpc2Args args, InvokeOptions? opts = null)
        public static Output<GetVpc2Result> Invoke(GetVpc2InvokeArgs args, InvokeOptions? opts = null)
    }
    public static CompletableFuture<GetVpc2Result> getVpc2(GetVpc2Args args, InvokeOptions options)
    // Output-based functions aren't available in Java yet
    
    fn::invoke:
      function: vultr:index/getVpc2:getVpc2
      arguments:
        # arguments dictionary

    The following arguments are supported:

    Filters List<ediri.Vultr.Inputs.GetVpc2Filter>
    Query parameters for finding VPCs 2.0.
    Filters []GetVpc2Filter
    Query parameters for finding VPCs 2.0.
    filters List<GetVpc2Filter>
    Query parameters for finding VPCs 2.0.
    filters GetVpc2Filter[]
    Query parameters for finding VPCs 2.0.
    filters Sequence[GetVpc2Filter]
    Query parameters for finding VPCs 2.0.
    filters List<Property Map>
    Query parameters for finding VPCs 2.0.

    getVpc2 Result

    The following output properties are available:

    DateCreated string
    The date the VPC 2.0 was added to your Vultr account.
    Description string
    The VPC 2.0's description.
    Id string
    The provider-assigned unique ID for this managed resource.
    IpBlock string
    The IPv4 network address. For example: 10.1.1.0.
    PrefixLength int
    The number of bits for the netmask in CIDR notation. Example: 20
    Region string
    The ID of the region that the VPC 2.0 is in.
    Filters List<ediri.Vultr.Outputs.GetVpc2Filter>
    DateCreated string
    The date the VPC 2.0 was added to your Vultr account.
    Description string
    The VPC 2.0's description.
    Id string
    The provider-assigned unique ID for this managed resource.
    IpBlock string
    The IPv4 network address. For example: 10.1.1.0.
    PrefixLength int
    The number of bits for the netmask in CIDR notation. Example: 20
    Region string
    The ID of the region that the VPC 2.0 is in.
    Filters []GetVpc2Filter
    dateCreated String
    The date the VPC 2.0 was added to your Vultr account.
    description String
    The VPC 2.0's description.
    id String
    The provider-assigned unique ID for this managed resource.
    ipBlock String
    The IPv4 network address. For example: 10.1.1.0.
    prefixLength Integer
    The number of bits for the netmask in CIDR notation. Example: 20
    region String
    The ID of the region that the VPC 2.0 is in.
    filters List<GetVpc2Filter>
    dateCreated string
    The date the VPC 2.0 was added to your Vultr account.
    description string
    The VPC 2.0's description.
    id string
    The provider-assigned unique ID for this managed resource.
    ipBlock string
    The IPv4 network address. For example: 10.1.1.0.
    prefixLength number
    The number of bits for the netmask in CIDR notation. Example: 20
    region string
    The ID of the region that the VPC 2.0 is in.
    filters GetVpc2Filter[]
    date_created str
    The date the VPC 2.0 was added to your Vultr account.
    description str
    The VPC 2.0's description.
    id str
    The provider-assigned unique ID for this managed resource.
    ip_block str
    The IPv4 network address. For example: 10.1.1.0.
    prefix_length int
    The number of bits for the netmask in CIDR notation. Example: 20
    region str
    The ID of the region that the VPC 2.0 is in.
    filters Sequence[GetVpc2Filter]
    dateCreated String
    The date the VPC 2.0 was added to your Vultr account.
    description String
    The VPC 2.0's description.
    id String
    The provider-assigned unique ID for this managed resource.
    ipBlock String
    The IPv4 network address. For example: 10.1.1.0.
    prefixLength Number
    The number of bits for the netmask in CIDR notation. Example: 20
    region String
    The ID of the region that the VPC 2.0 is in.
    filters List<Property Map>

    Supporting Types

    GetVpc2Filter

    Name string
    Attribute name to filter with.
    Values List<string>
    One or more values filter with.
    Name string
    Attribute name to filter with.
    Values []string
    One or more values filter with.
    name String
    Attribute name to filter with.
    values List<String>
    One or more values filter with.
    name string
    Attribute name to filter with.
    values string[]
    One or more values filter with.
    name str
    Attribute name to filter with.
    values Sequence[str]
    One or more values filter with.
    name String
    Attribute name to filter with.
    values 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 logo
    Vultr v2.21.0 published on Wednesday, Jun 19, 2024 by dirien