UNPKG

@pulumi/consul

Version:

A Pulumi package for creating and managing consul resources.

110 lines 4.75 kB
"use strict"; // *** 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.AclToken = void 0; const pulumi = require("@pulumi/pulumi"); const utilities = require("./utilities"); /** * ## Example Usage * * ```typescript * import * as pulumi from "@pulumi/pulumi"; * import * as consul from "@pulumi/consul"; * import * as random from "@pulumi/random"; * * // Basic usage * const agent = new consul.AclPolicy("agent", { * name: "agent", * rules: `node_prefix "" { * policy = "read" * } * `, * }); * const test = new consul.AclToken("test", { * description: "my test token", * policies: [agent.name], * local: true, * }); * // Explicitly set the `accessor_id` * const testRandomUuid = new random.RandomUuid("test", {}); * const testPredefinedId = new consul.AclToken("test_predefined_id", { * accessorId: testUuid.result, * description: "my test uuid token", * policies: [agent.name], * local: true, * }); * ``` * * ## Import * * ```sh * $ pulumi import consul:index/aclToken:AclToken anonymous 00000000-0000-0000-0000-000000000002 * ``` * * ```sh * $ pulumi import consul:index/aclToken:AclToken master-token 624d94ca-bc5c-f960-4e83-0a609cf588be * ``` */ 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["description"] = state ? state.description : undefined; resourceInputs["expirationTime"] = state ? state.expirationTime : undefined; resourceInputs["local"] = state ? state.local : undefined; resourceInputs["namespace"] = state ? state.namespace : undefined; resourceInputs["nodeIdentities"] = state ? state.nodeIdentities : undefined; resourceInputs["partition"] = state ? state.partition : undefined; resourceInputs["policies"] = state ? state.policies : undefined; resourceInputs["roles"] = state ? state.roles : undefined; resourceInputs["serviceIdentities"] = state ? state.serviceIdentities : undefined; resourceInputs["templatedPolicies"] = state ? state.templatedPolicies : undefined; } else { const args = argsOrState; resourceInputs["accessorId"] = args ? args.accessorId : undefined; resourceInputs["description"] = args ? args.description : undefined; resourceInputs["expirationTime"] = args ? args.expirationTime : undefined; resourceInputs["local"] = args ? args.local : undefined; resourceInputs["namespace"] = args ? args.namespace : undefined; resourceInputs["nodeIdentities"] = args ? args.nodeIdentities : undefined; resourceInputs["partition"] = args ? args.partition : undefined; resourceInputs["policies"] = args ? args.policies : undefined; resourceInputs["roles"] = args ? args.roles : undefined; resourceInputs["serviceIdentities"] = args ? args.serviceIdentities : undefined; resourceInputs["templatedPolicies"] = args ? args.templatedPolicies : undefined; } opts = pulumi.mergeOptions(utilities.resourceOptsDefaults(), opts); super(AclToken.__pulumiType, name, resourceInputs, opts); } } exports.AclToken = AclToken; /** @internal */ AclToken.__pulumiType = 'consul:index/aclToken:AclToken'; //# sourceMappingURL=aclToken.js.map