@upcloud/pulumi-upcloud
Version:
A Pulumi package for creating and managing UpCloud resources.
123 lines • 5.51 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.LoadbalancerResolver = void 0;
const pulumi = require("@pulumi/pulumi");
const utilities = require("./utilities");
/**
* This resource represents load balancer resolver.
*
* ## Example Usage
*
* ```typescript
* import * as pulumi from "@pulumi/pulumi";
* import * as upcloud from "@upcloud/pulumi-upcloud";
*
* const config = new pulumi.Config();
* const lbZone = config.get("lbZone") || "fi-hel2";
* const lbNetwork = new upcloud.Network("lb_network", {
* name: "lb-test-net",
* zone: lbZone,
* ipNetwork: {
* address: "10.0.0.0/24",
* dhcp: true,
* family: "IPv4",
* },
* });
* const lb = new upcloud.Loadbalancer("lb", {
* configuredStatus: "started",
* name: "lb-test",
* plan: "development",
* zone: lbZone,
* network: upcloudNetwork.lbNetwork.id,
* });
* const lbResolver1 = new upcloud.LoadbalancerResolver("lb_resolver_1", {
* loadbalancer: upcloudLoadbalancer.lb.id,
* name: "lb-resolver-1-test",
* cacheInvalid: 10,
* cacheValid: 100,
* retries: 5,
* timeout: 10,
* timeoutRetry: 10,
* nameservers: ["10.0.0.10:53"],
* });
* ```
*/
class LoadbalancerResolver extends pulumi.CustomResource {
/**
* Get an existing LoadbalancerResolver 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 LoadbalancerResolver(name, state, Object.assign(Object.assign({}, opts), { id: id }));
}
/**
* Returns true if the given object is an instance of LoadbalancerResolver. 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'] === LoadbalancerResolver.__pulumiType;
}
constructor(name, argsOrState, opts) {
let resourceInputs = {};
opts = opts || {};
if (opts.id) {
const state = argsOrState;
resourceInputs["cacheInvalid"] = state ? state.cacheInvalid : undefined;
resourceInputs["cacheValid"] = state ? state.cacheValid : undefined;
resourceInputs["loadbalancer"] = state ? state.loadbalancer : undefined;
resourceInputs["name"] = state ? state.name : undefined;
resourceInputs["nameservers"] = state ? state.nameservers : undefined;
resourceInputs["retries"] = state ? state.retries : undefined;
resourceInputs["timeout"] = state ? state.timeout : undefined;
resourceInputs["timeoutRetry"] = state ? state.timeoutRetry : undefined;
}
else {
const args = argsOrState;
if ((!args || args.cacheInvalid === undefined) && !opts.urn) {
throw new Error("Missing required property 'cacheInvalid'");
}
if ((!args || args.cacheValid === undefined) && !opts.urn) {
throw new Error("Missing required property 'cacheValid'");
}
if ((!args || args.loadbalancer === undefined) && !opts.urn) {
throw new Error("Missing required property 'loadbalancer'");
}
if ((!args || args.nameservers === undefined) && !opts.urn) {
throw new Error("Missing required property 'nameservers'");
}
if ((!args || args.retries === undefined) && !opts.urn) {
throw new Error("Missing required property 'retries'");
}
if ((!args || args.timeout === undefined) && !opts.urn) {
throw new Error("Missing required property 'timeout'");
}
if ((!args || args.timeoutRetry === undefined) && !opts.urn) {
throw new Error("Missing required property 'timeoutRetry'");
}
resourceInputs["cacheInvalid"] = args ? args.cacheInvalid : undefined;
resourceInputs["cacheValid"] = args ? args.cacheValid : undefined;
resourceInputs["loadbalancer"] = args ? args.loadbalancer : undefined;
resourceInputs["name"] = args ? args.name : undefined;
resourceInputs["nameservers"] = args ? args.nameservers : undefined;
resourceInputs["retries"] = args ? args.retries : undefined;
resourceInputs["timeout"] = args ? args.timeout : undefined;
resourceInputs["timeoutRetry"] = args ? args.timeoutRetry : undefined;
}
opts = pulumi.mergeOptions(utilities.resourceOptsDefaults(), opts);
super(LoadbalancerResolver.__pulumiType, name, resourceInputs, opts);
}
}
exports.LoadbalancerResolver = LoadbalancerResolver;
/** @internal */
LoadbalancerResolver.__pulumiType = 'upcloud:index/loadbalancerResolver:LoadbalancerResolver';
//# sourceMappingURL=loadbalancerResolver.js.map