UNPKG

@pulumi/nomad

Version:

A Pulumi package for creating and managing nomad cloud resources.

133 lines 4.91 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.AclToken = void 0; const pulumi = require("@pulumi/pulumi"); const utilities = require("./utilities"); /** * ## Example Usage * * Creating a token with limited policies: * * ```typescript * import * as pulumi from "@pulumi/pulumi"; * import * as nomad from "@pulumi/nomad"; * * const dakota = new nomad.AclToken("dakota", { * name: "Dakota", * type: "client", * policies: [ * "dev", * "qa", * ], * }); * ``` * * Creating a global token that will be replicated to all regions: * * ```typescript * import * as pulumi from "@pulumi/pulumi"; * import * as nomad from "@pulumi/nomad"; * * const dakota = new nomad.AclToken("dakota", { * name: "Dakota", * type: "client", * policies: [ * "dev", * "qa", * ], * global: true, * }); * ``` * * Creating a token with full access to the cluster: * * ```typescript * import * as pulumi from "@pulumi/pulumi"; * import * as nomad from "@pulumi/nomad"; * * const iman = new nomad.AclToken("iman", { * name: "Iman", * type: "management", * }); * ``` * * Accessing the token: * * ```typescript * import * as pulumi from "@pulumi/pulumi"; * import * as nomad from "@pulumi/nomad"; * * const token = new nomad.AclToken("token", { * type: "client", * policies: ["dev"], * }); * export const nomadToken = token.secretId; * ``` */ class AclToken extends pulumi.CustomResource { /** * Get an existing AclToken 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 AclToken(name, state, Object.assign(Object.assign({}, opts), { id: id })); } /** * Returns true if the given object is an instance of AclToken. 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'] === AclToken.__pulumiType; } constructor(name, argsOrState, opts) { let resourceInputs = {}; opts = opts || {}; if (opts.id) { const state = argsOrState; resourceInputs["accessorId"] = state ? state.accessorId : undefined; resourceInputs["createTime"] = state ? state.createTime : undefined; resourceInputs["expirationTime"] = state ? state.expirationTime : undefined; resourceInputs["expirationTtl"] = state ? state.expirationTtl : undefined; resourceInputs["global"] = state ? state.global : undefined; resourceInputs["name"] = state ? state.name : undefined; resourceInputs["policies"] = state ? state.policies : undefined; resourceInputs["roles"] = state ? state.roles : undefined; resourceInputs["secretId"] = state ? state.secretId : undefined; resourceInputs["type"] = state ? state.type : undefined; } else { const args = argsOrState; if ((!args || args.type === undefined) && !opts.urn) { throw new Error("Missing required property 'type'"); } resourceInputs["expirationTtl"] = args ? args.expirationTtl : undefined; resourceInputs["global"] = args ? args.global : undefined; resourceInputs["name"] = args ? args.name : undefined; resourceInputs["policies"] = args ? args.policies : undefined; resourceInputs["roles"] = args ? args.roles : undefined; resourceInputs["type"] = args ? args.type : undefined; resourceInputs["accessorId"] = undefined /*out*/; resourceInputs["createTime"] = undefined /*out*/; resourceInputs["expirationTime"] = undefined /*out*/; resourceInputs["secretId"] = undefined /*out*/; } opts = pulumi.mergeOptions(utilities.resourceOptsDefaults(), opts); const secretOpts = { additionalSecretOutputs: ["secretId"] }; opts = pulumi.mergeOptions(opts, secretOpts); super(AclToken.__pulumiType, name, resourceInputs, opts); } } exports.AclToken = AclToken; /** @internal */ AclToken.__pulumiType = 'nomad:index/aclToken:AclToken'; //# sourceMappingURL=aclToken.js.map