@lbrlabs/pulumi-harness
Version:
A Pulumi package for creating and managing Harness resources.
101 lines • 4.48 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.EncryptedText = void 0;
const pulumi = require("@pulumi/pulumi");
const utilities = require("./utilities");
/**
* Resource for creating an encrypted text secret
*
* ## Example Usage
*
* ```typescript
* import * as pulumi from "@pulumi/pulumi";
* import * as harness from "@lbrlabs/pulumi-harness";
* import * as harness from "@pulumi/harness";
*
* const default = harness.getSecretManager({
* "default": true,
* });
* const example = new harness.EncryptedText("example", {
* value: "someval",
* secretManagerId: _default.then(_default => _default.id),
* usageScopes: [
* {
* environmentFilterType: "PRODUCTION_ENVIRONMENTS",
* },
* {
* environmentFilterType: "NON_PRODUCTION_ENVIRONMENTS",
* },
* ],
* });
* ```
*
* ## Import
*
* Import using the Harness encrypted text format. NOTEThe secret value cannot be decrypted and imported.
*
* ```sh
* $ pulumi import harness:index/encryptedText:EncryptedText example <secret_id>
* ```
*/
class EncryptedText extends pulumi.CustomResource {
/**
* Get an existing EncryptedText 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 EncryptedText(name, state, Object.assign(Object.assign({}, opts), { id: id }));
}
/**
* Returns true if the given object is an instance of EncryptedText. 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'] === EncryptedText.__pulumiType;
}
constructor(name, argsOrState, opts) {
let resourceInputs = {};
opts = opts || {};
if (opts.id) {
const state = argsOrState;
resourceInputs["inheritScopesFromSecretManager"] = state ? state.inheritScopesFromSecretManager : undefined;
resourceInputs["name"] = state ? state.name : undefined;
resourceInputs["scopedToAccount"] = state ? state.scopedToAccount : undefined;
resourceInputs["secretManagerId"] = state ? state.secretManagerId : undefined;
resourceInputs["secretReference"] = state ? state.secretReference : undefined;
resourceInputs["usageScopes"] = state ? state.usageScopes : undefined;
resourceInputs["value"] = state ? state.value : undefined;
}
else {
const args = argsOrState;
if ((!args || args.secretManagerId === undefined) && !opts.urn) {
throw new Error("Missing required property 'secretManagerId'");
}
resourceInputs["inheritScopesFromSecretManager"] = args ? args.inheritScopesFromSecretManager : undefined;
resourceInputs["name"] = args ? args.name : undefined;
resourceInputs["scopedToAccount"] = args ? args.scopedToAccount : undefined;
resourceInputs["secretManagerId"] = args ? args.secretManagerId : undefined;
resourceInputs["secretReference"] = args ? args.secretReference : undefined;
resourceInputs["usageScopes"] = args ? args.usageScopes : undefined;
resourceInputs["value"] = (args === null || args === void 0 ? void 0 : args.value) ? pulumi.secret(args.value) : undefined;
}
opts = pulumi.mergeOptions(utilities.resourceOptsDefaults(), opts);
const secretOpts = { additionalSecretOutputs: ["value"] };
opts = pulumi.mergeOptions(opts, secretOpts);
super(EncryptedText.__pulumiType, name, resourceInputs, opts);
}
}
exports.EncryptedText = EncryptedText;
/** @internal */
EncryptedText.__pulumiType = 'harness:index/encryptedText:EncryptedText';
//# sourceMappingURL=encryptedText.js.map