Civo

Pulumi Official
Package maintained by Pulumi
v2.2.4 published on Friday, Jul 29, 2022 by Pulumi

getInstances

Get information on instances for use in other resources, with the ability to filter and sort the results. If no filters are specified, all instances will be returned.

Note: You can use the civo.Instance data source to obtain metadata about a single instance if you already know the id, unique hostname, or unique tag to retrieve.

Example Usage

using Pulumi;
using Civo = Pulumi.Civo;

class MyStack : Stack
{
    public MyStack()
    {
        var small_size = Output.Create(Civo.GetInstances.InvokeAsync(new Civo.GetInstancesArgs
        {
            Region = "NYC1",
            Filters = 
            {
                new Civo.Inputs.GetInstancesFilterArgs
                {
                    Key = "size",
                    Values = 
                    {
                        g3.Small,
                    },
                },
            },
        }));
    }

}

Coming soon!

package generated_program;

import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.civo.CivoFunctions;
import com.pulumi.civo.inputs.GetInstancesArgs;
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 small-size = CivoFunctions.getInstances(GetInstancesArgs.builder()
            .region("NYC1")
            .filters(GetInstancesFilterArgs.builder()
                .key("size")
                .values(g3.small())
                .build())
            .build());

    }
}
import pulumi
import pulumi_civo as civo

small_size = civo.get_instances(region="NYC1",
    filters=[civo.GetInstancesFilterArgs(
        key="size",
        values=[g3["small"]],
    )])
import * as pulumi from "@pulumi/pulumi";
import * as civo from "@pulumi/civo";

const small-size = civo.getInstances({
    region: "NYC1",
    filters: [{
        key: "size",
        values: [g3.small],
    }],
});
variables:
  small-size:
    Fn::Invoke:
      Function: civo:getInstances
      Arguments:
        region: NYC1
        filters:
          - key: size
            values:
              - ${g3.small}

Using getInstances

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 getInstances(args: GetInstancesArgs, opts?: InvokeOptions): Promise<GetInstancesResult>
function getInstancesOutput(args: GetInstancesOutputArgs, opts?: InvokeOptions): Output<GetInstancesResult>
def get_instances(filters: Optional[Sequence[GetInstancesFilter]] = None,
                  region: Optional[str] = None,
                  sorts: Optional[Sequence[GetInstancesSort]] = None,
                  opts: Optional[InvokeOptions] = None) -> GetInstancesResult
def get_instances_output(filters: Optional[pulumi.Input[Sequence[pulumi.Input[GetInstancesFilterArgs]]]] = None,
                  region: Optional[pulumi.Input[str]] = None,
                  sorts: Optional[pulumi.Input[Sequence[pulumi.Input[GetInstancesSortArgs]]]] = None,
                  opts: Optional[InvokeOptions] = None) -> Output[GetInstancesResult]
func GetInstances(ctx *Context, args *GetInstancesArgs, opts ...InvokeOption) (*GetInstancesResult, error)
func GetInstancesOutput(ctx *Context, args *GetInstancesOutputArgs, opts ...InvokeOption) GetInstancesResultOutput

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

public static class GetInstances 
{
    public static Task<GetInstancesResult> InvokeAsync(GetInstancesArgs args, InvokeOptions? opts = null)
    public static Output<GetInstancesResult> Invoke(GetInstancesInvokeArgs args, InvokeOptions? opts = null)
}
public static CompletableFuture<GetInstancesResult> getInstances(GetInstancesArgs args, InvokeOptions options)
// Output-based functions aren't available in Java yet
Fn::Invoke:
  Function: civo:index/getInstances:getInstances
  Arguments:
    # Arguments dictionary

The following arguments are supported:

getInstances Result

The following output properties are available:

Id string

The provider-assigned unique ID for this managed resource.

Instances List<GetInstancesInstance>
Filters List<GetInstancesFilter>
Region string
Sorts List<GetInstancesSort>
Id string

The provider-assigned unique ID for this managed resource.

Instances []GetInstancesInstance
Filters []GetInstancesFilter
Region string
Sorts []GetInstancesSort
id String

The provider-assigned unique ID for this managed resource.

instances List<GetInstancesInstance>
filters List<GetInstancesFilter>
region String
sorts List<GetInstancesSort>
id string

The provider-assigned unique ID for this managed resource.

instances GetInstancesInstance[]
filters GetInstancesFilter[]
region string
sorts GetInstancesSort[]
id String

The provider-assigned unique ID for this managed resource.

instances List<Property Map>
filters List<Property Map>
region String
sorts List<Property Map>

Supporting Types

GetInstancesFilter

Key string
Values List<string>
All bool
MatchBy string
Key string
Values []string
All bool
MatchBy string
key String
values List<String>
all Boolean
matchBy String
key string
values string[]
all boolean
matchBy string
key str
values Sequence[str]
all bool
match_by str
key String
values List<String>
all Boolean
matchBy String

GetInstancesInstance

CpuCores int
CreatedAt string
DiskGb int
FirewallId string
Hostname string
Id string
InitialPassword string
InitialUser string
NetworkId string
Notes string
PrivateIp string
PseudoIp string
PublicIp string
RamMb int
Region string
ReverseDns string
Script string
Size string
SshkeyId string
Status string
Tags List<string>
Template string
CpuCores int
CreatedAt string
DiskGb int
FirewallId string
Hostname string
Id string
InitialPassword string
InitialUser string
NetworkId string
Notes string
PrivateIp string
PseudoIp string
PublicIp string
RamMb int
Region string
ReverseDns string
Script string
Size string
SshkeyId string
Status string
Tags []string
Template string
cpuCores Integer
createdAt String
diskGb Integer
firewallId String
hostname String
id String
initialPassword String
initialUser String
networkId String
notes String
privateIp String
pseudoIp String
publicIp String
ramMb Integer
region String
reverseDns String
script String
size String
sshkeyId String
status String
tags List<String>
template String
cpuCores number
createdAt string
diskGb number
firewallId string
hostname string
id string
initialPassword string
initialUser string
networkId string
notes string
privateIp string
pseudoIp string
publicIp string
ramMb number
region string
reverseDns string
script string
size string
sshkeyId string
status string
tags string[]
template string
cpuCores Number
createdAt String
diskGb Number
firewallId String
hostname String
id String
initialPassword String
initialUser String
networkId String
notes String
privateIp String
pseudoIp String
publicIp String
ramMb Number
region String
reverseDns String
script String
size String
sshkeyId String
status String
tags List<String>
template String

GetInstancesSort

Key string
Direction string
Key string
Direction string
key String
direction String
key string
direction string
key str
direction str
key String
direction String

Package Details

Repository
https://github.com/pulumi/pulumi-civo
License
Apache-2.0
Notes

This Pulumi package is based on the civo Terraform Provider.