@pulumi/consul
Version:
A Pulumi package for creating and managing consul resources.
109 lines (108 loc) • 3.37 kB
TypeScript
import * as pulumi from "@pulumi/pulumi";
import * as inputs from "./types/input";
import * as outputs from "./types/output";
/**
* The `consul.getNodes` data source returns a list of Consul nodes that have
* been registered with the Consul cluster in a given datacenter. By specifying a
* different datacenter in the `queryOptions` it is possible to retrieve a list of
* nodes from a different WAN-attached Consul datacenter.
*
* ## Example Usage
*
* ```typescript
* import * as pulumi from "@pulumi/pulumi";
* import * as consul from "@pulumi/consul";
* import * as example from "@pulumi/example";
* import * as std from "@pulumi/std";
*
* const read_dc1_nodes = consul.getNodes({
* queryOptions: [{
* datacenter: "dc1",
* }],
* });
* // Set the description to a whitespace delimited list of the node names
* const app = new example.index.Resource("app", {description: std.join({
* separator: " ",
* input: std.formatlist({
* input: "%s",
* args: [nodeNames],
* }).result,
* }).result});
* ```
*/
export declare function getNodes(args?: GetNodesArgs, opts?: pulumi.InvokeOptions): Promise<GetNodesResult>;
/**
* A collection of arguments for invoking getNodes.
*/
export interface GetNodesArgs {
/**
* See below.
*/
queryOptions?: inputs.GetNodesQueryOption[];
}
/**
* A collection of values returned by getNodes.
*/
export interface GetNodesResult {
/**
* The datacenter the keys are being read from to.
*/
readonly datacenter: string;
/**
* The provider-assigned unique ID for this managed resource.
*/
readonly id: string;
/**
* A list of the Consul node IDs.
*/
readonly nodeIds: string[];
/**
* A list of the Consul node names.
*/
readonly nodeNames: string[];
/**
* A list of nodes and details about each Consul agent. The list of
* per-node attributes is detailed below.
*/
readonly nodes: outputs.GetNodesNode[];
readonly queryOptions?: outputs.GetNodesQueryOption[];
}
/**
* The `consul.getNodes` data source returns a list of Consul nodes that have
* been registered with the Consul cluster in a given datacenter. By specifying a
* different datacenter in the `queryOptions` it is possible to retrieve a list of
* nodes from a different WAN-attached Consul datacenter.
*
* ## Example Usage
*
* ```typescript
* import * as pulumi from "@pulumi/pulumi";
* import * as consul from "@pulumi/consul";
* import * as example from "@pulumi/example";
* import * as std from "@pulumi/std";
*
* const read_dc1_nodes = consul.getNodes({
* queryOptions: [{
* datacenter: "dc1",
* }],
* });
* // Set the description to a whitespace delimited list of the node names
* const app = new example.index.Resource("app", {description: std.join({
* separator: " ",
* input: std.formatlist({
* input: "%s",
* args: [nodeNames],
* }).result,
* }).result});
* ```
*/
export declare function getNodesOutput(args?: GetNodesOutputArgs, opts?: pulumi.InvokeOutputOptions): pulumi.Output<GetNodesResult>;
/**
* A collection of arguments for invoking getNodes.
*/
export interface GetNodesOutputArgs {
/**
* See below.
*/
queryOptions?: pulumi.Input<pulumi.Input<inputs.GetNodesQueryOptionArgs>[]>;
}