mirror of
https://github.com/opentffoundation/opentf.git
synced 2026-03-12 16:00:25 -04:00
Note: In DO, Droplets are about the only thing you pay. DNS/Float IP are free. Signed-off-by: Julien Pivotto <roidelapluie@inuits.eu>
3.1 KiB
3.1 KiB
layout, page_title, sidebar_current, description
| layout | page_title | sidebar_current | description |
|---|---|---|---|
| digitalocean | DigitalOcean: digitalocean_droplet | docs-do-resource-droplet | Provides a DigitalOcean Droplet resource. This can be used to create, modify, and delete Droplets. Droplets also support provisioning. |
digitalocean_droplet
Provides a DigitalOcean Droplet resource. This can be used to create, modify, and delete Droplets. Droplets also support provisioning.
Example Usage
# Create a new Web Droplet in the nyc2 region
resource "digitalocean_droplet" "web" {
image = "ubuntu-14-04-x64"
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 nameregion- (Required) The region to start insize- (Required) The instance size to startbackups- (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.ssh_keys- (Optional) A list of SSH IDs or fingerprints to enable in the format[12345, 123456]. To retrieve this info, use a tool such ascurlwith the DigitalOcean API, to retrieve them.resize_disk- (Optional) Boolean controlling whether to increase the disk size when resizing a Droplet. It defaults totrue. When set tofalse, 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.tags- (Optional) A list of the tags to label this droplet. A tag resource must exist before it can be associated with a droplet.user_data(Optional) - A string of the desired User Data for the Droplet.volume_ids(Optional) - A list of the IDs of each block storage volume to be attached to the Droplet.
Attributes Reference
The following attributes are exported:
id- The ID of the Dropletname- The name of the Dropletregion- The region of the Dropletimage- The image of the Dropletipv6- Is IPv6 enabledipv6_address- The IPv6 addressipv6_address_private- The private networking IPv6 addressipv4_address- The IPv4 addressipv4_address_private- The private networking IPv4 addresslocked- Is the Droplet lockedprivate_networking- Is private networking enabledprice_hourly- Droplet hourly priceprice_monthly- Droplet monthly pricesize- The instance sizedisk- The size of the instance's disk in GBvcpus- The number of the instance's virtual CPUsstatus- The status of the droplettags- The tags associated with the dropletvolume_ids- A list of the attached block storage volumes
Import
Droplets can be imported using the droplet id, e.g.
terraform import digitalocean_droplet.mydroplet 100823