@pulumi/openstack
Version:
A Pulumi package for creating and managing OpenStack cloud resources.
95 lines • 4.16 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.Keypair = void 0;
const pulumi = require("@pulumi/pulumi");
const utilities = require("../utilities");
/**
* ## Example Usage
*
* ### Import an Existing Public Key
*
* ```typescript
* import * as pulumi from "@pulumi/pulumi";
* import * as openstack from "@pulumi/openstack";
*
* const test_keypair = new openstack.compute.Keypair("test-keypair", {
* name: "my-keypair",
* publicKey: "ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQDAjpC1hwiOCCmKEWxJ4qzTTsJbKzndLotBCz5PcwtUnflmU+gHJtWMZKpuEGVi29h0A/+ydKek1O18k10Ff+4tyFjiHDQAnOfgWf7+b1yK+qDip3X1C0UPMbwHlTfSGWLGZqd9LvEFx9k3h/M+VtMvwR1lJ9LUyTAImnNjWG7TaIPmui30HvM2UiFEmqkr4ijq45MyX2+fLIePLRIF61p4whjHAQYufqyno3BS48icQb4p6iVEZPo4AE2o9oIyQvj2mx4dk5Y8CgSETOZTYDOR3rU2fZTRDRgPJDH9FWvQjF5tA0p3d9CoWWd2s6GKKbfoUIi8R/Db1BSPJwkqB",
* });
* ```
*
* ### Generate a Public/Private Key Pair
*
* ```typescript
* import * as pulumi from "@pulumi/pulumi";
* import * as openstack from "@pulumi/openstack";
*
* const test_keypair = new openstack.compute.Keypair("test-keypair", {name: "my-keypair"});
* ```
*
* ## Import
*
* Keypairs can be imported using the `name`, e.g.
*
* ```sh
* $ pulumi import openstack:compute/keypair:Keypair my-keypair test-keypair
* ```
*/
class Keypair extends pulumi.CustomResource {
/**
* Get an existing Keypair 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 Keypair(name, state, Object.assign(Object.assign({}, opts), { id: id }));
}
/**
* Returns true if the given object is an instance of Keypair. 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'] === Keypair.__pulumiType;
}
constructor(name, argsOrState, opts) {
let resourceInputs = {};
opts = opts || {};
if (opts.id) {
const state = argsOrState;
resourceInputs["fingerprint"] = state ? state.fingerprint : undefined;
resourceInputs["name"] = state ? state.name : undefined;
resourceInputs["privateKey"] = state ? state.privateKey : undefined;
resourceInputs["publicKey"] = state ? state.publicKey : undefined;
resourceInputs["region"] = state ? state.region : undefined;
resourceInputs["userId"] = state ? state.userId : undefined;
resourceInputs["valueSpecs"] = state ? state.valueSpecs : undefined;
}
else {
const args = argsOrState;
resourceInputs["name"] = args ? args.name : undefined;
resourceInputs["publicKey"] = args ? args.publicKey : undefined;
resourceInputs["region"] = args ? args.region : undefined;
resourceInputs["userId"] = args ? args.userId : undefined;
resourceInputs["valueSpecs"] = args ? args.valueSpecs : undefined;
resourceInputs["fingerprint"] = undefined /*out*/;
resourceInputs["privateKey"] = undefined /*out*/;
}
opts = pulumi.mergeOptions(utilities.resourceOptsDefaults(), opts);
const secretOpts = { additionalSecretOutputs: ["privateKey"] };
opts = pulumi.mergeOptions(opts, secretOpts);
super(Keypair.__pulumiType, name, resourceInputs, opts);
}
}
exports.Keypair = Keypair;
/** @internal */
Keypair.__pulumiType = 'openstack:compute/keypair:Keypair';
//# sourceMappingURL=keypair.js.map