Viewing docs for DigitalOcean v4.77.0
published on Friday, Jul 31, 2026 by Pulumi
published on Friday, Jul 31, 2026 by Pulumi
Viewing docs for DigitalOcean v4.77.0
published on Friday, Jul 31, 2026 by Pulumi
published on Friday, Jul 31, 2026 by Pulumi
Fetches a list of DigitalOcean MicroDroplets with optional region and name server-side filters, plus filter and sort blocks for client-side narrowing.
Example Usage
import * as pulumi from "@pulumi/pulumi";
import * as digitalocean from "@pulumi/digitalocean";
const all = digitalocean.getMicrodroplets({});
const nyc3 = digitalocean.getMicrodroplets({
region: "nyc3",
});
const byName = digitalocean.getMicrodroplets({
name: "my-microdroplet",
});
const running = digitalocean.getMicrodroplets({
filters: [{
key: "current_state",
values: ["running"],
}],
});
import pulumi
import pulumi_digitalocean as digitalocean
all = digitalocean.get_microdroplets()
nyc3 = digitalocean.get_microdroplets(region="nyc3")
by_name = digitalocean.get_microdroplets(name="my-microdroplet")
running = digitalocean.get_microdroplets(filters=[{
"key": "current_state",
"values": ["running"],
}])
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.GetMicrodroplets(ctx, &digitalocean.GetMicrodropletsArgs{}, nil)
if err != nil {
return err
}
_, err = digitalocean.GetMicrodroplets(ctx, &digitalocean.GetMicrodropletsArgs{
Region: pulumi.StringRef("nyc3"),
}, nil)
if err != nil {
return err
}
_, err = digitalocean.GetMicrodroplets(ctx, &digitalocean.GetMicrodropletsArgs{
Name: pulumi.StringRef("my-microdroplet"),
}, nil)
if err != nil {
return err
}
_, err = digitalocean.GetMicrodroplets(ctx, &digitalocean.GetMicrodropletsArgs{
Filters: []digitalocean.GetMicrodropletsFilter{
{
Key: "current_state",
Values: []string{
"running",
},
},
},
}, 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 all = DigitalOcean.GetMicrodroplets.Invoke();
var nyc3 = DigitalOcean.GetMicrodroplets.Invoke(new()
{
Region = "nyc3",
});
var byName = DigitalOcean.GetMicrodroplets.Invoke(new()
{
Name = "my-microdroplet",
});
var running = DigitalOcean.GetMicrodroplets.Invoke(new()
{
Filters = new[]
{
new DigitalOcean.Inputs.GetMicrodropletsFilterInputArgs
{
Key = "current_state",
Values = new[]
{
"running",
},
},
},
});
});
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.GetMicrodropletsArgs;
import com.pulumi.digitalocean.inputs.GetMicrodropletsFilterArgs;
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 all = DigitaloceanFunctions.getMicrodroplets(GetMicrodropletsArgs.builder()
.build());
final var nyc3 = DigitaloceanFunctions.getMicrodroplets(GetMicrodropletsArgs.builder()
.region("nyc3")
.build());
final var byName = DigitaloceanFunctions.getMicrodroplets(GetMicrodropletsArgs.builder()
.name("my-microdroplet")
.build());
final var running = DigitaloceanFunctions.getMicrodroplets(GetMicrodropletsArgs.builder()
.filters(GetMicrodropletsFilterArgs.builder()
.key("current_state")
.values("running")
.build())
.build());
}
}
variables:
all:
fn::invoke:
function: digitalocean:getMicrodroplets
arguments: {}
nyc3:
fn::invoke:
function: digitalocean:getMicrodroplets
arguments:
region: nyc3
byName:
fn::invoke:
function: digitalocean:getMicrodroplets
arguments:
name: my-microdroplet
running:
fn::invoke:
function: digitalocean:getMicrodroplets
arguments:
filters:
- key: current_state
values:
- running
pulumi {
required_providers {
digitalocean = {
source = "pulumi/digitalocean"
}
}
}
data "digitalocean_getmicrodroplets" "all" {
}
data "digitalocean_getmicrodroplets" "nyc3" {
region = "nyc3"
}
data "digitalocean_getmicrodroplets" "byName" {
name = "my-microdroplet"
}
data "digitalocean_getmicrodroplets" "running" {
filters {
key = "current_state"
values = ["running"]
}
}
Using getMicrodroplets
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 getMicrodroplets(args: GetMicrodropletsArgs, opts?: InvokeOptions): Promise<GetMicrodropletsResult>
function getMicrodropletsOutput(args: GetMicrodropletsOutputArgs, opts?: InvokeOptions): Output<GetMicrodropletsResult>def get_microdroplets(filters: Optional[Sequence[GetMicrodropletsFilter]] = None,
name: Optional[str] = None,
region: Optional[str] = None,
sorts: Optional[Sequence[GetMicrodropletsSort]] = None,
opts: Optional[InvokeOptions] = None) -> GetMicrodropletsResult
def get_microdroplets_output(filters: pulumi.Input[Optional[Sequence[pulumi.Input[GetMicrodropletsFilterArgs]]]] = None,
name: pulumi.Input[Optional[str]] = None,
region: pulumi.Input[Optional[str]] = None,
sorts: pulumi.Input[Optional[Sequence[pulumi.Input[GetMicrodropletsSortArgs]]]] = None,
opts: Optional[InvokeOptions] = None) -> Output[GetMicrodropletsResult]func GetMicrodroplets(ctx *Context, args *GetMicrodropletsArgs, opts ...InvokeOption) (*GetMicrodropletsResult, error)
func GetMicrodropletsOutput(ctx *Context, args *GetMicrodropletsOutputArgs, opts ...InvokeOption) GetMicrodropletsResultOutput> Note: This function is named GetMicrodroplets in the Go SDK.
public static class GetMicrodroplets
{
public static Task<GetMicrodropletsResult> InvokeAsync(GetMicrodropletsArgs args, InvokeOptions? opts = null)
public static Output<GetMicrodropletsResult> Invoke(GetMicrodropletsInvokeArgs args, InvokeOptions? opts = null)
}public static CompletableFuture<GetMicrodropletsResult> getMicrodroplets(GetMicrodropletsArgs args, InvokeOptions options)
public static Output<GetMicrodropletsResult> getMicrodroplets(GetMicrodropletsArgs args, InvokeOptions options)
fn::invoke:
function: digitalocean:index/getMicrodroplets:getMicrodroplets
arguments:
# arguments dictionarydata "digitalocean_get_microdroplets" "name" {
# arguments
}The following arguments are supported:
- Filters
List<Pulumi.
Digital Ocean. Inputs. Get Microdroplets Filter> - Repeatable client-side filter block:
- Name string
- Server-side filter: only include MicroDroplets whose name matches exactly. Conflicts with
region. - Region string
- Server-side filter: only include MicroDroplets in this region. Conflicts with
name. - Sorts
List<Pulumi.
Digital Ocean. Inputs. Get Microdroplets Sort> - Repeatable client-side sort block:
- Filters
[]Get
Microdroplets Filter - Repeatable client-side filter block:
- Name string
- Server-side filter: only include MicroDroplets whose name matches exactly. Conflicts with
region. - Region string
- Server-side filter: only include MicroDroplets in this region. Conflicts with
name. - Sorts
[]Get
Microdroplets Sort - Repeatable client-side sort block:
- filters list(object)
- Repeatable client-side filter block:
- name string
- Server-side filter: only include MicroDroplets whose name matches exactly. Conflicts with
region. - region string
- Server-side filter: only include MicroDroplets in this region. Conflicts with
name. - sorts list(object)
- Repeatable client-side sort block:
- filters
List<Get
Microdroplets Filter> - Repeatable client-side filter block:
- name String
- Server-side filter: only include MicroDroplets whose name matches exactly. Conflicts with
region. - region String
- Server-side filter: only include MicroDroplets in this region. Conflicts with
name. - sorts
List<Get
Microdroplets Sort> - Repeatable client-side sort block:
- filters
Get
Microdroplets Filter[] - Repeatable client-side filter block:
- name string
- Server-side filter: only include MicroDroplets whose name matches exactly. Conflicts with
region. - region string
- Server-side filter: only include MicroDroplets in this region. Conflicts with
name. - sorts
Get
Microdroplets Sort[] - Repeatable client-side sort block:
- filters
Sequence[Get
Microdroplets Filter] - Repeatable client-side filter block:
- name str
- Server-side filter: only include MicroDroplets whose name matches exactly. Conflicts with
region. - region str
- Server-side filter: only include MicroDroplets in this region. Conflicts with
name. - sorts
Sequence[Get
Microdroplets Sort] - Repeatable client-side sort block:
- filters List<Property Map>
- Repeatable client-side filter block:
- name String
- Server-side filter: only include MicroDroplets whose name matches exactly. Conflicts with
region. - region String
- Server-side filter: only include MicroDroplets in this region. Conflicts with
name. - sorts List<Property Map>
- Repeatable client-side sort block:
getMicrodroplets Result
The following output properties are available:
- Id string
- The provider-assigned unique ID for this managed resource.
- Micro
Droplets List<Pulumi.Digital Ocean. Outputs. Get Microdroplets Micro Droplet> - A list of MicroDroplet records. Each record has the same attribute set as the
digitalocean.Microdropletdata source. - Filters
List<Pulumi.
Digital Ocean. Outputs. Get Microdroplets Filter> - Name string
- Region string
- Sorts
List<Pulumi.
Digital Ocean. Outputs. Get Microdroplets Sort>
- Id string
- The provider-assigned unique ID for this managed resource.
- Micro
Droplets []GetMicrodroplets Micro Droplet - A list of MicroDroplet records. Each record has the same attribute set as the
digitalocean.Microdropletdata source. - Filters
[]Get
Microdroplets Filter - Name string
- Region string
- Sorts
[]Get
Microdroplets Sort
- id string
- The provider-assigned unique ID for this managed resource.
- micro_
droplets list(object) - A list of MicroDroplet records. Each record has the same attribute set as the
digitalocean.Microdropletdata source. - filters list(object)
- name string
- region string
- sorts list(object)
- id String
- The provider-assigned unique ID for this managed resource.
- micro
Droplets List<GetMicrodroplets Micro Droplet> - A list of MicroDroplet records. Each record has the same attribute set as the
digitalocean.Microdropletdata source. - filters
List<Get
Microdroplets Filter> - name String
- region String
- sorts
List<Get
Microdroplets Sort>
- id string
- The provider-assigned unique ID for this managed resource.
- micro
Droplets GetMicrodroplets Micro Droplet[] - A list of MicroDroplet records. Each record has the same attribute set as the
digitalocean.Microdropletdata source. - filters
Get
Microdroplets Filter[] - name string
- region string
- sorts
Get
Microdroplets Sort[]
- id str
- The provider-assigned unique ID for this managed resource.
- micro_
droplets Sequence[GetMicrodroplets Micro Droplet] - A list of MicroDroplet records. Each record has the same attribute set as the
digitalocean.Microdropletdata source. - filters
Sequence[Get
Microdroplets Filter] - name str
- region str
- sorts
Sequence[Get
Microdroplets Sort]
- id String
- The provider-assigned unique ID for this managed resource.
- micro
Droplets List<Property Map> - A list of MicroDroplet records. Each record has the same attribute set as the
digitalocean.Microdropletdata source. - filters List<Property Map>
- name String
- region String
- sorts List<Property Map>
Supporting Types
GetMicrodropletsFilter
GetMicrodropletsMicroDroplet
- Auto
Pauses List<Pulumi.Digital Ocean. Inputs. Get Microdroplets Micro Droplet Auto Pause> - Auto-pause configuration. Forces recreation on change: the MicroDroplets API has no in-place update path for auto_pause.
- Auto
Resume bool - Whether the MicroDroplet should auto-resume on request. Forces recreation on change: the MicroDroplets API has no in-place update path for auto_resume.
- Created
At string - The creation timestamp for the MicroDroplet
- Current
State string - Observed lifecycle state of the MicroDroplet
- Endpoint string
- Public endpoint URL for the MicroDroplet
- Environment Dictionary<string, string>
- Environment variables passed to the MicroDroplet
- Http
Port int - Port the MicroDroplet exposes over HTTP
- Http
Protocol string - HTTP protocol: 'http' or 'http2'
- Image string
- MicroDroplet image UUID or URN
- Name string
- Server-side filter: only include MicroDroplets whose name matches exactly. Conflicts with
region. - Networking string
- Networking mode: 'public' or 'vpc'
- Region string
- Server-side filter: only include MicroDroplets in this region. Conflicts with
name. - Size string
- MicroDroplet size slug
- State string
- Desired lifecycle state: 'running' or 'paused'. Changes are applied by calling the microdroplet pause / resume action endpoints.
- Urn string
- The uniform resource name (URN) for the MicroDroplet
- Vpc
Uuid string - UUID of the VPC to attach the MicroDroplet to. Only valid when networking is 'vpc'.
- Auto
Pauses []GetMicrodroplets Micro Droplet Auto Pause - Auto-pause configuration. Forces recreation on change: the MicroDroplets API has no in-place update path for auto_pause.
- Auto
Resume bool - Whether the MicroDroplet should auto-resume on request. Forces recreation on change: the MicroDroplets API has no in-place update path for auto_resume.
- Created
At string - The creation timestamp for the MicroDroplet
- Current
State string - Observed lifecycle state of the MicroDroplet
- Endpoint string
- Public endpoint URL for the MicroDroplet
- Environment map[string]string
- Environment variables passed to the MicroDroplet
- Http
Port int - Port the MicroDroplet exposes over HTTP
- Http
Protocol string - HTTP protocol: 'http' or 'http2'
- Image string
- MicroDroplet image UUID or URN
- Name string
- Server-side filter: only include MicroDroplets whose name matches exactly. Conflicts with
region. - Networking string
- Networking mode: 'public' or 'vpc'
- Region string
- Server-side filter: only include MicroDroplets in this region. Conflicts with
name. - Size string
- MicroDroplet size slug
- State string
- Desired lifecycle state: 'running' or 'paused'. Changes are applied by calling the microdroplet pause / resume action endpoints.
- Urn string
- The uniform resource name (URN) for the MicroDroplet
- Vpc
Uuid string - UUID of the VPC to attach the MicroDroplet to. Only valid when networking is 'vpc'.
- auto_
pauses list(object) - Auto-pause configuration. Forces recreation on change: the MicroDroplets API has no in-place update path for auto_pause.
- auto_
resume bool - Whether the MicroDroplet should auto-resume on request. Forces recreation on change: the MicroDroplets API has no in-place update path for auto_resume.
- created_
at string - The creation timestamp for the MicroDroplet
- current_
state string - Observed lifecycle state of the MicroDroplet
- endpoint string
- Public endpoint URL for the MicroDroplet
- environment map(string)
- Environment variables passed to the MicroDroplet
- http_
port number - Port the MicroDroplet exposes over HTTP
- http_
protocol string - HTTP protocol: 'http' or 'http2'
- image string
- MicroDroplet image UUID or URN
- name string
- Server-side filter: only include MicroDroplets whose name matches exactly. Conflicts with
region. - networking string
- Networking mode: 'public' or 'vpc'
- region string
- Server-side filter: only include MicroDroplets in this region. Conflicts with
name. - size string
- MicroDroplet size slug
- state string
- Desired lifecycle state: 'running' or 'paused'. Changes are applied by calling the microdroplet pause / resume action endpoints.
- urn string
- The uniform resource name (URN) for the MicroDroplet
- vpc_
uuid string - UUID of the VPC to attach the MicroDroplet to. Only valid when networking is 'vpc'.
- auto
Pauses List<GetMicrodroplets Micro Droplet Auto Pause> - Auto-pause configuration. Forces recreation on change: the MicroDroplets API has no in-place update path for auto_pause.
- auto
Resume Boolean - Whether the MicroDroplet should auto-resume on request. Forces recreation on change: the MicroDroplets API has no in-place update path for auto_resume.
- created
At String - The creation timestamp for the MicroDroplet
- current
State String - Observed lifecycle state of the MicroDroplet
- endpoint String
- Public endpoint URL for the MicroDroplet
- environment Map<String,String>
- Environment variables passed to the MicroDroplet
- http
Port Integer - Port the MicroDroplet exposes over HTTP
- http
Protocol String - HTTP protocol: 'http' or 'http2'
- image String
- MicroDroplet image UUID or URN
- name String
- Server-side filter: only include MicroDroplets whose name matches exactly. Conflicts with
region. - networking String
- Networking mode: 'public' or 'vpc'
- region String
- Server-side filter: only include MicroDroplets in this region. Conflicts with
name. - size String
- MicroDroplet size slug
- state String
- Desired lifecycle state: 'running' or 'paused'. Changes are applied by calling the microdroplet pause / resume action endpoints.
- urn String
- The uniform resource name (URN) for the MicroDroplet
- vpc
Uuid String - UUID of the VPC to attach the MicroDroplet to. Only valid when networking is 'vpc'.
- auto
Pauses GetMicrodroplets Micro Droplet Auto Pause[] - Auto-pause configuration. Forces recreation on change: the MicroDroplets API has no in-place update path for auto_pause.
- auto
Resume boolean - Whether the MicroDroplet should auto-resume on request. Forces recreation on change: the MicroDroplets API has no in-place update path for auto_resume.
- created
At string - The creation timestamp for the MicroDroplet
- current
State string - Observed lifecycle state of the MicroDroplet
- endpoint string
- Public endpoint URL for the MicroDroplet
- environment {[key: string]: string}
- Environment variables passed to the MicroDroplet
- http
Port number - Port the MicroDroplet exposes over HTTP
- http
Protocol string - HTTP protocol: 'http' or 'http2'
- image string
- MicroDroplet image UUID or URN
- name string
- Server-side filter: only include MicroDroplets whose name matches exactly. Conflicts with
region. - networking string
- Networking mode: 'public' or 'vpc'
- region string
- Server-side filter: only include MicroDroplets in this region. Conflicts with
name. - size string
- MicroDroplet size slug
- state string
- Desired lifecycle state: 'running' or 'paused'. Changes are applied by calling the microdroplet pause / resume action endpoints.
- urn string
- The uniform resource name (URN) for the MicroDroplet
- vpc
Uuid string - UUID of the VPC to attach the MicroDroplet to. Only valid when networking is 'vpc'.
- auto_
pauses Sequence[GetMicrodroplets Micro Droplet Auto Pause] - Auto-pause configuration. Forces recreation on change: the MicroDroplets API has no in-place update path for auto_pause.
- auto_
resume bool - Whether the MicroDroplet should auto-resume on request. Forces recreation on change: the MicroDroplets API has no in-place update path for auto_resume.
- created_
at str - The creation timestamp for the MicroDroplet
- current_
state str - Observed lifecycle state of the MicroDroplet
- endpoint str
- Public endpoint URL for the MicroDroplet
- environment Mapping[str, str]
- Environment variables passed to the MicroDroplet
- http_
port int - Port the MicroDroplet exposes over HTTP
- http_
protocol str - HTTP protocol: 'http' or 'http2'
- image str
- MicroDroplet image UUID or URN
- name str
- Server-side filter: only include MicroDroplets whose name matches exactly. Conflicts with
region. - networking str
- Networking mode: 'public' or 'vpc'
- region str
- Server-side filter: only include MicroDroplets in this region. Conflicts with
name. - size str
- MicroDroplet size slug
- state str
- Desired lifecycle state: 'running' or 'paused'. Changes are applied by calling the microdroplet pause / resume action endpoints.
- urn str
- The uniform resource name (URN) for the MicroDroplet
- vpc_
uuid str - UUID of the VPC to attach the MicroDroplet to. Only valid when networking is 'vpc'.
- auto
Pauses List<Property Map> - Auto-pause configuration. Forces recreation on change: the MicroDroplets API has no in-place update path for auto_pause.
- auto
Resume Boolean - Whether the MicroDroplet should auto-resume on request. Forces recreation on change: the MicroDroplets API has no in-place update path for auto_resume.
- created
At String - The creation timestamp for the MicroDroplet
- current
State String - Observed lifecycle state of the MicroDroplet
- endpoint String
- Public endpoint URL for the MicroDroplet
- environment Map<String>
- Environment variables passed to the MicroDroplet
- http
Port Number - Port the MicroDroplet exposes over HTTP
- http
Protocol String - HTTP protocol: 'http' or 'http2'
- image String
- MicroDroplet image UUID or URN
- name String
- Server-side filter: only include MicroDroplets whose name matches exactly. Conflicts with
region. - networking String
- Networking mode: 'public' or 'vpc'
- region String
- Server-side filter: only include MicroDroplets in this region. Conflicts with
name. - size String
- MicroDroplet size slug
- state String
- Desired lifecycle state: 'running' or 'paused'. Changes are applied by calling the microdroplet pause / resume action endpoints.
- urn String
- The uniform resource name (URN) for the MicroDroplet
- vpc
Uuid String - UUID of the VPC to attach the MicroDroplet to. Only valid when networking is 'vpc'.
GetMicrodropletsMicroDropletAutoPause
- Enabled bool
- Whether auto-pause is enabled. Forces recreation on change (no in-place API path).
- Idle
Timeout string - Idle timeout as a Go duration string (e.g. '5m', '30s'). Forces recreation on change (no in-place API path).
- Enabled bool
- Whether auto-pause is enabled. Forces recreation on change (no in-place API path).
- Idle
Timeout string - Idle timeout as a Go duration string (e.g. '5m', '30s'). Forces recreation on change (no in-place API path).
- enabled bool
- Whether auto-pause is enabled. Forces recreation on change (no in-place API path).
- idle_
timeout string - Idle timeout as a Go duration string (e.g. '5m', '30s'). Forces recreation on change (no in-place API path).
- enabled Boolean
- Whether auto-pause is enabled. Forces recreation on change (no in-place API path).
- idle
Timeout String - Idle timeout as a Go duration string (e.g. '5m', '30s'). Forces recreation on change (no in-place API path).
- enabled boolean
- Whether auto-pause is enabled. Forces recreation on change (no in-place API path).
- idle
Timeout string - Idle timeout as a Go duration string (e.g. '5m', '30s'). Forces recreation on change (no in-place API path).
- enabled bool
- Whether auto-pause is enabled. Forces recreation on change (no in-place API path).
- idle_
timeout str - Idle timeout as a Go duration string (e.g. '5m', '30s'). Forces recreation on change (no in-place API path).
- enabled Boolean
- Whether auto-pause is enabled. Forces recreation on change (no in-place API path).
- idle
Timeout String - Idle timeout as a Go duration string (e.g. '5m', '30s'). Forces recreation on change (no in-place API path).
GetMicrodropletsSort
Package Details
- Repository
- DigitalOcean pulumi/pulumi-digitalocean
- License
- Apache-2.0
- Notes
- This Pulumi package is based on the
digitaloceanTerraform Provider.
Viewing docs for DigitalOcean v4.77.0
published on Friday, Jul 31, 2026 by Pulumi
published on Friday, Jul 31, 2026 by Pulumi