UNPKG

@pulumi/harness

Version:

A Pulumi package for creating and managing Harness resources.

125 lines 5.45 kB
"use strict"; // *** 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.Token = void 0; const pulumi = require("@pulumi/pulumi"); const utilities = require("../utilities"); /** * Resource for creating tokens. * * ## Import * * The `pulumi import` command can be used, for example: * * Import account level token * * ```sh * $ pulumi import harness:platform/token:Token harness_platform_token <parent_id>/<apikey_id>/<apikey_type>/<token_id> * ``` * * Import org level token * * ```sh * $ pulumi import harness:platform/token:Token harness_platform_token <org_id>/<parent_id>/<apikey_id>/<apikey_type>/<token_id> * ``` * * Import project level token * * ```sh * $ pulumi import harness:platform/token:Token harness_platform_token <org_id>/<project_id>/<parent_id>/<apikey_id>/<apikey_type>/<token_id> * ``` */ class Token extends pulumi.CustomResource { /** * Get an existing Token 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 Token(name, state, { ...opts, id: id }); } /** * Returns true if the given object is an instance of Token. 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'] === Token.__pulumiType; } constructor(name, argsOrState, opts) { let resourceInputs = {}; opts = opts || {}; if (opts.id) { const state = argsOrState; resourceInputs["accountId"] = state?.accountId; resourceInputs["apikeyId"] = state?.apikeyId; resourceInputs["apikeyType"] = state?.apikeyType; resourceInputs["description"] = state?.description; resourceInputs["email"] = state?.email; resourceInputs["encodedPassword"] = state?.encodedPassword; resourceInputs["identifier"] = state?.identifier; resourceInputs["name"] = state?.name; resourceInputs["orgId"] = state?.orgId; resourceInputs["parentId"] = state?.parentId; resourceInputs["projectId"] = state?.projectId; resourceInputs["scheduledExpireTime"] = state?.scheduledExpireTime; resourceInputs["tags"] = state?.tags; resourceInputs["username"] = state?.username; resourceInputs["valid"] = state?.valid; resourceInputs["validFrom"] = state?.validFrom; resourceInputs["validTo"] = state?.validTo; resourceInputs["value"] = state?.value; } else { const args = argsOrState; if (args?.accountId === undefined && !opts.urn) { throw new Error("Missing required property 'accountId'"); } if (args?.apikeyId === undefined && !opts.urn) { throw new Error("Missing required property 'apikeyId'"); } if (args?.apikeyType === undefined && !opts.urn) { throw new Error("Missing required property 'apikeyType'"); } if (args?.identifier === undefined && !opts.urn) { throw new Error("Missing required property 'identifier'"); } if (args?.parentId === undefined && !opts.urn) { throw new Error("Missing required property 'parentId'"); } resourceInputs["accountId"] = args?.accountId; resourceInputs["apikeyId"] = args?.apikeyId; resourceInputs["apikeyType"] = args?.apikeyType; resourceInputs["description"] = args?.description; resourceInputs["email"] = args?.email; resourceInputs["encodedPassword"] = args?.encodedPassword; resourceInputs["identifier"] = args?.identifier; resourceInputs["name"] = args?.name; resourceInputs["orgId"] = args?.orgId; resourceInputs["parentId"] = args?.parentId; resourceInputs["projectId"] = args?.projectId; resourceInputs["scheduledExpireTime"] = args?.scheduledExpireTime; resourceInputs["tags"] = args?.tags; resourceInputs["username"] = args?.username; resourceInputs["valid"] = args?.valid; resourceInputs["validFrom"] = args?.validFrom; resourceInputs["validTo"] = args?.validTo; resourceInputs["value"] = undefined /*out*/; } opts = pulumi.mergeOptions(utilities.resourceOptsDefaults(), opts); const secretOpts = { additionalSecretOutputs: ["value"] }; opts = pulumi.mergeOptions(opts, secretOpts); super(Token.__pulumiType, name, resourceInputs, opts); } } exports.Token = Token; /** @internal */ Token.__pulumiType = 'harness:platform/token:Token'; //# sourceMappingURL=token.js.map