UNPKG

@pulumi/consul

Version:

A Pulumi package for creating and managing consul resources.

147 lines (146 loc) 5.07 kB
import * as pulumi from "@pulumi/pulumi"; /** * > **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); * ``` */ export declare function getAclTokenSecretId(args: GetAclTokenSecretIdArgs, opts?: pulumi.InvokeOptions): Promise<GetAclTokenSecretIdResult>; /** * A collection of arguments for invoking getAclTokenSecretId. */ export interface GetAclTokenSecretIdArgs { /** * The accessor ID of the ACL token. */ accessorId: string; /** * The namespace to lookup the token. */ namespace?: string; /** * The partition to lookup the token. */ partition?: string; /** * Either a base-64 encoded PGP public key, or a keybase * username in the form `keybase:some_person_that_exists`. **If you do not set this * argument, the token secret ID will be written as plain text in the Terraform * state.** */ pgpKey?: string; } /** * A collection of values returned by getAclTokenSecretId. */ export interface GetAclTokenSecretIdResult { readonly accessorId: string; /** * The encrypted secret ID of the ACL token if `pgpKey` * has been set. You can decrypt the secret by using the command line, for example * with: `terraform output encryptedSecret | base64 --decode | keybase pgp decrypt`. */ readonly encryptedSecretId: string; /** * The provider-assigned unique ID for this managed resource. */ readonly id: string; readonly namespace?: string; readonly partition?: string; readonly pgpKey?: string; /** * The secret ID of the ACL token if `pgpKey` has not been set. */ readonly secretId: string; } /** * > **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); * ``` */ export declare function getAclTokenSecretIdOutput(args: GetAclTokenSecretIdOutputArgs, opts?: pulumi.InvokeOutputOptions): pulumi.Output<GetAclTokenSecretIdResult>; /** * A collection of arguments for invoking getAclTokenSecretId. */ export interface GetAclTokenSecretIdOutputArgs { /** * The accessor ID of the ACL token. */ accessorId: pulumi.Input<string>; /** * The namespace to lookup the token. */ namespace?: pulumi.Input<string>; /** * The partition to lookup the token. */ partition?: pulumi.Input<string>; /** * Either a base-64 encoded PGP public key, or a keybase * username in the form `keybase:some_person_that_exists`. **If you do not set this * argument, the token secret ID will be written as plain text in the Terraform * state.** */ pgpKey?: pulumi.Input<string>; }