digitalocean_droplet

Get information on a Droplet for use in other resources. This data source provides all of the Droplet's properties as configured on your DigitalOcean account. This is useful if the Droplet in question is not managed by Terraform or you need to utilize any of the Droplet's data.

Note: This data source returns a single Droplet. When specifying a tag, an error is triggered if more than one Droplet is found.

Example Usage

Get the Droplet by name:

data "digitalocean_droplet" "example" {
  name = "web"
}

output "droplet_output" {
  value = data.digitalocean_droplet.example.ipv4_address
}

Get the Droplet by tag:

data "digitalocean_droplet" "example" {
  tag = "web"
}

Get the Droplet by ID:

data "digitalocean_droplet" "example" {
  id = digitalocean_kubernetes_cluster.example.node_pool[0].nodes[0].droplet_id
}

Argument Reference

One of the following arguments must be provided:

Attributes Reference

The following attributes are exported: