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

vultr.getInstance

Explore with Pulumi AI

Vultr v2.23.1 published on Tuesday, Dec 10, 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"],
    }],
});
Copy
import pulumi
import pulumi_vultr as vultr

my_instance = vultr.get_instance(filters=[{
    "name": "label",
    "values": ["my-instance-label"],
}])
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.LookupInstance(ctx, &vultr.LookupInstanceArgs{
			Filters: []vultr.GetInstanceFilter{
				{
					Name: "label",
					Values: []string{
						"my-instance-label",
					},
				},
			},
		}, 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 myInstance = Vultr.GetInstance.Invoke(new()
    {
        Filters = new[]
        {
            new Vultr.Inputs.GetInstanceFilterInputArgs
            {
                Name = "label",
                Values = new[]
                {
                    "my-instance-label",
                },
            },
        },
    });

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

    }
}
Copy
variables:
  myInstance:
    fn::invoke:
      Function: vultr:getInstance
      Arguments:
        filters:
          - name: label
            values:
              - my-instance-label
Copy

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>
Copy
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]
Copy
func LookupInstance(ctx *Context, args *LookupInstanceArgs, opts ...InvokeOption) (*LookupInstanceResult, error)
func LookupInstanceOutput(ctx *Context, args *LookupInstanceOutputArgs, opts ...InvokeOption) LookupInstanceResultOutput
Copy

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

The following arguments are supported:

Filters Changes to this property will trigger replacement. List<ediri.Vultr.Inputs.GetInstanceFilter>
Query parameters for finding instances.
Filters Changes to this property will trigger replacement. []GetInstanceFilter
Query parameters for finding instances.
filters Changes to this property will trigger replacement. List<GetInstanceFilter>
Query parameters for finding instances.
filters Changes to this property will trigger replacement. GetInstanceFilter[]
Query parameters for finding instances.
filters Changes to this property will trigger replacement. Sequence[GetInstanceFilter]
Query parameters for finding instances.
filters Changes to this property will trigger replacement. 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, string>
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.
UserScheme string
The scheme used for the default user (linux servers only).
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]string
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.
UserScheme string
The scheme used for the default user (linux servers only).
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,String>
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.
userScheme String
The scheme used for the default user (linux servers only).
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]: string}
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.
userScheme string
The scheme used for the default user (linux servers only).
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, str]
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.
user_scheme str
The scheme used for the default user (linux servers only).
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<String>
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.
userScheme String
The scheme used for the default user (linux servers only).
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 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