1. Packages
  2. Packages
  3. Lxd Provider
  4. API Docs
  5. getImage
Viewing docs for lxd 3.0.2
published on Monday, Jun 29, 2026 by terraform-lxd
Viewing docs for lxd 3.0.2
published on Monday, Jun 29, 2026 by terraform-lxd

    # lxd.Image

    Provides information about an existing LXD image.

    Example Usage

    import * as pulumi from "@pulumi/pulumi";
    import * as lxd from "@pulumi/lxd";
    
    const debianCustom = lxd.getImage({
        image: "debian_custom",
    });
    const inst = new lxd.Instance("inst", {
        name: "my-instance",
        image: debianCustom.then(debianCustom => debianCustom.fingerprint),
    });
    
    import pulumi
    import pulumi_lxd as lxd
    
    debian_custom = lxd.get_image(image="debian_custom")
    inst = lxd.Instance("inst",
        name="my-instance",
        image=debian_custom.fingerprint)
    
    package main
    
    import (
    	"github.com/pulumi/pulumi-terraform-provider/sdks/go/lxd/v3/lxd"
    	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
    )
    
    func main() {
    	pulumi.Run(func(ctx *pulumi.Context) error {
    		debianCustom, err := lxd.LookupImage(ctx, &lxd.LookupImageArgs{
    			Image: "debian_custom",
    		}, nil)
    		if err != nil {
    			return err
    		}
    		_, err = lxd.NewInstance(ctx, "inst", &lxd.InstanceArgs{
    			Name:  pulumi.String("my-instance"),
    			Image: pulumi.String(debianCustom.Fingerprint),
    		})
    		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 debianCustom = Lxd.GetImage.Invoke(new()
        {
            Image = "debian_custom",
        });
    
        var inst = new Lxd.Instance("inst", new()
        {
            Name = "my-instance",
            Image = debianCustom.Apply(getImageResult => getImageResult.Fingerprint),
        });
    
    });
    
    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.GetImageArgs;
    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 debianCustom = LxdFunctions.getImage(GetImageArgs.builder()
                .image("debian_custom")
                .build());
    
            var inst = new Instance("inst", InstanceArgs.builder()
                .name("my-instance")
                .image(debianCustom.fingerprint())
                .build());
    
        }
    }
    
    resources:
      inst:
        type: lxd:Instance
        properties:
          name: my-instance
          image: ${debianCustom.fingerprint}
    variables:
      debianCustom:
        fn::invoke:
          function: lxd:getImage
          arguments:
            image: debian_custom
    
    Example coming soon!
    

    Using getImage

    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 getImage(args: GetImageArgs, opts?: InvokeOptions): Promise<GetImageResult>
    function getImageOutput(args: GetImageOutputArgs, opts?: InvokeOptions): Output<GetImageResult>
    def get_image(architecture: Optional[str] = None,
                  image: Optional[str] = None,
                  project: Optional[str] = None,
                  type: Optional[str] = None,
                  opts: Optional[InvokeOptions] = None) -> GetImageResult
    def get_image_output(architecture: pulumi.Input[Optional[str]] = None,
                  image: pulumi.Input[Optional[str]] = None,
                  project: pulumi.Input[Optional[str]] = None,
                  type: pulumi.Input[Optional[str]] = None,
                  opts: Optional[InvokeOptions] = None) -> Output[GetImageResult]
    func LookupImage(ctx *Context, args *LookupImageArgs, opts ...InvokeOption) (*LookupImageResult, error)
    func LookupImageOutput(ctx *Context, args *LookupImageOutputArgs, opts ...InvokeOption) LookupImageResultOutput

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

    public static class GetImage 
    {
        public static Task<GetImageResult> InvokeAsync(GetImageArgs args, InvokeOptions? opts = null)
        public static Output<GetImageResult> Invoke(GetImageInvokeArgs args, InvokeOptions? opts = null)
    }
    public static CompletableFuture<GetImageResult> getImage(GetImageArgs args, InvokeOptions options)
    public static Output<GetImageResult> getImage(GetImageArgs args, InvokeOptions options)
    
    fn::invoke:
      function: lxd:index/getImage:getImage
      arguments:
        # arguments dictionary
    data "lxd_getimage" "name" {
        # arguments
    }

    The following arguments are supported:

    Image string
    Required - Name or fingerprint of the image in the format [<remote>:]<image>. If the remote is omitted, the provider's default remote is used.
    Architecture string
    Optional - The image architecture (e.g. x86_64, aarch64). See Architectures for all possible values.
    Project string
    Optional - Name of the project where the image is stored.
    Type string
    Optional - Type of image. Must be one of container or virtual-machine.
    Image string
    Required - Name or fingerprint of the image in the format [<remote>:]<image>. If the remote is omitted, the provider's default remote is used.
    Architecture string
    Optional - The image architecture (e.g. x86_64, aarch64). See Architectures for all possible values.
    Project string
    Optional - Name of the project where the image is stored.
    Type string
    Optional - Type of image. Must be one of container or virtual-machine.
    image string
    Required - Name or fingerprint of the image in the format [<remote>:]<image>. If the remote is omitted, the provider's default remote is used.
    architecture string
    Optional - The image architecture (e.g. x86_64, aarch64). See Architectures for all possible values.
    project string
    Optional - Name of the project where the image is stored.
    type string
    Optional - Type of image. Must be one of container or virtual-machine.
    image String
    Required - Name or fingerprint of the image in the format [<remote>:]<image>. If the remote is omitted, the provider's default remote is used.
    architecture String
    Optional - The image architecture (e.g. x86_64, aarch64). See Architectures for all possible values.
    project String
    Optional - Name of the project where the image is stored.
    type String
    Optional - Type of image. Must be one of container or virtual-machine.
    image string
    Required - Name or fingerprint of the image in the format [<remote>:]<image>. If the remote is omitted, the provider's default remote is used.
    architecture string
    Optional - The image architecture (e.g. x86_64, aarch64). See Architectures for all possible values.
    project string
    Optional - Name of the project where the image is stored.
    type string
    Optional - Type of image. Must be one of container or virtual-machine.
    image str
    Required - Name or fingerprint of the image in the format [<remote>:]<image>. If the remote is omitted, the provider's default remote is used.
    architecture str
    Optional - The image architecture (e.g. x86_64, aarch64). See Architectures for all possible values.
    project str
    Optional - Name of the project where the image is stored.
    type str
    Optional - Type of image. Must be one of container or virtual-machine.
    image String
    Required - Name or fingerprint of the image in the format [<remote>:]<image>. If the remote is omitted, the provider's default remote is used.
    architecture String
    Optional - The image architecture (e.g. x86_64, aarch64). See Architectures for all possible values.
    project String
    Optional - Name of the project where the image is stored.
    type String
    Optional - Type of image. Must be one of container or virtual-machine.

    getImage Result

    The following output properties are available:

    Aliases List<string>
    The list of aliases for the image.
    Architecture string
    CreatedAt double
    The datetime of image creation, in Unix time.
    Fingerprint string
    The unique hash fingerprint of the image.
    Id string
    The provider-assigned unique ID for this managed resource.
    Image string
    Type string
    Project string
    Aliases []string
    The list of aliases for the image.
    Architecture string
    CreatedAt float64
    The datetime of image creation, in Unix time.
    Fingerprint string
    The unique hash fingerprint of the image.
    Id string
    The provider-assigned unique ID for this managed resource.
    Image string
    Type string
    Project string
    aliases list(string)
    The list of aliases for the image.
    architecture string
    created_at number
    The datetime of image creation, in Unix time.
    fingerprint string
    The unique hash fingerprint of the image.
    id string
    The provider-assigned unique ID for this managed resource.
    image string
    type string
    project string
    aliases List<String>
    The list of aliases for the image.
    architecture String
    createdAt Double
    The datetime of image creation, in Unix time.
    fingerprint String
    The unique hash fingerprint of the image.
    id String
    The provider-assigned unique ID for this managed resource.
    image String
    type String
    project String
    aliases string[]
    The list of aliases for the image.
    architecture string
    createdAt number
    The datetime of image creation, in Unix time.
    fingerprint string
    The unique hash fingerprint of the image.
    id string
    The provider-assigned unique ID for this managed resource.
    image string
    type string
    project string
    aliases Sequence[str]
    The list of aliases for the image.
    architecture str
    created_at float
    The datetime of image creation, in Unix time.
    fingerprint str
    The unique hash fingerprint of the image.
    id str
    The provider-assigned unique ID for this managed resource.
    image str
    type str
    project str
    aliases List<String>
    The list of aliases for the image.
    architecture String
    createdAt Number
    The datetime of image creation, in Unix time.
    fingerprint String
    The unique hash fingerprint of the image.
    id String
    The provider-assigned unique ID for this managed resource.
    image String
    type String
    project String

    Package Details

    Repository
    lxd terraform-lxd/terraform-provider-lxd
    License
    Notes
    This Pulumi package is based on the lxd Terraform Provider.
    Viewing docs for lxd 3.0.2
    published on Monday, Jun 29, 2026 by terraform-lxd

      Try Pulumi Cloud free.
      Your team will thank you.

      Start free trial