@ediri/vultr
Version:
A Pulumi package for creating and managing Vultr cloud resources.
78 lines • 3.36 kB
JavaScript
;
// *** WARNING: this file was generated by pulumi-language-nodejs. ***
// *** Do not edit by hand unless you're certain you know what you are doing! ***
Object.defineProperty(exports, "__esModule", { value: true });
exports.SSHKey = void 0;
const pulumi = require("@pulumi/pulumi");
const utilities = require("./utilities");
/**
* Provides a Vultr SSH key resource. This can be used to create, read, modify, and delete SSH keys.
*
* ## Example Usage
*
* Create an SSH key
*
* ```typescript
* import * as pulumi from "@pulumi/pulumi";
* import * as vultr from "@ediri/vultr";
*
* const mySshKey = new vultr.SSHKey("mySshKey", {sshKey: "ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQCyVGaw1PuEl98f4/7Kq3O9ZIvDw2OFOSXAFVqilSFNkHlefm1iMtPeqsIBp2t9cbGUf55xNDULz/bD/4BCV43yZ5lh0cUYuXALg9NI29ui7PEGReXjSpNwUD6ceN/78YOK41KAcecq+SS0bJ4b4amKZIJG3JWmDKljtv1dmSBCrTmEAQaOorxqGGBYmZS7NQumRe4lav5r6wOs8OACMANE1ejkeZsGFzJFNqvr5DuHdDL5FAudW23me3BDmrM9ifUzzjl1Jwku3bnRaCcjaxH8oTumt1a00mWci/1qUlaVFft085yvVq7KZbF2OPPbl+erDW91+EZ2FgEi+v1/CSJ5 your_username@hostname"});
* ```
*
* ## Import
*
* SSH keys can be imported using the SSH key `ID`, e.g.
*
* ```sh
* $ pulumi import vultr:index/sSHKey:SSHKey my_key 6b0876a7-f709-41ba-aed8-abed9d38ae45
* ```
*/
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, id, state, opts) {
return new SSHKey(name, state, Object.assign(Object.assign({}, opts), { id: id }));
}
/**
* 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) {
if (obj === undefined || obj === null) {
return false;
}
return obj['__pulumiType'] === SSHKey.__pulumiType;
}
constructor(name, argsOrState, opts) {
let resourceInputs = {};
opts = opts || {};
if (opts.id) {
const state = argsOrState;
resourceInputs["dateCreated"] = state ? state.dateCreated : undefined;
resourceInputs["name"] = state ? state.name : undefined;
resourceInputs["sshKey"] = state ? state.sshKey : undefined;
}
else {
const args = argsOrState;
if ((!args || args.sshKey === undefined) && !opts.urn) {
throw new Error("Missing required property 'sshKey'");
}
resourceInputs["name"] = args ? args.name : undefined;
resourceInputs["sshKey"] = args ? args.sshKey : undefined;
resourceInputs["dateCreated"] = undefined /*out*/;
}
opts = pulumi.mergeOptions(utilities.resourceOptsDefaults(), opts);
super(SSHKey.__pulumiType, name, resourceInputs, opts);
}
}
exports.SSHKey = SSHKey;
/** @internal */
SSHKey.__pulumiType = 'vultr:index/sSHKey:SSHKey';
//# sourceMappingURL=sshkey.js.map