published on Thursday, Jul 16, 2026 by Pulumi
published on Thursday, Jul 16, 2026 by Pulumi
This data source provides Wafv3 Defense Rule available to the user.What is Defense Rule
NOTE: Available since v1.283.0.
Example Usage
import * as pulumi from "@pulumi/pulumi";
import * as alicloud from "@pulumi/alicloud";
const config = new pulumi.Config();
const name = config.get("name") || "terraform-example";
const regionId = config.get("regionId") || "cn-hangzhou";
const defaultnxb04D = new alicloud.wafv3.Instance("defaultnxb04D", {});
const defaultfIoHt5 = new alicloud.wafv3.DefenseTemplate("defaultfIoHt5", {
status: "1",
description: "testCreate",
instanceId: defaultnxb04D.id,
defenseTemplateName: "1782219650",
templateOrigin: "custom",
defenseScene: "custom_acl",
templateType: "user_custom",
});
const default9dtEmt = new alicloud.wafv3.AddressBook("default9dtEmt", {
description: "test",
instanceId: defaultnxb04D.id,
addressBookName: "1782219650",
addressLists: [
"100.100.100.100/32",
"101.101.101.101/32",
"102.102.102.102/32",
],
addressBookType: "ip",
});
const defaultSB0uHV = new alicloud.wafv3.AddressBook("defaultSB0uHV", {
description: "test",
instanceId: defaultnxb04D.id,
addressBookName: "1782219650",
addressLists: [
"100.100.100.100/32",
"101.101.101.101/32",
"102.102.102.102/32",
],
addressBookType: "ip",
});
const defaultDefenseRule = new alicloud.wafv3.DefenseRule("default", {
defenseOrigin: "custom",
instanceId: defaultnxb04D.id,
config: {
ruleAction: "block",
conditions: [
{
opValue: "contain",
values: "abc",
key: "URL",
},
{
opValue: "contain",
values: "abc",
key: "URLPath",
},
{
opValue: "contain",
values: "1.1.1.2",
key: "IP",
},
{
key: "IP",
opValue: "in-list",
values: default9dtEmt.addressBookId,
},
],
ccStatus: 0,
ccEffect: "service",
rateLimit: {
target: "remote_addr",
interval: 16,
threshold: 204,
ttl: 68,
status: {
code: 414,
count: 333,
},
subKey: "testky1",
},
grayStatus: 1,
grayConfig: {
grayTarget: "remote_addr",
grayRate: 80,
},
timeConfig: {
timeScope: "period",
timeZone: 8,
timePeriods: [
{
start: 1760174804000,
end: 1760175804000,
},
{
start: 1760171804000,
end: 1760172804000,
},
{
start: 1760176804000,
end: 1760177804000,
},
{
start: 1760178804000,
end: 1760179804000,
},
{
start: 1760170804000,
end: 1760171804000,
},
],
},
},
defenseScene: "custom_acl",
ruleStatus: 1,
defenseType: "template",
templateId: defaultfIoHt5.defenseTemplateId,
ruleName: "custom_acl-create",
});
const _default = alicloud.wafv3.getDefenseRulesOutput({
ids: [defaultDefenseRule.id],
defenseType: "template",
instanceId: defaultnxb04D.id,
});
export const alicloudWafv3DefenseRuleExampleId = _default.apply(_default => _default.rules?.[0]?.id);
import pulumi
import pulumi_alicloud as alicloud
config = pulumi.Config()
name = config.get("name")
if name is None:
name = "terraform-example"
region_id = config.get("regionId")
if region_id is None:
region_id = "cn-hangzhou"
defaultnxb04_d = alicloud.wafv3.Instance("defaultnxb04D")
defaultf_io_ht5 = alicloud.wafv3.DefenseTemplate("defaultfIoHt5",
status="1",
description="testCreate",
instance_id=defaultnxb04_d.id,
defense_template_name="1782219650",
template_origin="custom",
defense_scene="custom_acl",
template_type="user_custom")
default9dt_emt = alicloud.wafv3.AddressBook("default9dtEmt",
description="test",
instance_id=defaultnxb04_d.id,
address_book_name="1782219650",
address_lists=[
"100.100.100.100/32",
"101.101.101.101/32",
"102.102.102.102/32",
],
address_book_type="ip")
default_sb0u_hv = alicloud.wafv3.AddressBook("defaultSB0uHV",
description="test",
instance_id=defaultnxb04_d.id,
address_book_name="1782219650",
address_lists=[
"100.100.100.100/32",
"101.101.101.101/32",
"102.102.102.102/32",
],
address_book_type="ip")
default_defense_rule = alicloud.wafv3.DefenseRule("default",
defense_origin="custom",
instance_id=defaultnxb04_d.id,
config={
"rule_action": "block",
"conditions": [
{
"op_value": "contain",
"values": "abc",
"key": "URL",
},
{
"op_value": "contain",
"values": "abc",
"key": "URLPath",
},
{
"op_value": "contain",
"values": "1.1.1.2",
"key": "IP",
},
{
"key": "IP",
"op_value": "in-list",
"values": default9dt_emt.address_book_id,
},
],
"cc_status": 0,
"cc_effect": "service",
"rate_limit": {
"target": "remote_addr",
"interval": 16,
"threshold": 204,
"ttl": 68,
"status": {
"code": 414,
"count": 333,
},
"sub_key": "testky1",
},
"gray_status": 1,
"gray_config": {
"gray_target": "remote_addr",
"gray_rate": 80,
},
"time_config": {
"time_scope": "period",
"time_zone": 8,
"time_periods": [
{
"start": int(1760174804000),
"end": int(1760175804000),
},
{
"start": int(1760171804000),
"end": int(1760172804000),
},
{
"start": int(1760176804000),
"end": int(1760177804000),
},
{
"start": int(1760178804000),
"end": int(1760179804000),
},
{
"start": int(1760170804000),
"end": int(1760171804000),
},
],
},
},
defense_scene="custom_acl",
rule_status=1,
defense_type="template",
template_id=defaultf_io_ht5.defense_template_id,
rule_name="custom_acl-create")
default = alicloud.wafv3.get_defense_rules_output(ids=[default_defense_rule.id],
defense_type="template",
instance_id=defaultnxb04_d.id)
pulumi.export("alicloudWafv3DefenseRuleExampleId", default.rules[0].id)
package main
import (
"github.com/pulumi/pulumi-alicloud/sdk/v3/go/alicloud/wafv3"
"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 := "terraform-example"
if param := cfg.Get("name"); param != "" {
name = param
}
regionId := "cn-hangzhou"
if param := cfg.Get("regionId"); param != "" {
regionId = param
}
defaultnxb04D, err := wafv3.NewInstance(ctx, "defaultnxb04D", nil)
if err != nil {
return err
}
defaultfIoHt5, err := wafv3.NewDefenseTemplate(ctx, "defaultfIoHt5", &wafv3.DefenseTemplateArgs{
Status: pulumi.String("1"),
Description: pulumi.String("testCreate"),
InstanceId: defaultnxb04D.ID(),
DefenseTemplateName: pulumi.String("1782219650"),
TemplateOrigin: pulumi.String("custom"),
DefenseScene: pulumi.String("custom_acl"),
TemplateType: pulumi.String("user_custom"),
})
if err != nil {
return err
}
default9dtEmt, err := wafv3.NewAddressBook(ctx, "default9dtEmt", &wafv3.AddressBookArgs{
Description: pulumi.String("test"),
InstanceId: defaultnxb04D.ID(),
AddressBookName: pulumi.String("1782219650"),
AddressLists: pulumi.StringArray{
pulumi.String("100.100.100.100/32"),
pulumi.String("101.101.101.101/32"),
pulumi.String("102.102.102.102/32"),
},
AddressBookType: pulumi.String("ip"),
})
if err != nil {
return err
}
_, err = wafv3.NewAddressBook(ctx, "defaultSB0uHV", &wafv3.AddressBookArgs{
Description: pulumi.String("test"),
InstanceId: defaultnxb04D.ID(),
AddressBookName: pulumi.String("1782219650"),
AddressLists: pulumi.StringArray{
pulumi.String("100.100.100.100/32"),
pulumi.String("101.101.101.101/32"),
pulumi.String("102.102.102.102/32"),
},
AddressBookType: pulumi.String("ip"),
})
if err != nil {
return err
}
defaultDefenseRule, err := wafv3.NewDefenseRule(ctx, "default", &wafv3.DefenseRuleArgs{
DefenseOrigin: pulumi.String("custom"),
InstanceId: defaultnxb04D.ID(),
Config: &wafv3.DefenseRuleConfigArgs{
RuleAction: pulumi.String("block"),
Conditions: wafv3.DefenseRuleConfigConditionArray{
&wafv3.DefenseRuleConfigConditionArgs{
OpValue: pulumi.String("contain"),
Values: pulumi.String("abc"),
Key: pulumi.String("URL"),
},
&wafv3.DefenseRuleConfigConditionArgs{
OpValue: pulumi.String("contain"),
Values: pulumi.String("abc"),
Key: pulumi.String("URLPath"),
},
&wafv3.DefenseRuleConfigConditionArgs{
OpValue: pulumi.String("contain"),
Values: pulumi.String("1.1.1.2"),
Key: pulumi.String("IP"),
},
&wafv3.DefenseRuleConfigConditionArgs{
Key: pulumi.String("IP"),
OpValue: pulumi.String("in-list"),
Values: default9dtEmt.AddressBookId,
},
},
CcStatus: pulumi.Int(0),
CcEffect: pulumi.String("service"),
RateLimit: &wafv3.DefenseRuleConfigRateLimitArgs{
Target: pulumi.String("remote_addr"),
Interval: pulumi.Int(16),
Threshold: pulumi.Int(204),
Ttl: pulumi.Int(68),
Status: &wafv3.DefenseRuleConfigRateLimitStatusArgs{
Code: pulumi.Int(414),
Count: pulumi.Int(333),
},
SubKey: pulumi.String("testky1"),
},
GrayStatus: pulumi.Int(1),
GrayConfig: &wafv3.DefenseRuleConfigGrayConfigArgs{
GrayTarget: pulumi.String("remote_addr"),
GrayRate: pulumi.Int(80),
},
TimeConfig: &wafv3.DefenseRuleConfigTimeConfigArgs{
TimeScope: pulumi.String("period"),
TimeZone: pulumi.Int(8),
TimePeriods: wafv3.DefenseRuleConfigTimeConfigTimePeriodArray{
&wafv3.DefenseRuleConfigTimeConfigTimePeriodArgs{
Start: pulumi.Int(1760174804000),
End: pulumi.Int(1760175804000),
},
&wafv3.DefenseRuleConfigTimeConfigTimePeriodArgs{
Start: pulumi.Int(1760171804000),
End: pulumi.Int(1760172804000),
},
&wafv3.DefenseRuleConfigTimeConfigTimePeriodArgs{
Start: pulumi.Int(1760176804000),
End: pulumi.Int(1760177804000),
},
&wafv3.DefenseRuleConfigTimeConfigTimePeriodArgs{
Start: pulumi.Int(1760178804000),
End: pulumi.Int(1760179804000),
},
&wafv3.DefenseRuleConfigTimeConfigTimePeriodArgs{
Start: pulumi.Int(1760170804000),
End: pulumi.Int(1760171804000),
},
},
},
},
DefenseScene: pulumi.String("custom_acl"),
RuleStatus: pulumi.Int(1),
DefenseType: pulumi.String("template"),
TemplateId: defaultfIoHt5.DefenseTemplateId,
RuleName: pulumi.String("custom_acl-create"),
})
if err != nil {
return err
}
_default := wafv3.GetDefenseRulesOutput(ctx, wafv3.GetDefenseRulesOutputArgs{
Ids: pulumi.StringArray{
defaultDefenseRule.ID(),
},
DefenseType: pulumi.String("template"),
InstanceId: defaultnxb04D.ID(),
}, nil)
ctx.Export("alicloudWafv3DefenseRuleExampleId", _default.ApplyT(func(_default wafv3.GetDefenseRulesResult) (*string, error) {
return _default.Rules[0].Id, nil
}).(pulumi.StringPtrOutput))
return nil
})
}
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") ?? "terraform-example";
var regionId = config.Get("regionId") ?? "cn-hangzhou";
var defaultnxb04D = new AliCloud.Wafv3.Instance("defaultnxb04D");
var defaultfIoHt5 = new AliCloud.Wafv3.DefenseTemplate("defaultfIoHt5", new()
{
Status = "1",
Description = "testCreate",
InstanceId = defaultnxb04D.Id,
DefenseTemplateName = "1782219650",
TemplateOrigin = "custom",
DefenseScene = "custom_acl",
TemplateType = "user_custom",
});
var default9dtEmt = new AliCloud.Wafv3.AddressBook("default9dtEmt", new()
{
Description = "test",
InstanceId = defaultnxb04D.Id,
AddressBookName = "1782219650",
AddressLists = new[]
{
"100.100.100.100/32",
"101.101.101.101/32",
"102.102.102.102/32",
},
AddressBookType = "ip",
});
var defaultSB0uHV = new AliCloud.Wafv3.AddressBook("defaultSB0uHV", new()
{
Description = "test",
InstanceId = defaultnxb04D.Id,
AddressBookName = "1782219650",
AddressLists = new[]
{
"100.100.100.100/32",
"101.101.101.101/32",
"102.102.102.102/32",
},
AddressBookType = "ip",
});
var defaultDefenseRule = new AliCloud.Wafv3.DefenseRule("default", new()
{
DefenseOrigin = "custom",
InstanceId = defaultnxb04D.Id,
Config = new AliCloud.Wafv3.Inputs.DefenseRuleConfigArgs
{
RuleAction = "block",
Conditions = new[]
{
new AliCloud.Wafv3.Inputs.DefenseRuleConfigConditionArgs
{
OpValue = "contain",
Values = "abc",
Key = "URL",
},
new AliCloud.Wafv3.Inputs.DefenseRuleConfigConditionArgs
{
OpValue = "contain",
Values = "abc",
Key = "URLPath",
},
new AliCloud.Wafv3.Inputs.DefenseRuleConfigConditionArgs
{
OpValue = "contain",
Values = "1.1.1.2",
Key = "IP",
},
new AliCloud.Wafv3.Inputs.DefenseRuleConfigConditionArgs
{
Key = "IP",
OpValue = "in-list",
Values = default9dtEmt.AddressBookId,
},
},
CcStatus = 0,
CcEffect = "service",
RateLimit = new AliCloud.Wafv3.Inputs.DefenseRuleConfigRateLimitArgs
{
Target = "remote_addr",
Interval = 16,
Threshold = 204,
Ttl = 68,
Status = new AliCloud.Wafv3.Inputs.DefenseRuleConfigRateLimitStatusArgs
{
Code = 414,
Count = 333,
},
SubKey = "testky1",
},
GrayStatus = 1,
GrayConfig = new AliCloud.Wafv3.Inputs.DefenseRuleConfigGrayConfigArgs
{
GrayTarget = "remote_addr",
GrayRate = 80,
},
TimeConfig = new AliCloud.Wafv3.Inputs.DefenseRuleConfigTimeConfigArgs
{
TimeScope = "period",
TimeZone = 8,
TimePeriods = new[]
{
new AliCloud.Wafv3.Inputs.DefenseRuleConfigTimeConfigTimePeriodArgs
{
Start = 1760174804000,
End = 1760175804000,
},
new AliCloud.Wafv3.Inputs.DefenseRuleConfigTimeConfigTimePeriodArgs
{
Start = 1760171804000,
End = 1760172804000,
},
new AliCloud.Wafv3.Inputs.DefenseRuleConfigTimeConfigTimePeriodArgs
{
Start = 1760176804000,
End = 1760177804000,
},
new AliCloud.Wafv3.Inputs.DefenseRuleConfigTimeConfigTimePeriodArgs
{
Start = 1760178804000,
End = 1760179804000,
},
new AliCloud.Wafv3.Inputs.DefenseRuleConfigTimeConfigTimePeriodArgs
{
Start = 1760170804000,
End = 1760171804000,
},
},
},
},
DefenseScene = "custom_acl",
RuleStatus = 1,
DefenseType = "template",
TemplateId = defaultfIoHt5.DefenseTemplateId,
RuleName = "custom_acl-create",
});
var @default = AliCloud.Wafv3.GetDefenseRules.Invoke(new()
{
Ids = new[]
{
defaultDefenseRule.Id,
},
DefenseType = "template",
InstanceId = defaultnxb04D.Id,
});
return new Dictionary<string, object?>
{
["alicloudWafv3DefenseRuleExampleId"] = @default.Apply(@default => @default.Apply(getDefenseRulesResult => getDefenseRulesResult.Rules[0]?.Id)),
};
});
package generated_program;
import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.alicloud.wafv3.Instance;
import com.pulumi.alicloud.wafv3.DefenseTemplate;
import com.pulumi.alicloud.wafv3.DefenseTemplateArgs;
import com.pulumi.alicloud.wafv3.AddressBook;
import com.pulumi.alicloud.wafv3.AddressBookArgs;
import com.pulumi.alicloud.wafv3.DefenseRule;
import com.pulumi.alicloud.wafv3.DefenseRuleArgs;
import com.pulumi.alicloud.wafv3.inputs.DefenseRuleConfigArgs;
import com.pulumi.alicloud.wafv3.inputs.DefenseRuleConfigConditionArgs;
import com.pulumi.alicloud.wafv3.inputs.DefenseRuleConfigRateLimitArgs;
import com.pulumi.alicloud.wafv3.inputs.DefenseRuleConfigRateLimitStatusArgs;
import com.pulumi.alicloud.wafv3.inputs.DefenseRuleConfigGrayConfigArgs;
import com.pulumi.alicloud.wafv3.inputs.DefenseRuleConfigTimeConfigArgs;
import com.pulumi.alicloud.wafv3.inputs.DefenseRuleConfigTimeConfigTimePeriodArgs;
import com.pulumi.alicloud.wafv3.Wafv3Functions;
import com.pulumi.alicloud.wafv3.inputs.GetDefenseRulesArgs;
import java.util.ArrayList;
import java.util.Arrays;
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("terraform-example");
final var regionId = config.get("regionId").orElse("cn-hangzhou");
var defaultnxb04D = new Instance("defaultnxb04D");
var defaultfIoHt5 = new DefenseTemplate("defaultfIoHt5", DefenseTemplateArgs.builder()
.status("1")
.description("testCreate")
.instanceId(defaultnxb04D.id())
.defenseTemplateName("1782219650")
.templateOrigin("custom")
.defenseScene("custom_acl")
.templateType("user_custom")
.build());
var default9dtEmt = new AddressBook("default9dtEmt", AddressBookArgs.builder()
.description("test")
.instanceId(defaultnxb04D.id())
.addressBookName("1782219650")
.addressLists(
"100.100.100.100/32",
"101.101.101.101/32",
"102.102.102.102/32")
.addressBookType("ip")
.build());
var defaultSB0uHV = new AddressBook("defaultSB0uHV", AddressBookArgs.builder()
.description("test")
.instanceId(defaultnxb04D.id())
.addressBookName("1782219650")
.addressLists(
"100.100.100.100/32",
"101.101.101.101/32",
"102.102.102.102/32")
.addressBookType("ip")
.build());
var defaultDefenseRule = new DefenseRule("defaultDefenseRule", DefenseRuleArgs.builder()
.defenseOrigin("custom")
.instanceId(defaultnxb04D.id())
.config(DefenseRuleConfigArgs.builder()
.ruleAction("block")
.conditions(
DefenseRuleConfigConditionArgs.builder()
.opValue("contain")
.values("abc")
.key("URL")
.build(),
DefenseRuleConfigConditionArgs.builder()
.opValue("contain")
.values("abc")
.key("URLPath")
.build(),
DefenseRuleConfigConditionArgs.builder()
.opValue("contain")
.values("1.1.1.2")
.key("IP")
.build(),
DefenseRuleConfigConditionArgs.builder()
.key("IP")
.opValue("in-list")
.values(default9dtEmt.addressBookId())
.build())
.ccStatus(0)
.ccEffect("service")
.rateLimit(DefenseRuleConfigRateLimitArgs.builder()
.target("remote_addr")
.interval(16)
.threshold(204)
.ttl(68)
.status(DefenseRuleConfigRateLimitStatusArgs.builder()
.code(414)
.count(333)
.build())
.subKey("testky1")
.build())
.grayStatus(1)
.grayConfig(DefenseRuleConfigGrayConfigArgs.builder()
.grayTarget("remote_addr")
.grayRate(80)
.build())
.timeConfig(DefenseRuleConfigTimeConfigArgs.builder()
.timeScope("period")
.timeZone(8)
.timePeriods(
DefenseRuleConfigTimeConfigTimePeriodArgs.builder()
.start(1760174804000)
.end(1760175804000)
.build(),
DefenseRuleConfigTimeConfigTimePeriodArgs.builder()
.start(1760171804000)
.end(1760172804000)
.build(),
DefenseRuleConfigTimeConfigTimePeriodArgs.builder()
.start(1760176804000)
.end(1760177804000)
.build(),
DefenseRuleConfigTimeConfigTimePeriodArgs.builder()
.start(1760178804000)
.end(1760179804000)
.build(),
DefenseRuleConfigTimeConfigTimePeriodArgs.builder()
.start(1760170804000)
.end(1760171804000)
.build())
.build())
.build())
.defenseScene("custom_acl")
.ruleStatus(1)
.defenseType("template")
.templateId(defaultfIoHt5.defenseTemplateId())
.ruleName("custom_acl-create")
.build());
final var default = Wafv3Functions.getDefenseRules(GetDefenseRulesArgs.builder()
.ids(defaultDefenseRule.id())
.defenseType("template")
.instanceId(defaultnxb04D.id())
.build());
ctx.export("alicloudWafv3DefenseRuleExampleId", default_.applyValue(_default_ -> _default_.rules()[0].id()));
}
}
configuration:
name:
type: string
default: terraform-example
regionId:
type: string
default: cn-hangzhou
resources:
defaultnxb04D:
type: alicloud:wafv3:Instance
defaultfIoHt5:
type: alicloud:wafv3:DefenseTemplate
properties:
status: '1'
description: testCreate
instanceId: ${defaultnxb04D.id}
defenseTemplateName: '1782219650'
templateOrigin: custom
defenseScene: custom_acl
templateType: user_custom
default9dtEmt:
type: alicloud:wafv3:AddressBook
properties:
description: test
instanceId: ${defaultnxb04D.id}
addressBookName: '1782219650'
addressLists:
- 100.100.100.100/32
- 101.101.101.101/32
- 102.102.102.102/32
addressBookType: ip
defaultSB0uHV:
type: alicloud:wafv3:AddressBook
properties:
description: test
instanceId: ${defaultnxb04D.id}
addressBookName: '1782219650'
addressLists:
- 100.100.100.100/32
- 101.101.101.101/32
- 102.102.102.102/32
addressBookType: ip
defaultDefenseRule:
type: alicloud:wafv3:DefenseRule
name: default
properties:
defenseOrigin: custom
instanceId: ${defaultnxb04D.id}
config:
ruleAction: block
conditions:
- opValue: contain
values: abc
key: URL
- opValue: contain
values: abc
key: URLPath
- opValue: contain
values: 1.1.1.2
key: IP
- key: IP
opValue: in-list
values: ${default9dtEmt.addressBookId}
ccStatus: '0'
ccEffect: service
rateLimit:
target: remote_addr
interval: '16'
threshold: '204'
ttl: '68'
status:
code: '414'
count: '333'
subKey: testky1
grayStatus: '1'
grayConfig:
grayTarget: remote_addr
grayRate: '80'
timeConfig:
timeScope: period
timeZone: '8'
timePeriods:
- start: '1760174804000'
end: '1760175804000'
- start: '1760171804000'
end: '1760172804000'
- start: '1760176804000'
end: '1760177804000'
- start: '1760178804000'
end: '1760179804000'
- start: '1760170804000'
end: '1760171804000'
defenseScene: custom_acl
ruleStatus: '1'
defenseType: template
templateId: ${defaultfIoHt5.defenseTemplateId}
ruleName: custom_acl-create
variables:
default:
fn::invoke:
function: alicloud:wafv3:getDefenseRules
arguments:
ids:
- ${defaultDefenseRule.id}
defenseType: template
instanceId: ${defaultnxb04D.id}
outputs:
alicloudWafv3DefenseRuleExampleId: ${default.rules[0].id}
pulumi {
required_providers {
alicloud = {
source = "pulumi/alicloud"
}
}
}
data "alicloud_wafv3_getdefenserules" "default" {
ids = [alicloud_wafv3_defenserule.default.id]
defense_type = "template"
instance_id = alicloud_wafv3_instance.defaultnxb04D.id
}
resource "alicloud_wafv3_instance" "defaultnxb04D" {
}
resource "alicloud_wafv3_defensetemplate" "defaultfIoHt5" {
status = "1"
description = "testCreate"
instance_id = alicloud_wafv3_instance.defaultnxb04D.id
defense_template_name = "1782219650"
template_origin = "custom"
defense_scene = "custom_acl"
template_type = "user_custom"
}
resource "alicloud_wafv3_addressbook" "default9dtEmt" {
description = "test"
instance_id = alicloud_wafv3_instance.defaultnxb04D.id
address_book_name = "1782219650"
address_lists = ["100.100.100.100/32", "101.101.101.101/32", "102.102.102.102/32"]
address_book_type = "ip"
}
resource "alicloud_wafv3_addressbook" "defaultSB0uHV" {
description = "test"
instance_id = alicloud_wafv3_instance.defaultnxb04D.id
address_book_name = "1782219650"
address_lists = ["100.100.100.100/32", "101.101.101.101/32", "102.102.102.102/32"]
address_book_type = "ip"
}
resource "alicloud_wafv3_defenserule" "default" {
defense_origin = "custom"
instance_id = alicloud_wafv3_instance.defaultnxb04D.id
config = {
rule_action = "block"
conditions = [{
"opValue" = "contain"
"values" = "abc"
"key" = "URL"
}, {
"opValue" = "contain"
"values" = "abc"
"key" = "URLPath"
}, {
"opValue" = "contain"
"values" = "1.1.1.2"
"key" = "IP"
}, {
"key" = "IP"
"opValue" = "in-list"
"values" = alicloud_wafv3_addressbook.default9dtEmt.address_book_id
}]
cc_status = "0"
cc_effect = "service"
rate_limit = {
target = "remote_addr"
interval = "16"
threshold = "204"
ttl = "68"
status = {
code = "414"
count = "333"
}
sub_key = "testky1"
}
gray_status = "1"
gray_config = {
gray_target = "remote_addr"
gray_rate = "80"
}
time_config = {
time_scope = "period"
time_zone = "8"
time_periods = [{
"start" = "1760174804000"
"end" = "1760175804000"
}, {
"start" = "1760171804000"
"end" = "1760172804000"
}, {
"start" = "1760176804000"
"end" = "1760177804000"
}, {
"start" = "1760178804000"
"end" = "1760179804000"
}, {
"start" = "1760170804000"
"end" = "1760171804000"
}]
}
}
defense_scene = "custom_acl"
rule_status = "1"
defense_type = "template"
template_id = alicloud_wafv3_defensetemplate.defaultfIoHt5.defense_template_id
rule_name = "custom_acl-create"
}
variable "name" {
type = string
default = "terraform-example"
}
variable "regionId" {
type = string
default = "cn-hangzhou"
}
output "alicloudWafv3DefenseRuleExampleId" {
value = data.alicloud_wafv3_getdefenserules.default.rules[0].id
}
Using getDefenseRules
Two invocation forms are available. The direct form accepts plain arguments and either blocks until the result value is available, or returns a Promise-wrapped result. The output form accepts Input-wrapped arguments and returns an Output-wrapped result.
function getDefenseRules(args: GetDefenseRulesArgs, opts?: InvokeOptions): Promise<GetDefenseRulesResult>
function getDefenseRulesOutput(args: GetDefenseRulesOutputArgs, opts?: InvokeOptions): Output<GetDefenseRulesResult>def get_defense_rules(defense_type: Optional[str] = None,
enable_details: Optional[bool] = None,
ids: Optional[Sequence[str]] = None,
instance_id: Optional[str] = None,
output_file: Optional[str] = None,
query: Optional[str] = None,
rule_type: Optional[str] = None,
opts: Optional[InvokeOptions] = None) -> GetDefenseRulesResult
def get_defense_rules_output(defense_type: pulumi.Input[Optional[str]] = None,
enable_details: pulumi.Input[Optional[bool]] = None,
ids: pulumi.Input[Optional[Sequence[pulumi.Input[str]]]] = None,
instance_id: pulumi.Input[Optional[str]] = None,
output_file: pulumi.Input[Optional[str]] = None,
query: pulumi.Input[Optional[str]] = None,
rule_type: pulumi.Input[Optional[str]] = None,
opts: Optional[InvokeOptions] = None) -> Output[GetDefenseRulesResult]func GetDefenseRules(ctx *Context, args *GetDefenseRulesArgs, opts ...InvokeOption) (*GetDefenseRulesResult, error)
func GetDefenseRulesOutput(ctx *Context, args *GetDefenseRulesOutputArgs, opts ...InvokeOption) GetDefenseRulesResultOutput> Note: This function is named GetDefenseRules in the Go SDK.
public static class GetDefenseRules
{
public static Task<GetDefenseRulesResult> InvokeAsync(GetDefenseRulesArgs args, InvokeOptions? opts = null)
public static Output<GetDefenseRulesResult> Invoke(GetDefenseRulesInvokeArgs args, InvokeOptions? opts = null)
}public static CompletableFuture<GetDefenseRulesResult> getDefenseRules(GetDefenseRulesArgs args, InvokeOptions options)
public static Output<GetDefenseRulesResult> getDefenseRules(GetDefenseRulesArgs args, InvokeOptions options)
fn::invoke:
function: alicloud:wafv3/getDefenseRules:getDefenseRules
arguments:
# arguments dictionarydata "alicloud_wafv3_get_defense_rules" "name" {
# arguments
}The following arguments are supported:
- Instance
Id string - The ID of the Web Application Firewall (WAF) instance.
- Defense
Type string - The protection rule type. Value:
- Enable
Details bool - Default to
false. Set it totrueto call the per-ruleDescribeDefenseRuleAPI and fetch the fullconfigblock for each rule. - Ids List<string>
- A list of Defense Rule IDs. The value is formulated as
<instance_id>:<defense_type>:<rule_id>. - Output
File string - File name where to save data source results (after running
pulumi preview). - Query string
The query condition is converted into a string in JSON format constructed with a series of parameters.
NOTE: The results of the protection rules vary according to different query conditions. For more information, see Query parameter description.
- Rule
Type string - The protection rule type. Value:
- Instance
Id string - The ID of the Web Application Firewall (WAF) instance.
- Defense
Type string - The protection rule type. Value:
- Enable
Details bool - Default to
false. Set it totrueto call the per-ruleDescribeDefenseRuleAPI and fetch the fullconfigblock for each rule. - Ids []string
- A list of Defense Rule IDs. The value is formulated as
<instance_id>:<defense_type>:<rule_id>. - Output
File string - File name where to save data source results (after running
pulumi preview). - Query string
The query condition is converted into a string in JSON format constructed with a series of parameters.
NOTE: The results of the protection rules vary according to different query conditions. For more information, see Query parameter description.
- Rule
Type string - The protection rule type. Value:
- instance_
id string - The ID of the Web Application Firewall (WAF) instance.
- defense_
type string - The protection rule type. Value:
- enable_
details bool - Default to
false. Set it totrueto call the per-ruleDescribeDefenseRuleAPI and fetch the fullconfigblock for each rule. - ids list(string)
- A list of Defense Rule IDs. The value is formulated as
<instance_id>:<defense_type>:<rule_id>. - output_
file string - File name where to save data source results (after running
pulumi preview). - query string
The query condition is converted into a string in JSON format constructed with a series of parameters.
NOTE: The results of the protection rules vary according to different query conditions. For more information, see Query parameter description.
- rule_
type string - The protection rule type. Value:
- instance
Id String - The ID of the Web Application Firewall (WAF) instance.
- defense
Type String - The protection rule type. Value:
- enable
Details Boolean - Default to
false. Set it totrueto call the per-ruleDescribeDefenseRuleAPI and fetch the fullconfigblock for each rule. - ids List<String>
- A list of Defense Rule IDs. The value is formulated as
<instance_id>:<defense_type>:<rule_id>. - output
File String - File name where to save data source results (after running
pulumi preview). - query String
The query condition is converted into a string in JSON format constructed with a series of parameters.
NOTE: The results of the protection rules vary according to different query conditions. For more information, see Query parameter description.
- rule
Type String - The protection rule type. Value:
- instance
Id string - The ID of the Web Application Firewall (WAF) instance.
- defense
Type string - The protection rule type. Value:
- enable
Details boolean - Default to
false. Set it totrueto call the per-ruleDescribeDefenseRuleAPI and fetch the fullconfigblock for each rule. - ids string[]
- A list of Defense Rule IDs. The value is formulated as
<instance_id>:<defense_type>:<rule_id>. - output
File string - File name where to save data source results (after running
pulumi preview). - query string
The query condition is converted into a string in JSON format constructed with a series of parameters.
NOTE: The results of the protection rules vary according to different query conditions. For more information, see Query parameter description.
- rule
Type string - The protection rule type. Value:
- instance_
id str - The ID of the Web Application Firewall (WAF) instance.
- defense_
type str - The protection rule type. Value:
- enable_
details bool - Default to
false. Set it totrueto call the per-ruleDescribeDefenseRuleAPI and fetch the fullconfigblock for each rule. - ids Sequence[str]
- A list of Defense Rule IDs. The value is formulated as
<instance_id>:<defense_type>:<rule_id>. - output_
file str - File name where to save data source results (after running
pulumi preview). - query str
The query condition is converted into a string in JSON format constructed with a series of parameters.
NOTE: The results of the protection rules vary according to different query conditions. For more information, see Query parameter description.
- rule_
type str - The protection rule type. Value:
- instance
Id String - The ID of the Web Application Firewall (WAF) instance.
- defense
Type String - The protection rule type. Value:
- enable
Details Boolean - Default to
false. Set it totrueto call the per-ruleDescribeDefenseRuleAPI and fetch the fullconfigblock for each rule. - ids List<String>
- A list of Defense Rule IDs. The value is formulated as
<instance_id>:<defense_type>:<rule_id>. - output
File String - File name where to save data source results (after running
pulumi preview). - query String
The query condition is converted into a string in JSON format constructed with a series of parameters.
NOTE: The results of the protection rules vary according to different query conditions. For more information, see Query parameter description.
- rule
Type String - The protection rule type. Value:
getDefenseRules Result
The following output properties are available:
- Id string
- The provider-assigned unique ID for this managed resource.
- Ids List<string>
- A list of Defense Rule IDs.
- Instance
Id string - Rules
List<Pulumi.
Ali Cloud. Wafv3. Outputs. Get Defense Rules Rule> - A list of Defense Rule Entries. Each element contains the following attributes:
- Defense
Type string - The protection rule type.
- Enable
Details bool - Output
File string - Query string
- Rule
Type string - The type of the rule.
- Id string
- The provider-assigned unique ID for this managed resource.
- Ids []string
- A list of Defense Rule IDs.
- Instance
Id string - Rules
[]Get
Defense Rules Rule - A list of Defense Rule Entries. Each element contains the following attributes:
- Defense
Type string - The protection rule type.
- Enable
Details bool - Output
File string - Query string
- Rule
Type string - The type of the rule.
- id string
- The provider-assigned unique ID for this managed resource.
- ids list(string)
- A list of Defense Rule IDs.
- instance_
id string - rules list(object)
- A list of Defense Rule Entries. Each element contains the following attributes:
- defense_
type string - The protection rule type.
- enable_
details bool - output_
file string - query string
- rule_
type string - The type of the rule.
- id String
- The provider-assigned unique ID for this managed resource.
- ids List<String>
- A list of Defense Rule IDs.
- instance
Id String - rules
List<Get
Defense Rules Rule> - A list of Defense Rule Entries. Each element contains the following attributes:
- defense
Type String - The protection rule type.
- enable
Details Boolean - output
File String - query String
- rule
Type String - The type of the rule.
- id string
- The provider-assigned unique ID for this managed resource.
- ids string[]
- A list of Defense Rule IDs.
- instance
Id string - rules
Get
Defense Rules Rule[] - A list of Defense Rule Entries. Each element contains the following attributes:
- defense
Type string - The protection rule type.
- enable
Details boolean - output
File string - query string
- rule
Type string - The type of the rule.
- id str
- The provider-assigned unique ID for this managed resource.
- ids Sequence[str]
- A list of Defense Rule IDs.
- instance_
id str - rules
Sequence[Get
Defense Rules Rule] - A list of Defense Rule Entries. Each element contains the following attributes:
- defense_
type str - The protection rule type.
- enable_
details bool - output_
file str - query str
- rule_
type str - The type of the rule.
- id String
- The provider-assigned unique ID for this managed resource.
- ids List<String>
- A list of Defense Rule IDs.
- instance
Id String - rules List<Property Map>
- A list of Defense Rule Entries. Each element contains the following attributes:
- defense
Type String - The protection rule type.
- enable
Details Boolean - output
File String - query String
- rule
Type String - The type of the rule.
Supporting Types
GetDefenseRulesRule
- Configs
List<Pulumi.
Ali Cloud. Wafv3. Inputs. Get Defense Rules Rule Config> - Rule configuration content, in JSON format, constructed with a series of parameters.
- Defense
Origin string - Sources of protection.
- Defense
Scene string - The WAF protection scenario to be created.
- Defense
Type string - The protection rule type. Value:
- Gmt
Modified string - The modification time of the protection rule.
- Id string
- The ID of the resource supplied above.
- Resource string
- The protection object corresponding to the rule to be queried.
- Rule
Id int - The protection rule ID.
- Rule
Name string - The rule name.
- Rule
Status int - Protection rule status.
- Template
Id int - The protection template ID of the protection rule to be created.
- Configs
[]Get
Defense Rules Rule Config - Rule configuration content, in JSON format, constructed with a series of parameters.
- Defense
Origin string - Sources of protection.
- Defense
Scene string - The WAF protection scenario to be created.
- Defense
Type string - The protection rule type. Value:
- Gmt
Modified string - The modification time of the protection rule.
- Id string
- The ID of the resource supplied above.
- Resource string
- The protection object corresponding to the rule to be queried.
- Rule
Id int - The protection rule ID.
- Rule
Name string - The rule name.
- Rule
Status int - Protection rule status.
- Template
Id int - The protection template ID of the protection rule to be created.
- configs list(object)
- Rule configuration content, in JSON format, constructed with a series of parameters.
- defense_
origin string - Sources of protection.
- defense_
scene string - The WAF protection scenario to be created.
- defense_
type string - The protection rule type. Value:
- gmt_
modified string - The modification time of the protection rule.
- id string
- The ID of the resource supplied above.
- resource string
- The protection object corresponding to the rule to be queried.
- rule_
id number - The protection rule ID.
- rule_
name string - The rule name.
- rule_
status number - Protection rule status.
- template_
id number - The protection template ID of the protection rule to be created.
- configs
List<Get
Defense Rules Rule Config> - Rule configuration content, in JSON format, constructed with a series of parameters.
- defense
Origin String - Sources of protection.
- defense
Scene String - The WAF protection scenario to be created.
- defense
Type String - The protection rule type. Value:
- gmt
Modified String - The modification time of the protection rule.
- id String
- The ID of the resource supplied above.
- resource String
- The protection object corresponding to the rule to be queried.
- rule
Id Integer - The protection rule ID.
- rule
Name String - The rule name.
- rule
Status Integer - Protection rule status.
- template
Id Integer - The protection template ID of the protection rule to be created.
- configs
Get
Defense Rules Rule Config[] - Rule configuration content, in JSON format, constructed with a series of parameters.
- defense
Origin string - Sources of protection.
- defense
Scene string - The WAF protection scenario to be created.
- defense
Type string - The protection rule type. Value:
- gmt
Modified string - The modification time of the protection rule.
- id string
- The ID of the resource supplied above.
- resource string
- The protection object corresponding to the rule to be queried.
- rule
Id number - The protection rule ID.
- rule
Name string - The rule name.
- rule
Status number - Protection rule status.
- template
Id number - The protection template ID of the protection rule to be created.
- configs
Sequence[Get
Defense Rules Rule Config] - Rule configuration content, in JSON format, constructed with a series of parameters.
- defense_
origin str - Sources of protection.
- defense_
scene str - The WAF protection scenario to be created.
- defense_
type str - The protection rule type. Value:
- gmt_
modified str - The modification time of the protection rule.
- id str
- The ID of the resource supplied above.
- resource str
- The protection object corresponding to the rule to be queried.
- rule_
id int - The protection rule ID.
- rule_
name str - The rule name.
- rule_
status int - Protection rule status.
- template_
id int - The protection template ID of the protection rule to be created.
- configs List<Property Map>
- Rule configuration content, in JSON format, constructed with a series of parameters.
- defense
Origin String - Sources of protection.
- defense
Scene String - The WAF protection scenario to be created.
- defense
Type String - The protection rule type. Value:
- gmt
Modified String - The modification time of the protection rule.
- id String
- The ID of the resource supplied above.
- resource String
- The protection object corresponding to the rule to be queried.
- rule
Id Number - The protection rule ID.
- rule
Name String - The rule name.
- rule
Status Number - Protection rule status.
- template
Id Number - The protection template ID of the protection rule to be created.
GetDefenseRulesRuleConfig
- Abroad
Regions string - The regions outside China from which you want to block requests.
- Account
Identifiers List<Pulumi.Ali Cloud. Wafv3. Inputs. Get Defense Rules Rule Config Account Identifier> - The policies for account extraction.
- Auto
Update bool - Whether the new Web core protection rules are automatically updated.
- Bypass
Regular List<string>Rules - The list of regular rule IDs that are not detected.
- Bypass
Regular List<string>Types - The regular rule type is not detected.
- List<string>
- The modules to which the whitelist applies.
- Cc
Effect string - Set the effective range of the speed limit.
- Cc
Status int - Whether to open the speed limit.
- Cn
Regions string - The regions in China from which you want to block requests.
- Codec
Lists List<string> - The type to enable decoding.
- Conditions
List<Pulumi.
Ali Cloud. Wafv3. Inputs. Get Defense Rules Rule Config Condition> - The traffic characteristics of ACL, which are described in JSON format.
- Gray
Configs List<Pulumi.Ali Cloud. Wafv3. Inputs. Get Defense Rules Rule Config Gray Config> - The canary release configuration for the rule.
- Gray
Status int - Specifies whether to enable canary release for the rule.
- Mode int
- The HTTP flood protection mode.
- Protocol string
- The protocol type of the cached page address.
- Rate
Limits List<Pulumi.Ali Cloud. Wafv3. Inputs. Get Defense Rules Rule Config Rate Limit> - The detailed speed limit configuration, which is described in the JSON string format.
- Remote
Addrs List<string> - The IP addresses that you want to add to the blacklist.
- Rule
Action string - Web core protection rule action.
- Throttle
Threhold int - The throttling threshold.
- Throttle
Type string - The throttling method.
- Time
Configs List<Pulumi.Ali Cloud. Wafv3. Inputs. Get Defense Rules Rule Config Time Config> - The scheduled rule configuration.
- Ua string
- The User-Agent string that is allowed for access to the address.
- Url string
- The address of the cached page.
- Waf
Base List<Pulumi.Configs Ali Cloud. Wafv3. Inputs. Get Defense Rules Rule Config Waf Base Config> - The configuration of the Web core protection rules to be modified.
- Abroad
Regions string - The regions outside China from which you want to block requests.
- Account
Identifiers []GetDefense Rules Rule Config Account Identifier - The policies for account extraction.
- Auto
Update bool - Whether the new Web core protection rules are automatically updated.
- Bypass
Regular []stringRules - The list of regular rule IDs that are not detected.
- Bypass
Regular []stringTypes - The regular rule type is not detected.
- []string
- The modules to which the whitelist applies.
- Cc
Effect string - Set the effective range of the speed limit.
- Cc
Status int - Whether to open the speed limit.
- Cn
Regions string - The regions in China from which you want to block requests.
- Codec
Lists []string - The type to enable decoding.
- Conditions
[]Get
Defense Rules Rule Config Condition - The traffic characteristics of ACL, which are described in JSON format.
- Gray
Configs []GetDefense Rules Rule Config Gray Config - The canary release configuration for the rule.
- Gray
Status int - Specifies whether to enable canary release for the rule.
- Mode int
- The HTTP flood protection mode.
- Protocol string
- The protocol type of the cached page address.
- Rate
Limits []GetDefense Rules Rule Config Rate Limit - The detailed speed limit configuration, which is described in the JSON string format.
- Remote
Addrs []string - The IP addresses that you want to add to the blacklist.
- Rule
Action string - Web core protection rule action.
- Throttle
Threhold int - The throttling threshold.
- Throttle
Type string - The throttling method.
- Time
Configs []GetDefense Rules Rule Config Time Config - The scheduled rule configuration.
- Ua string
- The User-Agent string that is allowed for access to the address.
- Url string
- The address of the cached page.
- Waf
Base []GetConfigs Defense Rules Rule Config Waf Base Config - The configuration of the Web core protection rules to be modified.
- abroad_
regions string - The regions outside China from which you want to block requests.
- account_
identifiers list(object) - The policies for account extraction.
- auto_
update bool - Whether the new Web core protection rules are automatically updated.
- bypass_
regular_ list(string)rules - The list of regular rule IDs that are not detected.
- bypass_
regular_ list(string)types - The regular rule type is not detected.
- list(string)
- The modules to which the whitelist applies.
- cc_
effect string - Set the effective range of the speed limit.
- cc_
status number - Whether to open the speed limit.
- cn_
regions string - The regions in China from which you want to block requests.
- codec_
lists list(string) - The type to enable decoding.
- conditions list(object)
- The traffic characteristics of ACL, which are described in JSON format.
- gray_
configs list(object) - The canary release configuration for the rule.
- gray_
status number - Specifies whether to enable canary release for the rule.
- mode number
- The HTTP flood protection mode.
- protocol string
- The protocol type of the cached page address.
- rate_
limits list(object) - The detailed speed limit configuration, which is described in the JSON string format.
- remote_
addrs list(string) - The IP addresses that you want to add to the blacklist.
- rule_
action string - Web core protection rule action.
- throttle_
threhold number - The throttling threshold.
- throttle_
type string - The throttling method.
- time_
configs list(object) - The scheduled rule configuration.
- ua string
- The User-Agent string that is allowed for access to the address.
- url string
- The address of the cached page.
- waf_
base_ list(object)configs - The configuration of the Web core protection rules to be modified.
- abroad
Regions String - The regions outside China from which you want to block requests.
- account
Identifiers List<GetDefense Rules Rule Config Account Identifier> - The policies for account extraction.
- auto
Update Boolean - Whether the new Web core protection rules are automatically updated.
- bypass
Regular List<String>Rules - The list of regular rule IDs that are not detected.
- bypass
Regular List<String>Types - The regular rule type is not detected.
- List<String>
- The modules to which the whitelist applies.
- cc
Effect String - Set the effective range of the speed limit.
- cc
Status Integer - Whether to open the speed limit.
- cn
Regions String - The regions in China from which you want to block requests.
- codec
Lists List<String> - The type to enable decoding.
- conditions
List<Get
Defense Rules Rule Config Condition> - The traffic characteristics of ACL, which are described in JSON format.
- gray
Configs List<GetDefense Rules Rule Config Gray Config> - The canary release configuration for the rule.
- gray
Status Integer - Specifies whether to enable canary release for the rule.
- mode Integer
- The HTTP flood protection mode.
- protocol String
- The protocol type of the cached page address.
- rate
Limits List<GetDefense Rules Rule Config Rate Limit> - The detailed speed limit configuration, which is described in the JSON string format.
- remote
Addrs List<String> - The IP addresses that you want to add to the blacklist.
- rule
Action String - Web core protection rule action.
- throttle
Threhold Integer - The throttling threshold.
- throttle
Type String - The throttling method.
- time
Configs List<GetDefense Rules Rule Config Time Config> - The scheduled rule configuration.
- ua String
- The User-Agent string that is allowed for access to the address.
- url String
- The address of the cached page.
- waf
Base List<GetConfigs Defense Rules Rule Config Waf Base Config> - The configuration of the Web core protection rules to be modified.
- abroad
Regions string - The regions outside China from which you want to block requests.
- account
Identifiers GetDefense Rules Rule Config Account Identifier[] - The policies for account extraction.
- auto
Update boolean - Whether the new Web core protection rules are automatically updated.
- bypass
Regular string[]Rules - The list of regular rule IDs that are not detected.
- bypass
Regular string[]Types - The regular rule type is not detected.
- string[]
- The modules to which the whitelist applies.
- cc
Effect string - Set the effective range of the speed limit.
- cc
Status number - Whether to open the speed limit.
- cn
Regions string - The regions in China from which you want to block requests.
- codec
Lists string[] - The type to enable decoding.
- conditions
Get
Defense Rules Rule Config Condition[] - The traffic characteristics of ACL, which are described in JSON format.
- gray
Configs GetDefense Rules Rule Config Gray Config[] - The canary release configuration for the rule.
- gray
Status number - Specifies whether to enable canary release for the rule.
- mode number
- The HTTP flood protection mode.
- protocol string
- The protocol type of the cached page address.
- rate
Limits GetDefense Rules Rule Config Rate Limit[] - The detailed speed limit configuration, which is described in the JSON string format.
- remote
Addrs string[] - The IP addresses that you want to add to the blacklist.
- rule
Action string - Web core protection rule action.
- throttle
Threhold number - The throttling threshold.
- throttle
Type string - The throttling method.
- time
Configs GetDefense Rules Rule Config Time Config[] - The scheduled rule configuration.
- ua string
- The User-Agent string that is allowed for access to the address.
- url string
- The address of the cached page.
- waf
Base GetConfigs Defense Rules Rule Config Waf Base Config[] - The configuration of the Web core protection rules to be modified.
- abroad_
regions str - The regions outside China from which you want to block requests.
- account_
identifiers Sequence[GetDefense Rules Rule Config Account Identifier] - The policies for account extraction.
- auto_
update bool - Whether the new Web core protection rules are automatically updated.
- bypass_
regular_ Sequence[str]rules - The list of regular rule IDs that are not detected.
- bypass_
regular_ Sequence[str]types - The regular rule type is not detected.
- Sequence[str]
- The modules to which the whitelist applies.
- cc_
effect str - Set the effective range of the speed limit.
- cc_
status int - Whether to open the speed limit.
- cn_
regions str - The regions in China from which you want to block requests.
- codec_
lists Sequence[str] - The type to enable decoding.
- conditions
Sequence[Get
Defense Rules Rule Config Condition] - The traffic characteristics of ACL, which are described in JSON format.
- gray_
configs Sequence[GetDefense Rules Rule Config Gray Config] - The canary release configuration for the rule.
- gray_
status int - Specifies whether to enable canary release for the rule.
- mode int
- The HTTP flood protection mode.
- protocol str
- The protocol type of the cached page address.
- rate_
limits Sequence[GetDefense Rules Rule Config Rate Limit] - The detailed speed limit configuration, which is described in the JSON string format.
- remote_
addrs Sequence[str] - The IP addresses that you want to add to the blacklist.
- rule_
action str - Web core protection rule action.
- throttle_
threhold int - The throttling threshold.
- throttle_
type str - The throttling method.
- time_
configs Sequence[GetDefense Rules Rule Config Time Config] - The scheduled rule configuration.
- ua str
- The User-Agent string that is allowed for access to the address.
- url str
- The address of the cached page.
- waf_
base_ Sequence[Getconfigs Defense Rules Rule Config Waf Base Config] - The configuration of the Web core protection rules to be modified.
- abroad
Regions String - The regions outside China from which you want to block requests.
- account
Identifiers List<Property Map> - The policies for account extraction.
- auto
Update Boolean - Whether the new Web core protection rules are automatically updated.
- bypass
Regular List<String>Rules - The list of regular rule IDs that are not detected.
- bypass
Regular List<String>Types - The regular rule type is not detected.
- List<String>
- The modules to which the whitelist applies.
- cc
Effect String - Set the effective range of the speed limit.
- cc
Status Number - Whether to open the speed limit.
- cn
Regions String - The regions in China from which you want to block requests.
- codec
Lists List<String> - The type to enable decoding.
- conditions List<Property Map>
- The traffic characteristics of ACL, which are described in JSON format.
- gray
Configs List<Property Map> - The canary release configuration for the rule.
- gray
Status Number - Specifies whether to enable canary release for the rule.
- mode Number
- The HTTP flood protection mode.
- protocol String
- The protocol type of the cached page address.
- rate
Limits List<Property Map> - The detailed speed limit configuration, which is described in the JSON string format.
- remote
Addrs List<String> - The IP addresses that you want to add to the blacklist.
- rule
Action String - Web core protection rule action.
- throttle
Threhold Number - The throttling threshold.
- throttle
Type String - The throttling method.
- time
Configs List<Property Map> - The scheduled rule configuration.
- ua String
- The User-Agent string that is allowed for access to the address.
- url String
- The address of the cached page.
- waf
Base List<Property Map>Configs - The configuration of the Web core protection rules to be modified.
GetDefenseRulesRuleConfigAccountIdentifier
- Decode
Type string - The authentication mode.
- Key string
- Match field.
- Position string
- The field that stores the decoded account information.
- Priority int
- The priority of the current extraction configuration.
- Sub
Key string - The characteristics of the statistical object.
- Decode
Type string - The authentication mode.
- Key string
- Match field.
- Position string
- The field that stores the decoded account information.
- Priority int
- The priority of the current extraction configuration.
- Sub
Key string - The characteristics of the statistical object.
- decode_
type string - The authentication mode.
- key string
- Match field.
- position string
- The field that stores the decoded account information.
- priority number
- The priority of the current extraction configuration.
- sub_
key string - The characteristics of the statistical object.
- decode
Type String - The authentication mode.
- key String
- Match field.
- position String
- The field that stores the decoded account information.
- priority Integer
- The priority of the current extraction configuration.
- sub
Key String - The characteristics of the statistical object.
- decode
Type string - The authentication mode.
- key string
- Match field.
- position string
- The field that stores the decoded account information.
- priority number
- The priority of the current extraction configuration.
- sub
Key string - The characteristics of the statistical object.
- decode_
type str - The authentication mode.
- key str
- Match field.
- position str
- The field that stores the decoded account information.
- priority int
- The priority of the current extraction configuration.
- sub_
key str - The characteristics of the statistical object.
- decode
Type String - The authentication mode.
- key String
- Match field.
- position String
- The field that stores the decoded account information.
- priority Number
- The priority of the current extraction configuration.
- sub
Key String - The characteristics of the statistical object.
GetDefenseRulesRuleConfigCondition
GetDefenseRulesRuleConfigGrayConfig
- Gray
Rate int - The percentage of traffic for which the canary release takes effect.
- Gray
Sub stringKey - The sub-feature of the statistical object.
- Gray
Target string - The type of the canary release object.
- Gray
Rate int - The percentage of traffic for which the canary release takes effect.
- Gray
Sub stringKey - The sub-feature of the statistical object.
- Gray
Target string - The type of the canary release object.
- gray_
rate number - The percentage of traffic for which the canary release takes effect.
- gray_
sub_ stringkey - The sub-feature of the statistical object.
- gray_
target string - The type of the canary release object.
- gray
Rate Integer - The percentage of traffic for which the canary release takes effect.
- gray
Sub StringKey - The sub-feature of the statistical object.
- gray
Target String - The type of the canary release object.
- gray
Rate number - The percentage of traffic for which the canary release takes effect.
- gray
Sub stringKey - The sub-feature of the statistical object.
- gray
Target string - The type of the canary release object.
- gray_
rate int - The percentage of traffic for which the canary release takes effect.
- gray_
sub_ strkey - The sub-feature of the statistical object.
- gray_
target str - The type of the canary release object.
- gray
Rate Number - The percentage of traffic for which the canary release takes effect.
- gray
Sub StringKey - The sub-feature of the statistical object.
- gray
Target String - The type of the canary release object.
GetDefenseRulesRuleConfigRateLimit
- Interval int
- The statistical period, in seconds.
- Statuses
List<Pulumi.
Ali Cloud. Wafv3. Inputs. Get Defense Rules Rule Config Rate Limit Status> - Response code frequency setting.
- Sub
Key string - The characteristics of the statistical object.
- Target string
- The type of the statistical object.
- Threshold int
- The maximum number of requests that can be sent from a statistical object.
- Ttl int
- The period of time during which you want the specified action to be valid.
- Interval int
- The statistical period, in seconds.
- Statuses
[]Get
Defense Rules Rule Config Rate Limit Status - Response code frequency setting.
- Sub
Key string - The characteristics of the statistical object.
- Target string
- The type of the statistical object.
- Threshold int
- The maximum number of requests that can be sent from a statistical object.
- Ttl int
- The period of time during which you want the specified action to be valid.
- interval number
- The statistical period, in seconds.
- statuses list(object)
- Response code frequency setting.
- sub_
key string - The characteristics of the statistical object.
- target string
- The type of the statistical object.
- threshold number
- The maximum number of requests that can be sent from a statistical object.
- ttl number
- The period of time during which you want the specified action to be valid.
- interval Integer
- The statistical period, in seconds.
- statuses
List<Get
Defense Rules Rule Config Rate Limit Status> - Response code frequency setting.
- sub
Key String - The characteristics of the statistical object.
- target String
- The type of the statistical object.
- threshold Integer
- The maximum number of requests that can be sent from a statistical object.
- ttl Integer
- The period of time during which you want the specified action to be valid.
- interval number
- The statistical period, in seconds.
- statuses
Get
Defense Rules Rule Config Rate Limit Status[] - Response code frequency setting.
- sub
Key string - The characteristics of the statistical object.
- target string
- The type of the statistical object.
- threshold number
- The maximum number of requests that can be sent from a statistical object.
- ttl number
- The period of time during which you want the specified action to be valid.
- interval int
- The statistical period, in seconds.
- statuses
Sequence[Get
Defense Rules Rule Config Rate Limit Status] - Response code frequency setting.
- sub_
key str - The characteristics of the statistical object.
- target str
- The type of the statistical object.
- threshold int
- The maximum number of requests that can be sent from a statistical object.
- ttl int
- The period of time during which you want the specified action to be valid.
- interval Number
- The statistical period, in seconds.
- statuses List<Property Map>
- Response code frequency setting.
- sub
Key String - The characteristics of the statistical object.
- target String
- The type of the statistical object.
- threshold Number
- The maximum number of requests that can be sent from a statistical object.
- ttl Number
- The period of time during which you want the specified action to be valid.
GetDefenseRulesRuleConfigRateLimitStatus
GetDefenseRulesRuleConfigTimeConfig
- Time
Periods List<Pulumi.Ali Cloud. Wafv3. Inputs. Get Defense Rules Rule Config Time Config Time Period> - The time period during which the rule is effective.
- Time
Scope string - The effective period of the rule.
- Time
Zone int - The time zone in which the rule is effective.
- Week
Time List<Pulumi.Periods Ali Cloud. Wafv3. Inputs. Get Defense Rules Rule Config Time Config Week Time Period> - The periodic time period during which the rule is effective.
- Time
Periods []GetDefense Rules Rule Config Time Config Time Period - The time period during which the rule is effective.
- Time
Scope string - The effective period of the rule.
- Time
Zone int - The time zone in which the rule is effective.
- Week
Time []GetPeriods Defense Rules Rule Config Time Config Week Time Period - The periodic time period during which the rule is effective.
- time_
periods list(object) - The time period during which the rule is effective.
- time_
scope string - The effective period of the rule.
- time_
zone number - The time zone in which the rule is effective.
- week_
time_ list(object)periods - The periodic time period during which the rule is effective.
- time
Periods List<GetDefense Rules Rule Config Time Config Time Period> - The time period during which the rule is effective.
- time
Scope String - The effective period of the rule.
- time
Zone Integer - The time zone in which the rule is effective.
- week
Time List<GetPeriods Defense Rules Rule Config Time Config Week Time Period> - The periodic time period during which the rule is effective.
- time
Periods GetDefense Rules Rule Config Time Config Time Period[] - The time period during which the rule is effective.
- time
Scope string - The effective period of the rule.
- time
Zone number - The time zone in which the rule is effective.
- week
Time GetPeriods Defense Rules Rule Config Time Config Week Time Period[] - The periodic time period during which the rule is effective.
- time_
periods Sequence[GetDefense Rules Rule Config Time Config Time Period] - The time period during which the rule is effective.
- time_
scope str - The effective period of the rule.
- time_
zone int - The time zone in which the rule is effective.
- week_
time_ Sequence[Getperiods Defense Rules Rule Config Time Config Week Time Period] - The periodic time period during which the rule is effective.
- time
Periods List<Property Map> - The time period during which the rule is effective.
- time
Scope String - The effective period of the rule.
- time
Zone Number - The time zone in which the rule is effective.
- week
Time List<Property Map>Periods - The periodic time period during which the rule is effective.
GetDefenseRulesRuleConfigTimeConfigTimePeriod
GetDefenseRulesRuleConfigTimeConfigWeekTimePeriod
- Day string
- The time period of each day when the rule is effective.
- Day
Periods List<Pulumi.Ali Cloud. Wafv3. Inputs. Get Defense Rules Rule Config Time Config Week Time Period Day Period> - The time period of each day when the rule is effective.
- Day string
- The time period of each day when the rule is effective.
- Day
Periods []GetDefense Rules Rule Config Time Config Week Time Period Day Period - The time period of each day when the rule is effective.
- day string
- The time period of each day when the rule is effective.
- day_
periods list(object) - The time period of each day when the rule is effective.
- day String
- The time period of each day when the rule is effective.
- day
Periods List<GetDefense Rules Rule Config Time Config Week Time Period Day Period> - The time period of each day when the rule is effective.
- day string
- The time period of each day when the rule is effective.
- day
Periods GetDefense Rules Rule Config Time Config Week Time Period Day Period[] - The time period of each day when the rule is effective.
- day str
- The time period of each day when the rule is effective.
- day_
periods Sequence[GetDefense Rules Rule Config Time Config Week Time Period Day Period] - The time period of each day when the rule is effective.
- day String
- The time period of each day when the rule is effective.
- day
Periods List<Property Map> - The time period of each day when the rule is effective.
GetDefenseRulesRuleConfigTimeConfigWeekTimePeriodDayPeriod
GetDefenseRulesRuleConfigWafBaseConfig
- Rule
Batch stringOperation Config - The batch operation on rules.
- Rule
Details List<Pulumi.Ali Cloud. Wafv3. Inputs. Get Defense Rules Rule Config Waf Base Config Rule Detail> - The configuration of the Web core protection rules to be modified.
- Rule
Type string - The protection rule type. Value:
- Rule
Batch stringOperation Config - The batch operation on rules.
- Rule
Details []GetDefense Rules Rule Config Waf Base Config Rule Detail - The configuration of the Web core protection rules to be modified.
- Rule
Type string - The protection rule type. Value:
- rule_
batch_ stringoperation_ config - The batch operation on rules.
- rule_
details list(object) - The configuration of the Web core protection rules to be modified.
- rule_
type string - The protection rule type. Value:
- rule
Batch StringOperation Config - The batch operation on rules.
- rule
Details List<GetDefense Rules Rule Config Waf Base Config Rule Detail> - The configuration of the Web core protection rules to be modified.
- rule
Type String - The protection rule type. Value:
- rule
Batch stringOperation Config - The batch operation on rules.
- rule
Details GetDefense Rules Rule Config Waf Base Config Rule Detail[] - The configuration of the Web core protection rules to be modified.
- rule
Type string - The protection rule type. Value:
- rule_
batch_ stroperation_ config - The batch operation on rules.
- rule_
details Sequence[GetDefense Rules Rule Config Waf Base Config Rule Detail] - The configuration of the Web core protection rules to be modified.
- rule_
type str - The protection rule type. Value:
- rule
Batch StringOperation Config - The batch operation on rules.
- rule
Details List<Property Map> - The configuration of the Web core protection rules to be modified.
- rule
Type String - The protection rule type. Value:
GetDefenseRulesRuleConfigWafBaseConfigRuleDetail
- Rule
Action string - Web core protection rule action.
- Rule
Id string - The protection rule ID.
- Rule
Status int - Protection rule status.
- Rule
Action string - Web core protection rule action.
- Rule
Id string - The protection rule ID.
- Rule
Status int - Protection rule status.
- rule_
action string - Web core protection rule action.
- rule_
id string - The protection rule ID.
- rule_
status number - Protection rule status.
- rule
Action String - Web core protection rule action.
- rule
Id String - The protection rule ID.
- rule
Status Integer - Protection rule status.
- rule
Action string - Web core protection rule action.
- rule
Id string - The protection rule ID.
- rule
Status number - Protection rule status.
- rule_
action str - Web core protection rule action.
- rule_
id str - The protection rule ID.
- rule_
status int - Protection rule status.
- rule
Action String - Web core protection rule action.
- rule
Id String - The protection rule ID.
- rule
Status Number - Protection rule status.
Package Details
- Repository
- Alibaba Cloud pulumi/pulumi-alicloud
- License
- Apache-2.0
- Notes
- This Pulumi package is based on the
alicloudTerraform Provider.
published on Thursday, Jul 16, 2026 by Pulumi