1. Packages
  2. Vultr
  3. API Docs
  4. getInstance
Vultr v2.21.1 published on Monday, Jul 22, 2024 by dirien

vultr.getInstance

Explore with Pulumi AI

vultr logo
Vultr v2.21.1 published on Monday, Jul 22, 2024 by dirien

    Get information about a Vultr instance.

    Example Usage

    Get the information for a instance by label:

    import * as pulumi from "@pulumi/pulumi";
    import * as vultr from "@pulumi/vultr";
    
    const myInstance = vultr.getInstance({
        filters: [{
            name: "label",
            values: ["my-instance-label"],
        }],
    });
    
    import pulumi
    import pulumi_vultr as vultr
    
    my_instance = vultr.get_instance(filters=[vultr.GetInstanceFilterArgs(
        name="label",
        values=["my-instance-label"],
    )])
    
    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.LookupInstance(ctx, &vultr.LookupInstanceArgs{
    			Filters: []vultr.GetInstanceFilter{
    				{
    					Name: "label",
    					Values: []string{
    						"my-instance-label",
    					},
    				},
    			},
    		}, 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 myInstance = Vultr.GetInstance.Invoke(new()
        {
            Filters = new[]
            {
                new Vultr.Inputs.GetInstanceFilterInputArgs
                {
                    Name = "label",
                    Values = new[]
                    {
                        "my-instance-label",
                    },
                },
            },
        });
    
    });
    
    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.GetInstanceArgs;
    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 myInstance = VultrFunctions.getInstance(GetInstanceArgs.builder()
                .filters(GetInstanceFilterArgs.builder()
                    .name("label")
                    .values("my-instance-label")
                    .build())
                .build());
    
        }
    }
    
    variables:
      myInstance:
        fn::invoke:
          Function: vultr:getInstance
          Arguments:
            filters:
              - name: label
                values:
                  - my-instance-label
    

    Using getInstance

    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 getInstance(args: GetInstanceArgs, opts?: InvokeOptions): Promise<GetInstanceResult>
    function getInstanceOutput(args: GetInstanceOutputArgs, opts?: InvokeOptions): Output<GetInstanceResult>
    def get_instance(filters: Optional[Sequence[GetInstanceFilter]] = None,
                     opts: Optional[InvokeOptions] = None) -> GetInstanceResult
    def get_instance_output(filters: Optional[pulumi.Input[Sequence[pulumi.Input[GetInstanceFilterArgs]]]] = None,
                     opts: Optional[InvokeOptions] = None) -> Output[GetInstanceResult]
    func LookupInstance(ctx *Context, args *LookupInstanceArgs, opts ...InvokeOption) (*LookupInstanceResult, error)
    func LookupInstanceOutput(ctx *Context, args *LookupInstanceOutputArgs, opts ...InvokeOption) LookupInstanceResultOutput

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

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

    The following arguments are supported:

    Filters List<ediri.Vultr.Inputs.GetInstanceFilter>
    Query parameters for finding instances.
    Filters []GetInstanceFilter
    Query parameters for finding instances.
    filters List<GetInstanceFilter>
    Query parameters for finding instances.
    filters GetInstanceFilter[]
    Query parameters for finding instances.
    filters Sequence[GetInstanceFilter]
    Query parameters for finding instances.
    filters List<Property Map>
    Query parameters for finding instances.

    getInstance Result

    The following output properties are available:

    AllowedBandwidth int
    The server's allowed bandwidth usage in GB.
    AppId int
    The server's application ID.
    Backups string
    BackupsSchedule Dictionary<string, object>
    The current configuration for backups
    DateCreated string
    The date the server was added to your Vultr account.
    Disk int
    The description of the disk(s) on the server.
    Features List<string>
    Array of which features are enabled.
    FirewallGroupId string
    The ID of the firewall group applied to this server.
    GatewayV4 string
    The server's IPv4 gateway.
    Hostname string
    The hostname assigned to the server.
    Id string
    The provider-assigned unique ID for this managed resource.
    ImageId string
    The Marketplace ID for this application.
    InternalIp string
    The server's internal IP address.
    Kvm string
    The server's current KVM URL. This URL will change periodically. It is not advised to cache this value.
    Label string
    The server's label.
    Location string
    MainIp string
    The server's main IP address.
    NetmaskV4 string
    The server's IPv4 netmask.
    Os string
    The operating system of the instance.
    OsId int
    The server's operating system ID.
    Plan string
    The server's plan ID.
    PowerStatus string
    Whether the server is powered on or not.
    Ram int
    The amount of memory available on the instance in MB.
    Region string
    The region ID of the server.
    ServerStatus string
    A more detailed server status (none, locked, installingbooting, isomounting, ok).
    Status string
    The status of the server's subscription.
    Tags List<string>
    A list of tags applied to the instance.
    V6MainIp string
    The main IPv6 network address.
    V6Network string
    The IPv6 subnet.
    V6NetworkSize int
    The IPv6 network size in bits.
    VcpuCount int
    The number of virtual CPUs available on the server.
    Vpc2Ids List<string>
    A list of VPC 2.0 IDs attached to the server.
    VpcIds List<string>
    Filters List<ediri.Vultr.Outputs.GetInstanceFilter>
    AllowedBandwidth int
    The server's allowed bandwidth usage in GB.
    AppId int
    The server's application ID.
    Backups string
    BackupsSchedule map[string]interface{}
    The current configuration for backups
    DateCreated string
    The date the server was added to your Vultr account.
    Disk int
    The description of the disk(s) on the server.
    Features []string
    Array of which features are enabled.
    FirewallGroupId string
    The ID of the firewall group applied to this server.
    GatewayV4 string
    The server's IPv4 gateway.
    Hostname string
    The hostname assigned to the server.
    Id string
    The provider-assigned unique ID for this managed resource.
    ImageId string
    The Marketplace ID for this application.
    InternalIp string
    The server's internal IP address.
    Kvm string
    The server's current KVM URL. This URL will change periodically. It is not advised to cache this value.
    Label string
    The server's label.
    Location string
    MainIp string
    The server's main IP address.
    NetmaskV4 string
    The server's IPv4 netmask.
    Os string
    The operating system of the instance.
    OsId int
    The server's operating system ID.
    Plan string
    The server's plan ID.
    PowerStatus string
    Whether the server is powered on or not.
    Ram int
    The amount of memory available on the instance in MB.
    Region string
    The region ID of the server.
    ServerStatus string
    A more detailed server status (none, locked, installingbooting, isomounting, ok).
    Status string
    The status of the server's subscription.
    Tags []string
    A list of tags applied to the instance.
    V6MainIp string
    The main IPv6 network address.
    V6Network string
    The IPv6 subnet.
    V6NetworkSize int
    The IPv6 network size in bits.
    VcpuCount int
    The number of virtual CPUs available on the server.
    Vpc2Ids []string
    A list of VPC 2.0 IDs attached to the server.
    VpcIds []string
    Filters []GetInstanceFilter
    allowedBandwidth Integer
    The server's allowed bandwidth usage in GB.
    appId Integer
    The server's application ID.
    backups String
    backupsSchedule Map<String,Object>
    The current configuration for backups
    dateCreated String
    The date the server was added to your Vultr account.
    disk Integer
    The description of the disk(s) on the server.
    features List<String>
    Array of which features are enabled.
    firewallGroupId String
    The ID of the firewall group applied to this server.
    gatewayV4 String
    The server's IPv4 gateway.
    hostname String
    The hostname assigned to the server.
    id String
    The provider-assigned unique ID for this managed resource.
    imageId String
    The Marketplace ID for this application.
    internalIp String
    The server's internal IP address.
    kvm String
    The server's current KVM URL. This URL will change periodically. It is not advised to cache this value.
    label String
    The server's label.
    location String
    mainIp String
    The server's main IP address.
    netmaskV4 String
    The server's IPv4 netmask.
    os String
    The operating system of the instance.
    osId Integer
    The server's operating system ID.
    plan String
    The server's plan ID.
    powerStatus String
    Whether the server is powered on or not.
    ram Integer
    The amount of memory available on the instance in MB.
    region String
    The region ID of the server.
    serverStatus String
    A more detailed server status (none, locked, installingbooting, isomounting, ok).
    status String
    The status of the server's subscription.
    tags List<String>
    A list of tags applied to the instance.
    v6MainIp String
    The main IPv6 network address.
    v6Network String
    The IPv6 subnet.
    v6NetworkSize Integer
    The IPv6 network size in bits.
    vcpuCount Integer
    The number of virtual CPUs available on the server.
    vpc2Ids List<String>
    A list of VPC 2.0 IDs attached to the server.
    vpcIds List<String>
    filters List<GetInstanceFilter>
    allowedBandwidth number
    The server's allowed bandwidth usage in GB.
    appId number
    The server's application ID.
    backups string
    backupsSchedule {[key: string]: any}
    The current configuration for backups
    dateCreated string
    The date the server was added to your Vultr account.
    disk number
    The description of the disk(s) on the server.
    features string[]
    Array of which features are enabled.
    firewallGroupId string
    The ID of the firewall group applied to this server.
    gatewayV4 string
    The server's IPv4 gateway.
    hostname string
    The hostname assigned to the server.
    id string
    The provider-assigned unique ID for this managed resource.
    imageId string
    The Marketplace ID for this application.
    internalIp string
    The server's internal IP address.
    kvm string
    The server's current KVM URL. This URL will change periodically. It is not advised to cache this value.
    label string
    The server's label.
    location string
    mainIp string
    The server's main IP address.
    netmaskV4 string
    The server's IPv4 netmask.
    os string
    The operating system of the instance.
    osId number
    The server's operating system ID.
    plan string
    The server's plan ID.
    powerStatus string
    Whether the server is powered on or not.
    ram number
    The amount of memory available on the instance in MB.
    region string
    The region ID of the server.
    serverStatus string
    A more detailed server status (none, locked, installingbooting, isomounting, ok).
    status string
    The status of the server's subscription.
    tags string[]
    A list of tags applied to the instance.
    v6MainIp string
    The main IPv6 network address.
    v6Network string
    The IPv6 subnet.
    v6NetworkSize number
    The IPv6 network size in bits.
    vcpuCount number
    The number of virtual CPUs available on the server.
    vpc2Ids string[]
    A list of VPC 2.0 IDs attached to the server.
    vpcIds string[]
    filters GetInstanceFilter[]
    allowed_bandwidth int
    The server's allowed bandwidth usage in GB.
    app_id int
    The server's application ID.
    backups str
    backups_schedule Mapping[str, Any]
    The current configuration for backups
    date_created str
    The date the server was added to your Vultr account.
    disk int
    The description of the disk(s) on the server.
    features Sequence[str]
    Array of which features are enabled.
    firewall_group_id str
    The ID of the firewall group applied to this server.
    gateway_v4 str
    The server's IPv4 gateway.
    hostname str
    The hostname assigned to the server.
    id str
    The provider-assigned unique ID for this managed resource.
    image_id str
    The Marketplace ID for this application.
    internal_ip str
    The server's internal IP address.
    kvm str
    The server's current KVM URL. This URL will change periodically. It is not advised to cache this value.
    label str
    The server's label.
    location str
    main_ip str
    The server's main IP address.
    netmask_v4 str
    The server's IPv4 netmask.
    os str
    The operating system of the instance.
    os_id int
    The server's operating system ID.
    plan str
    The server's plan ID.
    power_status str
    Whether the server is powered on or not.
    ram int
    The amount of memory available on the instance in MB.
    region str
    The region ID of the server.
    server_status str
    A more detailed server status (none, locked, installingbooting, isomounting, ok).
    status str
    The status of the server's subscription.
    tags Sequence[str]
    A list of tags applied to the instance.
    v6_main_ip str
    The main IPv6 network address.
    v6_network str
    The IPv6 subnet.
    v6_network_size int
    The IPv6 network size in bits.
    vcpu_count int
    The number of virtual CPUs available on the server.
    vpc2_ids Sequence[str]
    A list of VPC 2.0 IDs attached to the server.
    vpc_ids Sequence[str]
    filters Sequence[GetInstanceFilter]
    allowedBandwidth Number
    The server's allowed bandwidth usage in GB.
    appId Number
    The server's application ID.
    backups String
    backupsSchedule Map<Any>
    The current configuration for backups
    dateCreated String
    The date the server was added to your Vultr account.
    disk Number
    The description of the disk(s) on the server.
    features List<String>
    Array of which features are enabled.
    firewallGroupId String
    The ID of the firewall group applied to this server.
    gatewayV4 String
    The server's IPv4 gateway.
    hostname String
    The hostname assigned to the server.
    id String
    The provider-assigned unique ID for this managed resource.
    imageId String
    The Marketplace ID for this application.
    internalIp String
    The server's internal IP address.
    kvm String
    The server's current KVM URL. This URL will change periodically. It is not advised to cache this value.
    label String
    The server's label.
    location String
    mainIp String
    The server's main IP address.
    netmaskV4 String
    The server's IPv4 netmask.
    os String
    The operating system of the instance.
    osId Number
    The server's operating system ID.
    plan String
    The server's plan ID.
    powerStatus String
    Whether the server is powered on or not.
    ram Number
    The amount of memory available on the instance in MB.
    region String
    The region ID of the server.
    serverStatus String
    A more detailed server status (none, locked, installingbooting, isomounting, ok).
    status String
    The status of the server's subscription.
    tags List<String>
    A list of tags applied to the instance.
    v6MainIp String
    The main IPv6 network address.
    v6Network String
    The IPv6 subnet.
    v6NetworkSize Number
    The IPv6 network size in bits.
    vcpuCount Number
    The number of virtual CPUs available on the server.
    vpc2Ids List<String>
    A list of VPC 2.0 IDs attached to the server.
    vpcIds List<String>
    filters List<Property Map>

    Supporting Types

    GetInstanceFilter

    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.1 published on Monday, Jul 22, 2024 by dirien