1. Packages
  2. Packages
  3. DigitalOcean Provider
  4. API Docs
  5. getMicrodropletImage
Viewing docs for DigitalOcean v4.77.0
published on Friday, Jul 31, 2026 by Pulumi
digitalocean logo
Viewing docs for DigitalOcean v4.77.0
published on Friday, Jul 31, 2026 by Pulumi

    Fetches a single DigitalOcean MicroDroplet image by id or by name.

    Name lookups page through the full image list on the account since the API has no filtered list endpoint for images.

    Example Usage

    import * as pulumi from "@pulumi/pulumi";
    import * as digitalocean from "@pulumi/digitalocean";
    
    const byid = digitalocean.getMicrodropletImage({
        id: "4a2c9f10-3d18-4b6a-9e3d-2b7f8e0f1c11",
    });
    const byname = digitalocean.getMicrodropletImage({
        name: "my-app-v1",
    });
    
    import pulumi
    import pulumi_digitalocean as digitalocean
    
    byid = digitalocean.get_microdroplet_image(id="4a2c9f10-3d18-4b6a-9e3d-2b7f8e0f1c11")
    byname = digitalocean.get_microdroplet_image(name="my-app-v1")
    
    package main
    
    import (
    	"github.com/pulumi/pulumi-digitalocean/sdk/v4/go/digitalocean"
    	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
    )
    
    func main() {
    	pulumi.Run(func(ctx *pulumi.Context) error {
    		_, err := digitalocean.GetMicrodropletImage(ctx, &digitalocean.LookupMicrodropletImageArgs{
    			Id: pulumi.StringRef("4a2c9f10-3d18-4b6a-9e3d-2b7f8e0f1c11"),
    		}, nil)
    		if err != nil {
    			return err
    		}
    		_, err = digitalocean.GetMicrodropletImage(ctx, &digitalocean.LookupMicrodropletImageArgs{
    			Name: pulumi.StringRef("my-app-v1"),
    		}, nil)
    		if err != nil {
    			return err
    		}
    		return nil
    	})
    }
    
    using System.Collections.Generic;
    using System.Linq;
    using Pulumi;
    using DigitalOcean = Pulumi.DigitalOcean;
    
    return await Deployment.RunAsync(() => 
    {
        var byid = DigitalOcean.GetMicrodropletImage.Invoke(new()
        {
            Id = "4a2c9f10-3d18-4b6a-9e3d-2b7f8e0f1c11",
        });
    
        var byname = DigitalOcean.GetMicrodropletImage.Invoke(new()
        {
            Name = "my-app-v1",
        });
    
    });
    
    package generated_program;
    
    import com.pulumi.Context;
    import com.pulumi.Pulumi;
    import com.pulumi.core.Output;
    import com.pulumi.digitalocean.DigitaloceanFunctions;
    import com.pulumi.digitalocean.inputs.GetMicrodropletImageArgs;
    import java.util.ArrayList;
    import java.util.Arrays;
    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 byid = DigitaloceanFunctions.getMicrodropletImage(GetMicrodropletImageArgs.builder()
                .id("4a2c9f10-3d18-4b6a-9e3d-2b7f8e0f1c11")
                .build());
    
            final var byname = DigitaloceanFunctions.getMicrodropletImage(GetMicrodropletImageArgs.builder()
                .name("my-app-v1")
                .build());
    
        }
    }
    
    variables:
      byid:
        fn::invoke:
          function: digitalocean:getMicrodropletImage
          arguments:
            id: 4a2c9f10-3d18-4b6a-9e3d-2b7f8e0f1c11
      byname:
        fn::invoke:
          function: digitalocean:getMicrodropletImage
          arguments:
            name: my-app-v1
    
    pulumi {
      required_providers {
        digitalocean = {
          source = "pulumi/digitalocean"
        }
      }
    }
    
    data "digitalocean_getmicrodropletimage" "byid" {
      id = "4a2c9f10-3d18-4b6a-9e3d-2b7f8e0f1c11"
    }
    data "digitalocean_getmicrodropletimage" "byname" {
      name = "my-app-v1"
    }
    

    Using getMicrodropletImage

    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 getMicrodropletImage(args: GetMicrodropletImageArgs, opts?: InvokeOptions): Promise<GetMicrodropletImageResult>
    function getMicrodropletImageOutput(args: GetMicrodropletImageOutputArgs, opts?: InvokeOptions): Output<GetMicrodropletImageResult>
    def get_microdroplet_image(id: Optional[str] = None,
                               name: Optional[str] = None,
                               opts: Optional[InvokeOptions] = None) -> GetMicrodropletImageResult
    def get_microdroplet_image_output(id: pulumi.Input[Optional[str]] = None,
                               name: pulumi.Input[Optional[str]] = None,
                               opts: Optional[InvokeOptions] = None) -> Output[GetMicrodropletImageResult]
    func LookupMicrodropletImage(ctx *Context, args *LookupMicrodropletImageArgs, opts ...InvokeOption) (*LookupMicrodropletImageResult, error)
    func LookupMicrodropletImageOutput(ctx *Context, args *LookupMicrodropletImageOutputArgs, opts ...InvokeOption) LookupMicrodropletImageResultOutput

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

    public static class GetMicrodropletImage 
    {
        public static Task<GetMicrodropletImageResult> InvokeAsync(GetMicrodropletImageArgs args, InvokeOptions? opts = null)
        public static Output<GetMicrodropletImageResult> Invoke(GetMicrodropletImageInvokeArgs args, InvokeOptions? opts = null)
    }
    public static CompletableFuture<GetMicrodropletImageResult> getMicrodropletImage(GetMicrodropletImageArgs args, InvokeOptions options)
    public static Output<GetMicrodropletImageResult> getMicrodropletImage(GetMicrodropletImageArgs args, InvokeOptions options)
    
    fn::invoke:
      function: digitalocean:index/getMicrodropletImage:getMicrodropletImage
      arguments:
        # arguments dictionary
    data "digitalocean_get_microdroplet_image" "name" {
        # arguments
    }

    The following arguments are supported:

    Id string
    The MicroDroplet image UUID.
    Name string
    The MicroDroplet image name. Errors if zero or more than one match.
    Id string
    The MicroDroplet image UUID.
    Name string
    The MicroDroplet image name. Errors if zero or more than one match.
    id string
    The MicroDroplet image UUID.
    name string
    The MicroDroplet image name. Errors if zero or more than one match.
    id String
    The MicroDroplet image UUID.
    name String
    The MicroDroplet image name. Errors if zero or more than one match.
    id string
    The MicroDroplet image UUID.
    name string
    The MicroDroplet image name. Errors if zero or more than one match.
    id str
    The MicroDroplet image UUID.
    name str
    The MicroDroplet image name. Errors if zero or more than one match.
    id String
    The MicroDroplet image UUID.
    name String
    The MicroDroplet image name. Errors if zero or more than one match.

    getMicrodropletImage Result

    The following output properties are available:

    CreatedAt string
    RFC3339 timestamp of when the image was created.
    Id string
    Name string
    Source string
    The OCI reference used when the image was imported.
    Status string
    Lifecycle status.
    Urn string
    The uniform resource name (URN) for the MicroDroplet image.
    CreatedAt string
    RFC3339 timestamp of when the image was created.
    Id string
    Name string
    Source string
    The OCI reference used when the image was imported.
    Status string
    Lifecycle status.
    Urn string
    The uniform resource name (URN) for the MicroDroplet image.
    created_at string
    RFC3339 timestamp of when the image was created.
    id string
    name string
    source string
    The OCI reference used when the image was imported.
    status string
    Lifecycle status.
    urn string
    The uniform resource name (URN) for the MicroDroplet image.
    createdAt String
    RFC3339 timestamp of when the image was created.
    id String
    name String
    source String
    The OCI reference used when the image was imported.
    status String
    Lifecycle status.
    urn String
    The uniform resource name (URN) for the MicroDroplet image.
    createdAt string
    RFC3339 timestamp of when the image was created.
    id string
    name string
    source string
    The OCI reference used when the image was imported.
    status string
    Lifecycle status.
    urn string
    The uniform resource name (URN) for the MicroDroplet image.
    created_at str
    RFC3339 timestamp of when the image was created.
    id str
    name str
    source str
    The OCI reference used when the image was imported.
    status str
    Lifecycle status.
    urn str
    The uniform resource name (URN) for the MicroDroplet image.
    createdAt String
    RFC3339 timestamp of when the image was created.
    id String
    name String
    source String
    The OCI reference used when the image was imported.
    status String
    Lifecycle status.
    urn String
    The uniform resource name (URN) for the MicroDroplet image.

    Package Details

    Repository
    DigitalOcean pulumi/pulumi-digitalocean
    License
    Apache-2.0
    Notes
    This Pulumi package is based on the digitalocean Terraform Provider.
    digitalocean logo
    Viewing docs for DigitalOcean v4.77.0
    published on Friday, Jul 31, 2026 by Pulumi

      Try Pulumi Cloud free.
      Your team will thank you.

      Start free trial