UNPKG

@pulumi/nomad

Version:

A Pulumi package for creating and managing nomad cloud resources.

133 lines 4.57 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, { ...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?.accessorId; resourceInputs["createTime"] = state?.createTime; resourceInputs["expirationTime"] = state?.expirationTime; resourceInputs["expirationTtl"] = state?.expirationTtl; resourceInputs["global"] = state?.global; resourceInputs["name"] = state?.name; resourceInputs["policies"] = state?.policies; resourceInputs["roles"] = state?.roles; resourceInputs["secretId"] = state?.secretId; resourceInputs["type"] = state?.type; } else { const args = argsOrState; if (args?.type === undefined && !opts.urn) { throw new Error("Missing required property 'type'"); } resourceInputs["expirationTtl"] = args?.expirationTtl; resourceInputs["global"] = args?.global; resourceInputs["name"] = args?.name; resourceInputs["policies"] = args?.policies; resourceInputs["roles"] = args?.roles; resourceInputs["type"] = args?.type; 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