@pulumi/consul
Version:
A Pulumi package for creating and managing consul resources.
145 lines (144 loc) • 4.95 kB
TypeScript
import * as pulumi from "@pulumi/pulumi";
import * as inputs from "./types/input";
import * as outputs from "./types/output";
/**
* `consul.Service` provides details about a specific Consul service in a
* given datacenter. The results include a list of nodes advertising the specified
* service, the node's IP address, port number, node ID, etc. By specifying a
* different datacenter in the `queryOptions` it is possible to retrieve a list of
* services from a different WAN-attached Consul datacenter.
*
* This data source is different from the `consul.getServices` (plural) data
* source, which provides a summary of the current Consul services.
*
* ## 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_consul_dc1 = consul.getService({
* name: "consul",
* 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: nodes,
* }).result});
* ```
*/
export declare function getService(args: GetServiceArgs, opts?: pulumi.InvokeOptions): Promise<GetServiceResult>;
/**
* A collection of arguments for invoking getService.
*/
export interface GetServiceArgs {
/**
* The Consul datacenter to query. Defaults to the
* same value found in `queryOptions` parameter specified below, or if that is
* empty, the `datacenter` value found in the Consul agent that this provider is
* configured to talk to.
*/
datacenter?: string;
filter?: string;
/**
* The service name to select.
*/
name: string;
/**
* See below.
*/
queryOptions?: inputs.GetServiceQueryOption[];
/**
* A single tag that can be used to filter the list of nodes
* to return based on a single matching tag..
*/
tag?: string;
}
/**
* A collection of values returned by getService.
*/
export interface GetServiceResult {
/**
* The datacenter the keys are being read from to.
*/
readonly datacenter?: string;
readonly filter?: string;
/**
* The provider-assigned unique ID for this managed resource.
*/
readonly id: string;
/**
* The name of the service
*/
readonly name: string;
readonly queryOptions?: outputs.GetServiceQueryOption[];
/**
* A list of nodes and details about each endpoint advertising a
* service. Each element in the list is a map of attributes that correspond to
* each individual node. The list of per-node attributes is detailed below.
*/
readonly services: outputs.GetServiceService[];
/**
* The name of the tag used to filter the list of nodes in `service`.
*/
readonly tag?: string;
}
/**
* `consul.Service` provides details about a specific Consul service in a
* given datacenter. The results include a list of nodes advertising the specified
* service, the node's IP address, port number, node ID, etc. By specifying a
* different datacenter in the `queryOptions` it is possible to retrieve a list of
* services from a different WAN-attached Consul datacenter.
*
* This data source is different from the `consul.getServices` (plural) data
* source, which provides a summary of the current Consul services.
*
* ## 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_consul_dc1 = consul.getService({
* name: "consul",
* 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: nodes,
* }).result});
* ```
*/
export declare function getServiceOutput(args: GetServiceOutputArgs, opts?: pulumi.InvokeOutputOptions): pulumi.Output<GetServiceResult>;
/**
* A collection of arguments for invoking getService.
*/
export interface GetServiceOutputArgs {
/**
* The Consul datacenter to query. Defaults to the
* same value found in `queryOptions` parameter specified below, or if that is
* empty, the `datacenter` value found in the Consul agent that this provider is
* configured to talk to.
*/
datacenter?: pulumi.Input<string>;
filter?: pulumi.Input<string>;
/**
* The service name to select.
*/
name: pulumi.Input<string>;
/**
* See below.
*/
queryOptions?: pulumi.Input<pulumi.Input<inputs.GetServiceQueryOptionArgs>[]>;
/**
* A single tag that can be used to filter the list of nodes
* to return based on a single matching tag..
*/
tag?: pulumi.Input<string>;
}