@pulumi/consul
Version:
A Pulumi package for creating and managing consul resources.
121 lines • 5.82 kB
JavaScript
;
// *** WARNING: this file was generated by pulumi-language-nodejs. ***
// *** Do not edit by hand unless you're certain you know what you are doing! ***
Object.defineProperty(exports, "__esModule", { value: true });
exports.ConfigEntryServiceDefaults = void 0;
const pulumi = require("@pulumi/pulumi");
const utilities = require("./utilities");
/**
* The `consul.ConfigEntryServiceDefaults` resource configures a [service defaults](https://developer.hashicorp.com/consul/docs/connect/config-entries/service-defaults) config entry that contains common configuration settings for service mesh services, such as upstreams and gateways.
*
* ## Example Usage
*
* ```typescript
* import * as pulumi from "@pulumi/pulumi";
* import * as consul from "@pulumi/consul";
*
* const dashboard = new consul.ConfigEntryServiceDefaults("dashboard", {
* name: "dashboard",
* upstreamConfigs: [{
* defaults: {
* meshGateways: {
* mode: "local",
* },
* limits: {
* maxConnections: 512,
* maxPendingRequests: 512,
* maxConcurrentRequests: 512,
* },
* },
* overrides: [{
* name: "counting",
* meshGateways: [{
* mode: "remote",
* }],
* }],
* }],
* });
* ```
*/
class ConfigEntryServiceDefaults extends pulumi.CustomResource {
/**
* Get an existing ConfigEntryServiceDefaults resource's state with the given name, ID, and optional extra
* properties used to qualify the lookup.
*
* @param name The _unique_ name of the resulting resource.
* @param id The _unique_ provider ID of the resource to lookup.
* @param state Any extra arguments used during the lookup.
* @param opts Optional settings to control the behavior of the CustomResource.
*/
static get(name, id, state, opts) {
return new ConfigEntryServiceDefaults(name, state, { ...opts, id: id });
}
/**
* Returns true if the given object is an instance of ConfigEntryServiceDefaults. This is designed to work even
* when multiple copies of the Pulumi SDK have been loaded into the same process.
*/
static isInstance(obj) {
if (obj === undefined || obj === null) {
return false;
}
return obj['__pulumiType'] === ConfigEntryServiceDefaults.__pulumiType;
}
constructor(name, argsOrState, opts) {
let resourceInputs = {};
opts = opts || {};
if (opts.id) {
const state = argsOrState;
resourceInputs["balanceInboundConnections"] = state?.balanceInboundConnections;
resourceInputs["destinations"] = state?.destinations;
resourceInputs["envoyExtensions"] = state?.envoyExtensions;
resourceInputs["exposes"] = state?.exposes;
resourceInputs["externalSni"] = state?.externalSni;
resourceInputs["localConnectTimeoutMs"] = state?.localConnectTimeoutMs;
resourceInputs["localRequestTimeoutMs"] = state?.localRequestTimeoutMs;
resourceInputs["maxInboundConnections"] = state?.maxInboundConnections;
resourceInputs["meshGateways"] = state?.meshGateways;
resourceInputs["meta"] = state?.meta;
resourceInputs["mode"] = state?.mode;
resourceInputs["mutualTlsMode"] = state?.mutualTlsMode;
resourceInputs["name"] = state?.name;
resourceInputs["namespace"] = state?.namespace;
resourceInputs["partition"] = state?.partition;
resourceInputs["protocol"] = state?.protocol;
resourceInputs["transparentProxies"] = state?.transparentProxies;
resourceInputs["upstreamConfigs"] = state?.upstreamConfigs;
}
else {
const args = argsOrState;
if (args?.exposes === undefined && !opts.urn) {
throw new Error("Missing required property 'exposes'");
}
if (args?.protocol === undefined && !opts.urn) {
throw new Error("Missing required property 'protocol'");
}
resourceInputs["balanceInboundConnections"] = args?.balanceInboundConnections;
resourceInputs["destinations"] = args?.destinations;
resourceInputs["envoyExtensions"] = args?.envoyExtensions;
resourceInputs["exposes"] = args?.exposes;
resourceInputs["externalSni"] = args?.externalSni;
resourceInputs["localConnectTimeoutMs"] = args?.localConnectTimeoutMs;
resourceInputs["localRequestTimeoutMs"] = args?.localRequestTimeoutMs;
resourceInputs["maxInboundConnections"] = args?.maxInboundConnections;
resourceInputs["meshGateways"] = args?.meshGateways;
resourceInputs["meta"] = args?.meta;
resourceInputs["mode"] = args?.mode;
resourceInputs["mutualTlsMode"] = args?.mutualTlsMode;
resourceInputs["name"] = args?.name;
resourceInputs["namespace"] = args?.namespace;
resourceInputs["partition"] = args?.partition;
resourceInputs["protocol"] = args?.protocol;
resourceInputs["transparentProxies"] = args?.transparentProxies;
resourceInputs["upstreamConfigs"] = args?.upstreamConfigs;
}
opts = pulumi.mergeOptions(utilities.resourceOptsDefaults(), opts);
super(ConfigEntryServiceDefaults.__pulumiType, name, resourceInputs, opts);
}
}
exports.ConfigEntryServiceDefaults = ConfigEntryServiceDefaults;
/** @internal */
ConfigEntryServiceDefaults.__pulumiType = 'consul:index/configEntryServiceDefaults:ConfigEntryServiceDefaults';
//# sourceMappingURL=configEntryServiceDefaults.js.map