@pulumi/consul
Version:
A Pulumi package for creating and managing consul resources.
83 lines • 4.12 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.AutopilotConfig = void 0;
const pulumi = require("@pulumi/pulumi");
const utilities = require("./utilities");
/**
* Provides access to the [Autopilot Configuration](https://www.consul.io/docs/guides/autopilot.html)
* of Consul to automatically manage Consul servers.
*
* It includes to automatically cleanup dead servers, monitor the status of the Raft
* cluster and stable server introduction.
*
* ## Example Usage
*
* ```typescript
* import * as pulumi from "@pulumi/pulumi";
* import * as consul from "@pulumi/consul";
*
* const config = new consul.AutopilotConfig("config", {
* cleanupDeadServers: false,
* lastContactThreshold: "1s",
* maxTrailingLogs: 500,
* });
* ```
*/
class AutopilotConfig extends pulumi.CustomResource {
/**
* Get an existing AutopilotConfig 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 AutopilotConfig(name, state, Object.assign(Object.assign({}, opts), { id: id }));
}
/**
* Returns true if the given object is an instance of AutopilotConfig. 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'] === AutopilotConfig.__pulumiType;
}
constructor(name, argsOrState, opts) {
let resourceInputs = {};
opts = opts || {};
if (opts.id) {
const state = argsOrState;
resourceInputs["cleanupDeadServers"] = state ? state.cleanupDeadServers : undefined;
resourceInputs["datacenter"] = state ? state.datacenter : undefined;
resourceInputs["disableUpgradeMigration"] = state ? state.disableUpgradeMigration : undefined;
resourceInputs["lastContactThreshold"] = state ? state.lastContactThreshold : undefined;
resourceInputs["maxTrailingLogs"] = state ? state.maxTrailingLogs : undefined;
resourceInputs["redundancyZoneTag"] = state ? state.redundancyZoneTag : undefined;
resourceInputs["serverStabilizationTime"] = state ? state.serverStabilizationTime : undefined;
resourceInputs["upgradeVersionTag"] = state ? state.upgradeVersionTag : undefined;
}
else {
const args = argsOrState;
resourceInputs["cleanupDeadServers"] = args ? args.cleanupDeadServers : undefined;
resourceInputs["datacenter"] = args ? args.datacenter : undefined;
resourceInputs["disableUpgradeMigration"] = args ? args.disableUpgradeMigration : undefined;
resourceInputs["lastContactThreshold"] = args ? args.lastContactThreshold : undefined;
resourceInputs["maxTrailingLogs"] = args ? args.maxTrailingLogs : undefined;
resourceInputs["redundancyZoneTag"] = args ? args.redundancyZoneTag : undefined;
resourceInputs["serverStabilizationTime"] = args ? args.serverStabilizationTime : undefined;
resourceInputs["upgradeVersionTag"] = args ? args.upgradeVersionTag : undefined;
}
opts = pulumi.mergeOptions(utilities.resourceOptsDefaults(), opts);
super(AutopilotConfig.__pulumiType, name, resourceInputs, opts);
}
}
exports.AutopilotConfig = AutopilotConfig;
/** @internal */
AutopilotConfig.__pulumiType = 'consul:index/autopilotConfig:AutopilotConfig';
//# sourceMappingURL=autopilotConfig.js.map