UNPKG

@pulumi/consul

Version:

A Pulumi package for creating and managing consul resources.

100 lines 3.92 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.getAclTokenSecretIdOutput = exports.getAclTokenSecretId = void 0; const pulumi = require("@pulumi/pulumi"); const utilities = require("./utilities"); /** * > **Warning:** When using this is resource, the ACL Token secret ID will be * written to the Terraform state. It is strongly recommended to use the `pgpKey` * attribute and to make sure the remote state has strong access controls before * using this resource. * * The `consulAclTokenSecret` data source returns the secret ID associated to * the accessor ID. This can be useful to make systems that cannot use an auth * method to interface with Consul. * * If you want to get other attributes of the Consul ACL token, please use the * [`consul.AclToken` data source](https://www.terraform.io/docs/providers/consul/d/acl_token.html). * * ## Example Usage * * ```typescript * import * as pulumi from "@pulumi/pulumi"; * import * as consul from "@pulumi/consul"; * * const test = new consul.AclPolicy("test", { * name: "test", * rules: "node \"\" { policy = \"read\" }", * datacenters: ["dc1"], * }); * const testAclToken = new consul.AclToken("test", { * description: "test", * policies: [test.name], * local: true, * }); * const read = consul.getAclTokenSecretIdOutput({ * accessorId: testAclToken.id, * pgpKey: "keybase:my_username", * }); * export const consulAclTokenSecretId = read.apply(read => read.encryptedSecretId); * ``` */ function getAclTokenSecretId(args, opts) { opts = pulumi.mergeOptions(utilities.resourceOptsDefaults(), opts || {}); return pulumi.runtime.invoke("consul:index/getAclTokenSecretId:getAclTokenSecretId", { "accessorId": args.accessorId, "namespace": args.namespace, "partition": args.partition, "pgpKey": args.pgpKey, }, opts); } exports.getAclTokenSecretId = getAclTokenSecretId; /** * > **Warning:** When using this is resource, the ACL Token secret ID will be * written to the Terraform state. It is strongly recommended to use the `pgpKey` * attribute and to make sure the remote state has strong access controls before * using this resource. * * The `consulAclTokenSecret` data source returns the secret ID associated to * the accessor ID. This can be useful to make systems that cannot use an auth * method to interface with Consul. * * If you want to get other attributes of the Consul ACL token, please use the * [`consul.AclToken` data source](https://www.terraform.io/docs/providers/consul/d/acl_token.html). * * ## Example Usage * * ```typescript * import * as pulumi from "@pulumi/pulumi"; * import * as consul from "@pulumi/consul"; * * const test = new consul.AclPolicy("test", { * name: "test", * rules: "node \"\" { policy = \"read\" }", * datacenters: ["dc1"], * }); * const testAclToken = new consul.AclToken("test", { * description: "test", * policies: [test.name], * local: true, * }); * const read = consul.getAclTokenSecretIdOutput({ * accessorId: testAclToken.id, * pgpKey: "keybase:my_username", * }); * export const consulAclTokenSecretId = read.apply(read => read.encryptedSecretId); * ``` */ function getAclTokenSecretIdOutput(args, opts) { opts = pulumi.mergeOptions(utilities.resourceOptsDefaults(), opts || {}); return pulumi.runtime.invokeOutput("consul:index/getAclTokenSecretId:getAclTokenSecretId", { "accessorId": args.accessorId, "namespace": args.namespace, "partition": args.partition, "pgpKey": args.pgpKey, }, opts); } exports.getAclTokenSecretIdOutput = getAclTokenSecretIdOutput; //# sourceMappingURL=getAclTokenSecretId.js.map