@huaweicloudos/pulumi
Version:
A Pulumi package for creating and managing Huaweicloud cloud resources.
114 lines • 5.2 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.RuleDataMasking = void 0;
const pulumi = require("@pulumi/pulumi");
const utilities = require("../utilities");
/**
* Manages a WAF Data Masking 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 data masking 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.RuleDataMasking("test", {
* policyId: policyId,
* enterpriseProjectId: enterpriseProjectId,
* path: "/login",
* field: "params",
* subfield: "password",
* description: "test description",
* });
* ```
*
* ## Import
*
* There are two ways to import WAF rule data masking state. * Using `policy_id` and `rule_id`, separated by a slash, e.g. bash
*
* ```sh
* $ pulumi import huaweicloud:Waf/ruleDataMasking:RuleDataMasking 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/ruleDataMasking:RuleDataMasking test <policy_id>/<rule_id>/<enterprise_project_id>
* ```
*/
class RuleDataMasking extends pulumi.CustomResource {
/**
* Get an existing RuleDataMasking 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 RuleDataMasking(name, state, Object.assign(Object.assign({}, opts), { id: id }));
}
/**
* Returns true if the given object is an instance of RuleDataMasking. 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'] === RuleDataMasking.__pulumiType;
}
constructor(name, argsOrState, opts) {
let resourceInputs = {};
opts = opts || {};
if (opts.id) {
const state = argsOrState;
resourceInputs["description"] = state ? state.description : undefined;
resourceInputs["enterpriseProjectId"] = state ? state.enterpriseProjectId : undefined;
resourceInputs["field"] = state ? state.field : 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;
resourceInputs["subfield"] = state ? state.subfield : undefined;
}
else {
const args = argsOrState;
if ((!args || args.field === undefined) && !opts.urn) {
throw new Error("Missing required property 'field'");
}
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'");
}
if ((!args || args.subfield === undefined) && !opts.urn) {
throw new Error("Missing required property 'subfield'");
}
resourceInputs["description"] = args ? args.description : undefined;
resourceInputs["enterpriseProjectId"] = args ? args.enterpriseProjectId : undefined;
resourceInputs["field"] = args ? args.field : 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;
resourceInputs["subfield"] = args ? args.subfield : undefined;
}
opts = pulumi.mergeOptions(utilities.resourceOptsDefaults(), opts);
super(RuleDataMasking.__pulumiType, name, resourceInputs, opts);
}
}
exports.RuleDataMasking = RuleDataMasking;
/** @internal */
RuleDataMasking.__pulumiType = 'huaweicloud:Waf/ruleDataMasking:RuleDataMasking';
//# sourceMappingURL=ruleDataMasking.js.map