UNPKG

@pulumi/consul

Version:

A Pulumi package for creating and managing consul resources.

147 lines (146 loc) 5.23 kB
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}); * ``` */ /** @deprecated getCatalogService has been deprecated in favor of getService */ export declare function getCatalogService(args: GetCatalogServiceArgs, opts?: pulumi.InvokeOptions): Promise<GetCatalogServiceResult>; /** * A collection of arguments for invoking getCatalogService. */ export interface GetCatalogServiceArgs { /** * 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.GetCatalogServiceQueryOption[]; /** * 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 getCatalogService. */ export interface GetCatalogServiceResult { /** * 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.GetCatalogServiceQueryOption[]; /** * 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.GetCatalogServiceService[]; /** * 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}); * ``` */ /** @deprecated getCatalogService has been deprecated in favor of getService */ export declare function getCatalogServiceOutput(args: GetCatalogServiceOutputArgs, opts?: pulumi.InvokeOutputOptions): pulumi.Output<GetCatalogServiceResult>; /** * A collection of arguments for invoking getCatalogService. */ export interface GetCatalogServiceOutputArgs { /** * 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.GetCatalogServiceQueryOptionArgs>[]>; /** * 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>; }