Droplet
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
An object specifying the backup policy for the Droplet. If omitted and backups
is true
, the backup plan will default to daily.
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
.
The uniform resource name of the Droplet
A boolean indicating whether the droplet should be gracefully shut down before it is deleted.
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.
The IPv4 address
The private networking IPv4 address
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.
The IPv6 address
Boolean controlling whether monitoring agent is installed. Defaults to false. If set to true
, you can configure monitor alert policies monitor alert resource
Droplet hourly price
Droplet monthly price
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.
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.
The unique slug that identifies the type of Droplet. You may list the available slugs using the DigitalOcean API.
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.
A string of the desired User Data provided during Droplet creation. Changing this forces a new resource to be created.