@huaweicloudos/pulumi
Version:
A Pulumi package for creating and managing Huaweicloud cloud resources.
110 lines • 4.9 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.L7policy = void 0;
const pulumi = require("@pulumi/pulumi");
const utilities = require("../utilities");
/**
* Manages an ELB L7 Policy resource within HuaweiCloud.
*
* ## Example Usage
*
* ```typescript
* import * as pulumi from "@pulumi/pulumi";
* import * as pulumi from "@huaweicloudos/pulumi";
*
* const loadbalancer1 = new huaweicloud.elb.Loadbalancer("loadbalancer1", {vipSubnetId: _var.subnet_id});
* const listener1 = new huaweicloud.elb.Listener("listener1", {
* protocol: "HTTP",
* protocolPort: 8080,
* loadbalancerId: loadbalancer1.id,
* });
* const pool1 = new huaweicloud.elb.Pool("pool1", {
* protocol: "HTTP",
* lbMethod: "ROUND_ROBIN",
* loadbalancerId: loadbalancer1.id,
* });
* const l7policy1 = new huaweicloud.elb.L7policy("l7policy1", {
* action: "REDIRECT_TO_POOL",
* description: "test l7 policy",
* position: 1,
* listenerId: listener1.id,
* redirectPoolId: pool1.id,
* });
* ```
*
* ## Import
*
* Load Balancer L7 Policy can be imported using the L7 Policy ID, e.g.bash
*
* ```sh
* $ pulumi import huaweicloud:Elb/l7policy:L7policy l7policy_1 8a7a79c2-cf17-4e65-b2ae-ddc8bfcf6c74
* ```
*/
class L7policy extends pulumi.CustomResource {
/**
* Get an existing L7policy 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 L7policy(name, state, Object.assign(Object.assign({}, opts), { id: id }));
}
/**
* Returns true if the given object is an instance of L7policy. 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'] === L7policy.__pulumiType;
}
constructor(name, argsOrState, opts) {
let resourceInputs = {};
opts = opts || {};
if (opts.id) {
const state = argsOrState;
resourceInputs["action"] = state ? state.action : undefined;
resourceInputs["adminStateUp"] = state ? state.adminStateUp : undefined;
resourceInputs["description"] = state ? state.description : undefined;
resourceInputs["listenerId"] = state ? state.listenerId : undefined;
resourceInputs["name"] = state ? state.name : undefined;
resourceInputs["position"] = state ? state.position : undefined;
resourceInputs["redirectListenerId"] = state ? state.redirectListenerId : undefined;
resourceInputs["redirectPoolId"] = state ? state.redirectPoolId : undefined;
resourceInputs["region"] = state ? state.region : undefined;
resourceInputs["tenantId"] = state ? state.tenantId : undefined;
}
else {
const args = argsOrState;
if ((!args || args.action === undefined) && !opts.urn) {
throw new Error("Missing required property 'action'");
}
if ((!args || args.listenerId === undefined) && !opts.urn) {
throw new Error("Missing required property 'listenerId'");
}
resourceInputs["action"] = args ? args.action : undefined;
resourceInputs["adminStateUp"] = args ? args.adminStateUp : undefined;
resourceInputs["description"] = args ? args.description : undefined;
resourceInputs["listenerId"] = args ? args.listenerId : undefined;
resourceInputs["name"] = args ? args.name : undefined;
resourceInputs["position"] = args ? args.position : undefined;
resourceInputs["redirectListenerId"] = args ? args.redirectListenerId : undefined;
resourceInputs["redirectPoolId"] = args ? args.redirectPoolId : undefined;
resourceInputs["region"] = args ? args.region : undefined;
resourceInputs["tenantId"] = args ? args.tenantId : undefined;
}
opts = pulumi.mergeOptions(utilities.resourceOptsDefaults(), opts);
super(L7policy.__pulumiType, name, resourceInputs, opts);
}
}
exports.L7policy = L7policy;
/** @internal */
L7policy.__pulumiType = 'huaweicloud:Elb/l7policy:L7policy';
//# sourceMappingURL=l7policy.js.map