published on Tuesday, Oct 13, 2026 by Pulumi
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 dictionarydata "digitalocean_get_microvm" "name" {
# arguments
}The following arguments are supported:
getMicrovm Result
The following output properties are available:
- Auto
Pauses List<Pulumi.Digital Ocean. Outputs. Get Microvm Auto Pause> - 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
runningorpaused. - Environment Dictionary<string, string>
- Failure
Reason string - A description of the failure when
currentStateisfailed. - Http
Port int - Http
Protocol string - The HTTP protocol the workload serves:
httporhttp2. - Id string
- The ID of the MicroVM.
- Name string
- The name of the MicroVM.
- Networking string
- The networking mode:
publicorvpc. - Ports List<int>
- The guest ports open for ingress.
- Region string
- The slug of the region the MicroVM is in.
- Sizes
List<Pulumi.
Digital Ocean. Outputs. Get Microvm Size> - The compute size of the MicroVM:
- Sources
List<Pulumi.
Digital Ocean. Outputs. Get Microvm Source> - What the MicroVM runs:
- State string
- List<string>
- The tags applied to the MicroVM.
- Urls
List<Pulumi.
Digital Ocean. Outputs. Get Microvm Url> - A list of ingress URLs for the MicroVM:
- Urn string
- The uniform resource name (URN) for the MicroVM.
- Vpc
Uuid string
- Auto
Pauses []GetMicrovm Auto Pause - 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
runningorpaused. - Environment map[string]string
- Failure
Reason string - A description of the failure when
currentStateisfailed. - Http
Port int - Http
Protocol string - The HTTP protocol the workload serves:
httporhttp2. - Id string
- The ID of the MicroVM.
- Name string
- The name of the MicroVM.
- Networking string
- The networking mode:
publicorvpc. - Ports []int
- The guest ports open for ingress.
- Region string
- The slug of the region the MicroVM is in.
- Sizes
[]Get
Microvm Size - The compute size of the MicroVM:
- Sources
[]Get
Microvm Source - What the MicroVM runs:
- State string
- []string
- The tags applied to the MicroVM.
- Urls
[]Get
Microvm Url - A list of ingress URLs for the MicroVM:
- Urn string
- The uniform resource name (URN) for the MicroVM.
- Vpc
Uuid 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
runningorpaused. - environment map(string)
- failure_
reason string - A description of the failure when
currentStateisfailed. - http_
port number - http_
protocol string - The HTTP protocol the workload serves:
httporhttp2. - id string
- The ID of the MicroVM.
- name string
- The name of the MicroVM.
- networking string
- The networking mode:
publicorvpc. - 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
- 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
- auto
Pauses List<GetMicrovm Auto Pause> - Auto-pause configuration:
- auto
Resume Boolean - 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
runningorpaused. - environment Map<String,String>
- failure
Reason String - A description of the failure when
currentStateisfailed. - http
Port Integer - http
Protocol String - The HTTP protocol the workload serves:
httporhttp2. - id String
- The ID of the MicroVM.
- name String
- The name of the MicroVM.
- networking String
- The networking mode:
publicorvpc. - ports List<Integer>
- The guest ports open for ingress.
- region String
- The slug of the region the MicroVM is in.
- sizes
List<Get
Microvm Size> - The compute size of the MicroVM:
- sources
List<Get
Microvm Source> - What the MicroVM runs:
- state String
- List<String>
- The tags applied to the MicroVM.
- urls
List<Get
Microvm Url> - A list of ingress URLs for the MicroVM:
- urn String
- The uniform resource name (URN) for the MicroVM.
- vpc
Uuid String
- auto
Pauses GetMicrovm Auto Pause[] - Auto-pause configuration:
- auto
Resume boolean - 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
runningorpaused. - environment {[key: string]: string}
- failure
Reason string - A description of the failure when
currentStateisfailed. - http
Port number - http
Protocol string - The HTTP protocol the workload serves:
httporhttp2. - id string
- The ID of the MicroVM.
- name string
- The name of the MicroVM.
- networking string
- The networking mode:
publicorvpc. - ports number[]
- The guest ports open for ingress.
- region string
- The slug of the region the MicroVM is in.
- sizes
Get
Microvm Size[] - The compute size of the MicroVM:
- sources
Get
Microvm Source[] - What the MicroVM runs:
- state string
- string[]
- The tags applied to the MicroVM.
- urls
Get
Microvm Url[] - A list of ingress URLs for the MicroVM:
- urn string
- The uniform resource name (URN) for the MicroVM.
- vpc
Uuid string
- auto_
pauses Sequence[GetMicrovm Auto Pause] - 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
runningorpaused. - environment Mapping[str, str]
- failure_
reason str - A description of the failure when
currentStateisfailed. - http_
port int - http_
protocol str - The HTTP protocol the workload serves:
httporhttp2. - id str
- The ID of the MicroVM.
- name str
- The name of the MicroVM.
- networking str
- The networking mode:
publicorvpc. - ports Sequence[int]
- The guest ports open for ingress.
- region str
- The slug of the region the MicroVM is in.
- sizes
Sequence[Get
Microvm Size] - The compute size of the MicroVM:
- sources
Sequence[Get
Microvm Source] - What the MicroVM runs:
- state str
- Sequence[str]
- The tags applied to the MicroVM.
- urls
Sequence[Get
Microvm Url] - A list of ingress URLs for the MicroVM:
- urn str
- The uniform resource name (URN) for the MicroVM.
- vpc_
uuid str
- auto
Pauses List<Property Map> - Auto-pause configuration:
- auto
Resume Boolean - 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
runningorpaused. - environment Map<String>
- failure
Reason String - A description of the failure when
currentStateisfailed. - http
Port Number - http
Protocol String - The HTTP protocol the workload serves:
httporhttp2. - id String
- The ID of the MicroVM.
- name String
- The name of the MicroVM.
- networking String
- The networking mode:
publicorvpc. - 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
- 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.
- vpc
Uuid String
Supporting Types
GetMicrovmAutoPause
- Enabled bool
- Whether auto-pause is enabled.
- Idle
Timeout 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 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.
- idle
Timeout String - How long the MicroVM must be idle before it pauses.
- enabled boolean
- Whether auto-pause is enabled.
- idle
Timeout 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.
- idle
Timeout String - How long the MicroVM must be idle before it pauses.
GetMicrovmSize
GetMicrovmSource
- Checkpoint
Id string - The ID of the checkpoint the MicroVM was restored from.
- Oci
Ref 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.
- checkpoint_
id string - The ID of the checkpoint the MicroVM was restored from.
- oci_
ref 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.
- checkpoint
Id string - The ID of the checkpoint the MicroVM was restored from.
- oci
Ref 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.
- checkpoint
Id String - The ID of the checkpoint the MicroVM was restored from.
- oci
Ref String - The OCI reference of the workload container image.
GetMicrovmUrl
Package Details
- Repository
- DigitalOcean pulumi/pulumi-digitalocean
- License
- Apache-2.0
- Notes
- This Pulumi package is based on the
digitaloceanTerraform Provider.
published on Tuesday, Oct 13, 2026 by Pulumi