@pulumi/linode
Version:
A Pulumi package for creating and managing linode cloud resources.
110 lines (109 loc) • 3.92 kB
TypeScript
import * as pulumi from "@pulumi/pulumi";
/**
* Provides a Linode SSH Key resource. This can be used to create, modify, and delete Linodes SSH Keys. Managed SSH Keys allow instances to be created with a list of Linode usernames, whose SSH keys will be automatically applied to the root account's `~/.ssh/authorized_keys` file.
* For more information, see the [Linode APIv4 docs](https://techdocs.akamai.com/linode-api/reference/get-ssh-keys).
*
* **NOTE**: This does not generate a new ssh key, you must have an existing key generated and saved locally.
*
* ## Example Usage
*
* The following example shows how one might use this resource to configure a SSH Key for access to a Linode Instance.
*
* ```typescript
* import * as pulumi from "@pulumi/pulumi";
* import * as linode from "@pulumi/linode";
* import * as std from "@pulumi/std";
*
* const foo = new linode.SshKey("foo", {
* label: "foo",
* sshKey: std.file({
* input: "~/.ssh/id_rsa.pub",
* }).then(invoke => std.chomp({
* input: invoke.result,
* })).then(invoke => invoke.result),
* });
* const fooInstance = new linode.Instance("foo", {
* image: "linode/ubuntu22.04",
* label: "foo",
* region: "us-east",
* type: "g6-nanode-1",
* authorizedKeys: [foo.sshKey],
* rootPass: "...",
* });
* ```
*
* ## Import
*
* Linodes SSH Keys can be imported using the Linode SSH Key `id`, e.g.
*
* ```sh
* $ pulumi import linode:index/sshKey:SshKey mysshkey 1234567
* ```
*/
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 date this SSH Key was created.
*/
readonly created: pulumi.Output<string>;
/**
* A label for the SSH Key.
*/
readonly label: pulumi.Output<string>;
/**
* The public SSH Key, which is used to authenticate to the root user of the Linodes you deploy.
*/
readonly sshKey: 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 date this SSH Key was created.
*/
created?: pulumi.Input<string>;
/**
* A label for the SSH Key.
*/
label?: pulumi.Input<string>;
/**
* The public SSH Key, which is used to authenticate to the root user of the Linodes you deploy.
*/
sshKey?: pulumi.Input<string>;
}
/**
* The set of arguments for constructing a SshKey resource.
*/
export interface SshKeyArgs {
/**
* A label for the SSH Key.
*/
label: pulumi.Input<string>;
/**
* The public SSH Key, which is used to authenticate to the root user of the Linodes you deploy.
*/
sshKey: pulumi.Input<string>;
}