tencentcloud.WafAttackWhiteRule
Explore with Pulumi AI
Provides a resource to create a WAF attack white rule
Example Usage
Using type_ids
import * as pulumi from "@pulumi/pulumi";
import * as tencentcloud from "@pulumi/tencentcloud";
const example = new tencentcloud.WafAttackWhiteRule("example", {
domain: "www.demo.com",
mode: 0,
rules: [
{
matchContent: "1.1.1.1",
matchField: "IP",
matchMethod: "ipmatch",
},
{
matchContent: "referer content",
matchField: "Referer",
matchMethod: "eq",
},
{
matchContent: "/prefix",
matchField: "URL",
matchMethod: "contains",
},
{
matchContent: "POST",
matchField: "HTTP_METHOD",
matchMethod: "neq",
},
{
matchContent: "value",
matchField: "GET",
matchMethod: "ncontains",
matchParams: "key",
},
],
status: 1,
typeIds: [
"010000000",
"020000000",
"030000000",
"040000000",
"050000000",
"060000000",
"090000000",
"110000000",
],
});
import pulumi
import pulumi_tencentcloud as tencentcloud
example = tencentcloud.WafAttackWhiteRule("example",
domain="www.demo.com",
mode=0,
rules=[
{
"match_content": "1.1.1.1",
"match_field": "IP",
"match_method": "ipmatch",
},
{
"match_content": "referer content",
"match_field": "Referer",
"match_method": "eq",
},
{
"match_content": "/prefix",
"match_field": "URL",
"match_method": "contains",
},
{
"match_content": "POST",
"match_field": "HTTP_METHOD",
"match_method": "neq",
},
{
"match_content": "value",
"match_field": "GET",
"match_method": "ncontains",
"match_params": "key",
},
],
status=1,
type_ids=[
"010000000",
"020000000",
"030000000",
"040000000",
"050000000",
"060000000",
"090000000",
"110000000",
])
package main
import (
"github.com/pulumi/pulumi-terraform-provider/sdks/go/tencentcloud/tencentcloud"
"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)
func main() {
pulumi.Run(func(ctx *pulumi.Context) error {
_, err := tencentcloud.NewWafAttackWhiteRule(ctx, "example", &tencentcloud.WafAttackWhiteRuleArgs{
Domain: pulumi.String("www.demo.com"),
Mode: pulumi.Float64(0),
Rules: tencentcloud.WafAttackWhiteRuleRuleArray{
&tencentcloud.WafAttackWhiteRuleRuleArgs{
MatchContent: pulumi.String("1.1.1.1"),
MatchField: pulumi.String("IP"),
MatchMethod: pulumi.String("ipmatch"),
},
&tencentcloud.WafAttackWhiteRuleRuleArgs{
MatchContent: pulumi.String("referer content"),
MatchField: pulumi.String("Referer"),
MatchMethod: pulumi.String("eq"),
},
&tencentcloud.WafAttackWhiteRuleRuleArgs{
MatchContent: pulumi.String("/prefix"),
MatchField: pulumi.String("URL"),
MatchMethod: pulumi.String("contains"),
},
&tencentcloud.WafAttackWhiteRuleRuleArgs{
MatchContent: pulumi.String("POST"),
MatchField: pulumi.String("HTTP_METHOD"),
MatchMethod: pulumi.String("neq"),
},
&tencentcloud.WafAttackWhiteRuleRuleArgs{
MatchContent: pulumi.String("value"),
MatchField: pulumi.String("GET"),
MatchMethod: pulumi.String("ncontains"),
MatchParams: pulumi.String("key"),
},
},
Status: pulumi.Float64(1),
TypeIds: pulumi.StringArray{
pulumi.String("010000000"),
pulumi.String("020000000"),
pulumi.String("030000000"),
pulumi.String("040000000"),
pulumi.String("050000000"),
pulumi.String("060000000"),
pulumi.String("090000000"),
pulumi.String("110000000"),
},
})
if err != nil {
return err
}
return nil
})
}
using System.Collections.Generic;
using System.Linq;
using Pulumi;
using Tencentcloud = Pulumi.Tencentcloud;
return await Deployment.RunAsync(() =>
{
var example = new Tencentcloud.WafAttackWhiteRule("example", new()
{
Domain = "www.demo.com",
Mode = 0,
Rules = new[]
{
new Tencentcloud.Inputs.WafAttackWhiteRuleRuleArgs
{
MatchContent = "1.1.1.1",
MatchField = "IP",
MatchMethod = "ipmatch",
},
new Tencentcloud.Inputs.WafAttackWhiteRuleRuleArgs
{
MatchContent = "referer content",
MatchField = "Referer",
MatchMethod = "eq",
},
new Tencentcloud.Inputs.WafAttackWhiteRuleRuleArgs
{
MatchContent = "/prefix",
MatchField = "URL",
MatchMethod = "contains",
},
new Tencentcloud.Inputs.WafAttackWhiteRuleRuleArgs
{
MatchContent = "POST",
MatchField = "HTTP_METHOD",
MatchMethod = "neq",
},
new Tencentcloud.Inputs.WafAttackWhiteRuleRuleArgs
{
MatchContent = "value",
MatchField = "GET",
MatchMethod = "ncontains",
MatchParams = "key",
},
},
Status = 1,
TypeIds = new[]
{
"010000000",
"020000000",
"030000000",
"040000000",
"050000000",
"060000000",
"090000000",
"110000000",
},
});
});
package generated_program;
import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.tencentcloud.WafAttackWhiteRule;
import com.pulumi.tencentcloud.WafAttackWhiteRuleArgs;
import com.pulumi.tencentcloud.inputs.WafAttackWhiteRuleRuleArgs;
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) {
var example = new WafAttackWhiteRule("example", WafAttackWhiteRuleArgs.builder()
.domain("www.demo.com")
.mode(0)
.rules(
WafAttackWhiteRuleRuleArgs.builder()
.matchContent("1.1.1.1")
.matchField("IP")
.matchMethod("ipmatch")
.build(),
WafAttackWhiteRuleRuleArgs.builder()
.matchContent("referer content")
.matchField("Referer")
.matchMethod("eq")
.build(),
WafAttackWhiteRuleRuleArgs.builder()
.matchContent("/prefix")
.matchField("URL")
.matchMethod("contains")
.build(),
WafAttackWhiteRuleRuleArgs.builder()
.matchContent("POST")
.matchField("HTTP_METHOD")
.matchMethod("neq")
.build(),
WafAttackWhiteRuleRuleArgs.builder()
.matchContent("value")
.matchField("GET")
.matchMethod("ncontains")
.matchParams("key")
.build())
.status(1)
.typeIds(
"010000000",
"020000000",
"030000000",
"040000000",
"050000000",
"060000000",
"090000000",
"110000000")
.build());
}
}
resources:
example:
type: tencentcloud:WafAttackWhiteRule
properties:
domain: www.demo.com
mode: 0
rules:
- matchContent: 1.1.1.1
matchField: IP
matchMethod: ipmatch
- matchContent: referer content
matchField: Referer
matchMethod: eq
- matchContent: /prefix
matchField: URL
matchMethod: contains
- matchContent: POST
matchField: HTTP_METHOD
matchMethod: neq
- matchContent: value
matchField: GET
matchMethod: ncontains
matchParams: key
status: 1
typeIds:
- '010000000'
- '020000000'
- '030000000'
- '040000000'
- '050000000'
- '060000000'
- '090000000'
- '110000000'
Using signature_ids
import * as pulumi from "@pulumi/pulumi";
import * as tencentcloud from "@pulumi/tencentcloud";
const example = new tencentcloud.WafAttackWhiteRule("example", {
domain: "www.demo.com",
mode: 1,
rules: [{
matchContent: "1.1.1.1",
matchField: "IP",
matchMethod: "ipmatch",
}],
signatureIds: [
"60270036",
"10000047",
],
status: 0,
});
import pulumi
import pulumi_tencentcloud as tencentcloud
example = tencentcloud.WafAttackWhiteRule("example",
domain="www.demo.com",
mode=1,
rules=[{
"match_content": "1.1.1.1",
"match_field": "IP",
"match_method": "ipmatch",
}],
signature_ids=[
"60270036",
"10000047",
],
status=0)
package main
import (
"github.com/pulumi/pulumi-terraform-provider/sdks/go/tencentcloud/tencentcloud"
"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)
func main() {
pulumi.Run(func(ctx *pulumi.Context) error {
_, err := tencentcloud.NewWafAttackWhiteRule(ctx, "example", &tencentcloud.WafAttackWhiteRuleArgs{
Domain: pulumi.String("www.demo.com"),
Mode: pulumi.Float64(1),
Rules: tencentcloud.WafAttackWhiteRuleRuleArray{
&tencentcloud.WafAttackWhiteRuleRuleArgs{
MatchContent: pulumi.String("1.1.1.1"),
MatchField: pulumi.String("IP"),
MatchMethod: pulumi.String("ipmatch"),
},
},
SignatureIds: pulumi.StringArray{
pulumi.String("60270036"),
pulumi.String("10000047"),
},
Status: pulumi.Float64(0),
})
if err != nil {
return err
}
return nil
})
}
using System.Collections.Generic;
using System.Linq;
using Pulumi;
using Tencentcloud = Pulumi.Tencentcloud;
return await Deployment.RunAsync(() =>
{
var example = new Tencentcloud.WafAttackWhiteRule("example", new()
{
Domain = "www.demo.com",
Mode = 1,
Rules = new[]
{
new Tencentcloud.Inputs.WafAttackWhiteRuleRuleArgs
{
MatchContent = "1.1.1.1",
MatchField = "IP",
MatchMethod = "ipmatch",
},
},
SignatureIds = new[]
{
"60270036",
"10000047",
},
Status = 0,
});
});
package generated_program;
import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.tencentcloud.WafAttackWhiteRule;
import com.pulumi.tencentcloud.WafAttackWhiteRuleArgs;
import com.pulumi.tencentcloud.inputs.WafAttackWhiteRuleRuleArgs;
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) {
var example = new WafAttackWhiteRule("example", WafAttackWhiteRuleArgs.builder()
.domain("www.demo.com")
.mode(1)
.rules(WafAttackWhiteRuleRuleArgs.builder()
.matchContent("1.1.1.1")
.matchField("IP")
.matchMethod("ipmatch")
.build())
.signatureIds(
"60270036",
"10000047")
.status(0)
.build());
}
}
resources:
example:
type: tencentcloud:WafAttackWhiteRule
properties:
domain: www.demo.com
mode: 1
rules:
- matchContent: 1.1.1.1
matchField: IP
matchMethod: ipmatch
signatureIds:
- '60270036'
- '10000047'
status: 0
Create WafAttackWhiteRule Resource
Resources are created with functions called constructors. To learn more about declaring and configuring resources, see Resources.
Constructor syntax
new WafAttackWhiteRule(name: string, args: WafAttackWhiteRuleArgs, opts?: CustomResourceOptions);
@overload
def WafAttackWhiteRule(resource_name: str,
args: WafAttackWhiteRuleArgs,
opts: Optional[ResourceOptions] = None)
@overload
def WafAttackWhiteRule(resource_name: str,
opts: Optional[ResourceOptions] = None,
domain: Optional[str] = None,
rules: Optional[Sequence[WafAttackWhiteRuleRuleArgs]] = None,
status: Optional[float] = None,
mode: Optional[float] = None,
name: Optional[str] = None,
signature_ids: Optional[Sequence[str]] = None,
type_ids: Optional[Sequence[str]] = None,
waf_attack_white_rule_id: Optional[str] = None)
func NewWafAttackWhiteRule(ctx *Context, name string, args WafAttackWhiteRuleArgs, opts ...ResourceOption) (*WafAttackWhiteRule, error)
public WafAttackWhiteRule(string name, WafAttackWhiteRuleArgs args, CustomResourceOptions? opts = null)
public WafAttackWhiteRule(String name, WafAttackWhiteRuleArgs args)
public WafAttackWhiteRule(String name, WafAttackWhiteRuleArgs args, CustomResourceOptions options)
type: tencentcloud:WafAttackWhiteRule
properties: # The arguments to resource properties.
options: # Bag of options to control resource's behavior.
Parameters
- name string
- The unique name of the resource.
- args WafAttackWhiteRuleArgs
- 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 WafAttackWhiteRuleArgs
- 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 WafAttackWhiteRuleArgs
- The arguments to resource properties.
- opts ResourceOption
- Bag of options to control resource's behavior.
- name string
- The unique name of the resource.
- args WafAttackWhiteRuleArgs
- The arguments to resource properties.
- opts CustomResourceOptions
- Bag of options to control resource's behavior.
- name String
- The unique name of the resource.
- args WafAttackWhiteRuleArgs
- The arguments to resource properties.
- options CustomResourceOptions
- Bag of options to control resource's behavior.
WafAttackWhiteRule Resource Properties
To learn more about resource properties and how to use them, see Inputs and Outputs in the Architecture and Concepts docs.
Inputs
In Python, inputs that are objects can be passed either as argument classes or as dictionary literals.
The WafAttackWhiteRule resource accepts the following input properties:
- Domain string
- Domain.
- Rules
List<Waf
Attack White Rule Rule> - Rule list.
- Status double
- Rule status.
- Mode double
- 0: Whiten according to a specific rule ID, 1: Whiten according to the rule type.
- Name string
- Rule name.
- Signature
Ids List<string> - Whitelist of rule IDs.
- Type
Ids List<string> - The whitened category rule ID.
- Waf
Attack stringWhite Rule Id - ID of the resource.
- Domain string
- Domain.
- Rules
[]Waf
Attack White Rule Rule Args - Rule list.
- Status float64
- Rule status.
- Mode float64
- 0: Whiten according to a specific rule ID, 1: Whiten according to the rule type.
- Name string
- Rule name.
- Signature
Ids []string - Whitelist of rule IDs.
- Type
Ids []string - The whitened category rule ID.
- Waf
Attack stringWhite Rule Id - ID of the resource.
- domain String
- Domain.
- rules
List<Waf
Attack White Rule Rule> - Rule list.
- status Double
- Rule status.
- mode Double
- 0: Whiten according to a specific rule ID, 1: Whiten according to the rule type.
- name String
- Rule name.
- signature
Ids List<String> - Whitelist of rule IDs.
- type
Ids List<String> - The whitened category rule ID.
- waf
Attack StringWhite Rule Id - ID of the resource.
- domain string
- Domain.
- rules
Waf
Attack White Rule Rule[] - Rule list.
- status number
- Rule status.
- mode number
- 0: Whiten according to a specific rule ID, 1: Whiten according to the rule type.
- name string
- Rule name.
- signature
Ids string[] - Whitelist of rule IDs.
- type
Ids string[] - The whitened category rule ID.
- waf
Attack stringWhite Rule Id - ID of the resource.
- domain str
- Domain.
- rules
Sequence[Waf
Attack White Rule Rule Args] - Rule list.
- status float
- Rule status.
- mode float
- 0: Whiten according to a specific rule ID, 1: Whiten according to the rule type.
- name str
- Rule name.
- signature_
ids Sequence[str] - Whitelist of rule IDs.
- type_
ids Sequence[str] - The whitened category rule ID.
- waf_
attack_ strwhite_ rule_ id - ID of the resource.
- domain String
- Domain.
- rules List<Property Map>
- Rule list.
- status Number
- Rule status.
- mode Number
- 0: Whiten according to a specific rule ID, 1: Whiten according to the rule type.
- name String
- Rule name.
- signature
Ids List<String> - Whitelist of rule IDs.
- type
Ids List<String> - The whitened category rule ID.
- waf
Attack StringWhite Rule Id - ID of the resource.
Outputs
All input properties are implicitly available as output properties. Additionally, the WafAttackWhiteRule resource produces the following output properties:
Look up Existing WafAttackWhiteRule Resource
Get an existing WafAttackWhiteRule 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?: WafAttackWhiteRuleState, opts?: CustomResourceOptions): WafAttackWhiteRule
@staticmethod
def get(resource_name: str,
id: str,
opts: Optional[ResourceOptions] = None,
domain: Optional[str] = None,
mode: Optional[float] = None,
name: Optional[str] = None,
rule_id: Optional[float] = None,
rules: Optional[Sequence[WafAttackWhiteRuleRuleArgs]] = None,
signature_ids: Optional[Sequence[str]] = None,
status: Optional[float] = None,
type_ids: Optional[Sequence[str]] = None,
waf_attack_white_rule_id: Optional[str] = None) -> WafAttackWhiteRule
func GetWafAttackWhiteRule(ctx *Context, name string, id IDInput, state *WafAttackWhiteRuleState, opts ...ResourceOption) (*WafAttackWhiteRule, error)
public static WafAttackWhiteRule Get(string name, Input<string> id, WafAttackWhiteRuleState? state, CustomResourceOptions? opts = null)
public static WafAttackWhiteRule get(String name, Output<String> id, WafAttackWhiteRuleState state, CustomResourceOptions options)
resources: _: type: tencentcloud:WafAttackWhiteRule get: id: ${id}
- 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.
- Domain string
- Domain.
- Mode double
- 0: Whiten according to a specific rule ID, 1: Whiten according to the rule type.
- Name string
- Rule name.
- Rule
Id double - Rule ID.
- Rules
List<Waf
Attack White Rule Rule> - Rule list.
- Signature
Ids List<string> - Whitelist of rule IDs.
- Status double
- Rule status.
- Type
Ids List<string> - The whitened category rule ID.
- Waf
Attack stringWhite Rule Id - ID of the resource.
- Domain string
- Domain.
- Mode float64
- 0: Whiten according to a specific rule ID, 1: Whiten according to the rule type.
- Name string
- Rule name.
- Rule
Id float64 - Rule ID.
- Rules
[]Waf
Attack White Rule Rule Args - Rule list.
- Signature
Ids []string - Whitelist of rule IDs.
- Status float64
- Rule status.
- Type
Ids []string - The whitened category rule ID.
- Waf
Attack stringWhite Rule Id - ID of the resource.
- domain String
- Domain.
- mode Double
- 0: Whiten according to a specific rule ID, 1: Whiten according to the rule type.
- name String
- Rule name.
- rule
Id Double - Rule ID.
- rules
List<Waf
Attack White Rule Rule> - Rule list.
- signature
Ids List<String> - Whitelist of rule IDs.
- status Double
- Rule status.
- type
Ids List<String> - The whitened category rule ID.
- waf
Attack StringWhite Rule Id - ID of the resource.
- domain string
- Domain.
- mode number
- 0: Whiten according to a specific rule ID, 1: Whiten according to the rule type.
- name string
- Rule name.
- rule
Id number - Rule ID.
- rules
Waf
Attack White Rule Rule[] - Rule list.
- signature
Ids string[] - Whitelist of rule IDs.
- status number
- Rule status.
- type
Ids string[] - The whitened category rule ID.
- waf
Attack stringWhite Rule Id - ID of the resource.
- domain str
- Domain.
- mode float
- 0: Whiten according to a specific rule ID, 1: Whiten according to the rule type.
- name str
- Rule name.
- rule_
id float - Rule ID.
- rules
Sequence[Waf
Attack White Rule Rule Args] - Rule list.
- signature_
ids Sequence[str] - Whitelist of rule IDs.
- status float
- Rule status.
- type_
ids Sequence[str] - The whitened category rule ID.
- waf_
attack_ strwhite_ rule_ id - ID of the resource.
- domain String
- Domain.
- mode Number
- 0: Whiten according to a specific rule ID, 1: Whiten according to the rule type.
- name String
- Rule name.
- rule
Id Number - Rule ID.
- rules List<Property Map>
- Rule list.
- signature
Ids List<String> - Whitelist of rule IDs.
- status Number
- Rule status.
- type
Ids List<String> - The whitened category rule ID.
- waf
Attack StringWhite Rule Id - ID of the resource.
Supporting Types
WafAttackWhiteRuleRule, WafAttackWhiteRuleRuleArgs
- Match
Content string - Matching content.
- Match
Field string - Matching domains.
- Match
Method string - Matching method.
- Match
Params string - Matching params.
- Match
Content string - Matching content.
- Match
Field string - Matching domains.
- Match
Method string - Matching method.
- Match
Params string - Matching params.
- match
Content String - Matching content.
- match
Field String - Matching domains.
- match
Method String - Matching method.
- match
Params String - Matching params.
- match
Content string - Matching content.
- match
Field string - Matching domains.
- match
Method string - Matching method.
- match
Params string - Matching params.
- match_
content str - Matching content.
- match_
field str - Matching domains.
- match_
method str - Matching method.
- match_
params str - Matching params.
- match
Content String - Matching content.
- match
Field String - Matching domains.
- match
Method String - Matching method.
- match
Params String - Matching params.
Import
WAF attack white rule can be imported using the id, e.g.
$ pulumi import tencentcloud:index/wafAttackWhiteRule:WafAttackWhiteRule example www.demo.com#38562
To learn more about importing existing cloud resources, see Importing resources.
Package Details
- Repository
- tencentcloud tencentcloudstack/terraform-provider-tencentcloud
- License
- Notes
- This Pulumi package is based on the
tencentcloud
Terraform Provider.