2014-07-24 16:29:42 +02:00
|
|
|
---
|
|
|
|
layout: "digitalocean"
|
|
|
|
page_title: "DigitalOcean: digitalocean_droplet"
|
|
|
|
sidebar_current: "docs-do-resource-droplet"
|
2014-10-22 05:21:56 +02:00
|
|
|
description: |-
|
2016-07-13 16:36:37 +02:00
|
|
|
Provides a DigitalOcean Droplet resource. This can be used to create, modify, and delete Droplets. Droplets also support provisioning.
|
2014-07-24 16:29:42 +02:00
|
|
|
---
|
|
|
|
|
|
|
|
# digitalocean\_droplet
|
|
|
|
|
2016-07-13 16:36:37 +02:00
|
|
|
Provides a DigitalOcean Droplet resource. This can be used to create,
|
|
|
|
modify, and delete Droplets. Droplets also support
|
2014-07-24 16:29:42 +02:00
|
|
|
[provisioning](/docs/provisioners/index.html).
|
|
|
|
|
|
|
|
## Example Usage
|
|
|
|
|
|
|
|
```
|
2016-07-13 16:36:37 +02:00
|
|
|
# Create a new Web Droplet in the nyc2 region
|
2014-07-24 16:29:42 +02:00
|
|
|
resource "digitalocean_droplet" "web" {
|
2017-02-18 23:48:50 +01:00
|
|
|
image = "ubuntu-14-04-x64"
|
|
|
|
name = "web-1"
|
|
|
|
region = "nyc2"
|
|
|
|
size = "512mb"
|
2014-07-24 16:29:42 +02:00
|
|
|
}
|
|
|
|
```
|
|
|
|
|
|
|
|
## Argument Reference
|
|
|
|
|
|
|
|
The following arguments are supported:
|
|
|
|
|
2016-07-13 16:36:37 +02:00
|
|
|
* `image` - (Required) The Droplet image ID or slug.
|
|
|
|
* `name` - (Required) The Droplet name
|
2014-07-24 16:29:42 +02:00
|
|
|
* `region` - (Required) The region to start in
|
2016-07-13 16:36:37 +02:00
|
|
|
* `size` - (Required) The instance size to start
|
2016-01-04 16:55:20 +01:00
|
|
|
* `backups` - (Optional) Boolean controlling if backups are made. Defaults to
|
|
|
|
false.
|
|
|
|
* `ipv6` - (Optional) Boolean controlling if IPv6 is enabled. Defaults to false.
|
|
|
|
* `private_networking` - (Optional) Boolean controlling if private networks are
|
|
|
|
enabled. Defaults to false.
|
2015-01-14 18:28:25 +01:00
|
|
|
* `ssh_keys` - (Optional) A list of SSH IDs or fingerprints to enable in
|
2014-08-11 18:14:30 +02:00
|
|
|
the format `[12345, 123456]`. To retrieve this info, use a tool such
|
|
|
|
as `curl` with the [DigitalOcean API](https://developers.digitalocean.com/#keys),
|
|
|
|
to retrieve them.
|
2016-10-25 02:00:04 +02:00
|
|
|
* `resize_disk` - (Optional) 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.
|
2016-07-11 13:09:06 +02:00
|
|
|
* `tags` - (Optional) A list of the tags to label this droplet. A tag resource
|
|
|
|
must exist before it can be associated with a droplet.
|
2014-09-05 17:16:12 +02:00
|
|
|
* `user_data` (Optional) - A string of the desired User Data for the Droplet.
|
2016-07-13 16:36:37 +02:00
|
|
|
* `volume_ids` (Optional) - A list of the IDs of each [block storage volume](/docs/providers/do/r/volume.html) to be attached to the Droplet.
|
2014-07-24 16:29:42 +02:00
|
|
|
|
|
|
|
## Attributes Reference
|
|
|
|
|
|
|
|
The following attributes are exported:
|
|
|
|
|
2016-07-13 16:36:37 +02:00
|
|
|
* `id` - The ID of the Droplet
|
|
|
|
* `name`- The name of the Droplet
|
|
|
|
* `region` - The region of the Droplet
|
|
|
|
* `image` - The image of the Droplet
|
2014-07-24 16:29:42 +02:00
|
|
|
* `ipv6` - Is IPv6 enabled
|
|
|
|
* `ipv6_address` - The IPv6 address
|
2014-07-30 00:58:48 +02:00
|
|
|
* `ipv6_address_private` - The private networking IPv6 address
|
2014-07-24 16:29:42 +02:00
|
|
|
* `ipv4_address` - The IPv4 address
|
2014-07-30 00:58:48 +02:00
|
|
|
* `ipv4_address_private` - The private networking IPv4 address
|
2014-07-28 19:04:17 +02:00
|
|
|
* `locked` - Is the Droplet locked
|
2014-07-24 16:29:42 +02:00
|
|
|
* `private_networking` - Is private networking enabled
|
|
|
|
* `size` - The instance size
|
2016-10-25 02:00:04 +02:00
|
|
|
* `disk` - The size of the instance's disk in GB
|
|
|
|
* `vcpus` - The number of the instance's virtual CPUs
|
2014-07-28 19:04:17 +02:00
|
|
|
* `status` - The status of the droplet
|
2016-07-11 13:09:06 +02:00
|
|
|
* `tags` - The tags associated with the droplet
|
2016-07-13 16:36:37 +02:00
|
|
|
* `volume_ids` - A list of the attached block storage volumes
|
2016-07-19 18:22:30 +02:00
|
|
|
|
|
|
|
## Import
|
|
|
|
|
2017-02-18 23:48:50 +01:00
|
|
|
Droplets can be imported using the droplet `id`, e.g.
|
2016-07-19 18:22:30 +02:00
|
|
|
|
|
|
|
```
|
|
|
|
terraform import digitalocean_droplet.mydroplet 100823
|
|
|
|
```
|