@lbrlabs/pulumi-harness
Version:
A Pulumi package for creating and managing Harness resources.
168 lines • 6.24 kB
JavaScript
;
// *** 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.SecretSshkey = void 0;
const pulumi = require("@pulumi/pulumi");
const utilities = require("../utilities");
/**
* Resource for creating an ssh key type secret.
*
* ## Example Usage
*
* ```typescript
* import * as pulumi from "@pulumi/pulumi";
* import * as harness from "@lbrlabs/pulumi-harness";
*
* const keyTabFilePath = new harness.platform.SecretSshkey("keyTabFilePath", {
* identifier: "identifier",
* description: "test",
* tags: ["foo:bar"],
* port: 22,
* kerberos: {
* tgtKeyTabFilePathSpec: {
* keyPath: "key_path",
* },
* principal: "principal",
* realm: "realm",
* tgtGenerationMethod: "KeyTabFilePath",
* },
* });
* const _tgtPassword = new harness.platform.SecretSshkey(" tgtPassword", {
* identifier: "identifier",
* description: "test",
* tags: ["foo:bar"],
* port: 22,
* kerberos: {
* tgtPasswordSpec: {
* password: `account.${secret.id}`,
* },
* principal: "principal",
* realm: "realm",
* tgtGenerationMethod: "Password",
* },
* });
* const sshkeyReference = new harness.platform.SecretSshkey("sshkeyReference", {
* identifier: "identifier",
* description: "test",
* tags: ["foo:bar"],
* port: 22,
* ssh: {
* sshkeyReferenceCredential: {
* userName: "user_name",
* key: `account.${key.id}`,
* encryptedPassphrase: `account.${secret.id}`,
* },
* credentialType: "KeyReference",
* },
* });
* const _sshkeyPath = new harness.platform.SecretSshkey(" sshkeyPath", {
* identifier: "identifier",
* description: "test",
* tags: ["foo:bar"],
* port: 22,
* ssh: {
* sshkeyPathCredential: {
* userName: "user_name",
* keyPath: "key_path",
* encryptedPassphrase: "encrypted_passphrase",
* },
* credentialType: "KeyPath",
* },
* });
* const sshPassword = new harness.platform.SecretSshkey("sshPassword", {
* identifier: "identifier",
* description: "test",
* tags: ["foo:bar"],
* port: 22,
* ssh: {
* sshPasswordCredential: {
* userName: "user_name",
* password: `account.${secret.id}`,
* },
* credentialType: "Password",
* },
* });
* ```
*
* ## Import
*
* Import account level secret sshkey
*
* ```sh
* $ pulumi import harness:platform/secretSshkey:SecretSshkey example <secret_sshkey_id>
* ```
*
* Import org level secret sshkey
*
* ```sh
* $ pulumi import harness:platform/secretSshkey:SecretSshkey example <ord_id>/<secret_sshkey_id>
* ```
*
* Import project level secret sshkey
*
* ```sh
* $ pulumi import harness:platform/secretSshkey:SecretSshkey example <org_id>/<project_id>/<secret_sshkey_id>
* ```
*/
class SecretSshkey extends pulumi.CustomResource {
/**
* Get an existing SecretSshkey 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 SecretSshkey(name, state, Object.assign(Object.assign({}, opts), { id: id }));
}
/**
* Returns true if the given object is an instance of SecretSshkey. 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'] === SecretSshkey.__pulumiType;
}
constructor(name, argsOrState, opts) {
let resourceInputs = {};
opts = opts || {};
if (opts.id) {
const state = argsOrState;
resourceInputs["description"] = state ? state.description : undefined;
resourceInputs["identifier"] = state ? state.identifier : undefined;
resourceInputs["kerberos"] = state ? state.kerberos : undefined;
resourceInputs["name"] = state ? state.name : undefined;
resourceInputs["orgId"] = state ? state.orgId : undefined;
resourceInputs["port"] = state ? state.port : undefined;
resourceInputs["projectId"] = state ? state.projectId : undefined;
resourceInputs["ssh"] = state ? state.ssh : undefined;
resourceInputs["tags"] = state ? state.tags : undefined;
}
else {
const args = argsOrState;
if ((!args || args.identifier === undefined) && !opts.urn) {
throw new Error("Missing required property 'identifier'");
}
resourceInputs["description"] = args ? args.description : undefined;
resourceInputs["identifier"] = args ? args.identifier : undefined;
resourceInputs["kerberos"] = args ? args.kerberos : undefined;
resourceInputs["name"] = args ? args.name : undefined;
resourceInputs["orgId"] = args ? args.orgId : undefined;
resourceInputs["port"] = args ? args.port : undefined;
resourceInputs["projectId"] = args ? args.projectId : undefined;
resourceInputs["ssh"] = args ? args.ssh : undefined;
resourceInputs["tags"] = args ? args.tags : undefined;
}
opts = pulumi.mergeOptions(utilities.resourceOptsDefaults(), opts);
super(SecretSshkey.__pulumiType, name, resourceInputs, opts);
}
}
exports.SecretSshkey = SecretSshkey;
/** @internal */
SecretSshkey.__pulumiType = 'harness:platform/secretSshkey:SecretSshkey';
//# sourceMappingURL=secretSshkey.js.map