@volcengine/pulumi
Version:
A Pulumi package for creating and managing volcengine cloud resources.
182 lines • 8.27 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.CcRule = void 0;
const pulumi = require("@pulumi/pulumi");
const utilities = require("../utilities");
/**
* Provides a resource to manage waf cc rule
* ## Example Usage
*
* ```typescript
* import * as pulumi from "@pulumi/pulumi";
* import * as volcengine from "@volcengine/pulumi";
*
* const foo = new volcengine.waf.CcRule("foo", {
* accurateGroup: {
* accurateRules: [
* {
* httpObj: "request.uri",
* objType: 1,
* opretar: 2,
* property: 0,
* valueString: "tf",
* },
* {
* httpObj: "request.schema",
* objType: 0,
* opretar: 2,
* property: 0,
* valueString: "tf-2",
* },
* ],
* logic: 2,
* },
* ccType: 1,
* countTime: 102,
* cronConfs: [
* {
* crontab: "* 0 * * 1,2,3,4,5,6,0",
* pathThreshold: 123,
* singleThreshold: 234,
* },
* {
* crontab: "* 3-8 * * 1,2,3,4,5,6,0",
* pathThreshold: 345,
* singleThreshold: 456,
* },
* ],
* cronEnable: 1,
* effectTime: 200,
* enable: 1,
* exemptionTime: 0,
* field: "HEADER:User-Agemnt",
* host: "www.tf-test.com",
* pathThreshold: 101,
* rulePriority: 2,
* singleThreshold: 100,
* url: "/",
* });
* ```
*
* ## Import
*
* WafCcRule can be imported using the id, e.g.
*
* ```sh
* $ pulumi import volcengine:waf/ccRule:CcRule default resource_id:Host
* ```
*/
class CcRule extends pulumi.CustomResource {
/**
* Get an existing CcRule 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 CcRule(name, state, Object.assign(Object.assign({}, opts), { id: id }));
}
/**
* Returns true if the given object is an instance of CcRule. 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'] === CcRule.__pulumiType;
}
constructor(name, argsOrState, opts) {
let resourceInputs = {};
opts = opts || {};
if (opts.id) {
const state = argsOrState;
resourceInputs["accurateGroup"] = state ? state.accurateGroup : undefined;
resourceInputs["advancedEnable"] = state ? state.advancedEnable : undefined;
resourceInputs["ccType"] = state ? state.ccType : undefined;
resourceInputs["countTime"] = state ? state.countTime : undefined;
resourceInputs["cronConfs"] = state ? state.cronConfs : undefined;
resourceInputs["cronEnable"] = state ? state.cronEnable : undefined;
resourceInputs["effectTime"] = state ? state.effectTime : undefined;
resourceInputs["enable"] = state ? state.enable : undefined;
resourceInputs["enableCount"] = state ? state.enableCount : undefined;
resourceInputs["exemptionTime"] = state ? state.exemptionTime : undefined;
resourceInputs["field"] = state ? state.field : undefined;
resourceInputs["host"] = state ? state.host : undefined;
resourceInputs["insertTime"] = state ? state.insertTime : undefined;
resourceInputs["name"] = state ? state.name : undefined;
resourceInputs["pathThreshold"] = state ? state.pathThreshold : undefined;
resourceInputs["projectName"] = state ? state.projectName : undefined;
resourceInputs["ruleGroups"] = state ? state.ruleGroups : undefined;
resourceInputs["rulePriority"] = state ? state.rulePriority : undefined;
resourceInputs["singleThreshold"] = state ? state.singleThreshold : undefined;
resourceInputs["totalCount"] = state ? state.totalCount : undefined;
resourceInputs["url"] = state ? state.url : undefined;
}
else {
const args = argsOrState;
if ((!args || args.ccType === undefined) && !opts.urn) {
throw new Error("Missing required property 'ccType'");
}
if ((!args || args.countTime === undefined) && !opts.urn) {
throw new Error("Missing required property 'countTime'");
}
if ((!args || args.effectTime === undefined) && !opts.urn) {
throw new Error("Missing required property 'effectTime'");
}
if ((!args || args.enable === undefined) && !opts.urn) {
throw new Error("Missing required property 'enable'");
}
if ((!args || args.field === undefined) && !opts.urn) {
throw new Error("Missing required property 'field'");
}
if ((!args || args.host === undefined) && !opts.urn) {
throw new Error("Missing required property 'host'");
}
if ((!args || args.pathThreshold === undefined) && !opts.urn) {
throw new Error("Missing required property 'pathThreshold'");
}
if ((!args || args.rulePriority === undefined) && !opts.urn) {
throw new Error("Missing required property 'rulePriority'");
}
if ((!args || args.singleThreshold === undefined) && !opts.urn) {
throw new Error("Missing required property 'singleThreshold'");
}
if ((!args || args.url === undefined) && !opts.urn) {
throw new Error("Missing required property 'url'");
}
resourceInputs["accurateGroup"] = args ? args.accurateGroup : undefined;
resourceInputs["advancedEnable"] = args ? args.advancedEnable : undefined;
resourceInputs["ccType"] = args ? args.ccType : undefined;
resourceInputs["countTime"] = args ? args.countTime : undefined;
resourceInputs["cronConfs"] = args ? args.cronConfs : undefined;
resourceInputs["cronEnable"] = args ? args.cronEnable : undefined;
resourceInputs["effectTime"] = args ? args.effectTime : undefined;
resourceInputs["enable"] = args ? args.enable : undefined;
resourceInputs["exemptionTime"] = args ? args.exemptionTime : undefined;
resourceInputs["field"] = args ? args.field : undefined;
resourceInputs["host"] = args ? args.host : undefined;
resourceInputs["name"] = args ? args.name : undefined;
resourceInputs["pathThreshold"] = args ? args.pathThreshold : undefined;
resourceInputs["projectName"] = args ? args.projectName : undefined;
resourceInputs["rulePriority"] = args ? args.rulePriority : undefined;
resourceInputs["singleThreshold"] = args ? args.singleThreshold : undefined;
resourceInputs["url"] = args ? args.url : undefined;
resourceInputs["enableCount"] = undefined /*out*/;
resourceInputs["insertTime"] = undefined /*out*/;
resourceInputs["ruleGroups"] = undefined /*out*/;
resourceInputs["totalCount"] = undefined /*out*/;
}
opts = pulumi.mergeOptions(utilities.resourceOptsDefaults(), opts);
super(CcRule.__pulumiType, name, resourceInputs, opts);
}
}
exports.CcRule = CcRule;
/** @internal */
CcRule.__pulumiType = 'volcengine:waf/ccRule:CcRule';
//# sourceMappingURL=ccRule.js.map