alicloud.dcdn.WafRule
Explore with Pulumi AI
Provides a Dcdn Waf Rule resource.
For information about Dcdn Waf Rule and how to use it, see What is Waf Rule.
NOTE: Available since v1.201.0.
Example Usage
Basic Usage
using System.Collections.Generic;
using System.Linq;
using Pulumi;
using AliCloud = Pulumi.AliCloud;
return await Deployment.RunAsync(() =>
{
var config = new Config();
var name = config.Get("name") ?? "tf_example";
var exampleWafPolicy = new AliCloud.Dcdn.WafPolicy("exampleWafPolicy", new()
{
DefenseScene = "waf_group",
PolicyName = name,
PolicyType = "custom",
Status = "on",
});
var exampleWafRule = new AliCloud.Dcdn.WafRule("exampleWafRule", new()
{
PolicyId = exampleWafPolicy.Id,
RuleName = name,
Conditions = new[]
{
new AliCloud.Dcdn.Inputs.WafRuleConditionArgs
{
Key = "URI",
OpValue = "ne",
Values = "/login.php",
},
new AliCloud.Dcdn.Inputs.WafRuleConditionArgs
{
Key = "Header",
SubKey = "a",
OpValue = "eq",
Values = "b",
},
},
Status = "on",
CcStatus = "on",
Action = "monitor",
Effect = "rule",
RateLimit = new AliCloud.Dcdn.Inputs.WafRuleRateLimitArgs
{
Target = "IP",
Interval = 5,
Threshold = 5,
Ttl = 1800,
Status = new AliCloud.Dcdn.Inputs.WafRuleRateLimitStatusArgs
{
Code = "200",
Ratio = 60,
},
},
});
});
package main
import (
"github.com/pulumi/pulumi-alicloud/sdk/v3/go/alicloud/dcdn"
"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
"github.com/pulumi/pulumi/sdk/v3/go/pulumi/config"
)
func main() {
pulumi.Run(func(ctx *pulumi.Context) error {
cfg := config.New(ctx, "")
name := "tf_example"
if param := cfg.Get("name"); param != "" {
name = param
}
exampleWafPolicy, err := dcdn.NewWafPolicy(ctx, "exampleWafPolicy", &dcdn.WafPolicyArgs{
DefenseScene: pulumi.String("waf_group"),
PolicyName: pulumi.String(name),
PolicyType: pulumi.String("custom"),
Status: pulumi.String("on"),
})
if err != nil {
return err
}
_, err = dcdn.NewWafRule(ctx, "exampleWafRule", &dcdn.WafRuleArgs{
PolicyId: exampleWafPolicy.ID(),
RuleName: pulumi.String(name),
Conditions: dcdn.WafRuleConditionArray{
&dcdn.WafRuleConditionArgs{
Key: pulumi.String("URI"),
OpValue: pulumi.String("ne"),
Values: pulumi.String("/login.php"),
},
&dcdn.WafRuleConditionArgs{
Key: pulumi.String("Header"),
SubKey: pulumi.String("a"),
OpValue: pulumi.String("eq"),
Values: pulumi.String("b"),
},
},
Status: pulumi.String("on"),
CcStatus: pulumi.String("on"),
Action: pulumi.String("monitor"),
Effect: pulumi.String("rule"),
RateLimit: &dcdn.WafRuleRateLimitArgs{
Target: pulumi.String("IP"),
Interval: pulumi.Int(5),
Threshold: pulumi.Int(5),
Ttl: pulumi.Int(1800),
Status: &dcdn.WafRuleRateLimitStatusArgs{
Code: pulumi.String("200"),
Ratio: pulumi.Int(60),
},
},
})
if err != nil {
return err
}
return nil
})
}
package generated_program;
import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.alicloud.dcdn.WafPolicy;
import com.pulumi.alicloud.dcdn.WafPolicyArgs;
import com.pulumi.alicloud.dcdn.WafRule;
import com.pulumi.alicloud.dcdn.WafRuleArgs;
import com.pulumi.alicloud.dcdn.inputs.WafRuleConditionArgs;
import com.pulumi.alicloud.dcdn.inputs.WafRuleRateLimitArgs;
import com.pulumi.alicloud.dcdn.inputs.WafRuleRateLimitStatusArgs;
import java.util.List;
import java.util.ArrayList;
import java.util.Map;
import java.io.File;
import java.nio.file.Files;
import java.nio.file.Paths;
public class App {
public static void main(String[] args) {
Pulumi.run(App::stack);
}
public static void stack(Context ctx) {
final var config = ctx.config();
final var name = config.get("name").orElse("tf_example");
var exampleWafPolicy = new WafPolicy("exampleWafPolicy", WafPolicyArgs.builder()
.defenseScene("waf_group")
.policyName(name)
.policyType("custom")
.status("on")
.build());
var exampleWafRule = new WafRule("exampleWafRule", WafRuleArgs.builder()
.policyId(exampleWafPolicy.id())
.ruleName(name)
.conditions(
WafRuleConditionArgs.builder()
.key("URI")
.opValue("ne")
.values("/login.php")
.build(),
WafRuleConditionArgs.builder()
.key("Header")
.subKey("a")
.opValue("eq")
.values("b")
.build())
.status("on")
.ccStatus("on")
.action("monitor")
.effect("rule")
.rateLimit(WafRuleRateLimitArgs.builder()
.target("IP")
.interval("5")
.threshold("5")
.ttl("1800")
.status(WafRuleRateLimitStatusArgs.builder()
.code("200")
.ratio("60")
.build())
.build())
.build());
}
}
import pulumi
import pulumi_alicloud as alicloud
config = pulumi.Config()
name = config.get("name")
if name is None:
name = "tf_example"
example_waf_policy = alicloud.dcdn.WafPolicy("exampleWafPolicy",
defense_scene="waf_group",
policy_name=name,
policy_type="custom",
status="on")
example_waf_rule = alicloud.dcdn.WafRule("exampleWafRule",
policy_id=example_waf_policy.id,
rule_name=name,
conditions=[
alicloud.dcdn.WafRuleConditionArgs(
key="URI",
op_value="ne",
values="/login.php",
),
alicloud.dcdn.WafRuleConditionArgs(
key="Header",
sub_key="a",
op_value="eq",
values="b",
),
],
status="on",
cc_status="on",
action="monitor",
effect="rule",
rate_limit=alicloud.dcdn.WafRuleRateLimitArgs(
target="IP",
interval=5,
threshold=5,
ttl=1800,
status=alicloud.dcdn.WafRuleRateLimitStatusArgs(
code="200",
ratio=60,
),
))
import * as pulumi from "@pulumi/pulumi";
import * as alicloud from "@pulumi/alicloud";
const config = new pulumi.Config();
const name = config.get("name") || "tf_example";
const exampleWafPolicy = new alicloud.dcdn.WafPolicy("exampleWafPolicy", {
defenseScene: "waf_group",
policyName: name,
policyType: "custom",
status: "on",
});
const exampleWafRule = new alicloud.dcdn.WafRule("exampleWafRule", {
policyId: exampleWafPolicy.id,
ruleName: name,
conditions: [
{
key: "URI",
opValue: "ne",
values: "/login.php",
},
{
key: "Header",
subKey: "a",
opValue: "eq",
values: "b",
},
],
status: "on",
ccStatus: "on",
action: "monitor",
effect: "rule",
rateLimit: {
target: "IP",
interval: 5,
threshold: 5,
ttl: 1800,
status: {
code: "200",
ratio: 60,
},
},
});
configuration:
name:
type: string
default: tf_example
resources:
exampleWafPolicy:
type: alicloud:dcdn:WafPolicy
properties:
defenseScene: waf_group
policyName: ${name}
policyType: custom
status: on
exampleWafRule:
type: alicloud:dcdn:WafRule
properties:
policyId: ${exampleWafPolicy.id}
ruleName: ${name}
conditions:
- key: URI
opValue: ne
values: /login.php
- key: Header
subKey: a
opValue: eq
values: b
status: on
ccStatus: on
action: monitor
effect: rule
rateLimit:
target: IP
interval: '5'
threshold: '5'
ttl: '1800'
status:
code: '200'
ratio: '60'
Create WafRule Resource
new WafRule(name: string, args: WafRuleArgs, opts?: CustomResourceOptions);
@overload
def WafRule(resource_name: str,
opts: Optional[ResourceOptions] = None,
action: Optional[str] = None,
cc_status: Optional[str] = None,
cn_region_list: Optional[str] = None,
conditions: Optional[Sequence[WafRuleConditionArgs]] = None,
effect: Optional[str] = None,
other_region_list: Optional[str] = None,
policy_id: Optional[str] = None,
rate_limit: Optional[WafRuleRateLimitArgs] = None,
regular_rules: Optional[Sequence[str]] = None,
regular_types: Optional[Sequence[str]] = None,
remote_addrs: Optional[Sequence[str]] = None,
rule_name: Optional[str] = None,
scenes: Optional[Sequence[str]] = None,
status: Optional[str] = None,
waf_group_ids: Optional[str] = None)
@overload
def WafRule(resource_name: str,
args: WafRuleArgs,
opts: Optional[ResourceOptions] = None)
func NewWafRule(ctx *Context, name string, args WafRuleArgs, opts ...ResourceOption) (*WafRule, error)
public WafRule(string name, WafRuleArgs args, CustomResourceOptions? opts = null)
public WafRule(String name, WafRuleArgs args)
public WafRule(String name, WafRuleArgs args, CustomResourceOptions options)
type: alicloud:dcdn:WafRule
properties: # The arguments to resource properties.
options: # Bag of options to control resource's behavior.
- name string
- The unique name of the resource.
- args WafRuleArgs
- The arguments to resource properties.
- opts CustomResourceOptions
- Bag of options to control resource's behavior.
- resource_name str
- The unique name of the resource.
- args WafRuleArgs
- The arguments to resource properties.
- opts ResourceOptions
- Bag of options to control resource's behavior.
- ctx Context
- Context object for the current deployment.
- name string
- The unique name of the resource.
- args WafRuleArgs
- The arguments to resource properties.
- opts ResourceOption
- Bag of options to control resource's behavior.
- name string
- The unique name of the resource.
- args WafRuleArgs
- The arguments to resource properties.
- opts CustomResourceOptions
- Bag of options to control resource's behavior.
- name String
- The unique name of the resource.
- args WafRuleArgs
- The arguments to resource properties.
- options CustomResourceOptions
- Bag of options to control resource's behavior.
WafRule Resource Properties
To learn more about resource properties and how to use them, see Inputs and Outputs in the Architecture and Concepts docs.
Inputs
The WafRule resource accepts the following input properties:
- Policy
Id string The protection policy ID.
- Rule
Name string The name of the protection rule. The name can be up to 64 characters in length and can contain letters, digits, and underscores (_). NOTE: This parameter cannot be modified when policy is of type
region_block
.- Action string
Specifies the action of the rule. Valid values:
block
,monitor
,js
.- Cc
Status string Specifies whether to enable rate limiting. Valid values:
on
andoff
. NOTE: This parameter is required when policy is of typecustom_acl
.- Cn
Region stringList The blocked regions in the Chinese mainland, separated by commas (,).
- Conditions
List<Pulumi.
Ali Cloud. Dcdn. Inputs. Waf Rule Condition> Conditions that trigger the rule. See
conditions
below. NOTE: This parameter is required when policy is of typecustom_acl
orwhitelist
.- Effect string
The effective scope of the rate limiting blacklist. If you set ccStatus to on, you must configure this parameter. Valid values:
rule
(takes effect for the current rule) andservice
(takes effect globally).- Other
Region stringList Blocked regions outside the Chinese mainland, separated by commas (,).
- Rate
Limit Pulumi.Ali Cloud. Dcdn. Inputs. Waf Rule Rate Limit The rules of rate limiting. If you set
cc_status
to on, you must configure this parameter. Seerate_limit
below.- Regular
Rules List<string> The regular expression.e, when waf_group appears in tags, this value can be filled in, and only one list of six digits in string format can appear with regultypes.
- Regular
Types List<string> Regular rule type, when waf_group appears in tags, this value can be filled in, optional values:["sqli", "xss", "code_exec", "crlf", "lfileii", "rfileii", "webshell", "vvip", "other"]
- Remote
Addrs List<string> Filter by IP address.
- Scenes List<string>
The types of the protection policies.
- Status string
The status of the waf rule. Valid values:
on
andoff
. Default value: on.- Waf
Group stringIds The id of the waf rule group. The default value is "1012". Multiple rules are separated by commas.
- Policy
Id string The protection policy ID.
- Rule
Name string The name of the protection rule. The name can be up to 64 characters in length and can contain letters, digits, and underscores (_). NOTE: This parameter cannot be modified when policy is of type
region_block
.- Action string
Specifies the action of the rule. Valid values:
block
,monitor
,js
.- Cc
Status string Specifies whether to enable rate limiting. Valid values:
on
andoff
. NOTE: This parameter is required when policy is of typecustom_acl
.- Cn
Region stringList The blocked regions in the Chinese mainland, separated by commas (,).
- Conditions
[]Waf
Rule Condition Args Conditions that trigger the rule. See
conditions
below. NOTE: This parameter is required when policy is of typecustom_acl
orwhitelist
.- Effect string
The effective scope of the rate limiting blacklist. If you set ccStatus to on, you must configure this parameter. Valid values:
rule
(takes effect for the current rule) andservice
(takes effect globally).- Other
Region stringList Blocked regions outside the Chinese mainland, separated by commas (,).
- Rate
Limit WafRule Rate Limit Args The rules of rate limiting. If you set
cc_status
to on, you must configure this parameter. Seerate_limit
below.- Regular
Rules []string The regular expression.e, when waf_group appears in tags, this value can be filled in, and only one list of six digits in string format can appear with regultypes.
- Regular
Types []string Regular rule type, when waf_group appears in tags, this value can be filled in, optional values:["sqli", "xss", "code_exec", "crlf", "lfileii", "rfileii", "webshell", "vvip", "other"]
- Remote
Addrs []string Filter by IP address.
- Scenes []string
The types of the protection policies.
- Status string
The status of the waf rule. Valid values:
on
andoff
. Default value: on.- Waf
Group stringIds The id of the waf rule group. The default value is "1012". Multiple rules are separated by commas.
- policy
Id String The protection policy ID.
- rule
Name String The name of the protection rule. The name can be up to 64 characters in length and can contain letters, digits, and underscores (_). NOTE: This parameter cannot be modified when policy is of type
region_block
.- action String
Specifies the action of the rule. Valid values:
block
,monitor
,js
.- cc
Status String Specifies whether to enable rate limiting. Valid values:
on
andoff
. NOTE: This parameter is required when policy is of typecustom_acl
.- cn
Region StringList The blocked regions in the Chinese mainland, separated by commas (,).
- conditions
List<Waf
Rule Condition> Conditions that trigger the rule. See
conditions
below. NOTE: This parameter is required when policy is of typecustom_acl
orwhitelist
.- effect String
The effective scope of the rate limiting blacklist. If you set ccStatus to on, you must configure this parameter. Valid values:
rule
(takes effect for the current rule) andservice
(takes effect globally).- other
Region StringList Blocked regions outside the Chinese mainland, separated by commas (,).
- rate
Limit WafRule Rate Limit The rules of rate limiting. If you set
cc_status
to on, you must configure this parameter. Seerate_limit
below.- regular
Rules List<String> The regular expression.e, when waf_group appears in tags, this value can be filled in, and only one list of six digits in string format can appear with regultypes.
- regular
Types List<String> Regular rule type, when waf_group appears in tags, this value can be filled in, optional values:["sqli", "xss", "code_exec", "crlf", "lfileii", "rfileii", "webshell", "vvip", "other"]
- remote
Addrs List<String> Filter by IP address.
- scenes List<String>
The types of the protection policies.
- status String
The status of the waf rule. Valid values:
on
andoff
. Default value: on.- waf
Group StringIds The id of the waf rule group. The default value is "1012". Multiple rules are separated by commas.
- policy
Id string The protection policy ID.
- rule
Name string The name of the protection rule. The name can be up to 64 characters in length and can contain letters, digits, and underscores (_). NOTE: This parameter cannot be modified when policy is of type
region_block
.- action string
Specifies the action of the rule. Valid values:
block
,monitor
,js
.- cc
Status string Specifies whether to enable rate limiting. Valid values:
on
andoff
. NOTE: This parameter is required when policy is of typecustom_acl
.- cn
Region stringList The blocked regions in the Chinese mainland, separated by commas (,).
- conditions
Waf
Rule Condition[] Conditions that trigger the rule. See
conditions
below. NOTE: This parameter is required when policy is of typecustom_acl
orwhitelist
.- effect string
The effective scope of the rate limiting blacklist. If you set ccStatus to on, you must configure this parameter. Valid values:
rule
(takes effect for the current rule) andservice
(takes effect globally).- other
Region stringList Blocked regions outside the Chinese mainland, separated by commas (,).
- rate
Limit WafRule Rate Limit The rules of rate limiting. If you set
cc_status
to on, you must configure this parameter. Seerate_limit
below.- regular
Rules string[] The regular expression.e, when waf_group appears in tags, this value can be filled in, and only one list of six digits in string format can appear with regultypes.
- regular
Types string[] Regular rule type, when waf_group appears in tags, this value can be filled in, optional values:["sqli", "xss", "code_exec", "crlf", "lfileii", "rfileii", "webshell", "vvip", "other"]
- remote
Addrs string[] Filter by IP address.
- scenes string[]
The types of the protection policies.
- status string
The status of the waf rule. Valid values:
on
andoff
. Default value: on.- waf
Group stringIds The id of the waf rule group. The default value is "1012". Multiple rules are separated by commas.
- policy_
id str The protection policy ID.
- rule_
name str The name of the protection rule. The name can be up to 64 characters in length and can contain letters, digits, and underscores (_). NOTE: This parameter cannot be modified when policy is of type
region_block
.- action str
Specifies the action of the rule. Valid values:
block
,monitor
,js
.- cc_
status str Specifies whether to enable rate limiting. Valid values:
on
andoff
. NOTE: This parameter is required when policy is of typecustom_acl
.- cn_
region_ strlist The blocked regions in the Chinese mainland, separated by commas (,).
- conditions
Sequence[Waf
Rule Condition Args] Conditions that trigger the rule. See
conditions
below. NOTE: This parameter is required when policy is of typecustom_acl
orwhitelist
.- effect str
The effective scope of the rate limiting blacklist. If you set ccStatus to on, you must configure this parameter. Valid values:
rule
(takes effect for the current rule) andservice
(takes effect globally).- other_
region_ strlist Blocked regions outside the Chinese mainland, separated by commas (,).
- rate_
limit WafRule Rate Limit Args The rules of rate limiting. If you set
cc_status
to on, you must configure this parameter. Seerate_limit
below.- regular_
rules Sequence[str] The regular expression.e, when waf_group appears in tags, this value can be filled in, and only one list of six digits in string format can appear with regultypes.
- regular_
types Sequence[str] Regular rule type, when waf_group appears in tags, this value can be filled in, optional values:["sqli", "xss", "code_exec", "crlf", "lfileii", "rfileii", "webshell", "vvip", "other"]
- remote_
addrs Sequence[str] Filter by IP address.
- scenes Sequence[str]
The types of the protection policies.
- status str
The status of the waf rule. Valid values:
on
andoff
. Default value: on.- waf_
group_ strids The id of the waf rule group. The default value is "1012". Multiple rules are separated by commas.
- policy
Id String The protection policy ID.
- rule
Name String The name of the protection rule. The name can be up to 64 characters in length and can contain letters, digits, and underscores (_). NOTE: This parameter cannot be modified when policy is of type
region_block
.- action String
Specifies the action of the rule. Valid values:
block
,monitor
,js
.- cc
Status String Specifies whether to enable rate limiting. Valid values:
on
andoff
. NOTE: This parameter is required when policy is of typecustom_acl
.- cn
Region StringList The blocked regions in the Chinese mainland, separated by commas (,).
- conditions List<Property Map>
Conditions that trigger the rule. See
conditions
below. NOTE: This parameter is required when policy is of typecustom_acl
orwhitelist
.- effect String
The effective scope of the rate limiting blacklist. If you set ccStatus to on, you must configure this parameter. Valid values:
rule
(takes effect for the current rule) andservice
(takes effect globally).- other
Region StringList Blocked regions outside the Chinese mainland, separated by commas (,).
- rate
Limit Property Map The rules of rate limiting. If you set
cc_status
to on, you must configure this parameter. Seerate_limit
below.- regular
Rules List<String> The regular expression.e, when waf_group appears in tags, this value can be filled in, and only one list of six digits in string format can appear with regultypes.
- regular
Types List<String> Regular rule type, when waf_group appears in tags, this value can be filled in, optional values:["sqli", "xss", "code_exec", "crlf", "lfileii", "rfileii", "webshell", "vvip", "other"]
- remote
Addrs List<String> Filter by IP address.
- scenes List<String>
The types of the protection policies.
- status String
The status of the waf rule. Valid values:
on
andoff
. Default value: on.- waf
Group StringIds The id of the waf rule group. The default value is "1012". Multiple rules are separated by commas.
Outputs
All input properties are implicitly available as output properties. Additionally, the WafRule resource produces the following output properties:
- Defense
Scene string The type of protection policy. The following scenarios are supported:-waf_group:Web basic protection-custom_acl: Custom protection policy-whitelist: whitelist
- Gmt
Modified string Revised the time. The date format is based on ISO8601 notation and uses UTC +0 time in the format of yyyy-MM-ddTHH:mm:ssZ.
- Id string
The provider-assigned unique ID for this managed resource.
- Defense
Scene string The type of protection policy. The following scenarios are supported:-waf_group:Web basic protection-custom_acl: Custom protection policy-whitelist: whitelist
- Gmt
Modified string Revised the time. The date format is based on ISO8601 notation and uses UTC +0 time in the format of yyyy-MM-ddTHH:mm:ssZ.
- Id string
The provider-assigned unique ID for this managed resource.
- defense
Scene String The type of protection policy. The following scenarios are supported:-waf_group:Web basic protection-custom_acl: Custom protection policy-whitelist: whitelist
- gmt
Modified String Revised the time. The date format is based on ISO8601 notation and uses UTC +0 time in the format of yyyy-MM-ddTHH:mm:ssZ.
- id String
The provider-assigned unique ID for this managed resource.
- defense
Scene string The type of protection policy. The following scenarios are supported:-waf_group:Web basic protection-custom_acl: Custom protection policy-whitelist: whitelist
- gmt
Modified string Revised the time. The date format is based on ISO8601 notation and uses UTC +0 time in the format of yyyy-MM-ddTHH:mm:ssZ.
- id string
The provider-assigned unique ID for this managed resource.
- defense_
scene str The type of protection policy. The following scenarios are supported:-waf_group:Web basic protection-custom_acl: Custom protection policy-whitelist: whitelist
- gmt_
modified str Revised the time. The date format is based on ISO8601 notation and uses UTC +0 time in the format of yyyy-MM-ddTHH:mm:ssZ.
- id str
The provider-assigned unique ID for this managed resource.
- defense
Scene String The type of protection policy. The following scenarios are supported:-waf_group:Web basic protection-custom_acl: Custom protection policy-whitelist: whitelist
- gmt
Modified String Revised the time. The date format is based on ISO8601 notation and uses UTC +0 time in the format of yyyy-MM-ddTHH:mm:ssZ.
- id String
The provider-assigned unique ID for this managed resource.
Look up Existing WafRule Resource
Get an existing WafRule resource’s state with the given name, ID, and optional extra properties used to qualify the lookup.
public static get(name: string, id: Input<ID>, state?: WafRuleState, opts?: CustomResourceOptions): WafRule
@staticmethod
def get(resource_name: str,
id: str,
opts: Optional[ResourceOptions] = None,
action: Optional[str] = None,
cc_status: Optional[str] = None,
cn_region_list: Optional[str] = None,
conditions: Optional[Sequence[WafRuleConditionArgs]] = None,
defense_scene: Optional[str] = None,
effect: Optional[str] = None,
gmt_modified: Optional[str] = None,
other_region_list: Optional[str] = None,
policy_id: Optional[str] = None,
rate_limit: Optional[WafRuleRateLimitArgs] = None,
regular_rules: Optional[Sequence[str]] = None,
regular_types: Optional[Sequence[str]] = None,
remote_addrs: Optional[Sequence[str]] = None,
rule_name: Optional[str] = None,
scenes: Optional[Sequence[str]] = None,
status: Optional[str] = None,
waf_group_ids: Optional[str] = None) -> WafRule
func GetWafRule(ctx *Context, name string, id IDInput, state *WafRuleState, opts ...ResourceOption) (*WafRule, error)
public static WafRule Get(string name, Input<string> id, WafRuleState? state, CustomResourceOptions? opts = null)
public static WafRule get(String name, Output<String> id, WafRuleState state, CustomResourceOptions options)
Resource lookup is not supported in YAML
- name
- The unique name of the resulting resource.
- id
- The unique provider ID of the resource to lookup.
- state
- Any extra arguments used during the lookup.
- opts
- A bag of options that control this resource's behavior.
- resource_name
- The unique name of the resulting resource.
- id
- The unique provider ID of the resource to lookup.
- name
- The unique name of the resulting resource.
- id
- The unique provider ID of the resource to lookup.
- state
- Any extra arguments used during the lookup.
- opts
- A bag of options that control this resource's behavior.
- name
- The unique name of the resulting resource.
- id
- The unique provider ID of the resource to lookup.
- state
- Any extra arguments used during the lookup.
- opts
- A bag of options that control this resource's behavior.
- name
- The unique name of the resulting resource.
- id
- The unique provider ID of the resource to lookup.
- state
- Any extra arguments used during the lookup.
- opts
- A bag of options that control this resource's behavior.
- Action string
Specifies the action of the rule. Valid values:
block
,monitor
,js
.- Cc
Status string Specifies whether to enable rate limiting. Valid values:
on
andoff
. NOTE: This parameter is required when policy is of typecustom_acl
.- Cn
Region stringList The blocked regions in the Chinese mainland, separated by commas (,).
- Conditions
List<Pulumi.
Ali Cloud. Dcdn. Inputs. Waf Rule Condition> Conditions that trigger the rule. See
conditions
below. NOTE: This parameter is required when policy is of typecustom_acl
orwhitelist
.- Defense
Scene string The type of protection policy. The following scenarios are supported:-waf_group:Web basic protection-custom_acl: Custom protection policy-whitelist: whitelist
- Effect string
The effective scope of the rate limiting blacklist. If you set ccStatus to on, you must configure this parameter. Valid values:
rule
(takes effect for the current rule) andservice
(takes effect globally).- Gmt
Modified string Revised the time. The date format is based on ISO8601 notation and uses UTC +0 time in the format of yyyy-MM-ddTHH:mm:ssZ.
- Other
Region stringList Blocked regions outside the Chinese mainland, separated by commas (,).
- Policy
Id string The protection policy ID.
- Rate
Limit Pulumi.Ali Cloud. Dcdn. Inputs. Waf Rule Rate Limit The rules of rate limiting. If you set
cc_status
to on, you must configure this parameter. Seerate_limit
below.- Regular
Rules List<string> The regular expression.e, when waf_group appears in tags, this value can be filled in, and only one list of six digits in string format can appear with regultypes.
- Regular
Types List<string> Regular rule type, when waf_group appears in tags, this value can be filled in, optional values:["sqli", "xss", "code_exec", "crlf", "lfileii", "rfileii", "webshell", "vvip", "other"]
- Remote
Addrs List<string> Filter by IP address.
- Rule
Name string The name of the protection rule. The name can be up to 64 characters in length and can contain letters, digits, and underscores (_). NOTE: This parameter cannot be modified when policy is of type
region_block
.- Scenes List<string>
The types of the protection policies.
- Status string
The status of the waf rule. Valid values:
on
andoff
. Default value: on.- Waf
Group stringIds The id of the waf rule group. The default value is "1012". Multiple rules are separated by commas.
- Action string
Specifies the action of the rule. Valid values:
block
,monitor
,js
.- Cc
Status string Specifies whether to enable rate limiting. Valid values:
on
andoff
. NOTE: This parameter is required when policy is of typecustom_acl
.- Cn
Region stringList The blocked regions in the Chinese mainland, separated by commas (,).
- Conditions
[]Waf
Rule Condition Args Conditions that trigger the rule. See
conditions
below. NOTE: This parameter is required when policy is of typecustom_acl
orwhitelist
.- Defense
Scene string The type of protection policy. The following scenarios are supported:-waf_group:Web basic protection-custom_acl: Custom protection policy-whitelist: whitelist
- Effect string
The effective scope of the rate limiting blacklist. If you set ccStatus to on, you must configure this parameter. Valid values:
rule
(takes effect for the current rule) andservice
(takes effect globally).- Gmt
Modified string Revised the time. The date format is based on ISO8601 notation and uses UTC +0 time in the format of yyyy-MM-ddTHH:mm:ssZ.
- Other
Region stringList Blocked regions outside the Chinese mainland, separated by commas (,).
- Policy
Id string The protection policy ID.
- Rate
Limit WafRule Rate Limit Args The rules of rate limiting. If you set
cc_status
to on, you must configure this parameter. Seerate_limit
below.- Regular
Rules []string The regular expression.e, when waf_group appears in tags, this value can be filled in, and only one list of six digits in string format can appear with regultypes.
- Regular
Types []string Regular rule type, when waf_group appears in tags, this value can be filled in, optional values:["sqli", "xss", "code_exec", "crlf", "lfileii", "rfileii", "webshell", "vvip", "other"]
- Remote
Addrs []string Filter by IP address.
- Rule
Name string The name of the protection rule. The name can be up to 64 characters in length and can contain letters, digits, and underscores (_). NOTE: This parameter cannot be modified when policy is of type
region_block
.- Scenes []string
The types of the protection policies.
- Status string
The status of the waf rule. Valid values:
on
andoff
. Default value: on.- Waf
Group stringIds The id of the waf rule group. The default value is "1012". Multiple rules are separated by commas.
- action String
Specifies the action of the rule. Valid values:
block
,monitor
,js
.- cc
Status String Specifies whether to enable rate limiting. Valid values:
on
andoff
. NOTE: This parameter is required when policy is of typecustom_acl
.- cn
Region StringList The blocked regions in the Chinese mainland, separated by commas (,).
- conditions
List<Waf
Rule Condition> Conditions that trigger the rule. See
conditions
below. NOTE: This parameter is required when policy is of typecustom_acl
orwhitelist
.- defense
Scene String The type of protection policy. The following scenarios are supported:-waf_group:Web basic protection-custom_acl: Custom protection policy-whitelist: whitelist
- effect String
The effective scope of the rate limiting blacklist. If you set ccStatus to on, you must configure this parameter. Valid values:
rule
(takes effect for the current rule) andservice
(takes effect globally).- gmt
Modified String Revised the time. The date format is based on ISO8601 notation and uses UTC +0 time in the format of yyyy-MM-ddTHH:mm:ssZ.
- other
Region StringList Blocked regions outside the Chinese mainland, separated by commas (,).
- policy
Id String The protection policy ID.
- rate
Limit WafRule Rate Limit The rules of rate limiting. If you set
cc_status
to on, you must configure this parameter. Seerate_limit
below.- regular
Rules List<String> The regular expression.e, when waf_group appears in tags, this value can be filled in, and only one list of six digits in string format can appear with regultypes.
- regular
Types List<String> Regular rule type, when waf_group appears in tags, this value can be filled in, optional values:["sqli", "xss", "code_exec", "crlf", "lfileii", "rfileii", "webshell", "vvip", "other"]
- remote
Addrs List<String> Filter by IP address.
- rule
Name String The name of the protection rule. The name can be up to 64 characters in length and can contain letters, digits, and underscores (_). NOTE: This parameter cannot be modified when policy is of type
region_block
.- scenes List<String>
The types of the protection policies.
- status String
The status of the waf rule. Valid values:
on
andoff
. Default value: on.- waf
Group StringIds The id of the waf rule group. The default value is "1012". Multiple rules are separated by commas.
- action string
Specifies the action of the rule. Valid values:
block
,monitor
,js
.- cc
Status string Specifies whether to enable rate limiting. Valid values:
on
andoff
. NOTE: This parameter is required when policy is of typecustom_acl
.- cn
Region stringList The blocked regions in the Chinese mainland, separated by commas (,).
- conditions
Waf
Rule Condition[] Conditions that trigger the rule. See
conditions
below. NOTE: This parameter is required when policy is of typecustom_acl
orwhitelist
.- defense
Scene string The type of protection policy. The following scenarios are supported:-waf_group:Web basic protection-custom_acl: Custom protection policy-whitelist: whitelist
- effect string
The effective scope of the rate limiting blacklist. If you set ccStatus to on, you must configure this parameter. Valid values:
rule
(takes effect for the current rule) andservice
(takes effect globally).- gmt
Modified string Revised the time. The date format is based on ISO8601 notation and uses UTC +0 time in the format of yyyy-MM-ddTHH:mm:ssZ.
- other
Region stringList Blocked regions outside the Chinese mainland, separated by commas (,).
- policy
Id string The protection policy ID.
- rate
Limit WafRule Rate Limit The rules of rate limiting. If you set
cc_status
to on, you must configure this parameter. Seerate_limit
below.- regular
Rules string[] The regular expression.e, when waf_group appears in tags, this value can be filled in, and only one list of six digits in string format can appear with regultypes.
- regular
Types string[] Regular rule type, when waf_group appears in tags, this value can be filled in, optional values:["sqli", "xss", "code_exec", "crlf", "lfileii", "rfileii", "webshell", "vvip", "other"]
- remote
Addrs string[] Filter by IP address.
- rule
Name string The name of the protection rule. The name can be up to 64 characters in length and can contain letters, digits, and underscores (_). NOTE: This parameter cannot be modified when policy is of type
region_block
.- scenes string[]
The types of the protection policies.
- status string
The status of the waf rule. Valid values:
on
andoff
. Default value: on.- waf
Group stringIds The id of the waf rule group. The default value is "1012". Multiple rules are separated by commas.
- action str
Specifies the action of the rule. Valid values:
block
,monitor
,js
.- cc_
status str Specifies whether to enable rate limiting. Valid values:
on
andoff
. NOTE: This parameter is required when policy is of typecustom_acl
.- cn_
region_ strlist The blocked regions in the Chinese mainland, separated by commas (,).
- conditions
Sequence[Waf
Rule Condition Args] Conditions that trigger the rule. See
conditions
below. NOTE: This parameter is required when policy is of typecustom_acl
orwhitelist
.- defense_
scene str The type of protection policy. The following scenarios are supported:-waf_group:Web basic protection-custom_acl: Custom protection policy-whitelist: whitelist
- effect str
The effective scope of the rate limiting blacklist. If you set ccStatus to on, you must configure this parameter. Valid values:
rule
(takes effect for the current rule) andservice
(takes effect globally).- gmt_
modified str Revised the time. The date format is based on ISO8601 notation and uses UTC +0 time in the format of yyyy-MM-ddTHH:mm:ssZ.
- other_
region_ strlist Blocked regions outside the Chinese mainland, separated by commas (,).
- policy_
id str The protection policy ID.
- rate_
limit WafRule Rate Limit Args The rules of rate limiting. If you set
cc_status
to on, you must configure this parameter. Seerate_limit
below.- regular_
rules Sequence[str] The regular expression.e, when waf_group appears in tags, this value can be filled in, and only one list of six digits in string format can appear with regultypes.
- regular_
types Sequence[str] Regular rule type, when waf_group appears in tags, this value can be filled in, optional values:["sqli", "xss", "code_exec", "crlf", "lfileii", "rfileii", "webshell", "vvip", "other"]
- remote_
addrs Sequence[str] Filter by IP address.
- rule_
name str The name of the protection rule. The name can be up to 64 characters in length and can contain letters, digits, and underscores (_). NOTE: This parameter cannot be modified when policy is of type
region_block
.- scenes Sequence[str]
The types of the protection policies.
- status str
The status of the waf rule. Valid values:
on
andoff
. Default value: on.- waf_
group_ strids The id of the waf rule group. The default value is "1012". Multiple rules are separated by commas.
- action String
Specifies the action of the rule. Valid values:
block
,monitor
,js
.- cc
Status String Specifies whether to enable rate limiting. Valid values:
on
andoff
. NOTE: This parameter is required when policy is of typecustom_acl
.- cn
Region StringList The blocked regions in the Chinese mainland, separated by commas (,).
- conditions List<Property Map>
Conditions that trigger the rule. See
conditions
below. NOTE: This parameter is required when policy is of typecustom_acl
orwhitelist
.- defense
Scene String The type of protection policy. The following scenarios are supported:-waf_group:Web basic protection-custom_acl: Custom protection policy-whitelist: whitelist
- effect String
The effective scope of the rate limiting blacklist. If you set ccStatus to on, you must configure this parameter. Valid values:
rule
(takes effect for the current rule) andservice
(takes effect globally).- gmt
Modified String Revised the time. The date format is based on ISO8601 notation and uses UTC +0 time in the format of yyyy-MM-ddTHH:mm:ssZ.
- other
Region StringList Blocked regions outside the Chinese mainland, separated by commas (,).
- policy
Id String The protection policy ID.
- rate
Limit Property Map The rules of rate limiting. If you set
cc_status
to on, you must configure this parameter. Seerate_limit
below.- regular
Rules List<String> The regular expression.e, when waf_group appears in tags, this value can be filled in, and only one list of six digits in string format can appear with regultypes.
- regular
Types List<String> Regular rule type, when waf_group appears in tags, this value can be filled in, optional values:["sqli", "xss", "code_exec", "crlf", "lfileii", "rfileii", "webshell", "vvip", "other"]
- remote
Addrs List<String> Filter by IP address.
- rule
Name String The name of the protection rule. The name can be up to 64 characters in length and can contain letters, digits, and underscores (_). NOTE: This parameter cannot be modified when policy is of type
region_block
.- scenes List<String>
The types of the protection policies.
- status String
The status of the waf rule. Valid values:
on
andoff
. Default value: on.- waf
Group StringIds The id of the waf rule group. The default value is "1012". Multiple rules are separated by commas.
Supporting Types
WafRuleCondition, WafRuleConditionArgs
WafRuleRateLimit, WafRuleRateLimitArgs
- Interval int
Statistical duration, 5-1800.
- Status
Pulumi.
Ali Cloud. Dcdn. Inputs. Waf Rule Rate Limit Status Response code statistics. See
status
below.- Sub
Key string The subfield of the target field. If you set
target
toHeader
,Query String Parameter
, orCookie Name
, you must configuresub_key
.- Target string
The statistical field for frequency control. Currently,
IP
,Header
,Query String Parameter
,Cookie Name
,Session
is supported.- Threshold int
The trigger threshold of rate limiting. Valid values: 2 to 500000. Unit: requests.
- Ttl int
The validity period of the blacklist. Valid values: 60 to 86400. Unit: seconds.
- Interval int
Statistical duration, 5-1800.
- Status
Waf
Rule Rate Limit Status Response code statistics. See
status
below.- Sub
Key string The subfield of the target field. If you set
target
toHeader
,Query String Parameter
, orCookie Name
, you must configuresub_key
.- Target string
The statistical field for frequency control. Currently,
IP
,Header
,Query String Parameter
,Cookie Name
,Session
is supported.- Threshold int
The trigger threshold of rate limiting. Valid values: 2 to 500000. Unit: requests.
- Ttl int
The validity period of the blacklist. Valid values: 60 to 86400. Unit: seconds.
- interval Integer
Statistical duration, 5-1800.
- status
Waf
Rule Rate Limit Status Response code statistics. See
status
below.- sub
Key String The subfield of the target field. If you set
target
toHeader
,Query String Parameter
, orCookie Name
, you must configuresub_key
.- target String
The statistical field for frequency control. Currently,
IP
,Header
,Query String Parameter
,Cookie Name
,Session
is supported.- threshold Integer
The trigger threshold of rate limiting. Valid values: 2 to 500000. Unit: requests.
- ttl Integer
The validity period of the blacklist. Valid values: 60 to 86400. Unit: seconds.
- interval number
Statistical duration, 5-1800.
- status
Waf
Rule Rate Limit Status Response code statistics. See
status
below.- sub
Key string The subfield of the target field. If you set
target
toHeader
,Query String Parameter
, orCookie Name
, you must configuresub_key
.- target string
The statistical field for frequency control. Currently,
IP
,Header
,Query String Parameter
,Cookie Name
,Session
is supported.- threshold number
The trigger threshold of rate limiting. Valid values: 2 to 500000. Unit: requests.
- ttl number
The validity period of the blacklist. Valid values: 60 to 86400. Unit: seconds.
- interval int
Statistical duration, 5-1800.
- status
Waf
Rule Rate Limit Status Response code statistics. See
status
below.- sub_
key str The subfield of the target field. If you set
target
toHeader
,Query String Parameter
, orCookie Name
, you must configuresub_key
.- target str
The statistical field for frequency control. Currently,
IP
,Header
,Query String Parameter
,Cookie Name
,Session
is supported.- threshold int
The trigger threshold of rate limiting. Valid values: 2 to 500000. Unit: requests.
- ttl int
The validity period of the blacklist. Valid values: 60 to 86400. Unit: seconds.
- interval Number
Statistical duration, 5-1800.
- status Property Map
Response code statistics. See
status
below.- sub
Key String The subfield of the target field. If you set
target
toHeader
,Query String Parameter
, orCookie Name
, you must configuresub_key
.- target String
The statistical field for frequency control. Currently,
IP
,Header
,Query String Parameter
,Cookie Name
,Session
is supported.- threshold Number
The trigger threshold of rate limiting. Valid values: 2 to 500000. Unit: requests.
- ttl Number
The validity period of the blacklist. Valid values: 60 to 86400. Unit: seconds.
WafRuleRateLimitStatus, WafRuleRateLimitStatusArgs
- Code string
The HTTP status code returned.
- Count int
The number of times that the HTTP status code that was returned. Valid values: 2 to 50000. You can configure only one of the
ratio
andcount
fields.- Ratio int
The percentage of HTTP status codes. Valid values: 1 to 100. You can configure only one of the
ratio
andcount
fields.
- Code string
The HTTP status code returned.
- Count int
The number of times that the HTTP status code that was returned. Valid values: 2 to 50000. You can configure only one of the
ratio
andcount
fields.- Ratio int
The percentage of HTTP status codes. Valid values: 1 to 100. You can configure only one of the
ratio
andcount
fields.
- code String
The HTTP status code returned.
- count Integer
The number of times that the HTTP status code that was returned. Valid values: 2 to 50000. You can configure only one of the
ratio
andcount
fields.- ratio Integer
The percentage of HTTP status codes. Valid values: 1 to 100. You can configure only one of the
ratio
andcount
fields.
- code string
The HTTP status code returned.
- count number
The number of times that the HTTP status code that was returned. Valid values: 2 to 50000. You can configure only one of the
ratio
andcount
fields.- ratio number
The percentage of HTTP status codes. Valid values: 1 to 100. You can configure only one of the
ratio
andcount
fields.
- code str
The HTTP status code returned.
- count int
The number of times that the HTTP status code that was returned. Valid values: 2 to 50000. You can configure only one of the
ratio
andcount
fields.- ratio int
The percentage of HTTP status codes. Valid values: 1 to 100. You can configure only one of the
ratio
andcount
fields.
- code String
The HTTP status code returned.
- count Number
The number of times that the HTTP status code that was returned. Valid values: 2 to 50000. You can configure only one of the
ratio
andcount
fields.- ratio Number
The percentage of HTTP status codes. Valid values: 1 to 100. You can configure only one of the
ratio
andcount
fields.
Import
Dcdn Waf Rule can be imported using the id, e.g.
$ pulumi import alicloud:dcdn/wafRule:WafRule example <id>
Package Details
- Repository
- Alibaba Cloud pulumi/pulumi-alicloud
- License
- Apache-2.0
- Notes
This Pulumi package is based on the
alicloud
Terraform Provider.