civo 1.1.7 published on Sunday, Sep 14, 2025 by civo
civo.getInstance
Get information on an instance for use in other resources. This data source provides all of the instance’s properties as configured on your Civo account.
Note: This data source returns a single instance. When specifying a hostname, an error will be raised if more than one instances found.
Example Usage
import * as pulumi from "@pulumi/pulumi";
import * as civo from "@pulumi/civo";
const myhostaname = civo.getInstance({
    hostname: "myhostname.com",
});
export const instanceOutput = myhostaname.then(myhostaname => myhostaname.publicIp);
import pulumi
import pulumi_civo as civo
myhostaname = civo.get_instance(hostname="myhostname.com")
pulumi.export("instanceOutput", myhostaname.public_ip)
package main
import (
	"github.com/pulumi/pulumi-terraform-provider/sdks/go/civo/civo"
	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)
func main() {
	pulumi.Run(func(ctx *pulumi.Context) error {
		myhostaname, err := civo.LookupInstance(ctx, &civo.LookupInstanceArgs{
			Hostname: pulumi.StringRef("myhostname.com"),
		}, nil)
		if err != nil {
			return err
		}
		ctx.Export("instanceOutput", myhostaname.PublicIp)
		return nil
	})
}
using System.Collections.Generic;
using System.Linq;
using Pulumi;
using Civo = Pulumi.Civo;
return await Deployment.RunAsync(() => 
{
    var myhostaname = Civo.GetInstance.Invoke(new()
    {
        Hostname = "myhostname.com",
    });
    return new Dictionary<string, object?>
    {
        ["instanceOutput"] = myhostaname.Apply(getInstanceResult => getInstanceResult.PublicIp),
    };
});
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.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 myhostaname = CivoFunctions.getInstance(GetInstanceArgs.builder()
            .hostname("myhostname.com")
            .build());
        ctx.export("instanceOutput", myhostaname.applyValue(getInstanceResult -> getInstanceResult.publicIp()));
    }
}
variables:
  myhostaname:
    fn::invoke:
      function: civo:getInstance
      arguments:
        hostname: myhostname.com
outputs:
  instanceOutput: ${myhostaname.publicIp}
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(hostname: Optional[str] = None,
                 id: Optional[str] = None,
                 region: Optional[str] = None,
                 opts: Optional[InvokeOptions] = None) -> GetInstanceResult
def get_instance_output(hostname: Optional[pulumi.Input[str]] = None,
                 id: Optional[pulumi.Input[str]] = None,
                 region: Optional[pulumi.Input[str]] = 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)
public static Output<GetInstanceResult> getInstance(GetInstanceArgs args, InvokeOptions options)
fn::invoke:
  function: civo:index/getInstance:getInstance
  arguments:
    # arguments dictionaryThe following arguments are supported:
getInstance Result
The following output properties are available:
- CpuCores double
- Total cpu of the instance
- CreatedAt string
- The date of creation of the instance
- DiskGb double
- The size of the disk
- FirewallId string
- The ID of the firewall used
- InitialPassword string
- Instance initial password
- InitialUser string
- The name of the initial user created on the server
- NetworkId string
- his will be the ID of the network
- Notes string
- The notes of the instance
- PrivateIp string
- The private IP
- PseudoIp string
- Is the ip that is used to route the public ip from the internet to the instance using NAT
- PublicIp string
- The public IP
- RamMb double
- Total ram of the instance
- ReverseDns string
- A fully qualified domain name
- Script string
- The contents of a script uploaded
- Size string
- The name of the size
- SshkeyId string
- The ID SSH key
- Status string
- The status of the instance
- List<string>
- An optional list of tags
- Template string
- The ID for the disk image/template to used to build the instance
- Hostname string
- The hostname of the Instance
- Id string
- The ID of this resource.
- Region string
- The region of an existing Instance
- CpuCores float64
- Total cpu of the instance
- CreatedAt string
- The date of creation of the instance
- DiskGb float64
- The size of the disk
- FirewallId string
- The ID of the firewall used
- InitialPassword string
- Instance initial password
- InitialUser string
- The name of the initial user created on the server
- NetworkId string
- his will be the ID of the network
- Notes string
- The notes of the instance
- PrivateIp string
- The private IP
- PseudoIp string
- Is the ip that is used to route the public ip from the internet to the instance using NAT
- PublicIp string
- The public IP
- RamMb float64
- Total ram of the instance
- ReverseDns string
- A fully qualified domain name
- Script string
- The contents of a script uploaded
- Size string
- The name of the size
- SshkeyId string
- The ID SSH key
- Status string
- The status of the instance
- []string
- An optional list of tags
- Template string
- The ID for the disk image/template to used to build the instance
- Hostname string
- The hostname of the Instance
- Id string
- The ID of this resource.
- Region string
- The region of an existing Instance
- cpuCores Double
- Total cpu of the instance
- createdAt String
- The date of creation of the instance
- diskGb Double
- The size of the disk
- firewallId String
- The ID of the firewall used
- initialPassword String
- Instance initial password
- initialUser String
- The name of the initial user created on the server
- networkId String
- his will be the ID of the network
- notes String
- The notes of the instance
- privateIp String
- The private IP
- pseudoIp String
- Is the ip that is used to route the public ip from the internet to the instance using NAT
- publicIp String
- The public IP
- ramMb Double
- Total ram of the instance
- reverseDns String
- A fully qualified domain name
- script String
- The contents of a script uploaded
- size String
- The name of the size
- sshkeyId String
- The ID SSH key
- status String
- The status of the instance
- List<String>
- An optional list of tags
- template String
- The ID for the disk image/template to used to build the instance
- hostname String
- The hostname of the Instance
- id String
- The ID of this resource.
- region String
- The region of an existing Instance
- cpuCores number
- Total cpu of the instance
- createdAt string
- The date of creation of the instance
- diskGb number
- The size of the disk
- firewallId string
- The ID of the firewall used
- initialPassword string
- Instance initial password
- initialUser string
- The name of the initial user created on the server
- networkId string
- his will be the ID of the network
- notes string
- The notes of the instance
- privateIp string
- The private IP
- pseudoIp string
- Is the ip that is used to route the public ip from the internet to the instance using NAT
- publicIp string
- The public IP
- ramMb number
- Total ram of the instance
- reverseDns string
- A fully qualified domain name
- script string
- The contents of a script uploaded
- size string
- The name of the size
- sshkeyId string
- The ID SSH key
- status string
- The status of the instance
- string[]
- An optional list of tags
- template string
- The ID for the disk image/template to used to build the instance
- hostname string
- The hostname of the Instance
- id string
- The ID of this resource.
- region string
- The region of an existing Instance
- cpu_cores float
- Total cpu of the instance
- created_at str
- The date of creation of the instance
- disk_gb float
- The size of the disk
- firewall_id str
- The ID of the firewall used
- initial_password str
- Instance initial password
- initial_user str
- The name of the initial user created on the server
- network_id str
- his will be the ID of the network
- notes str
- The notes of the instance
- private_ip str
- The private IP
- pseudo_ip str
- Is the ip that is used to route the public ip from the internet to the instance using NAT
- public_ip str
- The public IP
- ram_mb float
- Total ram of the instance
- reverse_dns str
- A fully qualified domain name
- script str
- The contents of a script uploaded
- size str
- The name of the size
- sshkey_id str
- The ID SSH key
- status str
- The status of the instance
- Sequence[str]
- An optional list of tags
- template str
- The ID for the disk image/template to used to build the instance
- hostname str
- The hostname of the Instance
- id str
- The ID of this resource.
- region str
- The region of an existing Instance
- cpuCores Number
- Total cpu of the instance
- createdAt String
- The date of creation of the instance
- diskGb Number
- The size of the disk
- firewallId String
- The ID of the firewall used
- initialPassword String
- Instance initial password
- initialUser String
- The name of the initial user created on the server
- networkId String
- his will be the ID of the network
- notes String
- The notes of the instance
- privateIp String
- The private IP
- pseudoIp String
- Is the ip that is used to route the public ip from the internet to the instance using NAT
- publicIp String
- The public IP
- ramMb Number
- Total ram of the instance
- reverseDns String
- A fully qualified domain name
- script String
- The contents of a script uploaded
- size String
- The name of the size
- sshkeyId String
- The ID SSH key
- status String
- The status of the instance
- List<String>
- An optional list of tags
- template String
- The ID for the disk image/template to used to build the instance
- hostname String
- The hostname of the Instance
- id String
- The ID of this resource.
- region String
- The region of an existing Instance
Package Details
- Repository
- Civo civo/terraform-provider-civo
- License
- Notes
- This Pulumi package is based on the civoTerraform Provider.
