UNPKG

@equinix-labs/pulumi-equinix

Version:

A Pulumi package for creating and managing equinix cloud resources.

99 lines 4.22 kB
"use strict"; // *** WARNING: this file was generated by the Pulumi Terraform Bridge (tfgen) Tool. *** // *** 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 resource to manage User SSH keys on your Equinix Metal user account. If you create a new device in a project, all the keys of the project's collaborators will be injected to the device. * * The link between User SSH key and device is implicit. If you want to make sure that a key will be copied to a device, you must ensure that the device resource `dependsOn` the key resource. * * ## Example Usage * ```typescript * import * as pulumi from "@pulumi/pulumi"; * import * as equinix from "@equinix-labs/pulumi-equinix"; * import * as std from "@pulumi/std"; * * const key1 = new equinix.metal.SshKey("key1", { * name: "terraform-1", * publicKey: std.fileOutput({ * input: "/home/terraform/.ssh/id_rsa.pub", * }).apply(invoke => invoke.result), * }); * const test = new equinix.metal.Device("test", { * hostname: "test-device", * plan: equinix.metal.Plan.C3SmallX86, * metro: "sv", * operatingSystem: equinix.metal.OperatingSystem.Ubuntu20_04, * billingCycle: equinix.metal.BillingCycle.Hourly, * projectId: projectId, * }, { * dependsOn: [key1], * }); * ``` * * ## Import * * This resource can be imported using an existing SSH Key ID: * * ```sh * $ pulumi import equinix:metal/sshKey:SshKey equinix_metal_ssh_key {existing_sshkey_id} * ``` */ 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["created"] = state ? state.created : undefined; resourceInputs["fingerprint"] = state ? state.fingerprint : undefined; resourceInputs["name"] = state ? state.name : undefined; resourceInputs["ownerId"] = state ? state.ownerId : undefined; resourceInputs["publicKey"] = state ? state.publicKey : undefined; resourceInputs["updated"] = state ? state.updated : undefined; } else { const args = argsOrState; if ((!args || args.publicKey === undefined) && !opts.urn) { throw new Error("Missing required property 'publicKey'"); } resourceInputs["name"] = args ? args.name : undefined; resourceInputs["publicKey"] = args ? args.publicKey : undefined; resourceInputs["created"] = undefined /*out*/; resourceInputs["fingerprint"] = undefined /*out*/; resourceInputs["ownerId"] = undefined /*out*/; resourceInputs["updated"] = undefined /*out*/; } opts = pulumi.mergeOptions(utilities.resourceOptsDefaults(), opts); super(SshKey.__pulumiType, name, resourceInputs, opts); } } exports.SshKey = SshKey; /** @internal */ SshKey.__pulumiType = 'equinix:metal/sshKey:SshKey'; //# sourceMappingURL=sshKey.js.map