Rule Args
data class RuleArgs(val category: Output<Int>? = null, val content: Output<String>? = null, val contentCategory: Output<String>? = null, val description: Output<String>? = null, val lang: Output<String>? = null, val productCode: Output<String>? = null, val productId: Output<String>? = null, val riskLevelId: Output<String>? = null, val ruleName: Output<String>? = null, val ruleType: Output<Int>? = null, val statExpress: Output<String>? = null, val status: Output<Int>? = null, val target: Output<String>? = null, val warnLevel: Output<Int>? = null) : ConvertibleToJava<RuleArgs>
Provides a Data Security Center Rule resource. For information about Data Security Center Rule and how to use it, see What is Rule.
NOTE: Available since v1.132.0.
Example Usage
Basic Usage
import * as pulumi from "@pulumi/pulumi";
import * as alicloud from "@pulumi/alicloud";
const config = new pulumi.Config();
const name = config.get("name") || "tf-example-name";
const _default = new alicloud.sddp.Rule("default", {
ruleName: name,
category: 2,
content: ` [
{
"rule": [
{
"operator": "contains",
"target": "content",
"value": "tf-testACCContent"
}
],
"ruleRelation": "AND"
}
]
`,
riskLevelId: "4",
productCode: "OSS",
});Content copied to clipboard
import pulumi
import pulumi_alicloud as alicloud
config = pulumi.Config()
name = config.get("name")
if name is None:
name = "tf-example-name"
default = alicloud.sddp.Rule("default",
rule_name=name,
category=2,
content=""" [
{
"rule": [
{
"operator": "contains",
"target": "content",
"value": "tf-testACCContent"
}
],
"ruleRelation": "AND"
}
]
""",
risk_level_id="4",
product_code="OSS")Content copied to clipboard
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-name";
var @default = new AliCloud.Sddp.Rule("default", new()
{
RuleName = name,
Category = 2,
Content = @" [
{
""rule"": [
{
""operator"": ""contains"",
""target"": ""content"",
""value"": ""tf-testACCContent""
}
],
""ruleRelation"": ""AND""
}
]
",
RiskLevelId = "4",
ProductCode = "OSS",
});
});Content copied to clipboard
package main
import (
"github.com/pulumi/pulumi-alicloud/sdk/v3/go/alicloud/sddp"
"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-name"
if param := cfg.Get("name"); param != "" {
name = param
}
_, err := sddp.NewRule(ctx, "default", &sddp.RuleArgs{
RuleName: pulumi.String(name),
Category: pulumi.Int(2),
Content: pulumi.String(` [
{
"rule": [
{
"operator": "contains",
"target": "content",
"value": "tf-testACCContent"
}
],
"ruleRelation": "AND"
}
]
`),
RiskLevelId: pulumi.String("4"),
ProductCode: pulumi.String("OSS"),
})
if err != nil {
return err
}
return nil
})
}Content copied to clipboard
package generated_program;
import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.alicloud.sddp.Rule;
import com.pulumi.alicloud.sddp.RuleArgs;
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-name");
var default_ = new Rule("default", RuleArgs.builder()
.ruleName(name)
.category("2")
.content("""
[
{
"rule": [
{
"operator": "contains",
"target": "content",
"value": "tf-testACCContent"
}
],
"ruleRelation": "AND"
}
]
""")
.riskLevelId("4")
.productCode("OSS")
.build());
}
}Content copied to clipboard
configuration:
name:
type: string
default: tf-example-name
resources:
default:
type: alicloud:sddp:Rule
properties:
ruleName: ${name}
category: '2'
content: |2
[
{
"rule": [
{
"operator": "contains",
"target": "content",
"value": "tf-testACCContent"
}
],
"ruleRelation": "AND"
}
]
riskLevelId: '4'
productCode: OSSContent copied to clipboard
Import
Data Security Center Rule can be imported using the id, e.g.
$ pulumi import alicloud:sddp/rule:Rule example <id>Content copied to clipboard
Constructors
Link copied to clipboard
fun RuleArgs(category: Output<Int>? = null, content: Output<String>? = null, contentCategory: Output<String>? = null, description: Output<String>? = null, lang: Output<String>? = null, productCode: Output<String>? = null, productId: Output<String>? = null, riskLevelId: Output<String>? = null, ruleName: Output<String>? = null, ruleType: Output<Int>? = null, statExpress: Output<String>? = null, status: Output<Int>? = null, target: Output<String>? = null, warnLevel: Output<Int>? = null)