UNPKG

@pulumi/consul

Version:

A Pulumi package for creating and managing consul resources.

189 lines (188 loc) 5.94 kB
import * as pulumi from "@pulumi/pulumi"; import * as inputs from "./types/input"; import * as outputs from "./types/output"; /** * ## Example Usage * * ```typescript * import * as pulumi from "@pulumi/pulumi"; * import * as aws from "@pulumi/aws"; * import * as consul from "@pulumi/consul"; * * const app = consul.getKeyPrefix({ * datacenter: "nyc1", * token: "abcd", * pathPrefix: "myapp/config/", * subkeyCollection: [{ * name: "ami", * path: "app/launch_ami", * "default": "ami-1234", * }], * }); * // Start our instance with the dynamic ami value * const appInstance = new aws.index.Instance("app", {ami: app["var"]?.ami}); * ``` * * ```typescript * import * as pulumi from "@pulumi/pulumi"; * import * as aws from "@pulumi/aws"; * import * as consul from "@pulumi/consul"; * * const web = consul.getKeyPrefix({ * datacenter: "nyc1", * token: "efgh", * pathPrefix: "myapp/config/", * }); * // Start our instance with the dynamic ami value * const webInstance = new aws.index.Instance("web", {ami: web.subkeys?.["app/launch_ami"]}); * ``` */ export declare function getKeyPrefix(args: GetKeyPrefixArgs, opts?: pulumi.InvokeOptions): Promise<GetKeyPrefixResult>; /** * A collection of arguments for invoking getKeyPrefix. */ export interface GetKeyPrefixArgs { /** * The datacenter to use. This overrides the * agent's default datacenter and the datacenter in the provider setup. */ datacenter?: string; /** * The namespace to lookup the keys within. */ namespace?: string; /** * The namespace to lookup the keys within. */ partition?: string; /** * Specifies the common prefix shared by all keys * that will be read by this data source instance. In most cases, this will * end with a slash to read a "folder" of subkeys. */ pathPrefix: string; /** * Specifies a subkey in Consul to be read. Supported * values documented below. Multiple blocks supported. */ subkeyCollection?: inputs.GetKeyPrefixSubkeyCollection[]; /** * The ACL token to use. This overrides the * token that the agent provides by default. * * @deprecated The token argument has been deprecated and will be removed in a future release. Please use the token argument in the provider configuration */ token?: string; } /** * A collection of values returned by getKeyPrefix. */ export interface GetKeyPrefixResult { /** * The datacenter the keys are being read from. */ readonly datacenter: string; /** * The provider-assigned unique ID for this managed resource. */ readonly id: string; readonly namespace?: string; readonly partition?: string; /** * the common prefix shared by all keys being read. * * `var.<name>` - For each name given, the corresponding attribute * has the value of the key. */ readonly pathPrefix: string; readonly subkeyCollection?: outputs.GetKeyPrefixSubkeyCollection[]; /** * A map of the subkeys and values is set if no `subkey` * block is provided. */ readonly subkeys: { [key: string]: string; }; /** * @deprecated The token argument has been deprecated and will be removed in a future release. Please use the token argument in the provider configuration */ readonly token?: string; readonly var: { [key: string]: string; }; } /** * ## Example Usage * * ```typescript * import * as pulumi from "@pulumi/pulumi"; * import * as aws from "@pulumi/aws"; * import * as consul from "@pulumi/consul"; * * const app = consul.getKeyPrefix({ * datacenter: "nyc1", * token: "abcd", * pathPrefix: "myapp/config/", * subkeyCollection: [{ * name: "ami", * path: "app/launch_ami", * "default": "ami-1234", * }], * }); * // Start our instance with the dynamic ami value * const appInstance = new aws.index.Instance("app", {ami: app["var"]?.ami}); * ``` * * ```typescript * import * as pulumi from "@pulumi/pulumi"; * import * as aws from "@pulumi/aws"; * import * as consul from "@pulumi/consul"; * * const web = consul.getKeyPrefix({ * datacenter: "nyc1", * token: "efgh", * pathPrefix: "myapp/config/", * }); * // Start our instance with the dynamic ami value * const webInstance = new aws.index.Instance("web", {ami: web.subkeys?.["app/launch_ami"]}); * ``` */ export declare function getKeyPrefixOutput(args: GetKeyPrefixOutputArgs, opts?: pulumi.InvokeOutputOptions): pulumi.Output<GetKeyPrefixResult>; /** * A collection of arguments for invoking getKeyPrefix. */ export interface GetKeyPrefixOutputArgs { /** * The datacenter to use. This overrides the * agent's default datacenter and the datacenter in the provider setup. */ datacenter?: pulumi.Input<string>; /** * The namespace to lookup the keys within. */ namespace?: pulumi.Input<string>; /** * The namespace to lookup the keys within. */ partition?: pulumi.Input<string>; /** * Specifies the common prefix shared by all keys * that will be read by this data source instance. In most cases, this will * end with a slash to read a "folder" of subkeys. */ pathPrefix: pulumi.Input<string>; /** * Specifies a subkey in Consul to be read. Supported * values documented below. Multiple blocks supported. */ subkeyCollection?: pulumi.Input<pulumi.Input<inputs.GetKeyPrefixSubkeyCollectionArgs>[]>; /** * The ACL token to use. This overrides the * token that the agent provides by default. * * @deprecated The token argument has been deprecated and will be removed in a future release. Please use the token argument in the provider configuration */ token?: pulumi.Input<string>; }