@pulumi/openstack
Version:
A Pulumi package for creating and managing OpenStack cloud resources.
102 lines • 5.26 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.LoadBalancer = void 0;
const pulumi = require("@pulumi/pulumi");
const utilities = require("../utilities");
/**
* Manages a V2 loadbalancer resource within OpenStack.
*
* > **Note:** This resource has attributes that depend on octavia minor versions.
* Please ensure your Openstack cloud supports the required minor version.
*
* ## Example Usage
*
* ```typescript
* import * as pulumi from "@pulumi/pulumi";
* import * as openstack from "@pulumi/openstack";
*
* const lb1 = new openstack.loadbalancer.LoadBalancer("lb_1", {vipSubnetId: "d9415786-5f1a-428b-b35f-2f1523e146d2"});
* ```
*
* ## Import
*
* Load Balancer can be imported using the Load Balancer ID, e.g.:
*
* ```sh
* $ pulumi import openstack:loadbalancer/loadBalancer:LoadBalancer loadbalancer_1 19bcfdc7-c521-4a7e-9459-6750bd16df76
* ```
*/
class LoadBalancer extends pulumi.CustomResource {
/**
* Get an existing LoadBalancer 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 LoadBalancer(name, state, Object.assign(Object.assign({}, opts), { id: id }));
}
/**
* Returns true if the given object is an instance of LoadBalancer. 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'] === LoadBalancer.__pulumiType;
}
constructor(name, argsOrState, opts) {
let resourceInputs = {};
opts = opts || {};
if (opts.id) {
const state = argsOrState;
resourceInputs["adminStateUp"] = state ? state.adminStateUp : undefined;
resourceInputs["availabilityZone"] = state ? state.availabilityZone : undefined;
resourceInputs["description"] = state ? state.description : undefined;
resourceInputs["flavorId"] = state ? state.flavorId : undefined;
resourceInputs["loadbalancerProvider"] = state ? state.loadbalancerProvider : undefined;
resourceInputs["name"] = state ? state.name : undefined;
resourceInputs["region"] = state ? state.region : undefined;
resourceInputs["securityGroupIds"] = state ? state.securityGroupIds : undefined;
resourceInputs["tags"] = state ? state.tags : undefined;
resourceInputs["tenantId"] = state ? state.tenantId : undefined;
resourceInputs["vipAddress"] = state ? state.vipAddress : undefined;
resourceInputs["vipNetworkId"] = state ? state.vipNetworkId : undefined;
resourceInputs["vipPortId"] = state ? state.vipPortId : undefined;
resourceInputs["vipQosPolicyId"] = state ? state.vipQosPolicyId : undefined;
resourceInputs["vipSubnetId"] = state ? state.vipSubnetId : undefined;
}
else {
const args = argsOrState;
resourceInputs["adminStateUp"] = args ? args.adminStateUp : undefined;
resourceInputs["availabilityZone"] = args ? args.availabilityZone : undefined;
resourceInputs["description"] = args ? args.description : undefined;
resourceInputs["flavorId"] = args ? args.flavorId : undefined;
resourceInputs["loadbalancerProvider"] = args ? args.loadbalancerProvider : undefined;
resourceInputs["name"] = args ? args.name : undefined;
resourceInputs["region"] = args ? args.region : undefined;
resourceInputs["securityGroupIds"] = args ? args.securityGroupIds : undefined;
resourceInputs["tags"] = args ? args.tags : undefined;
resourceInputs["tenantId"] = args ? args.tenantId : undefined;
resourceInputs["vipAddress"] = args ? args.vipAddress : undefined;
resourceInputs["vipNetworkId"] = args ? args.vipNetworkId : undefined;
resourceInputs["vipPortId"] = args ? args.vipPortId : undefined;
resourceInputs["vipQosPolicyId"] = args ? args.vipQosPolicyId : undefined;
resourceInputs["vipSubnetId"] = args ? args.vipSubnetId : undefined;
}
opts = pulumi.mergeOptions(utilities.resourceOptsDefaults(), opts);
const aliasOpts = { aliases: [{ type: "openstack:index/lbLoadbalancerV2:LbLoadbalancerV2" }] };
opts = pulumi.mergeOptions(opts, aliasOpts);
super(LoadBalancer.__pulumiType, name, resourceInputs, opts);
}
}
exports.LoadBalancer = LoadBalancer;
/** @internal */
LoadBalancer.__pulumiType = 'openstack:loadbalancer/loadBalancer:LoadBalancer';
//# sourceMappingURL=loadBalancer.js.map