@pulumi/vault
Version:
A Pulumi package for creating and managing HashiCorp Vault cloud resources.
120 lines • 5.09 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.Token = void 0;
const pulumi = require("@pulumi/pulumi");
const utilities = require("./utilities");
/**
* ## Example Usage
*
* ```typescript
* import * as pulumi from "@pulumi/pulumi";
* import * as vault from "@pulumi/vault";
*
* const example = new vault.Token("example", {
* roleName: "app",
* policies: [
* "policy1",
* "policy2",
* ],
* renewable: true,
* ttl: "24h",
* renewMinLease: 43200,
* renewIncrement: 86400,
* metadata: {
* purpose: "service-account",
* },
* });
* ```
*
* ## Import
*
* Tokens can be imported using its `id` as accessor id, e.g.
*
* ```sh
* $ pulumi import vault:index/token:Token example <accessor_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["clientToken"] = state?.clientToken;
resourceInputs["displayName"] = state?.displayName;
resourceInputs["explicitMaxTtl"] = state?.explicitMaxTtl;
resourceInputs["leaseDuration"] = state?.leaseDuration;
resourceInputs["leaseStarted"] = state?.leaseStarted;
resourceInputs["metadata"] = state?.metadata;
resourceInputs["namespace"] = state?.namespace;
resourceInputs["noDefaultPolicy"] = state?.noDefaultPolicy;
resourceInputs["noParent"] = state?.noParent;
resourceInputs["numUses"] = state?.numUses;
resourceInputs["period"] = state?.period;
resourceInputs["policies"] = state?.policies;
resourceInputs["renewIncrement"] = state?.renewIncrement;
resourceInputs["renewMinLease"] = state?.renewMinLease;
resourceInputs["renewable"] = state?.renewable;
resourceInputs["roleName"] = state?.roleName;
resourceInputs["ttl"] = state?.ttl;
resourceInputs["wrappedToken"] = state?.wrappedToken;
resourceInputs["wrappingAccessor"] = state?.wrappingAccessor;
resourceInputs["wrappingTtl"] = state?.wrappingTtl;
}
else {
const args = argsOrState;
resourceInputs["displayName"] = args?.displayName;
resourceInputs["explicitMaxTtl"] = args?.explicitMaxTtl;
resourceInputs["metadata"] = args?.metadata;
resourceInputs["namespace"] = args?.namespace;
resourceInputs["noDefaultPolicy"] = args?.noDefaultPolicy;
resourceInputs["noParent"] = args?.noParent;
resourceInputs["numUses"] = args?.numUses;
resourceInputs["period"] = args?.period;
resourceInputs["policies"] = args?.policies;
resourceInputs["renewIncrement"] = args?.renewIncrement;
resourceInputs["renewMinLease"] = args?.renewMinLease;
resourceInputs["renewable"] = args?.renewable;
resourceInputs["roleName"] = args?.roleName;
resourceInputs["ttl"] = args?.ttl;
resourceInputs["wrappingTtl"] = args?.wrappingTtl;
resourceInputs["clientToken"] = undefined /*out*/;
resourceInputs["leaseDuration"] = undefined /*out*/;
resourceInputs["leaseStarted"] = undefined /*out*/;
resourceInputs["wrappedToken"] = undefined /*out*/;
resourceInputs["wrappingAccessor"] = undefined /*out*/;
}
opts = pulumi.mergeOptions(utilities.resourceOptsDefaults(), opts);
const secretOpts = { additionalSecretOutputs: ["clientToken", "wrappedToken", "wrappingAccessor"] };
opts = pulumi.mergeOptions(opts, secretOpts);
super(Token.__pulumiType, name, resourceInputs, opts);
}
}
exports.Token = Token;
/** @internal */
Token.__pulumiType = 'vault:index/token:Token';
//# sourceMappingURL=token.js.map