Skip to content

Commit

Permalink
docs: Document values attribute in ssh_keys data source (fixes: #792). (
Browse files Browse the repository at this point in the history
  • Loading branch information
andrewsomething committed May 25, 2022
1 parent e4a9080 commit d1fa48d
Showing 1 changed file with 16 additions and 3 deletions.
19 changes: 16 additions & 3 deletions docs/data-sources/ssh_keys.md
Original file line number Diff line number Diff line change
Expand Up @@ -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" {
Expand All @@ -25,18 +25,31 @@ 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.
The `filter` block is documented below.

* `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`.
Expand All @@ -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.
Expand Down

0 comments on commit d1fa48d

Please sign in to comment.