GetSshKey

Get information on a ssh key. This data source provides the name, public key, and fingerprint as configured on your DigitalOcean account. This is useful if the ssh key in question is not managed by this provider or you need to utilize any of the keys data.

An error is triggered if the provided ssh key name does not exist.

Example Usage

using Pulumi;
using DigitalOcean = Pulumi.DigitalOcean;

class MyStack : Stack
{
    public MyStack()
    {
        var exampleSshKey = Output.Create(DigitalOcean.GetSshKey.InvokeAsync(new DigitalOcean.GetSshKeyArgs
        {
            Name = "example",
        }));
        var exampleDroplet = new DigitalOcean.Droplet("exampleDroplet", new DigitalOcean.DropletArgs
        {
            Image = "ubuntu-18-04-x64",
            Region = "nyc2",
            Size = "s-1vcpu-1gb",
            SshKeys = 
            {
                exampleSshKey.Apply(exampleSshKey => exampleSshKey.Id),
            },
        });
    }

}

Coming soon!

import pulumi
import pulumi_digitalocean as digitalocean

example_ssh_key = digitalocean.get_ssh_key(name="example")
example_droplet = digitalocean.Droplet("exampleDroplet",
    image="ubuntu-18-04-x64",
    region="nyc2",
    size="s-1vcpu-1gb",
    ssh_keys=[example_ssh_key.id])
import * as pulumi from "@pulumi/pulumi";
import * as digitalocean from "@pulumi/digitalocean";

const exampleSshKey = digitalocean.getSshKey({
    name: "example",
});
const exampleDroplet = new digitalocean.Droplet("exampleDroplet", {
    image: "ubuntu-18-04-x64",
    region: "nyc2",
    size: "s-1vcpu-1gb",
    sshKeys: [exampleSshKey.then(exampleSshKey => exampleSshKey.id)],
});

Using GetSshKey

function getSshKey(args: GetSshKeyArgs, opts?: InvokeOptions): Promise<GetSshKeyResult>
function  get_ssh_key(name=None, opts=None)
func LookupSshKey(ctx *Context, args *LookupSshKeyArgs, opts ...InvokeOption) (*LookupSshKeyResult, error)

Note: This function is named LookupSshKey in the Go SDK.

public static class GetSshKey {
    public static Task<GetSshKeyResult> InvokeAsync(GetSshKeyArgs args, InvokeOptions? opts = null)
}

The following arguments are supported:

Name string

The name of the ssh key.

Name string

The name of the ssh key.

name string

The name of the ssh key.

name str

The name of the ssh key.

GetSshKey Result

The following output properties are available:

Fingerprint string
Id string

The provider-assigned unique ID for this managed resource.

Name string
PublicKey string
Fingerprint string
Id string

The provider-assigned unique ID for this managed resource.

Name string
PublicKey string
fingerprint string
id string

The provider-assigned unique ID for this managed resource.

name string
publicKey string
fingerprint str
id str

The provider-assigned unique ID for this managed resource.

name str
public_key str

Package Details

Repository
https://github.com/pulumi/pulumi-digitalocean
License
Apache-2.0
Notes
This Pulumi package is based on the digitalocean Terraform Provider.