1. Registry
  2. Packages
  3. DigitalOcean Provider
  4. API Docs
  5. getMicrovm
Viewing docs for DigitalOcean v4.84.1
published on Tuesday, Oct 13, 2026 by Pulumi
digitalocean logo
Viewing docs for DigitalOcean v4.84.1
published on Tuesday, Oct 13, 2026 by Pulumi

    Get information on a MicroVM for use in other resources. This is useful if the MicroVM is not managed by Terraform or you need to use any of its data.

    Note: This data source returns a single MicroVM. When looking up by name, an error is triggered if more than one MicroVM has that name.

    Note: MicroVMs are in public preview.

    Example Usage

    Get the MicroVM by name:

    import * as pulumi from "@pulumi/pulumi";
    import * as digitalocean from "@pulumi/digitalocean";
    
    const example = digitalocean.getMicrovm({
        name: "example-microvm",
    });
    export const hostname = example.then(example => example.urls?.[0]?.hostname);
    
    import pulumi
    import pulumi_digitalocean as digitalocean
    
    example = digitalocean.get_microvm(name="example-microvm")
    pulumi.export("hostname", example.urls[0].hostname)
    
    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 {
    		example, err := digitalocean.GetMicrovm(ctx, &digitalocean.LookupMicrovmArgs{
    			Name: pulumi.StringRef("example-microvm"),
    		}, nil)
    		if err != nil {
    			return err
    		}
    		ctx.Export("hostname", example.Urls[0].Hostname)
    		return nil
    	})
    }
    
    using System.Collections.Generic;
    using System.Linq;
    using Pulumi;
    using DigitalOcean = Pulumi.DigitalOcean;
    
    return await Deployment.RunAsync(() => 
    {
        var example = DigitalOcean.GetMicrovm.Invoke(new()
        {
            Name = "example-microvm",
        });
    
        return new Dictionary<string, object?>
        {
            ["hostname"] = example.Apply(getMicrovmResult => getMicrovmResult.Urls[0]?.Hostname),
        };
    });
    
    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.GetMicrovmArgs;
    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 example = DigitaloceanFunctions.getMicrovm(GetMicrovmArgs.builder()
                .name("example-microvm")
                .build());
    
            ctx.export("hostname", example.urls()[0].hostname());
        }
    }
    
    variables:
      example:
        fn::invoke:
          function: digitalocean:getMicrovm
          arguments:
            name: example-microvm
    outputs:
      hostname: ${example.urls[0].hostname}
    
    terraform {
      required_providers {
        digitalocean = {
          source = "pulumi/digitalocean"
        }
      }
    }
    
    data "digitalocean_microvm" "example" {
      name = "example-microvm"
    }
    
    output "hostname" {
      value = data.digitalocean_microvm.example.urls[0].hostname
    }
    

    Get the MicroVM by ID:

    import * as pulumi from "@pulumi/pulumi";
    import * as digitalocean from "@pulumi/digitalocean";
    
    const example = digitalocean.getMicrovm({
        id: "506f78a4-e098-11e5-ad9f-000f53306ae1",
    });
    
    import pulumi
    import pulumi_digitalocean as digitalocean
    
    example = digitalocean.get_microvm(id="506f78a4-e098-11e5-ad9f-000f53306ae1")
    
    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.GetMicrovm(ctx, &digitalocean.LookupMicrovmArgs{
    			Id: pulumi.StringRef("506f78a4-e098-11e5-ad9f-000f53306ae1"),
    		}, 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 example = DigitalOcean.GetMicrovm.Invoke(new()
        {
            Id = "506f78a4-e098-11e5-ad9f-000f53306ae1",
        });
    
    });
    
    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.GetMicrovmArgs;
    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 example = DigitaloceanFunctions.getMicrovm(GetMicrovmArgs.builder()
                .id("506f78a4-e098-11e5-ad9f-000f53306ae1")
                .build());
    
        }
    }
    
    variables:
      example:
        fn::invoke:
          function: digitalocean:getMicrovm
          arguments:
            id: 506f78a4-e098-11e5-ad9f-000f53306ae1
    
    terraform {
      required_providers {
        digitalocean = {
          source = "pulumi/digitalocean"
        }
      }
    }
    
    data "digitalocean_microvm" "example" {
      id = "506f78a4-e098-11e5-ad9f-000f53306ae1"
    }
    

    Using getMicrovm

    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 getMicrovm(args: GetMicrovmArgs, opts?: InvokeOptions): Promise<GetMicrovmResult>
    function getMicrovmOutput(args: GetMicrovmOutputArgs, opts?: InvokeOutputOptions): Output<GetMicrovmResult>
    def get_microvm(id: Optional[str] = None,
                    name: Optional[str] = None,
                    opts: Optional[InvokeOptions] = None) -> GetMicrovmResult
    def get_microvm_output(id: pulumi.Input[Optional[str]] = None,
                    name: pulumi.Input[Optional[str]] = None,
                    opts: Optional[InvokeOutputOptions] = None) -> Output[GetMicrovmResult]
    func LookupMicrovm(ctx *Context, args *LookupMicrovmArgs, opts ...InvokeOption) (*LookupMicrovmResult, error)
    func LookupMicrovmOutput(ctx *Context, args *LookupMicrovmOutputArgs, opts ...InvokeOption) LookupMicrovmResultOutput

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

    public static class GetMicrovm 
    {
        public static Task<GetMicrovmResult> InvokeAsync(GetMicrovmArgs args, InvokeOptions? opts = null)
        public static Output<GetMicrovmResult> Invoke(GetMicrovmInvokeArgs args, InvokeOptions? opts = null)
        public static Output<GetMicrovmResult> Invoke(GetMicrovmInvokeArgs args, InvokeOutputOptions opts)
    }
    public static CompletableFuture<GetMicrovmResult> getMicrovm(GetMicrovmArgs args, InvokeOptions options)
    public static Output<GetMicrovmResult> getMicrovm(GetMicrovmArgs args, InvokeOptions options)
    public static Output<GetMicrovmResult> getMicrovm(GetMicrovmArgs args, InvokeOutputOptions options)
    
    fn::invoke:
      function: digitalocean:index/getMicrovm:getMicrovm
      arguments:
        # arguments dictionary
    data "digitalocean_get_microvm" "name" {
        # arguments
    }

    The following arguments are supported:

    Id string
    The ID of the MicroVM.
    Name string
    The name of the MicroVM.
    Id string
    The ID of the MicroVM.
    Name string
    The name of the MicroVM.
    id string
    The ID of the MicroVM.
    name string
    The name of the MicroVM.
    id String
    The ID of the MicroVM.
    name String
    The name of the MicroVM.
    id string
    The ID of the MicroVM.
    name string
    The name of the MicroVM.
    id str
    The ID of the MicroVM.
    name str
    The name of the MicroVM.
    id String
    The ID of the MicroVM.
    name String
    The name of the MicroVM.

    getMicrovm Result

    The following output properties are available:

    AutoPauses List<Pulumi.DigitalOcean.Outputs.GetMicrovmAutoPause>
    Auto-pause configuration:
    AutoResume bool
    Whether the MicroVM resumes automatically on incoming HTTP traffic.
    CreatedAt string
    The date and time the MicroVM was created.
    CurrentState string
    The observed lifecycle state of the MicroVM, such as running or paused.
    Environment Dictionary<string, string>
    FailureReason string
    A description of the failure when currentState is failed.
    HttpPort int
    HttpProtocol string
    The HTTP protocol the workload serves: http or http2.
    Id string
    The ID of the MicroVM.
    Name string
    The name of the MicroVM.
    Networking string
    The networking mode: public or vpc.
    Ports List<int>
    The guest ports open for ingress.
    Region string
    The slug of the region the MicroVM is in.
    Sizes List<Pulumi.DigitalOcean.Outputs.GetMicrovmSize>
    The compute size of the MicroVM:
    Sources List<Pulumi.DigitalOcean.Outputs.GetMicrovmSource>
    What the MicroVM runs:
    State string
    Tags List<string>
    The tags applied to the MicroVM.
    Urls List<Pulumi.DigitalOcean.Outputs.GetMicrovmUrl>
    A list of ingress URLs for the MicroVM:
    Urn string
    The uniform resource name (URN) for the MicroVM.
    VpcUuid string
    AutoPauses []GetMicrovmAutoPause
    Auto-pause configuration:
    AutoResume bool
    Whether the MicroVM resumes automatically on incoming HTTP traffic.
    CreatedAt string
    The date and time the MicroVM was created.
    CurrentState string
    The observed lifecycle state of the MicroVM, such as running or paused.
    Environment map[string]string
    FailureReason string
    A description of the failure when currentState is failed.
    HttpPort int
    HttpProtocol string
    The HTTP protocol the workload serves: http or http2.
    Id string
    The ID of the MicroVM.
    Name string
    The name of the MicroVM.
    Networking string
    The networking mode: public or vpc.
    Ports []int
    The guest ports open for ingress.
    Region string
    The slug of the region the MicroVM is in.
    Sizes []GetMicrovmSize
    The compute size of the MicroVM:
    Sources []GetMicrovmSource
    What the MicroVM runs:
    State string
    Tags []string
    The tags applied to the MicroVM.
    Urls []GetMicrovmUrl
    A list of ingress URLs for the MicroVM:
    Urn string
    The uniform resource name (URN) for the MicroVM.
    VpcUuid string
    auto_pauses list(object)
    Auto-pause configuration:
    auto_resume bool
    Whether the MicroVM resumes automatically on incoming HTTP traffic.
    created_at string
    The date and time the MicroVM was created.
    current_state string
    The observed lifecycle state of the MicroVM, such as running or paused.
    environment map(string)
    failure_reason string
    A description of the failure when currentState is failed.
    http_port number
    http_protocol string
    The HTTP protocol the workload serves: http or http2.
    id string
    The ID of the MicroVM.
    name string
    The name of the MicroVM.
    networking string
    The networking mode: public or vpc.
    ports list(number)
    The guest ports open for ingress.
    region string
    The slug of the region the MicroVM is in.
    sizes list(object)
    The compute size of the MicroVM:
    sources list(object)
    What the MicroVM runs:
    state string
    tags list(string)
    The tags applied to the MicroVM.
    urls list(object)
    A list of ingress URLs for the MicroVM:
    urn string
    The uniform resource name (URN) for the MicroVM.
    vpc_uuid string
    autoPauses List<GetMicrovmAutoPause>
    Auto-pause configuration:
    autoResume Boolean
    Whether the MicroVM resumes automatically on incoming HTTP traffic.
    createdAt String
    The date and time the MicroVM was created.
    currentState String
    The observed lifecycle state of the MicroVM, such as running or paused.
    environment Map<String,String>
    failureReason String
    A description of the failure when currentState is failed.
    httpPort Integer
    httpProtocol String
    The HTTP protocol the workload serves: http or http2.
    id String
    The ID of the MicroVM.
    name String
    The name of the MicroVM.
    networking String
    The networking mode: public or vpc.
    ports List<Integer>
    The guest ports open for ingress.
    region String
    The slug of the region the MicroVM is in.
    sizes List<GetMicrovmSize>
    The compute size of the MicroVM:
    sources List<GetMicrovmSource>
    What the MicroVM runs:
    state String
    tags List<String>
    The tags applied to the MicroVM.
    urls List<GetMicrovmUrl>
    A list of ingress URLs for the MicroVM:
    urn String
    The uniform resource name (URN) for the MicroVM.
    vpcUuid String
    autoPauses GetMicrovmAutoPause[]
    Auto-pause configuration:
    autoResume boolean
    Whether the MicroVM resumes automatically on incoming HTTP traffic.
    createdAt string
    The date and time the MicroVM was created.
    currentState string
    The observed lifecycle state of the MicroVM, such as running or paused.
    environment {[key: string]: string}
    failureReason string
    A description of the failure when currentState is failed.
    httpPort number
    httpProtocol string
    The HTTP protocol the workload serves: http or http2.
    id string
    The ID of the MicroVM.
    name string
    The name of the MicroVM.
    networking string
    The networking mode: public or vpc.
    ports number[]
    The guest ports open for ingress.
    region string
    The slug of the region the MicroVM is in.
    sizes GetMicrovmSize[]
    The compute size of the MicroVM:
    sources GetMicrovmSource[]
    What the MicroVM runs:
    state string
    tags string[]
    The tags applied to the MicroVM.
    urls GetMicrovmUrl[]
    A list of ingress URLs for the MicroVM:
    urn string
    The uniform resource name (URN) for the MicroVM.
    vpcUuid string
    auto_pauses Sequence[GetMicrovmAutoPause]
    Auto-pause configuration:
    auto_resume bool
    Whether the MicroVM resumes automatically on incoming HTTP traffic.
    created_at str
    The date and time the MicroVM was created.
    current_state str
    The observed lifecycle state of the MicroVM, such as running or paused.
    environment Mapping[str, str]
    failure_reason str
    A description of the failure when currentState is failed.
    http_port int
    http_protocol str
    The HTTP protocol the workload serves: http or http2.
    id str
    The ID of the MicroVM.
    name str
    The name of the MicroVM.
    networking str
    The networking mode: public or vpc.
    ports Sequence[int]
    The guest ports open for ingress.
    region str
    The slug of the region the MicroVM is in.
    sizes Sequence[GetMicrovmSize]
    The compute size of the MicroVM:
    sources Sequence[GetMicrovmSource]
    What the MicroVM runs:
    state str
    tags Sequence[str]
    The tags applied to the MicroVM.
    urls Sequence[GetMicrovmUrl]
    A list of ingress URLs for the MicroVM:
    urn str
    The uniform resource name (URN) for the MicroVM.
    vpc_uuid str
    autoPauses List<Property Map>
    Auto-pause configuration:
    autoResume Boolean
    Whether the MicroVM resumes automatically on incoming HTTP traffic.
    createdAt String
    The date and time the MicroVM was created.
    currentState String
    The observed lifecycle state of the MicroVM, such as running or paused.
    environment Map<String>
    failureReason String
    A description of the failure when currentState is failed.
    httpPort Number
    httpProtocol String
    The HTTP protocol the workload serves: http or http2.
    id String
    The ID of the MicroVM.
    name String
    The name of the MicroVM.
    networking String
    The networking mode: public or vpc.
    ports List<Number>
    The guest ports open for ingress.
    region String
    The slug of the region the MicroVM is in.
    sizes List<Property Map>
    The compute size of the MicroVM:
    sources List<Property Map>
    What the MicroVM runs:
    state String
    tags List<String>
    The tags applied to the MicroVM.
    urls List<Property Map>
    A list of ingress URLs for the MicroVM:
    urn String
    The uniform resource name (URN) for the MicroVM.
    vpcUuid String

    Supporting Types

    GetMicrovmAutoPause

    Enabled bool
    Whether auto-pause is enabled.
    IdleTimeout string
    How long the MicroVM must be idle before it pauses.
    Enabled bool
    Whether auto-pause is enabled.
    IdleTimeout string
    How long the MicroVM must be idle before it pauses.
    enabled bool
    Whether auto-pause is enabled.
    idle_timeout string
    How long the MicroVM must be idle before it pauses.
    enabled Boolean
    Whether auto-pause is enabled.
    idleTimeout String
    How long the MicroVM must be idle before it pauses.
    enabled boolean
    Whether auto-pause is enabled.
    idleTimeout string
    How long the MicroVM must be idle before it pauses.
    enabled bool
    Whether auto-pause is enabled.
    idle_timeout str
    How long the MicroVM must be idle before it pauses.
    enabled Boolean
    Whether auto-pause is enabled.
    idleTimeout String
    How long the MicroVM must be idle before it pauses.

    GetMicrovmSize

    Cpu int
    The number of vCPUs.
    Disk int
    The size of the attached disk in GB.
    Memory int
    The amount of memory in MiB.
    Cpu int
    The number of vCPUs.
    Disk int
    The size of the attached disk in GB.
    Memory int
    The amount of memory in MiB.
    cpu number
    The number of vCPUs.
    disk number
    The size of the attached disk in GB.
    memory number
    The amount of memory in MiB.
    cpu Integer
    The number of vCPUs.
    disk Integer
    The size of the attached disk in GB.
    memory Integer
    The amount of memory in MiB.
    cpu number
    The number of vCPUs.
    disk number
    The size of the attached disk in GB.
    memory number
    The amount of memory in MiB.
    cpu int
    The number of vCPUs.
    disk int
    The size of the attached disk in GB.
    memory int
    The amount of memory in MiB.
    cpu Number
    The number of vCPUs.
    disk Number
    The size of the attached disk in GB.
    memory Number
    The amount of memory in MiB.

    GetMicrovmSource

    CheckpointId string
    The ID of the checkpoint the MicroVM was restored from.
    OciRef string
    The OCI reference of the workload container image.
    CheckpointId string
    The ID of the checkpoint the MicroVM was restored from.
    OciRef string
    The OCI reference of the workload container image.
    checkpoint_id string
    The ID of the checkpoint the MicroVM was restored from.
    oci_ref string
    The OCI reference of the workload container image.
    checkpointId String
    The ID of the checkpoint the MicroVM was restored from.
    ociRef String
    The OCI reference of the workload container image.
    checkpointId string
    The ID of the checkpoint the MicroVM was restored from.
    ociRef string
    The OCI reference of the workload container image.
    checkpoint_id str
    The ID of the checkpoint the MicroVM was restored from.
    oci_ref str
    The OCI reference of the workload container image.
    checkpointId String
    The ID of the checkpoint the MicroVM was restored from.
    ociRef String
    The OCI reference of the workload container image.

    GetMicrovmUrl

    Default bool
    Whether this is the default URL.
    Hostname string
    The hostname, without a scheme.
    Port int
    The guest port the URL forwards to.
    Status string
    The URL status: PENDING or ACTIVE.
    Default bool
    Whether this is the default URL.
    Hostname string
    The hostname, without a scheme.
    Port int
    The guest port the URL forwards to.
    Status string
    The URL status: PENDING or ACTIVE.
    default bool
    Whether this is the default URL.
    hostname string
    The hostname, without a scheme.
    port number
    The guest port the URL forwards to.
    status string
    The URL status: PENDING or ACTIVE.
    default_ Boolean
    Whether this is the default URL.
    hostname String
    The hostname, without a scheme.
    port Integer
    The guest port the URL forwards to.
    status String
    The URL status: PENDING or ACTIVE.
    default boolean
    Whether this is the default URL.
    hostname string
    The hostname, without a scheme.
    port number
    The guest port the URL forwards to.
    status string
    The URL status: PENDING or ACTIVE.
    default bool
    Whether this is the default URL.
    hostname str
    The hostname, without a scheme.
    port int
    The guest port the URL forwards to.
    status str
    The URL status: PENDING or ACTIVE.
    default Boolean
    Whether this is the default URL.
    hostname String
    The hostname, without a scheme.
    port Number
    The guest port the URL forwards to.
    status String
    The URL status: PENDING or ACTIVE.

    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.84.1
    published on Tuesday, Oct 13, 2026 by Pulumi

      Try Pulumi Cloud free.
      Your team will thank you.

      Start free trial