UNPKG

@huaweicloudos/pulumi

Version:

A Pulumi package for creating and managing Huaweicloud cloud resources.

108 lines 5.05 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.RuleWebTamperProtection = void 0; const pulumi = require("@pulumi/pulumi"); const utilities = require("../utilities"); /** * Manages a WAF web tamper protection rule resource within HuaweiCloud. * * > **NOTE:** All WAF resources depend on WAF instances, and the WAF instances need to be purchased before they can be * used. The web tamper protection rule resource can be used in Cloud Mode and Dedicated Mode. * * ## Example Usage * * ```typescript * import * as pulumi from "@pulumi/pulumi"; * import * as pulumi from "@huaweicloudos/pulumi"; * * const config = new pulumi.Config(); * const enterpriseProjectId = config.requireObject("enterpriseProjectId"); * const policyId = config.requireObject("policyId"); * const test = new huaweicloud.waf.RuleWebTamperProtection("test", { * policyId: policyId, * enterpriseProjectId: enterpriseProjectId, * domain: "www.your-domain.com", * path: "/payment", * description: "test description", * }); * ``` * * ## Import * * There are two ways to import WAF rule web tamper protection state. * Using `policy_id` and `rule_id`, separated by a slash, e.g. bash * * ```sh * $ pulumi import huaweicloud:Waf/ruleWebTamperProtection:RuleWebTamperProtection test <policy_id>/<rule_id> * ``` * * * Using `policy_id`, `rule_id` and `enterprise_project_id`, separated by slashes, e.g. bash * * ```sh * $ pulumi import huaweicloud:Waf/ruleWebTamperProtection:RuleWebTamperProtection test <policy_id>/<rule_id>/<enterprise_project_id> * ``` */ class RuleWebTamperProtection extends pulumi.CustomResource { /** * Get an existing RuleWebTamperProtection 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 RuleWebTamperProtection(name, state, Object.assign(Object.assign({}, opts), { id: id })); } /** * Returns true if the given object is an instance of RuleWebTamperProtection. 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'] === RuleWebTamperProtection.__pulumiType; } constructor(name, argsOrState, opts) { let resourceInputs = {}; opts = opts || {}; if (opts.id) { const state = argsOrState; resourceInputs["description"] = state ? state.description : undefined; resourceInputs["domain"] = state ? state.domain : undefined; resourceInputs["enterpriseProjectId"] = state ? state.enterpriseProjectId : undefined; resourceInputs["path"] = state ? state.path : undefined; resourceInputs["policyId"] = state ? state.policyId : undefined; resourceInputs["region"] = state ? state.region : undefined; resourceInputs["status"] = state ? state.status : undefined; } else { const args = argsOrState; if ((!args || args.domain === undefined) && !opts.urn) { throw new Error("Missing required property 'domain'"); } if ((!args || args.path === undefined) && !opts.urn) { throw new Error("Missing required property 'path'"); } if ((!args || args.policyId === undefined) && !opts.urn) { throw new Error("Missing required property 'policyId'"); } resourceInputs["description"] = args ? args.description : undefined; resourceInputs["domain"] = args ? args.domain : undefined; resourceInputs["enterpriseProjectId"] = args ? args.enterpriseProjectId : undefined; resourceInputs["path"] = args ? args.path : undefined; resourceInputs["policyId"] = args ? args.policyId : undefined; resourceInputs["region"] = args ? args.region : undefined; resourceInputs["status"] = args ? args.status : undefined; } opts = pulumi.mergeOptions(utilities.resourceOptsDefaults(), opts); super(RuleWebTamperProtection.__pulumiType, name, resourceInputs, opts); } } exports.RuleWebTamperProtection = RuleWebTamperProtection; /** @internal */ RuleWebTamperProtection.__pulumiType = 'huaweicloud:Waf/ruleWebTamperProtection:RuleWebTamperProtection'; //# sourceMappingURL=ruleWebTamperProtection.js.map