get Ssh Keys
Get information on SSH Keys for use in other resources. This data source is useful if the SSH Keys in question are not managed by the provider or you need to utilize any of the SSH Keys' data. Note: You can use the digitalocean.SshKey
data source to obtain metadata about a single SSH Key if you already know the unique name
to retrieve.
Example Usage
For example, to find all SSH keys:
package generated_program;
import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.digitalocean.DigitaloceanFunctions;
import com.pulumi.digitalocean.inputs.GetSshKeysArgs;
import java.util.List;
import java.util.ArrayList;
import java.util.Map;
import java.io.File;
import java.nio.file.Files;
import java.nio.file.Paths;
public class App {
public static void main(String[] args) {
Pulumi.run(App::stack);
}
public static void stack(Context ctx) {
final var keys = DigitaloceanFunctions.getSshKeys(GetSshKeysArgs.builder()
.sorts(GetSshKeysSortArgs.builder()
.direction("asc")
.key("name")
.build())
.build());
}
}
Content copied to clipboard
Return
A collection of values returned by getSshKeys.
Parameters
argument
A collection of arguments for invoking getSshKeys.
suspend fun getSshKeys(filters: List<GetSshKeysFilter>? = null, sorts: List<GetSshKeysSort>? = null): GetSshKeysResult
Return
A collection of values returned by getSshKeys.
See also
Parameters
filters
Filter the results. The filter
block is documented below.
sorts
Sort the results. The sort
block is documented below.
Return
A collection of values returned by getSshKeys.
See also
Parameters
argument
Builder for com.pulumi.digitalocean.kotlin.inputs.GetSshKeysPlainArgs.