diff --git a/digitalocean/droplet/datasource_droplets_test.go b/digitalocean/droplet/datasource_droplets_test.go index 936050bcb..2041c4dfe 100644 --- a/digitalocean/droplet/datasource_droplets_test.go +++ b/digitalocean/droplet/datasource_droplets_test.go @@ -82,11 +82,11 @@ resource "digitalocean_ssh_key" "foobar" { } resource "digitalocean_droplet" "gpu" { - name = "%s" - size = "%s" - image = "%s" - region = "nyc2" - ssh_keys = [digitalocean_ssh_key.foobar.id] + name = "%s" + size = "%s" + image = "%s" + region = "nyc2" + ssh_keys = [digitalocean_ssh_key.foobar.id] } resource "digitalocean_droplet" "regular" { diff --git a/docs/data-sources/droplet.md b/docs/data-sources/droplet.md index 88fcffa06..5db784655 100644 --- a/docs/data-sources/droplet.md +++ b/docs/data-sources/droplet.md @@ -51,6 +51,10 @@ One of the following arguments must be provided: * `name` - (Optional) The name of the Droplet. * `tag` - (Optional) A tag applied to the Droplet. +To include GPU Droplets when searching by name, use: + +* `gpu` - (Optional) A boolean value specifying whether or not to search GPU Droplets + ## Attributes Reference The following attributes are exported: diff --git a/docs/data-sources/droplets.md b/docs/data-sources/droplets.md index 5e6bcff09..2d233ae54 100644 --- a/docs/data-sources/droplets.md +++ b/docs/data-sources/droplets.md @@ -11,6 +11,9 @@ If no filters are specified, all Droplets will be returned. This data source is useful if the Droplets in question are not managed by Terraform or you need to utilize any of the Droplets' data. +By default, only non-GPU Droplets are returned. To list only GPU Droplets, set +the `gpus` attribute to `true`. + Note: You can use the [`digitalocean_droplet`](droplet) data source to obtain metadata about a single Droplet if you already know the `id`, unique `name`, or unique `tag` to retrieve. @@ -50,6 +53,8 @@ data "digitalocean_droplets" "small-with-backups" { ## Argument Reference +* `gpus` - (Optional) A boolean value specifying whether or not to list GPU Droplets + * `filter` - (Optional) Filter the results. The `filter` block is documented below.