GetSizes

Retrieves information about the Droplet sizes that DigitalOcean supports, with the ability to filter and sort the results. If no filters are specified, all sizes will be returned.

Example Usage

using Pulumi;
using DigitalOcean = Pulumi.DigitalOcean;

class MyStack : Stack
{
    public MyStack()
    {
        var main = Output.Create(DigitalOcean.GetSizes.InvokeAsync(new DigitalOcean.GetSizesArgs
        {
            Filter = 
            {
                
                {
                    { "key", "slug" },
                    { "values", 
                    {
                        "s-1vcpu-1gb",
                    } },
                },
            },
        }));
        var web = new DigitalOcean.Droplet("web", new DigitalOcean.DropletArgs
        {
            Image = "ubuntu-18-04-x64",
            Region = "sgp1",
            Size = main.Apply(main => main.Sizes)[0].Apply(sizes => sizes.Slug),
        });
    }

}

Coming soon!

import pulumi
import pulumi_digitalocean as digitalocean

main = digitalocean.get_sizes(filter=[{
    "key": "slug",
    "values": ["s-1vcpu-1gb"],
}])
web = digitalocean.Droplet("web",
    image="ubuntu-18-04-x64",
    region="sgp1",
    size=main.sizes[0]["slug"])
import * as pulumi from "@pulumi/pulumi";
import * as digitalocean from "@pulumi/digitalocean";

const main = digitalocean.getSizes({
    filter: [{
        key: "slug",
        values: ["s-1vcpu-1gb"],
    }],
});
const web = new digitalocean.Droplet("web", {
    image: "ubuntu-18-04-x64",
    region: "sgp1",
    size: main.then(main => main.sizes)[0].then(sizes => sizes.slug),
});

Using GetSizes

function getSizes(args: GetSizesArgs, opts?: InvokeOptions): Promise<GetSizesResult>
function  get_sizes(filters=None, sorts=None, opts=None)
func GetSizes(ctx *Context, args *GetSizesArgs, opts ...InvokeOption) (*GetSizesResult, error)
public static class GetSizes {
    public static Task<GetSizesResult> InvokeAsync(GetSizesArgs args, InvokeOptions? opts = null)
}

The following arguments are supported:

Filters List<Pulumi.DigitalOcean.Inputs.GetSizesFilterArgs>

Filter the results. The filter block is documented below.

Sorts List<Pulumi.DigitalOcean.Inputs.GetSizesSortArgs>

Sort the results. The sort block is documented below.

Filters []GetSizesFilter

Filter the results. The filter block is documented below.

Sorts []GetSizesSort

Sort the results. The sort block is documented below.

filters GetSizesFilter[]

Filter the results. The filter block is documented below.

sorts GetSizesSort[]

Sort the results. The sort block is documented below.

filters List[GetSizesFilter]

Filter the results. The filter block is documented below.

sorts List[GetSizesSort]

Sort the results. The sort block is documented below.

GetSizes Result

The following output properties are available:

Id string

The provider-assigned unique ID for this managed resource.

Sizes List<Pulumi.DigitalOcean.Outputs.GetSizesSize>
Filters List<Pulumi.DigitalOcean.Outputs.GetSizesFilter>
Sorts List<Pulumi.DigitalOcean.Outputs.GetSizesSort>
Id string

The provider-assigned unique ID for this managed resource.

Sizes []GetSizesSize
Filters []GetSizesFilter
Sorts []GetSizesSort
id string

The provider-assigned unique ID for this managed resource.

sizes GetSizesSize[]
filters GetSizesFilter[]
sorts GetSizesSort[]
id str

The provider-assigned unique ID for this managed resource.

sizes List[GetSizesSize]
filters List[GetSizesFilter]
sorts List[GetSizesSort]

Supporting Types

GetSizesFilter

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 sizes by this key. This may be one of slug, regions, memory, vcpus, disk, transfer, price_monthly, price_hourly, or available.

Values List<string>

Only retrieves images which keys has value that matches one of the values provided here.

Key string

Filter the sizes by this key. This may be one of slug, regions, memory, vcpus, disk, transfer, price_monthly, price_hourly, or available.

Values []string

Only retrieves images which keys has value that matches one of the values provided here.

key string

Filter the sizes by this key. This may be one of slug, regions, memory, vcpus, disk, transfer, price_monthly, price_hourly, or available.

values string[]

Only retrieves images which keys has value that matches one of the values provided here.

key str

Filter the sizes by this key. This may be one of slug, regions, memory, vcpus, disk, transfer, price_monthly, price_hourly, or available.

values List[str]

Only retrieves images which keys has value that matches one of the values provided here.

GetSizesSize

See the output API doc for this type.

See the output API doc for this type.

See the output API doc for this type.

Available bool

This represents whether new Droplets can be created with this size.

Disk int

The amount of disk space set aside for Droplets of this size. The value is measured in gigabytes.

Memory int

The amount of RAM allocated to Droplets created of this size. The value is measured in megabytes.

PriceHourly double

The hourly cost of Droplets created in this size as measured hourly. The value is measured in US dollars.

PriceMonthly double

The monthly cost of Droplets created in this size if they are kept for an entire month. The value is measured in US dollars.

Regions List<string>

List of region slugs where Droplets can be created in this size.

Slug string

A human-readable string that is used to uniquely identify each size.

Transfer double

The amount of transfer bandwidth that is available for Droplets created in this size. This only counts traffic on the public interface. The value is given in terabytes.

Vcpus int

The number of CPUs allocated to Droplets of this size.

Available bool

This represents whether new Droplets can be created with this size.

Disk int

The amount of disk space set aside for Droplets of this size. The value is measured in gigabytes.

Memory int

The amount of RAM allocated to Droplets created of this size. The value is measured in megabytes.

PriceHourly float64

The hourly cost of Droplets created in this size as measured hourly. The value is measured in US dollars.

PriceMonthly float64

The monthly cost of Droplets created in this size if they are kept for an entire month. The value is measured in US dollars.

Regions []string

List of region slugs where Droplets can be created in this size.

Slug string

A human-readable string that is used to uniquely identify each size.

Transfer float64

The amount of transfer bandwidth that is available for Droplets created in this size. This only counts traffic on the public interface. The value is given in terabytes.

Vcpus int

The number of CPUs allocated to Droplets of this size.

available boolean

This represents whether new Droplets can be created with this size.

disk number

The amount of disk space set aside for Droplets of this size. The value is measured in gigabytes.

memory number

The amount of RAM allocated to Droplets created of this size. The value is measured in megabytes.

priceHourly number

The hourly cost of Droplets created in this size as measured hourly. The value is measured in US dollars.

priceMonthly number

The monthly cost of Droplets created in this size if they are kept for an entire month. The value is measured in US dollars.

regions string[]

List of region slugs where Droplets can be created in this size.

slug string

A human-readable string that is used to uniquely identify each size.

transfer number

The amount of transfer bandwidth that is available for Droplets created in this size. This only counts traffic on the public interface. The value is given in terabytes.

vcpus number

The number of CPUs allocated to Droplets of this size.

available bool

This represents whether new Droplets can be created with this size.

disk float

The amount of disk space set aside for Droplets of this size. The value is measured in gigabytes.

memory float

The amount of RAM allocated to Droplets created of this size. The value is measured in megabytes.

price_hourly float

The hourly cost of Droplets created in this size as measured hourly. The value is measured in US dollars.

price_monthly float

The monthly cost of Droplets created in this size if they are kept for an entire month. The value is measured in US dollars.

regions List[str]

List of region slugs where Droplets can be created in this size.

slug str

A human-readable string that is used to uniquely identify each size.

transfer float

The amount of transfer bandwidth that is available for Droplets created in this size. This only counts traffic on the public interface. The value is given in terabytes.

vcpus float

The number of CPUs allocated to Droplets of this size.

GetSizesSort

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 sizes by this key. This may be one of slug, memory, vcpus, disk, transfer, price_monthly, or price_hourly.

Direction string

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

Key string

Sort the sizes by this key. This may be one of slug, memory, vcpus, disk, transfer, price_monthly, or price_hourly.

Direction string

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

key string

Sort the sizes by this key. This may be one of slug, memory, vcpus, disk, transfer, price_monthly, or price_hourly.

direction string

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

key str

Sort the sizes by this key. This may be one of slug, memory, vcpus, disk, transfer, price_monthly, or price_hourly.

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.