From d1fa48d07b44eb6317376ba5e2815886c44a1f55 Mon Sep 17 00:00:00 2001 From: Andrew Starr-Bochicchio Date: Wed, 25 May 2022 16:12:33 -0400 Subject: [PATCH] docs: Document values attribute in ssh_keys data source (fixes: #792). (#832) --- docs/data-sources/ssh_keys.md | 19 ++++++++++++++++--- 1 file changed, 16 insertions(+), 3 deletions(-) diff --git a/docs/data-sources/ssh_keys.md b/docs/data-sources/ssh_keys.md index dc1eeffdd..4e914ab14 100644 --- a/docs/data-sources/ssh_keys.md +++ b/docs/data-sources/ssh_keys.md @@ -14,7 +14,7 @@ about a single SSH Key if you already know the unique `name` to retrieve. ## Example Usage -For example to find all SSH Keys: +For example, to find all SSH keys: ```hcl data "digitalocean_ssh_keys" "keys" { @@ -25,6 +25,17 @@ data "digitalocean_ssh_keys" "keys" { } ``` +Or to find ones matching specific values: + +```hcl +data "digitalocean_ssh_keys" "keys" { + filter { + key = "name" + values = ["laptop", "desktop"] + } +} +``` + ## Argument Reference * `filter` - (Optional) Filter the results. @@ -32,11 +43,13 @@ data "digitalocean_ssh_keys" "keys" { * `sort` - (Optional) Sort the results. The `sort` block is documented below. - + `filter` supports the following arguments: * `key` - (Required) Filter the SSH Keys by this key. This may be one of `name`, `public_key`, or `fingerprint`. +* `values` - (Required) A list of values to match against the key field. Only retrieves SSH keys where the key field matches one or more of the values provided here. + `sort` supports the following arguments: * `key` - (Required) Sort the SSH Keys by this key. This may be one of `name`, `public_key`, or `fingerprint`. @@ -45,7 +58,7 @@ data "digitalocean_ssh_keys" "keys" { ## Attributes Reference -* `ssh_keys` - A list of SSH Keys. Each SSH Key has the following attributes: +* `ssh_keys` - A list of SSH Keys. Each SSH Key has the following attributes: * `id` - The ID of the ssh key. * `name`: The name of the ssh key.