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",
});
import pulumi
import pulumi_lxd as lxd
inst = lxd.get_instance(name="my-instance")
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
	})
}
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",
    });
});
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());
    }
}
variables:
  inst:
    fn::invoke:
      function: lxd:getInstance
      arguments:
        name: my-instance
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(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]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: lxd:index/getInstance:getInstance
  arguments:
    # arguments dictionaryThe following arguments are supported:
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, GetInstance Devices> 
- 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, GetInstance Interfaces> 
- 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]GetInstance Devices 
- 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]GetInstance Interfaces 
- 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,GetInstance Devices> 
- 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,GetInstance Interfaces> 
- 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]: GetInstance Devices} 
- 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]: GetInstance Interfaces} 
- 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, GetInstance Devices] 
- 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, GetInstance Interfaces] 
- 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 Dictionary<string, string>
- Type string
- Instance type.
- Properties map[string]string
- Type string
- Instance type.
- properties Map<String,String>
- type String
- Instance type.
- properties {[key: string]: string}
- type string
- Instance type.
- properties Mapping[str, str]
- type str
- Instance type.
- properties Map<String>
- type String
- Instance type.
GetInstanceInterfaces  
- Ips
List<GetInstance Interfaces Ip> 
- Name string
- Required - Name of the instance.
- State string
- Type string
- Instance type.
- Ips
[]GetInstance Interfaces Ip 
- Name string
- Required - Name of the instance.
- State string
- Type string
- Instance type.
- ips
List<GetInstance Interfaces Ip> 
- name String
- Required - Name of the instance.
- state String
- type String
- Instance type.
- ips
GetInstance Interfaces Ip[] 
- name string
- Required - Name of the instance.
- state string
- type string
- Instance type.
- ips
Sequence[GetInstance Interfaces Ip] 
- name str
- Required - Name of the instance.
- state str
- type str
- Instance type.
- ips List<Property Map>
- name String
- Required - Name of the instance.
- state String
- type String
- Instance type.
GetInstanceInterfacesIp   
Package Details
- Repository
- lxd terraform-lxd/terraform-provider-lxd
- License
- Notes
- This Pulumi package is based on the lxdTerraform Provider.