GetDroplets

Get information on Droplets for use in other resources, with the ability to filter and sort the results. If no filters are specified, all Droplets will be returned.

This data source is useful if the Droplets in question are not managed by this provider or you need to utilize any of the Droplets’ data.

Note: You can use the digitalocean..Droplet data source to obtain metadata about a single Droplet if you already know the id, unique name, or unique tag to retrieve.

Example Usage

using Pulumi;
using DigitalOcean = Pulumi.DigitalOcean;

class MyStack : Stack
{
    public MyStack()
    {
        var small = Output.Create(DigitalOcean.GetDroplets.InvokeAsync(new DigitalOcean.GetDropletsArgs
        {
            Filters = 
            {
                new DigitalOcean.Inputs.GetDropletsFilterArgs
                {
                    Key = "size",
                    Values = 
                    {
                        "s-1vcpu-1gb",
                    },
                },
            },
        }));
    }

}

Coming soon!

import pulumi
import pulumi_digitalocean as digitalocean

small = digitalocean.get_droplets(filters=[{
    "key": "size",
    "values": ["s-1vcpu-1gb"],
}])
import * as pulumi from "@pulumi/pulumi";
import * as digitalocean from "@pulumi/digitalocean";

const small = pulumi.output(digitalocean.getDroplets({
    filters: [{
        key: "size",
        values: ["s-1vcpu-1gb"],
    }],
}, { async: true }));

Using GetDroplets

function getDroplets(args: GetDropletsArgs, opts?: InvokeOptions): Promise<GetDropletsResult>
function  get_droplets(filters=None, sorts=None, opts=None)
func GetDroplets(ctx *Context, args *GetDropletsArgs, opts ...InvokeOption) (*GetDropletsResult, error)
public static class GetDroplets {
    public static Task<GetDropletsResult> InvokeAsync(GetDropletsArgs args, InvokeOptions? opts = null)
}

The following arguments are supported:

Filters List<Pulumi.DigitalOcean.Inputs.GetDropletsFilterArgs>

Filter the results. The filter block is documented below.

Sorts List<Pulumi.DigitalOcean.Inputs.GetDropletsSortArgs>

Sort the results. The sort block is documented below.

Filters []GetDropletsFilter

Filter the results. The filter block is documented below.

Sorts []GetDropletsSort

Sort the results. The sort block is documented below.

filters GetDropletsFilter[]

Filter the results. The filter block is documented below.

sorts GetDropletsSort[]

Sort the results. The sort block is documented below.

filters List[GetDropletsFilter]

Filter the results. The filter block is documented below.

sorts List[GetDropletsSort]

Sort the results. The sort block is documented below.

GetDroplets Result

The following output properties are available:

Droplets List<Pulumi.DigitalOcean.Outputs.GetDropletsDroplet>

A list of Droplets satisfying any filter and sort criteria. Each Droplet has the following attributes:

Id string

The provider-assigned unique ID for this managed resource.

Filters List<Pulumi.DigitalOcean.Outputs.GetDropletsFilter>
Sorts List<Pulumi.DigitalOcean.Outputs.GetDropletsSort>
Droplets []GetDropletsDroplet

A list of Droplets satisfying any filter and sort criteria. Each Droplet has the following attributes:

Id string

The provider-assigned unique ID for this managed resource.

Filters []GetDropletsFilter
Sorts []GetDropletsSort
droplets GetDropletsDroplet[]

A list of Droplets satisfying any filter and sort criteria. Each Droplet has the following attributes:

id string

The provider-assigned unique ID for this managed resource.

filters GetDropletsFilter[]
sorts GetDropletsSort[]
droplets List[GetDropletsDroplet]

A list of Droplets satisfying any filter and sort criteria. Each Droplet has the following attributes:

id str

The provider-assigned unique ID for this managed resource.

filters List[GetDropletsFilter]
sorts List[GetDropletsSort]

Supporting Types

GetDropletsDroplet

See the output API doc for this type.

See the output API doc for this type.

See the output API doc for this type.

Backups bool
CreatedAt string
Disk int
Id int
Image string
Ipv4Address string
Ipv4AddressPrivate string
Ipv6 bool
Ipv6Address string
Ipv6AddressPrivate string
Locked bool
Memory int
Monitoring bool
Name string
PriceHourly double
PriceMonthly double
PrivateNetworking bool
Region string
Size string
Status string
Tags List<string>
Urn string
Vcpus int
VolumeIds List<string>
VpcUuid string
Backups bool
CreatedAt string
Disk int
Id int
Image string
Ipv4Address string
Ipv4AddressPrivate string
Ipv6 bool
Ipv6Address string
Ipv6AddressPrivate string
Locked bool
Memory int
Monitoring bool
Name string
PriceHourly float64
PriceMonthly float64
PrivateNetworking bool
Region string
Size string
Status string
Tags []string
Urn string
Vcpus int
VolumeIds []string
VpcUuid string
backups boolean
createdAt string
disk number
id number
image string
ipv4Address string
ipv4AddressPrivate string
ipv6 boolean
ipv6Address string
ipv6AddressPrivate string
locked boolean
memory number
monitoring boolean
name string
priceHourly number
priceMonthly number
privateNetworking boolean
region string
size string
status string
tags string[]
urn string
vcpus number
volumeIds string[]
vpcUuid string
backups bool
created_at str
disk float
id float
image str
ipv4_address str
ipv4_address_private str
ipv6 bool
ipv6AddressPrivate str
ipv6_address str
locked bool
memory float
monitoring bool
name str
price_hourly float
price_monthly float
private_networking bool
region str
size str
status str
tags List[str]
urn str
vcpus float
volume_ids List[str]
vpc_uuid str

GetDropletsFilter

See the input and output API doc for this type.

See the input and output API doc for this type.

See the input and output API doc for this type.

Key string

Filter the Droplets by this key. This may be one of ‘backups, created_at, disk, id, image, ipv4_address, ipv4_address_private, ipv6, ipv6_address, ipv6_address_private, locked, memory, monitoring, name, price_hourly, price_monthly, private_networking, region, size, status, tags, urn, vcpus, volume_ids, or vpc_uuid’.

Values List<string>

A list of values to match against the key field. Only retrieves Droplets where the key field takes on one or more of the values provided here.

Key string

Filter the Droplets by this key. This may be one of ‘backups, created_at, disk, id, image, ipv4_address, ipv4_address_private, ipv6, ipv6_address, ipv6_address_private, locked, memory, monitoring, name, price_hourly, price_monthly, private_networking, region, size, status, tags, urn, vcpus, volume_ids, or vpc_uuid’.

Values []string

A list of values to match against the key field. Only retrieves Droplets where the key field takes on one or more of the values provided here.

key string

Filter the Droplets by this key. This may be one of ‘backups, created_at, disk, id, image, ipv4_address, ipv4_address_private, ipv6, ipv6_address, ipv6_address_private, locked, memory, monitoring, name, price_hourly, price_monthly, private_networking, region, size, status, tags, urn, vcpus, volume_ids, or vpc_uuid’.

values string[]

A list of values to match against the key field. Only retrieves Droplets where the key field takes on one or more of the values provided here.

key str

Filter the Droplets by this key. This may be one of ‘backups, created_at, disk, id, image, ipv4_address, ipv4_address_private, ipv6, ipv6_address, ipv6_address_private, locked, memory, monitoring, name, price_hourly, price_monthly, private_networking, region, size, status, tags, urn, vcpus, volume_ids, or vpc_uuid’.

values List[str]

A list of values to match against the key field. Only retrieves Droplets where the key field takes on one or more of the values provided here.

GetDropletsSort

See the input and output API doc for this type.

See the input and output API doc for this type.

See the input and output API doc for this type.

Key string

Sort the Droplets by this key. This may be one of backups, created_at, disk, id, image, ipv4_address, ipv4_address_private, ipv6, ipv6_address, ipv6_address_private, locked, memory, monitoring, name, price_hourly, price_monthly, private_networking, region, size, status, urn, vcpus, or vpc_uuid.

Direction string

The sort direction. This may be either asc or desc.

Key string

Sort the Droplets by this key. This may be one of backups, created_at, disk, id, image, ipv4_address, ipv4_address_private, ipv6, ipv6_address, ipv6_address_private, locked, memory, monitoring, name, price_hourly, price_monthly, private_networking, region, size, status, urn, vcpus, or vpc_uuid.

Direction string

The sort direction. This may be either asc or desc.

key string

Sort the Droplets by this key. This may be one of backups, created_at, disk, id, image, ipv4_address, ipv4_address_private, ipv6, ipv6_address, ipv6_address_private, locked, memory, monitoring, name, price_hourly, price_monthly, private_networking, region, size, status, urn, vcpus, or vpc_uuid.

direction string

The sort direction. This may be either asc or desc.

key str

Sort the Droplets by this key. This may be one of backups, created_at, disk, id, image, ipv4_address, ipv4_address_private, ipv6, ipv6_address, ipv6_address_private, locked, memory, monitoring, name, price_hourly, price_monthly, private_networking, region, size, status, urn, vcpus, or vpc_uuid.

direction str

The sort direction. This may be either asc or desc.

Package Details

Repository
https://github.com/pulumi/pulumi-digitalocean
License
Apache-2.0
Notes
This Pulumi package is based on the digitalocean Terraform Provider.