2014-07-24 16:29:42 +02:00
|
|
|
---
|
|
|
|
layout: "digitalocean"
|
|
|
|
page_title: "DigitalOcean: digitalocean_droplet"
|
|
|
|
sidebar_current: "docs-do-resource-droplet"
|
|
|
|
---
|
|
|
|
|
|
|
|
# digitalocean\_droplet
|
|
|
|
|
|
|
|
Provides a DigitalOcean droplet resource. This can be used to create,
|
|
|
|
modify, and delete droplets. Droplets also support
|
|
|
|
[provisioning](/docs/provisioners/index.html).
|
|
|
|
|
|
|
|
## Example Usage
|
|
|
|
|
|
|
|
```
|
|
|
|
# Create a new Web droplet in the nyc2 region
|
|
|
|
resource "digitalocean_droplet" "web" {
|
2014-07-31 19:48:31 +02:00
|
|
|
image = "ubuntu-14-04-x64"
|
2014-07-24 16:29:42 +02:00
|
|
|
name = "web-1"
|
|
|
|
region = "nyc2"
|
|
|
|
size = "512mb"
|
|
|
|
}
|
|
|
|
```
|
|
|
|
|
|
|
|
## Argument Reference
|
|
|
|
|
|
|
|
The following arguments are supported:
|
|
|
|
|
|
|
|
* `image` - (Required) The droplet image ID or slug.
|
|
|
|
* `name` - (Required) The droplet name
|
|
|
|
* `region` - (Required) The region to start in
|
|
|
|
* `size` - (Required) The instance size to start
|
2014-07-29 08:51:24 +02:00
|
|
|
* `backups` - (Optional) Boolean controlling if backups are made.
|
|
|
|
* `ipv6` - (Optional) Boolean controlling if IPv6 is enabled.
|
|
|
|
* `private_networking` - (Optional) Boolean controlling if private networks are enabled.
|
2014-07-30 23:50:13 +02: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.
|
2014-09-05 17:16:12 +02:00
|
|
|
* `user_data` (Optional) - A string of the desired User Data for the Droplet.
|
|
|
|
User Data is currently only available in regions with metadata
|
|
|
|
listed in their features.
|
2014-07-24 16:29:42 +02:00
|
|
|
|
|
|
|
## Attributes Reference
|
|
|
|
|
|
|
|
The following attributes are exported:
|
|
|
|
|
|
|
|
* `id` - The ID of the droplet
|
|
|
|
* `name`- The name of the droplet
|
|
|
|
* `region` - The region of the droplet
|
|
|
|
* `image` - The image of the droplet
|
|
|
|
* `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
|
2014-07-28 19:04:17 +02:00
|
|
|
* `status` - The status of the droplet
|
2014-07-24 16:29:42 +02:00
|
|
|
|