Provides a Data Security Center Rule resource.
For information about Data Security Center Rule and how to use it, see What is Rule.
Basic Usage
variable "name" {
default = "tf-example-name"
}
resource "alicloud_sddp_rule" "default" {
rule_name = var.name
category = "2"
content = <<EOF
[
{
"rule": [
{
"operator": "contains",
"target": "content",
"value": "tf-testACCContent"
}
],
"ruleRelation": "AND"
}
]
EOF
risk_level_id = "4"
product_code = "OSS"
}
[
{
"rule": [
{
"operator": "contains",
"target": "content",
"value": "tf-testACCContent"
}
],
"ruleRelation": "AND"
}
]
EOF
risk_level_id = "4"
product_code = "OSS"
}
The following arguments are supported:
rule_name
- (Required) The name of the sensitive data detection rule. NOTE: From version 1.222.0, rule_name
can be modified.category
- (Required, Int) The content type of the sensitive data detection rule. Valid values:
0
: Keyword.2
: Regular expression.
NOTE: From version 1.222.0, category
can be modified.content
- (Required) The content of the sensitive data detection rule. NOTE: From version 1.222.0, content
can be modified.content_category
- (Optional, ForceNew) The type of the content in the sensitive data detection rule. NOTE: From version 1.222.0, content_category
cannot be modified.risk_level_id
- (Optional) The sensitivity level of the sensitive data that hits the sensitive data detection rule. Valid values:
2
: S1, which indicates the low sensitivity level.3
: S2, which indicates the medium sensitivity level.4
: S3, which indicates the high sensitivity level.5
: S4, which indicates the highest sensitivity level.rule_type
- (Optional, Int) The type of the sensitive data detection rule. Valid values:
1
: Sensitive data detection rule.2
: Audit rule.3
: Anomalous event detection rule.product_code
- (Optional) The name of the service to which data in the column of the table belongs. Valid values: OSS
, RDS
, ODPS
(MaxCompute).product_id
- (Optional) The ID of the service to which the data asset belongs. Valid values:
1
:MaxCompute.2
:OSS.5
:RDS.warn_level
- (Optional, Int) The risk level of the alert that is triggered. Valid values:
1
: Low warn Level.2
: Medium Risk Level.3
: High Risk Level.stat_express
- (Optional, ForceNew) The statistical expression. NOTE: From version 1.222.0, stat_express
cannot be modified.target
- (Optional, ForceNew) The code of the service to which the sensitive data detection rule is applied. NOTE: From version 1.222.0, target
cannot be modified.status
- (Optional) Sensitive Specifies whether to enable the sensitive data detection rule. Valid values:
0
: Disable.1
: Enable.description
- (Optional, ForceNew) The description of the rule. NOTE: From version 1.222.0, description
cannot be modified.lang
- (Optional) The language of the content within the request and response. Default value: zh
. Valid values:
zh
: Chinese.en
: English.The following attributes are exported:
id
- The resource ID in terraform of Rule.custom_type
- The type of the sensitive data detection rule. NOTE: From version 1.222.0, custom_type
cannot be specified when create Rule.Data Security Center Rule can be imported using the id, e.g.
$ terraform import alicloud_sddp_rule.example <id>