@pulumi/consul
Version:
A Pulumi package for creating and managing consul resources.
109 lines (108 loc) • 3.65 kB
TypeScript
import * as pulumi from "@pulumi/pulumi";
import * as inputs from "./types/input";
import * as outputs from "./types/output";
/**
* The `consul.getServices` data source returns a list of Consul services 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 services from a different WAN-attached Consul datacenter.
*
* This data source is different from the `consul.Service` (singular) data
* source, which provides a detailed response about a specific Consul service.
*
* ## 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 = consul.getServices({
* queryOptions: [{
* datacenter: "dc1",
* }],
* });
* // Set the description to a whitespace delimited list of the services
* const app = new example.index.Resource("app", {description: std.join({
* separator: " ",
* input: names,
* }).result});
* ```
*/
export declare function getServices(args?: GetServicesArgs, opts?: pulumi.InvokeOptions): Promise<GetServicesResult>;
/**
* A collection of arguments for invoking getServices.
*/
export interface GetServicesArgs {
/**
* See below.
*/
queryOptions?: inputs.GetServicesQueryOption[];
}
/**
* A collection of values returned by getServices.
*/
export interface GetServicesResult {
/**
* The datacenter the keys are being read from to.
*/
readonly datacenter: string;
/**
* The provider-assigned unique ID for this managed resource.
*/
readonly id: string;
readonly names: string[];
readonly queryOptions?: outputs.GetServicesQueryOption[];
readonly services: {
[key: string]: string;
};
/**
* A map of the tags found for each service. If more than one service
* shares the same tag, unique service names will be joined by whitespace (this
* is the inverse of `services` and can be used to lookup the services that match
* a single tag).
*/
readonly tags: {
[key: string]: string;
};
}
/**
* The `consul.getServices` data source returns a list of Consul services 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 services from a different WAN-attached Consul datacenter.
*
* This data source is different from the `consul.Service` (singular) data
* source, which provides a detailed response about a specific Consul service.
*
* ## 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 = consul.getServices({
* queryOptions: [{
* datacenter: "dc1",
* }],
* });
* // Set the description to a whitespace delimited list of the services
* const app = new example.index.Resource("app", {description: std.join({
* separator: " ",
* input: names,
* }).result});
* ```
*/
export declare function getServicesOutput(args?: GetServicesOutputArgs, opts?: pulumi.InvokeOutputOptions): pulumi.Output<GetServicesResult>;
/**
* A collection of arguments for invoking getServices.
*/
export interface GetServicesOutputArgs {
/**
* See below.
*/
queryOptions?: pulumi.Input<pulumi.Input<inputs.GetServicesQueryOptionArgs>[]>;
}