1. Packages
  2. Lxd Provider
  3. API Docs
  4. getInstance
lxd 2.5.0 published on Thursday, Mar 13, 2025 by terraform-lxd

lxd.getInstance

Explore with Pulumi AI

# lxd.Instance

Provides information about an existing LXD instance.

Example Usage

import * as pulumi from "@pulumi/pulumi";
import * as lxd from "@pulumi/lxd";

const inst = lxd.getInstance({
    name: "my-instance",
});
Copy
import pulumi
import pulumi_lxd as lxd

inst = lxd.get_instance(name="my-instance")
Copy
package main

import (
	"github.com/pulumi/pulumi-terraform-provider/sdks/go/lxd/v2/lxd"
	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)

func main() {
	pulumi.Run(func(ctx *pulumi.Context) error {
		_, err := lxd.LookupInstance(ctx, &lxd.LookupInstanceArgs{
			Name: "my-instance",
		}, nil)
		if err != nil {
			return err
		}
		return nil
	})
}
Copy
using System.Collections.Generic;
using System.Linq;
using Pulumi;
using Lxd = Pulumi.Lxd;

return await Deployment.RunAsync(() => 
{
    var inst = Lxd.GetInstance.Invoke(new()
    {
        Name = "my-instance",
    });

});
Copy
package generated_program;

import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.lxd.LxdFunctions;
import com.pulumi.lxd.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 inst = LxdFunctions.getInstance(GetInstanceArgs.builder()
            .name("my-instance")
            .build());

    }
}
Copy
variables:
  inst:
    fn::invoke:
      function: lxd:getInstance
      arguments:
        name: my-instance
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(name: Optional[str] = None,
                 project: Optional[str] = None,
                 remote: Optional[str] = None,
                 opts: Optional[InvokeOptions] = None) -> GetInstanceResult
def get_instance_output(name: Optional[pulumi.Input[str]] = None,
                 project: Optional[pulumi.Input[str]] = None,
                 remote: Optional[pulumi.Input[str]] = 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: lxd:index/getInstance:getInstance
  arguments:
    # arguments dictionary
Copy

The following arguments are supported:

Name This property is required. string
Required - Name of the instance.
Project string
Optional - Name of the project where instance is located.
Remote string
Optional - The remote in which the resource was created. If not provided, the provider's default remote is used.
Name This property is required. string
Required - Name of the instance.
Project string
Optional - Name of the project where instance is located.
Remote string
Optional - The remote in which the resource was created. If not provided, the provider's default remote is used.
name This property is required. String
Required - Name of the instance.
project String
Optional - Name of the project where instance is located.
remote String
Optional - The remote in which the resource was created. If not provided, the provider's default remote is used.
name This property is required. string
Required - Name of the instance.
project string
Optional - Name of the project where instance is located.
remote string
Optional - The remote in which the resource was created. If not provided, the provider's default remote is used.
name This property is required. str
Required - Name of the instance.
project str
Optional - Name of the project where instance is located.
remote str
Optional - The remote in which the resource was created. If not provided, the provider's default remote is used.
name This property is required. String
Required - Name of the instance.
project String
Optional - Name of the project where instance is located.
remote String
Optional - The remote in which the resource was created. If not provided, the provider's default remote is used.

getInstance Result

The following output properties are available:

Config Dictionary<string, string>
Map of key/value pairs of instance config settings.
Description string
Description of the instance.
Devices Dictionary<string, GetInstanceDevices>
Map of instance devices. The map key represents a device name.
Ephemeral bool
Boolean indicating if this instance is ephemeral.
Id string
The provider-assigned unique ID for this managed resource.
Interfaces Dictionary<string, GetInstanceInterfaces>
Map of all instance network interfaces (excluding loopback device). The map key represents the name of the network device (from LXD configuration).
Ipv4Address string
The instance's IPv4 address.
Ipv6Address string
The instance's IPv6 address.
Limits Dictionary<string, string>
Map of key/value pairs that define the instance resources limits.
Location string
Name of the cluster member where instance is located.
MacAddress string
The instance's MAC address.
Name string
Profiles List<string>
List of applied instance profiles.
Running bool
Boolean indicating whether the instance is currently running.
Status string
The status of the instance.
Type string
Instance type.
Project string
Remote string
Config map[string]string
Map of key/value pairs of instance config settings.
Description string
Description of the instance.
Devices map[string]GetInstanceDevices
Map of instance devices. The map key represents a device name.
Ephemeral bool
Boolean indicating if this instance is ephemeral.
Id string
The provider-assigned unique ID for this managed resource.
Interfaces map[string]GetInstanceInterfaces
Map of all instance network interfaces (excluding loopback device). The map key represents the name of the network device (from LXD configuration).
Ipv4Address string
The instance's IPv4 address.
Ipv6Address string
The instance's IPv6 address.
Limits map[string]string
Map of key/value pairs that define the instance resources limits.
Location string
Name of the cluster member where instance is located.
MacAddress string
The instance's MAC address.
Name string
Profiles []string
List of applied instance profiles.
Running bool
Boolean indicating whether the instance is currently running.
Status string
The status of the instance.
Type string
Instance type.
Project string
Remote string
config Map<String,String>
Map of key/value pairs of instance config settings.
description String
Description of the instance.
devices Map<String,GetInstanceDevices>
Map of instance devices. The map key represents a device name.
ephemeral Boolean
Boolean indicating if this instance is ephemeral.
id String
The provider-assigned unique ID for this managed resource.
interfaces Map<String,GetInstanceInterfaces>
Map of all instance network interfaces (excluding loopback device). The map key represents the name of the network device (from LXD configuration).
ipv4Address String
The instance's IPv4 address.
ipv6Address String
The instance's IPv6 address.
limits Map<String,String>
Map of key/value pairs that define the instance resources limits.
location String
Name of the cluster member where instance is located.
macAddress String
The instance's MAC address.
name String
profiles List<String>
List of applied instance profiles.
running Boolean
Boolean indicating whether the instance is currently running.
status String
The status of the instance.
type String
Instance type.
project String
remote String
config {[key: string]: string}
Map of key/value pairs of instance config settings.
description string
Description of the instance.
devices {[key: string]: GetInstanceDevices}
Map of instance devices. The map key represents a device name.
ephemeral boolean
Boolean indicating if this instance is ephemeral.
id string
The provider-assigned unique ID for this managed resource.
interfaces {[key: string]: GetInstanceInterfaces}
Map of all instance network interfaces (excluding loopback device). The map key represents the name of the network device (from LXD configuration).
ipv4Address string
The instance's IPv4 address.
ipv6Address string
The instance's IPv6 address.
limits {[key: string]: string}
Map of key/value pairs that define the instance resources limits.
location string
Name of the cluster member where instance is located.
macAddress string
The instance's MAC address.
name string
profiles string[]
List of applied instance profiles.
running boolean
Boolean indicating whether the instance is currently running.
status string
The status of the instance.
type string
Instance type.
project string
remote string
config Mapping[str, str]
Map of key/value pairs of instance config settings.
description str
Description of the instance.
devices Mapping[str, GetInstanceDevices]
Map of instance devices. The map key represents a device name.
ephemeral bool
Boolean indicating if this instance is ephemeral.
id str
The provider-assigned unique ID for this managed resource.
interfaces Mapping[str, GetInstanceInterfaces]
Map of all instance network interfaces (excluding loopback device). The map key represents the name of the network device (from LXD configuration).
ipv4_address str
The instance's IPv4 address.
ipv6_address str
The instance's IPv6 address.
limits Mapping[str, str]
Map of key/value pairs that define the instance resources limits.
location str
Name of the cluster member where instance is located.
mac_address str
The instance's MAC address.
name str
profiles Sequence[str]
List of applied instance profiles.
running bool
Boolean indicating whether the instance is currently running.
status str
The status of the instance.
type str
Instance type.
project str
remote str
config Map<String>
Map of key/value pairs of instance config settings.
description String
Description of the instance.
devices Map<Property Map>
Map of instance devices. The map key represents a device name.
ephemeral Boolean
Boolean indicating if this instance is ephemeral.
id String
The provider-assigned unique ID for this managed resource.
interfaces Map<Property Map>
Map of all instance network interfaces (excluding loopback device). The map key represents the name of the network device (from LXD configuration).
ipv4Address String
The instance's IPv4 address.
ipv6Address String
The instance's IPv6 address.
limits Map<String>
Map of key/value pairs that define the instance resources limits.
location String
Name of the cluster member where instance is located.
macAddress String
The instance's MAC address.
name String
profiles List<String>
List of applied instance profiles.
running Boolean
Boolean indicating whether the instance is currently running.
status String
The status of the instance.
type String
Instance type.
project String
remote String

Supporting Types

GetInstanceDevices

Properties This property is required. Dictionary<string, string>
Type This property is required. string
Instance type.
Properties This property is required. map[string]string
Type This property is required. string
Instance type.
properties This property is required. Map<String,String>
type This property is required. String
Instance type.
properties This property is required. {[key: string]: string}
type This property is required. string
Instance type.
properties This property is required. Mapping[str, str]
type This property is required. str
Instance type.
properties This property is required. Map<String>
type This property is required. String
Instance type.

GetInstanceInterfaces

Ips This property is required. List<GetInstanceInterfacesIp>
Name This property is required. string
Required - Name of the instance.
State This property is required. string
Type This property is required. string
Instance type.
Ips This property is required. []GetInstanceInterfacesIp
Name This property is required. string
Required - Name of the instance.
State This property is required. string
Type This property is required. string
Instance type.
ips This property is required. List<GetInstanceInterfacesIp>
name This property is required. String
Required - Name of the instance.
state This property is required. String
type This property is required. String
Instance type.
ips This property is required. GetInstanceInterfacesIp[]
name This property is required. string
Required - Name of the instance.
state This property is required. string
type This property is required. string
Instance type.
ips This property is required. Sequence[GetInstanceInterfacesIp]
name This property is required. str
Required - Name of the instance.
state This property is required. str
type This property is required. str
Instance type.
ips This property is required. List<Property Map>
name This property is required. String
Required - Name of the instance.
state This property is required. String
type This property is required. String
Instance type.

GetInstanceInterfacesIp

Address This property is required. string
Family This property is required. string
Scope This property is required. string
Address This property is required. string
Family This property is required. string
Scope This property is required. string
address This property is required. String
family This property is required. String
scope This property is required. String
address This property is required. string
family This property is required. string
scope This property is required. string
address This property is required. str
family This property is required. str
scope This property is required. str
address This property is required. String
family This property is required. String
scope This property is required. String

Package Details

Repository
lxd terraform-lxd/terraform-provider-lxd
License
Notes
This Pulumi package is based on the lxd Terraform Provider.