@huaweicloudos/pulumi
Version:
A Pulumi package for creating and managing Huaweicloud cloud resources.
91 lines • 4.47 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.Policy = void 0;
const pulumi = require("@pulumi/pulumi");
const utilities = require("../utilities");
/**
* Manages a WAF policy 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 policy resource can be used in Cloud Mode and Dedicated Mode.
*
* ## Import
*
* There are two ways to import WAF policy state. * Using the `id`, e.g. bash
*
* ```sh
* $ pulumi import huaweicloud:Waf/policy:Policy test <id>
* ```
*
* * Using `id` and `enterprise_project_id`, separated by a slash, e.g. bash
*
* ```sh
* $ pulumi import huaweicloud:Waf/policy:Policy test <id>/<enterprise_project_id>
* ```
*/
class Policy extends pulumi.CustomResource {
/**
* Get an existing Policy 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 Policy(name, state, Object.assign(Object.assign({}, opts), { id: id }));
}
/**
* Returns true if the given object is an instance of Policy. 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'] === Policy.__pulumiType;
}
constructor(name, argsOrState, opts) {
let resourceInputs = {};
opts = opts || {};
if (opts.id) {
const state = argsOrState;
resourceInputs["bindHosts"] = state ? state.bindHosts : undefined;
resourceInputs["deepInspection"] = state ? state.deepInspection : undefined;
resourceInputs["enterpriseProjectId"] = state ? state.enterpriseProjectId : undefined;
resourceInputs["fullDetection"] = state ? state.fullDetection : undefined;
resourceInputs["headerInspection"] = state ? state.headerInspection : undefined;
resourceInputs["level"] = state ? state.level : undefined;
resourceInputs["name"] = state ? state.name : undefined;
resourceInputs["options"] = state ? state.options : undefined;
resourceInputs["protectionMode"] = state ? state.protectionMode : undefined;
resourceInputs["region"] = state ? state.region : undefined;
resourceInputs["robotAction"] = state ? state.robotAction : undefined;
resourceInputs["shiroDecryptionCheck"] = state ? state.shiroDecryptionCheck : undefined;
}
else {
const args = argsOrState;
resourceInputs["deepInspection"] = args ? args.deepInspection : undefined;
resourceInputs["enterpriseProjectId"] = args ? args.enterpriseProjectId : undefined;
resourceInputs["fullDetection"] = args ? args.fullDetection : undefined;
resourceInputs["headerInspection"] = args ? args.headerInspection : undefined;
resourceInputs["level"] = args ? args.level : undefined;
resourceInputs["name"] = args ? args.name : undefined;
resourceInputs["options"] = args ? args.options : undefined;
resourceInputs["protectionMode"] = args ? args.protectionMode : undefined;
resourceInputs["region"] = args ? args.region : undefined;
resourceInputs["robotAction"] = args ? args.robotAction : undefined;
resourceInputs["shiroDecryptionCheck"] = args ? args.shiroDecryptionCheck : undefined;
resourceInputs["bindHosts"] = undefined /*out*/;
}
opts = pulumi.mergeOptions(utilities.resourceOptsDefaults(), opts);
super(Policy.__pulumiType, name, resourceInputs, opts);
}
}
exports.Policy = Policy;
/** @internal */
Policy.__pulumiType = 'huaweicloud:Waf/policy:Policy';
//# sourceMappingURL=policy.js.map