lxd 2.5.0 published on Thursday, Mar 13, 2025 by terraform-lxd
lxd.getProfile
Explore with Pulumi AI
# lxd.Profile
Provides information about an existing LXD profile.
Example Usage
import * as pulumi from "@pulumi/pulumi";
import * as lxd from "@pulumi/lxd";
const _default = lxd.getProfile({
    name: "default",
});
const inst = new lxd.Instance("inst", {
    image: "ubuntu:24.04",
    profiles: [_default.then(_default => _default.name)],
});
import pulumi
import pulumi_lxd as lxd
default = lxd.get_profile(name="default")
inst = lxd.Instance("inst",
    image="ubuntu:24.04",
    profiles=[default.name])
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 {
		_default, err := lxd.LookupProfile(ctx, &lxd.LookupProfileArgs{
			Name: "default",
		}, nil)
		if err != nil {
			return err
		}
		_, err = lxd.NewInstance(ctx, "inst", &lxd.InstanceArgs{
			Image: pulumi.String("ubuntu:24.04"),
			Profiles: pulumi.StringArray{
				pulumi.String(_default.Name),
			},
		})
		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 @default = Lxd.GetProfile.Invoke(new()
    {
        Name = "default",
    });
    var inst = new Lxd.Instance("inst", new()
    {
        Image = "ubuntu:24.04",
        Profiles = new[]
        {
            @default.Apply(@default => @default.Apply(getProfileResult => getProfileResult.Name)),
        },
    });
});
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.GetProfileArgs;
import com.pulumi.lxd.Instance;
import com.pulumi.lxd.InstanceArgs;
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 default = LxdFunctions.getProfile(GetProfileArgs.builder()
            .name("default")
            .build());
        var inst = new Instance("inst", InstanceArgs.builder()
            .image("ubuntu:24.04")
            .profiles(default_.name())
            .build());
    }
}
resources:
  inst:
    type: lxd:Instance
    properties:
      image: ubuntu:24.04
      profiles:
        - ${default.name}
variables:
  default:
    fn::invoke:
      function: lxd:getProfile
      arguments:
        name: default
Using getProfile
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 getProfile(args: GetProfileArgs, opts?: InvokeOptions): Promise<GetProfileResult>
function getProfileOutput(args: GetProfileOutputArgs, opts?: InvokeOptions): Output<GetProfileResult>def get_profile(devices: Optional[Sequence[GetProfileDevice]] = None,
                name: Optional[str] = None,
                project: Optional[str] = None,
                remote: Optional[str] = None,
                opts: Optional[InvokeOptions] = None) -> GetProfileResult
def get_profile_output(devices: Optional[pulumi.Input[Sequence[pulumi.Input[GetProfileDeviceArgs]]]] = None,
                name: Optional[pulumi.Input[str]] = None,
                project: Optional[pulumi.Input[str]] = None,
                remote: Optional[pulumi.Input[str]] = None,
                opts: Optional[InvokeOptions] = None) -> Output[GetProfileResult]func LookupProfile(ctx *Context, args *LookupProfileArgs, opts ...InvokeOption) (*LookupProfileResult, error)
func LookupProfileOutput(ctx *Context, args *LookupProfileOutputArgs, opts ...InvokeOption) LookupProfileResultOutput> Note: This function is named LookupProfile in the Go SDK.
public static class GetProfile 
{
    public static Task<GetProfileResult> InvokeAsync(GetProfileArgs args, InvokeOptions? opts = null)
    public static Output<GetProfileResult> Invoke(GetProfileInvokeArgs args, InvokeOptions? opts = null)
}public static CompletableFuture<GetProfileResult> getProfile(GetProfileArgs args, InvokeOptions options)
public static Output<GetProfileResult> getProfile(GetProfileArgs args, InvokeOptions options)
fn::invoke:
  function: lxd:index/getProfile:getProfile
  arguments:
    # arguments dictionaryThe following arguments are supported:
- Name string
 - Required - Name of the profile.
 - Devices
List<Get
Profile Device>  - Device definition. See reference below.
 - Project string
 - Optional - Name of the project where the profile is create.
 - Remote string
 - Optional - The remote in which the resource was created. If not provided, the provider's default remote is used.
 
- Name string
 - Required - Name of the profile.
 - Devices
[]Get
Profile Device  - Device definition. See reference below.
 - Project string
 - Optional - Name of the project where the profile is create.
 - Remote string
 - Optional - The remote in which the resource was created. If not provided, the provider's default remote is used.
 
- name String
 - Required - Name of the profile.
 - devices
List<Get
Profile Device>  - Device definition. See reference below.
 - project String
 - Optional - Name of the project where the profile is create.
 - remote String
 - Optional - The remote in which the resource was created. If not provided, the provider's default remote is used.
 
- name string
 - Required - Name of the profile.
 - devices
Get
Profile Device[]  - Device definition. See reference below.
 - project string
 - Optional - Name of the project where the profile is create.
 - remote string
 - Optional - The remote in which the resource was created. If not provided, the provider's default remote is used.
 
- name str
 - Required - Name of the profile.
 - devices
Sequence[Get
Profile Device]  - Device definition. See reference below.
 - project str
 - Optional - Name of the project where the profile is create.
 - remote str
 - Optional - The remote in which the resource was created. If not provided, the provider's default remote is used.
 
- name String
 - Required - Name of the profile.
 - devices List<Property Map>
 - Device definition. See reference below.
 - project String
 - Optional - Name of the project where the profile is create.
 - remote String
 - Optional - The remote in which the resource was created. If not provided, the provider's default remote is used.
 
getProfile Result
The following output properties are available:
- Config Dictionary<string, string>
 - Map of key/value pairs of instance config settings.
 - Description string
 - Id string
 - The provider-assigned unique ID for this managed resource.
 - Name string
 - Name of the device.
 - Devices
List<Get
Profile Device>  - Device definition. See reference below.
 - Project string
 - Remote string
 
- Config map[string]string
 - Map of key/value pairs of instance config settings.
 - Description string
 - Id string
 - The provider-assigned unique ID for this managed resource.
 - Name string
 - Name of the device.
 - Devices
[]Get
Profile Device  - Device definition. See reference below.
 - Project string
 - Remote string
 
- config Map<String,String>
 - Map of key/value pairs of instance config settings.
 - description String
 - id String
 - The provider-assigned unique ID for this managed resource.
 - name String
 - Name of the device.
 - devices
List<Get
Profile Device>  - Device definition. See reference below.
 - project String
 - remote String
 
- config {[key: string]: string}
 - Map of key/value pairs of instance config settings.
 - description string
 - id string
 - The provider-assigned unique ID for this managed resource.
 - name string
 - Name of the device.
 - devices
Get
Profile Device[]  - Device definition. See reference below.
 - project string
 - remote string
 
- config Mapping[str, str]
 - Map of key/value pairs of instance config settings.
 - description str
 - id str
 - The provider-assigned unique ID for this managed resource.
 - name str
 - Name of the device.
 - devices
Sequence[Get
Profile Device]  - Device definition. See reference below.
 - project str
 - remote str
 
- config Map<String>
 - Map of key/value pairs of instance config settings.
 - description String
 - id String
 - The provider-assigned unique ID for this managed resource.
 - name String
 - Name of the device.
 - devices List<Property Map>
 - Device definition. See reference below.
 - project String
 - remote String
 
Supporting Types
GetProfileDevice  
- Name string
 - Required - Name of the profile.
 - Properties Dictionary<string, string>
 - Map of key/value pairs of device properties.
 - Type string
 - Type of the device.
 
- Name string
 - Required - Name of the profile.
 - Properties map[string]string
 - Map of key/value pairs of device properties.
 - Type string
 - Type of the device.
 
- name String
 - Required - Name of the profile.
 - properties Map<String,String>
 - Map of key/value pairs of device properties.
 - type String
 - Type of the device.
 
- name string
 - Required - Name of the profile.
 - properties {[key: string]: string}
 - Map of key/value pairs of device properties.
 - type string
 - Type of the device.
 
- name str
 - Required - Name of the profile.
 - properties Mapping[str, str]
 - Map of key/value pairs of device properties.
 - type str
 - Type of the device.
 
- name String
 - Required - Name of the profile.
 - properties Map<String>
 - Map of key/value pairs of device properties.
 - type String
 - Type of the device.
 
Package Details
- Repository
 - lxd terraform-lxd/terraform-provider-lxd
 - License
 - Notes
 - This Pulumi package is based on the 
lxdTerraform Provider.