@pulumi/consul
Version:
A Pulumi package for creating and managing consul resources.
88 lines • 3.4 kB
JavaScript
;
// *** WARNING: this file was generated by the Pulumi Terraform Bridge (tfgen) Tool. ***
// *** Do not edit by hand unless you're certain you know what you are doing! ***
Object.defineProperty(exports, "__esModule", { value: true });
exports.getServiceOutput = exports.getService = void 0;
const pulumi = require("@pulumi/pulumi");
const utilities = require("./utilities");
/**
* `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});
* ```
*/
function getService(args, opts) {
opts = pulumi.mergeOptions(utilities.resourceOptsDefaults(), opts || {});
return pulumi.runtime.invoke("consul:index/getService:getService", {
"datacenter": args.datacenter,
"filter": args.filter,
"name": args.name,
"queryOptions": args.queryOptions,
"tag": args.tag,
}, opts);
}
exports.getService = getService;
/**
* `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});
* ```
*/
function getServiceOutput(args, opts) {
opts = pulumi.mergeOptions(utilities.resourceOptsDefaults(), opts || {});
return pulumi.runtime.invokeOutput("consul:index/getService:getService", {
"datacenter": args.datacenter,
"filter": args.filter,
"name": args.name,
"queryOptions": args.queryOptions,
"tag": args.tag,
}, opts);
}
exports.getServiceOutput = getServiceOutput;
//# sourceMappingURL=getService.js.map