UNPKG

@huaweicloudos/pulumi

Version:

A Pulumi package for creating and managing Huaweicloud cloud resources.

94 lines 4.68 kB
"use strict"; // *** 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.ForwardRule = void 0; const pulumi = require("@pulumi/pulumi"); const utilities = require("../utilities"); /** * Manages a forward rule resource of Advanced Anti-DDos service within HuaweiCloud. * * ## Import * * Rule can be imported using the `id` (combination of `instance_id`, `ip`, `forward_protocol` and `forward_port`), separated by slashes (/), e.g. bash * * ```sh * $ pulumi import huaweicloud:AdvancedAntiDDos/forwardRule:ForwardRule test <instance_id>/<ip>/<forward_protocol>/<forward_port> * ``` */ class ForwardRule extends pulumi.CustomResource { /** * Get an existing ForwardRule 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 ForwardRule(name, state, Object.assign(Object.assign({}, opts), { id: id })); } /** * Returns true if the given object is an instance of ForwardRule. 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'] === ForwardRule.__pulumiType; } constructor(name, argsOrState, opts) { let resourceInputs = {}; opts = opts || {}; if (opts.id) { const state = argsOrState; resourceInputs["forwardPort"] = state ? state.forwardPort : undefined; resourceInputs["forwardProtocol"] = state ? state.forwardProtocol : undefined; resourceInputs["instanceId"] = state ? state.instanceId : undefined; resourceInputs["ip"] = state ? state.ip : undefined; resourceInputs["lbMethod"] = state ? state.lbMethod : undefined; resourceInputs["ruleId"] = state ? state.ruleId : undefined; resourceInputs["sourceIp"] = state ? state.sourceIp : undefined; resourceInputs["sourcePort"] = state ? state.sourcePort : undefined; resourceInputs["status"] = state ? state.status : undefined; } else { const args = argsOrState; if ((!args || args.forwardPort === undefined) && !opts.urn) { throw new Error("Missing required property 'forwardPort'"); } if ((!args || args.forwardProtocol === undefined) && !opts.urn) { throw new Error("Missing required property 'forwardProtocol'"); } if ((!args || args.instanceId === undefined) && !opts.urn) { throw new Error("Missing required property 'instanceId'"); } if ((!args || args.ip === undefined) && !opts.urn) { throw new Error("Missing required property 'ip'"); } if ((!args || args.sourceIp === undefined) && !opts.urn) { throw new Error("Missing required property 'sourceIp'"); } if ((!args || args.sourcePort === undefined) && !opts.urn) { throw new Error("Missing required property 'sourcePort'"); } resourceInputs["forwardPort"] = args ? args.forwardPort : undefined; resourceInputs["forwardProtocol"] = args ? args.forwardProtocol : undefined; resourceInputs["instanceId"] = args ? args.instanceId : undefined; resourceInputs["ip"] = args ? args.ip : undefined; resourceInputs["sourceIp"] = args ? args.sourceIp : undefined; resourceInputs["sourcePort"] = args ? args.sourcePort : undefined; resourceInputs["lbMethod"] = undefined /*out*/; resourceInputs["ruleId"] = undefined /*out*/; resourceInputs["status"] = undefined /*out*/; } opts = pulumi.mergeOptions(utilities.resourceOptsDefaults(), opts); super(ForwardRule.__pulumiType, name, resourceInputs, opts); } } exports.ForwardRule = ForwardRule; /** @internal */ ForwardRule.__pulumiType = 'huaweicloud:AdvancedAntiDDos/forwardRule:ForwardRule'; //# sourceMappingURL=forwardRule.js.map