@pulumi/digitalocean
Version:
A Pulumi package for creating and managing DigitalOcean cloud resources.
110 lines (109 loc) • 3.62 kB
TypeScript
import * as pulumi from "@pulumi/pulumi";
/**
* Provides a DigitalOcean SSH key resource to allow you to manage SSH
* keys for Droplet access. Keys created with this resource
* can be referenced in your Droplet configuration via their ID or
* fingerprint.
*
* ## Example Usage
*
* ```typescript
* import * as pulumi from "@pulumi/pulumi";
* import * as digitalocean from "@pulumi/digitalocean";
* import * as std from "@pulumi/std";
*
* // Create a new SSH key
* const _default = new digitalocean.SshKey("default", {
* name: "Example",
* publicKey: std.file({
* input: "/Users/myuser/.ssh/id_rsa.pub",
* }).then(invoke => invoke.result),
* });
* // Create a new Droplet using the SSH key
* const web = new digitalocean.Droplet("web", {
* image: "ubuntu-18-04-x64",
* name: "web-1",
* region: digitalocean.Region.NYC3,
* size: digitalocean.DropletSlug.DropletS1VCPU1GB,
* sshKeys: [_default.fingerprint],
* });
* ```
*
* ## Import
*
* SSH Keys can be imported using the `ssh key id`, e.g.
*
* ```sh
* $ pulumi import digitalocean:index/sshKey:SshKey mykey 263654
* ```
*/
export declare class SshKey extends pulumi.CustomResource {
/**
* Get an existing SshKey resource's state with the given name, ID, and optional extra
* properties used to qualify the lookup.
*
* @param name The _unique_ name of the resulting resource.
* @param id The _unique_ provider ID of the resource to lookup.
* @param state Any extra arguments used during the lookup.
* @param opts Optional settings to control the behavior of the CustomResource.
*/
static get(name: string, id: pulumi.Input<pulumi.ID>, state?: SshKeyState, opts?: pulumi.CustomResourceOptions): SshKey;
/**
* Returns true if the given object is an instance of SshKey. This is designed to work even
* when multiple copies of the Pulumi SDK have been loaded into the same process.
*/
static isInstance(obj: any): obj is SshKey;
/**
* The fingerprint of the SSH key
*/
readonly fingerprint: pulumi.Output<string>;
/**
* The name of the SSH key for identification
*/
readonly name: pulumi.Output<string>;
/**
* The public key. If this is a file, it
* can be read using the file interpolation function
*/
readonly publicKey: pulumi.Output<string>;
/**
* Create a SshKey resource with the given unique name, arguments, and options.
*
* @param name The _unique_ name of the resource.
* @param args The arguments to use to populate this resource's properties.
* @param opts A bag of options that control this resource's behavior.
*/
constructor(name: string, args: SshKeyArgs, opts?: pulumi.CustomResourceOptions);
}
/**
* Input properties used for looking up and filtering SshKey resources.
*/
export interface SshKeyState {
/**
* The fingerprint of the SSH key
*/
fingerprint?: pulumi.Input<string>;
/**
* The name of the SSH key for identification
*/
name?: pulumi.Input<string>;
/**
* The public key. If this is a file, it
* can be read using the file interpolation function
*/
publicKey?: pulumi.Input<string>;
}
/**
* The set of arguments for constructing a SshKey resource.
*/
export interface SshKeyArgs {
/**
* The name of the SSH key for identification
*/
name?: pulumi.Input<string>;
/**
* The public key. If this is a file, it
* can be read using the file interpolation function
*/
publicKey: pulumi.Input<string>;
}