Droplet

class Droplet : KotlinCustomResource

Provides a DigitalOcean Droplet resource. This can be used to create, modify, and delete Droplets.

Example Usage

import * as pulumi from "@pulumi/pulumi";
import * as digitalocean from "@pulumi/digitalocean";
// Create a new Web Droplet in the nyc2 region
const web = new digitalocean.Droplet("web", {
image: "ubuntu-20-04-x64",
name: "web-1",
region: digitalocean.Region.NYC2,
size: digitalocean.DropletSlug.DropletS1VCPU1GB,
backups: true,
backupPolicy: {
plan: "weekly",
weekday: "TUE",
hour: 8,
},
});
import pulumi
import pulumi_digitalocean as digitalocean
# Create a new Web Droplet in the nyc2 region
web = digitalocean.Droplet("web",
image="ubuntu-20-04-x64",
name="web-1",
region=digitalocean.Region.NYC2,
size=digitalocean.DropletSlug.DROPLET_S1_VCPU1_GB,
backups=True,
backup_policy={
"plan": "weekly",
"weekday": "TUE",
"hour": 8,
})
using System.Collections.Generic;
using System.Linq;
using Pulumi;
using DigitalOcean = Pulumi.DigitalOcean;
return await Deployment.RunAsync(() =>
{
// Create a new Web Droplet in the nyc2 region
var web = new DigitalOcean.Droplet("web", new()
{
Image = "ubuntu-20-04-x64",
Name = "web-1",
Region = DigitalOcean.Region.NYC2,
Size = DigitalOcean.DropletSlug.DropletS1VCPU1GB,
Backups = true,
BackupPolicy = new DigitalOcean.Inputs.DropletBackupPolicyArgs
{
Plan = "weekly",
Weekday = "TUE",
Hour = 8,
},
});
});
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 {
// Create a new Web Droplet in the nyc2 region
_, err := digitalocean.NewDroplet(ctx, "web", &digitalocean.DropletArgs{
Image: pulumi.String("ubuntu-20-04-x64"),
Name: pulumi.String("web-1"),
Region: pulumi.String(digitalocean.RegionNYC2),
Size: pulumi.String(digitalocean.DropletSlugDropletS1VCPU1GB),
Backups: pulumi.Bool(true),
BackupPolicy: &digitalocean.DropletBackupPolicyArgs{
Plan: pulumi.String("weekly"),
Weekday: pulumi.String("TUE"),
Hour: pulumi.Int(8),
},
})
if err != nil {
return err
}
return nil
})
}
package generated_program;
import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.digitalocean.Droplet;
import com.pulumi.digitalocean.DropletArgs;
import com.pulumi.digitalocean.inputs.DropletBackupPolicyArgs;
import java.util.List;
import java.util.ArrayList;
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) {
// Create a new Web Droplet in the nyc2 region
var web = new Droplet("web", DropletArgs.builder()
.image("ubuntu-20-04-x64")
.name("web-1")
.region("nyc2")
.size("s-1vcpu-1gb")
.backups(true)
.backupPolicy(DropletBackupPolicyArgs.builder()
.plan("weekly")
.weekday("TUE")
.hour(8)
.build())
.build());
}
}
resources:
# Create a new Web Droplet in the nyc2 region
web:
type: digitalocean:Droplet
properties:
image: ubuntu-20-04-x64
name: web-1
region: nyc2
size: s-1vcpu-1gb
backups: true
backupPolicy:
plan: weekly
weekday: TUE
hour: 8

Import

Droplets can be imported using the Droplet id, e.g.

$ pulumi import digitalocean:index/droplet:Droplet mydroplet 100823

Properties

Link copied to clipboard

An object specifying the backup policy for the Droplet. If omitted and backups is true, the backup plan will default to daily.

Link copied to clipboard
val backups: Output<Boolean>?

Boolean controlling if backups are made. Defaults to false.

Link copied to clipboard
val createdAt: Output<String>
Link copied to clipboard
val disk: Output<Int>

The size of the instance's disk in GB

Link copied to clipboard
val dropletAgent: Output<Boolean>?

A boolean indicating whether to install the DigitalOcean agent used for providing access to the Droplet web console in the control panel. By default, the agent is installed on new Droplets but installation errors (i.e. OS not supported) are ignored. To prevent it from being installed, set to false. To make installation errors fatal, explicitly set it to true.

Link copied to clipboard
val dropletUrn: Output<String>

The uniform resource name of the Droplet

Link copied to clipboard

A boolean indicating whether the droplet should be gracefully shut down before it is deleted.

Link copied to clipboard
val id: Output<String>
Link copied to clipboard
val image: Output<String>

The Droplet image ID or slug. This could be either image ID or droplet snapshot ID. You can find image IDs and slugs using the DigitalOcean API.

Link copied to clipboard
val ipv4Address: Output<String>

The IPv4 address

Link copied to clipboard

The private networking IPv4 address

Link copied to clipboard
val ipv6: Output<Boolean>?

Boolean controlling if IPv6 is enabled. Defaults to false. Once enabled for a Droplet, IPv6 can not be disabled. When enabling IPv6 on an existing Droplet, additional OS-level configuration is required.

Link copied to clipboard
val ipv6Address: Output<String>

The IPv6 address

Link copied to clipboard
val locked: Output<Boolean>

Is the Droplet locked

Link copied to clipboard
val memory: Output<Int>
Link copied to clipboard
val monitoring: Output<Boolean>?

Boolean controlling whether monitoring agent is installed. Defaults to false. If set to true, you can configure monitor alert policies monitor alert resource

Link copied to clipboard
val name: Output<String>

The Droplet name.

Link copied to clipboard
val priceHourly: Output<Double>

Droplet hourly price

Link copied to clipboard
val priceMonthly: Output<Double>

Droplet monthly price

Link copied to clipboard

Deprecated Boolean controlling if private networking is enabled. This parameter has been deprecated. Use vpc_uuid instead to specify a VPC network for the Droplet. If no vpc_uuid is provided, the Droplet will be placed in your account's default VPC for the region.

Link copied to clipboard
val pulumiChildResources: Set<KotlinResource>
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
val region: Output<String>

The region where the Droplet will be created.

Link copied to clipboard
val resizeDisk: Output<Boolean>?

Boolean controlling whether to increase the disk size when resizing a Droplet. It defaults to true. When set to false, only the Droplet's RAM and CPU will be resized. Increasing a Droplet's disk size is a permanent change. Increasing only RAM and CPU is reversible.

Link copied to clipboard
val size: Output<String>

The unique slug that identifies the type of Droplet. You may list the available slugs using the DigitalOcean API.

Link copied to clipboard
val sshKeys: Output<List<String>>?

A list of SSH key IDs or fingerprints to enable in the format [12345, 123456]. To retrieve this info, use the DigitalOcean API or CLI (doctl compute ssh-key list). Once a Droplet is created keys can not be added or removed via this provider. Modifying this field will prompt you to destroy and recreate the Droplet.

Link copied to clipboard
val status: Output<String>

The status of the Droplet

Link copied to clipboard
val tags: Output<List<String>>?

A list of the tags to be applied to this Droplet.

Link copied to clipboard
val urn: Output<String>
Link copied to clipboard
val userData: Output<String>?

A string of the desired User Data provided during Droplet creation. Changing this forces a new resource to be created.

Link copied to clipboard
val vcpus: Output<Int>

The number of the instance's virtual CPUs

Link copied to clipboard
val volumeIds: Output<List<String>>

A list of the IDs of each block storage volume to be attached to the Droplet.

Link copied to clipboard
val vpcUuid: Output<String>

The ID of the VPC where the Droplet will be located.