tencentcloud.WafCustomRule
Explore with Pulumi AI
Provides a resource to create a waf custom rule
NOTE: If
job_type
isTimedJob
, Thenexpire_time
must select the maximum time value of theend_date_time
in the parameter listtimed
.
Example Usage
Create a standard custom rule
import * as pulumi from "@pulumi/pulumi";
import * as tencentcloud from "@pulumi/tencentcloud";
const example = new tencentcloud.WafCustomRule("example", {
actionType: "1",
domain: "test.com",
expireTime: "0",
redirect: "/",
sortId: "50",
status: "1",
strategies: [{
arg: "",
compareFunc: "ipmatch",
content: "2.2.2.2",
field: "IP",
}],
});
import pulumi
import pulumi_tencentcloud as tencentcloud
example = tencentcloud.WafCustomRule("example",
action_type="1",
domain="test.com",
expire_time="0",
redirect="/",
sort_id="50",
status="1",
strategies=[{
"arg": "",
"compare_func": "ipmatch",
"content": "2.2.2.2",
"field": "IP",
}])
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.NewWafCustomRule(ctx, "example", &tencentcloud.WafCustomRuleArgs{
ActionType: pulumi.String("1"),
Domain: pulumi.String("test.com"),
ExpireTime: pulumi.String("0"),
Redirect: pulumi.String("/"),
SortId: pulumi.String("50"),
Status: pulumi.String("1"),
Strategies: tencentcloud.WafCustomRuleStrategyArray{
&tencentcloud.WafCustomRuleStrategyArgs{
Arg: pulumi.String(""),
CompareFunc: pulumi.String("ipmatch"),
Content: pulumi.String("2.2.2.2"),
Field: pulumi.String("IP"),
},
},
})
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.WafCustomRule("example", new()
{
ActionType = "1",
Domain = "test.com",
ExpireTime = "0",
Redirect = "/",
SortId = "50",
Status = "1",
Strategies = new[]
{
new Tencentcloud.Inputs.WafCustomRuleStrategyArgs
{
Arg = "",
CompareFunc = "ipmatch",
Content = "2.2.2.2",
Field = "IP",
},
},
});
});
package generated_program;
import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.tencentcloud.WafCustomRule;
import com.pulumi.tencentcloud.WafCustomRuleArgs;
import com.pulumi.tencentcloud.inputs.WafCustomRuleStrategyArgs;
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 WafCustomRule("example", WafCustomRuleArgs.builder()
.actionType("1")
.domain("test.com")
.expireTime("0")
.redirect("/")
.sortId("50")
.status("1")
.strategies(WafCustomRuleStrategyArgs.builder()
.arg("")
.compareFunc("ipmatch")
.content("2.2.2.2")
.field("IP")
.build())
.build());
}
}
resources:
example:
type: tencentcloud:WafCustomRule
properties:
actionType: '1'
domain: test.com
expireTime: '0'
redirect: /
sortId: '50'
status: '1'
strategies:
- arg: ""
compareFunc: ipmatch
content: 2.2.2.2
field: IP
Create a timed resource for execution
import * as pulumi from "@pulumi/pulumi";
import * as tencentcloud from "@pulumi/tencentcloud";
const example = new tencentcloud.WafCustomRule("example", {
actionType: "1",
domain: "test.com",
expireTime: "1740672000",
jobDateTime: {
timeTZone: "UTC+8",
timeds: [{
endDateTime: 1740672000,
startDateTime: 1740585600,
}],
},
jobType: "TimedJob",
redirect: "/",
sortId: "50",
status: "1",
strategies: [
{
arg: "",
compareFunc: "ipmatch",
content: "2.2.2.2",
field: "IP",
},
{
arg: "",
caseNotSensitive: 1,
compareFunc: "strprefix",
content: "https://www.demo.com",
field: "Referer",
},
],
});
import pulumi
import pulumi_tencentcloud as tencentcloud
example = tencentcloud.WafCustomRule("example",
action_type="1",
domain="test.com",
expire_time="1740672000",
job_date_time={
"time_t_zone": "UTC+8",
"timeds": [{
"end_date_time": 1740672000,
"start_date_time": 1740585600,
}],
},
job_type="TimedJob",
redirect="/",
sort_id="50",
status="1",
strategies=[
{
"arg": "",
"compare_func": "ipmatch",
"content": "2.2.2.2",
"field": "IP",
},
{
"arg": "",
"case_not_sensitive": 1,
"compare_func": "strprefix",
"content": "https://www.demo.com",
"field": "Referer",
},
])
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.NewWafCustomRule(ctx, "example", &tencentcloud.WafCustomRuleArgs{
ActionType: pulumi.String("1"),
Domain: pulumi.String("test.com"),
ExpireTime: pulumi.String("1740672000"),
JobDateTime: &tencentcloud.WafCustomRuleJobDateTimeArgs{
TimeTZone: pulumi.String("UTC+8"),
Timeds: tencentcloud.WafCustomRuleJobDateTimeTimedArray{
&tencentcloud.WafCustomRuleJobDateTimeTimedArgs{
EndDateTime: pulumi.Float64(1740672000),
StartDateTime: pulumi.Float64(1740585600),
},
},
},
JobType: pulumi.String("TimedJob"),
Redirect: pulumi.String("/"),
SortId: pulumi.String("50"),
Status: pulumi.String("1"),
Strategies: tencentcloud.WafCustomRuleStrategyArray{
&tencentcloud.WafCustomRuleStrategyArgs{
Arg: pulumi.String(""),
CompareFunc: pulumi.String("ipmatch"),
Content: pulumi.String("2.2.2.2"),
Field: pulumi.String("IP"),
},
&tencentcloud.WafCustomRuleStrategyArgs{
Arg: pulumi.String(""),
CaseNotSensitive: pulumi.Float64(1),
CompareFunc: pulumi.String("strprefix"),
Content: pulumi.String("https://www.demo.com"),
Field: pulumi.String("Referer"),
},
},
})
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.WafCustomRule("example", new()
{
ActionType = "1",
Domain = "test.com",
ExpireTime = "1740672000",
JobDateTime = new Tencentcloud.Inputs.WafCustomRuleJobDateTimeArgs
{
TimeTZone = "UTC+8",
Timeds = new[]
{
new Tencentcloud.Inputs.WafCustomRuleJobDateTimeTimedArgs
{
EndDateTime = 1740672000,
StartDateTime = 1740585600,
},
},
},
JobType = "TimedJob",
Redirect = "/",
SortId = "50",
Status = "1",
Strategies = new[]
{
new Tencentcloud.Inputs.WafCustomRuleStrategyArgs
{
Arg = "",
CompareFunc = "ipmatch",
Content = "2.2.2.2",
Field = "IP",
},
new Tencentcloud.Inputs.WafCustomRuleStrategyArgs
{
Arg = "",
CaseNotSensitive = 1,
CompareFunc = "strprefix",
Content = "https://www.demo.com",
Field = "Referer",
},
},
});
});
package generated_program;
import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.tencentcloud.WafCustomRule;
import com.pulumi.tencentcloud.WafCustomRuleArgs;
import com.pulumi.tencentcloud.inputs.WafCustomRuleJobDateTimeArgs;
import com.pulumi.tencentcloud.inputs.WafCustomRuleStrategyArgs;
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 WafCustomRule("example", WafCustomRuleArgs.builder()
.actionType("1")
.domain("test.com")
.expireTime("1740672000")
.jobDateTime(WafCustomRuleJobDateTimeArgs.builder()
.timeTZone("UTC+8")
.timeds(WafCustomRuleJobDateTimeTimedArgs.builder()
.endDateTime(1740672000)
.startDateTime(1740585600)
.build())
.build())
.jobType("TimedJob")
.redirect("/")
.sortId("50")
.status("1")
.strategies(
WafCustomRuleStrategyArgs.builder()
.arg("")
.compareFunc("ipmatch")
.content("2.2.2.2")
.field("IP")
.build(),
WafCustomRuleStrategyArgs.builder()
.arg("")
.caseNotSensitive(1)
.compareFunc("strprefix")
.content("https://www.demo.com")
.field("Referer")
.build())
.build());
}
}
resources:
example:
type: tencentcloud:WafCustomRule
properties:
actionType: '1'
domain: test.com
expireTime: '1740672000'
jobDateTime:
timeTZone: UTC+8
timeds:
- endDateTime: 1.740672e+09
startDateTime: 1.7405856e+09
jobType: TimedJob
redirect: /
sortId: '50'
status: '1'
strategies:
- arg: ""
compareFunc: ipmatch
content: 2.2.2.2
field: IP
- arg: ""
caseNotSensitive: 1
compareFunc: strprefix
content: https://www.demo.com
field: Referer
Create a cron resource for execution
import * as pulumi from "@pulumi/pulumi";
import * as tencentcloud from "@pulumi/tencentcloud";
const example = new tencentcloud.WafCustomRule("example", {
actionType: "1",
domain: "test.com",
expireTime: "0",
jobDateTime: {
crons: [{
endTime: "03:00:00",
startTime: "01:00:00",
wDays: [
0,
1,
2,
3,
4,
5,
6,
],
}],
timeTZone: "UTC+8",
},
jobType: "CronJob",
redirect: "/",
sortId: "50",
status: "1",
strategies: [
{
arg: "",
compareFunc: "ipmatch",
content: "2.2.2.2",
field: "IP",
},
{
arg: "",
caseNotSensitive: 1,
compareFunc: "strprefix",
content: "https://www.demo.com",
field: "Referer",
},
],
});
import pulumi
import pulumi_tencentcloud as tencentcloud
example = tencentcloud.WafCustomRule("example",
action_type="1",
domain="test.com",
expire_time="0",
job_date_time={
"crons": [{
"end_time": "03:00:00",
"start_time": "01:00:00",
"w_days": [
0,
1,
2,
3,
4,
5,
6,
],
}],
"time_t_zone": "UTC+8",
},
job_type="CronJob",
redirect="/",
sort_id="50",
status="1",
strategies=[
{
"arg": "",
"compare_func": "ipmatch",
"content": "2.2.2.2",
"field": "IP",
},
{
"arg": "",
"case_not_sensitive": 1,
"compare_func": "strprefix",
"content": "https://www.demo.com",
"field": "Referer",
},
])
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.NewWafCustomRule(ctx, "example", &tencentcloud.WafCustomRuleArgs{
ActionType: pulumi.String("1"),
Domain: pulumi.String("test.com"),
ExpireTime: pulumi.String("0"),
JobDateTime: &tencentcloud.WafCustomRuleJobDateTimeArgs{
Crons: tencentcloud.WafCustomRuleJobDateTimeCronArray{
&tencentcloud.WafCustomRuleJobDateTimeCronArgs{
EndTime: pulumi.String("03:00:00"),
StartTime: pulumi.String("01:00:00"),
WDays: pulumi.Float64Array{
pulumi.Float64(0),
pulumi.Float64(1),
pulumi.Float64(2),
pulumi.Float64(3),
pulumi.Float64(4),
pulumi.Float64(5),
pulumi.Float64(6),
},
},
},
TimeTZone: pulumi.String("UTC+8"),
},
JobType: pulumi.String("CronJob"),
Redirect: pulumi.String("/"),
SortId: pulumi.String("50"),
Status: pulumi.String("1"),
Strategies: tencentcloud.WafCustomRuleStrategyArray{
&tencentcloud.WafCustomRuleStrategyArgs{
Arg: pulumi.String(""),
CompareFunc: pulumi.String("ipmatch"),
Content: pulumi.String("2.2.2.2"),
Field: pulumi.String("IP"),
},
&tencentcloud.WafCustomRuleStrategyArgs{
Arg: pulumi.String(""),
CaseNotSensitive: pulumi.Float64(1),
CompareFunc: pulumi.String("strprefix"),
Content: pulumi.String("https://www.demo.com"),
Field: pulumi.String("Referer"),
},
},
})
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.WafCustomRule("example", new()
{
ActionType = "1",
Domain = "test.com",
ExpireTime = "0",
JobDateTime = new Tencentcloud.Inputs.WafCustomRuleJobDateTimeArgs
{
Crons = new[]
{
new Tencentcloud.Inputs.WafCustomRuleJobDateTimeCronArgs
{
EndTime = "03:00:00",
StartTime = "01:00:00",
WDays = new[]
{
0,
1,
2,
3,
4,
5,
6,
},
},
},
TimeTZone = "UTC+8",
},
JobType = "CronJob",
Redirect = "/",
SortId = "50",
Status = "1",
Strategies = new[]
{
new Tencentcloud.Inputs.WafCustomRuleStrategyArgs
{
Arg = "",
CompareFunc = "ipmatch",
Content = "2.2.2.2",
Field = "IP",
},
new Tencentcloud.Inputs.WafCustomRuleStrategyArgs
{
Arg = "",
CaseNotSensitive = 1,
CompareFunc = "strprefix",
Content = "https://www.demo.com",
Field = "Referer",
},
},
});
});
package generated_program;
import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.tencentcloud.WafCustomRule;
import com.pulumi.tencentcloud.WafCustomRuleArgs;
import com.pulumi.tencentcloud.inputs.WafCustomRuleJobDateTimeArgs;
import com.pulumi.tencentcloud.inputs.WafCustomRuleStrategyArgs;
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 WafCustomRule("example", WafCustomRuleArgs.builder()
.actionType("1")
.domain("test.com")
.expireTime("0")
.jobDateTime(WafCustomRuleJobDateTimeArgs.builder()
.crons(WafCustomRuleJobDateTimeCronArgs.builder()
.endTime("03:00:00")
.startTime("01:00:00")
.wDays(
0,
1,
2,
3,
4,
5,
6)
.build())
.timeTZone("UTC+8")
.build())
.jobType("CronJob")
.redirect("/")
.sortId("50")
.status("1")
.strategies(
WafCustomRuleStrategyArgs.builder()
.arg("")
.compareFunc("ipmatch")
.content("2.2.2.2")
.field("IP")
.build(),
WafCustomRuleStrategyArgs.builder()
.arg("")
.caseNotSensitive(1)
.compareFunc("strprefix")
.content("https://www.demo.com")
.field("Referer")
.build())
.build());
}
}
resources:
example:
type: tencentcloud:WafCustomRule
properties:
actionType: '1'
domain: test.com
expireTime: '0'
jobDateTime:
crons:
- endTime: 03:00:00
startTime: 01:00:00
wDays:
- 0
- 1
- 2
- 3
- 4
- 5
- 6
timeTZone: UTC+8
jobType: CronJob
redirect: /
sortId: '50'
status: '1'
strategies:
- arg: ""
compareFunc: ipmatch
content: 2.2.2.2
field: IP
- arg: ""
caseNotSensitive: 1
compareFunc: strprefix
content: https://www.demo.com
field: Referer
Create WafCustomRule Resource
Resources are created with functions called constructors. To learn more about declaring and configuring resources, see Resources.
Constructor syntax
new WafCustomRule(name: string, args: WafCustomRuleArgs, opts?: CustomResourceOptions);
@overload
def WafCustomRule(resource_name: str,
args: WafCustomRuleArgs,
opts: Optional[ResourceOptions] = None)
@overload
def WafCustomRule(resource_name: str,
opts: Optional[ResourceOptions] = None,
action_type: Optional[str] = None,
domain: Optional[str] = None,
expire_time: Optional[str] = None,
sort_id: Optional[str] = None,
strategies: Optional[Sequence[WafCustomRuleStrategyArgs]] = None,
job_date_time: Optional[WafCustomRuleJobDateTimeArgs] = None,
job_type: Optional[str] = None,
name: Optional[str] = None,
redirect: Optional[str] = None,
status: Optional[str] = None,
waf_custom_rule_id: Optional[str] = None)
func NewWafCustomRule(ctx *Context, name string, args WafCustomRuleArgs, opts ...ResourceOption) (*WafCustomRule, error)
public WafCustomRule(string name, WafCustomRuleArgs args, CustomResourceOptions? opts = null)
public WafCustomRule(String name, WafCustomRuleArgs args)
public WafCustomRule(String name, WafCustomRuleArgs args, CustomResourceOptions options)
type: tencentcloud:WafCustomRule
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 WafCustomRuleArgs
- 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 WafCustomRuleArgs
- 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 WafCustomRuleArgs
- The arguments to resource properties.
- opts ResourceOption
- Bag of options to control resource's behavior.
- name string
- The unique name of the resource.
- args WafCustomRuleArgs
- The arguments to resource properties.
- opts CustomResourceOptions
- Bag of options to control resource's behavior.
- name String
- The unique name of the resource.
- args WafCustomRuleArgs
- The arguments to resource properties.
- options CustomResourceOptions
- Bag of options to control resource's behavior.
WafCustomRule 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 WafCustomRule resource accepts the following input properties:
- Action
Type string - Action type, 1(Block), 2(Captcha), 3(log), 4(Redirect).
- Domain string
- Domain.
- Expire
Time string - Expiration time in second-level timestamp, for example, 1677254399 indicates the expiration time is 2023-02-24 23:59:59; 0 indicates it will never expire.
- Sort
Id string - Priority, value range 0-100.
- Strategies
List<Waf
Custom Rule Strategy> - Strategies detail.
- Job
Date WafTime Custom Rule Job Date Time - Rule execution time.
- Job
Type string - Rule execution mode: TimedJob indicates scheduled execution. CronJob indicates periodic execution.
- Name string
- Rule Name.
- Redirect string
- If the action is a Redirect, it represents the redirect address; Other situations can be left blank.
- Status string
- The status of the rule, 1(open), 0(close).
- Waf
Custom stringRule Id - ID of the resource.
- Action
Type string - Action type, 1(Block), 2(Captcha), 3(log), 4(Redirect).
- Domain string
- Domain.
- Expire
Time string - Expiration time in second-level timestamp, for example, 1677254399 indicates the expiration time is 2023-02-24 23:59:59; 0 indicates it will never expire.
- Sort
Id string - Priority, value range 0-100.
- Strategies
[]Waf
Custom Rule Strategy Args - Strategies detail.
- Job
Date WafTime Custom Rule Job Date Time Args - Rule execution time.
- Job
Type string - Rule execution mode: TimedJob indicates scheduled execution. CronJob indicates periodic execution.
- Name string
- Rule Name.
- Redirect string
- If the action is a Redirect, it represents the redirect address; Other situations can be left blank.
- Status string
- The status of the rule, 1(open), 0(close).
- Waf
Custom stringRule Id - ID of the resource.
- action
Type String - Action type, 1(Block), 2(Captcha), 3(log), 4(Redirect).
- domain String
- Domain.
- expire
Time String - Expiration time in second-level timestamp, for example, 1677254399 indicates the expiration time is 2023-02-24 23:59:59; 0 indicates it will never expire.
- sort
Id String - Priority, value range 0-100.
- strategies
List<Waf
Custom Rule Strategy> - Strategies detail.
- job
Date WafTime Custom Rule Job Date Time - Rule execution time.
- job
Type String - Rule execution mode: TimedJob indicates scheduled execution. CronJob indicates periodic execution.
- name String
- Rule Name.
- redirect String
- If the action is a Redirect, it represents the redirect address; Other situations can be left blank.
- status String
- The status of the rule, 1(open), 0(close).
- waf
Custom StringRule Id - ID of the resource.
- action
Type string - Action type, 1(Block), 2(Captcha), 3(log), 4(Redirect).
- domain string
- Domain.
- expire
Time string - Expiration time in second-level timestamp, for example, 1677254399 indicates the expiration time is 2023-02-24 23:59:59; 0 indicates it will never expire.
- sort
Id string - Priority, value range 0-100.
- strategies
Waf
Custom Rule Strategy[] - Strategies detail.
- job
Date WafTime Custom Rule Job Date Time - Rule execution time.
- job
Type string - Rule execution mode: TimedJob indicates scheduled execution. CronJob indicates periodic execution.
- name string
- Rule Name.
- redirect string
- If the action is a Redirect, it represents the redirect address; Other situations can be left blank.
- status string
- The status of the rule, 1(open), 0(close).
- waf
Custom stringRule Id - ID of the resource.
- action_
type str - Action type, 1(Block), 2(Captcha), 3(log), 4(Redirect).
- domain str
- Domain.
- expire_
time str - Expiration time in second-level timestamp, for example, 1677254399 indicates the expiration time is 2023-02-24 23:59:59; 0 indicates it will never expire.
- sort_
id str - Priority, value range 0-100.
- strategies
Sequence[Waf
Custom Rule Strategy Args] - Strategies detail.
- job_
date_ Waftime Custom Rule Job Date Time Args - Rule execution time.
- job_
type str - Rule execution mode: TimedJob indicates scheduled execution. CronJob indicates periodic execution.
- name str
- Rule Name.
- redirect str
- If the action is a Redirect, it represents the redirect address; Other situations can be left blank.
- status str
- The status of the rule, 1(open), 0(close).
- waf_
custom_ strrule_ id - ID of the resource.
- action
Type String - Action type, 1(Block), 2(Captcha), 3(log), 4(Redirect).
- domain String
- Domain.
- expire
Time String - Expiration time in second-level timestamp, for example, 1677254399 indicates the expiration time is 2023-02-24 23:59:59; 0 indicates it will never expire.
- sort
Id String - Priority, value range 0-100.
- strategies List<Property Map>
- Strategies detail.
- job
Date Property MapTime - Rule execution time.
- job
Type String - Rule execution mode: TimedJob indicates scheduled execution. CronJob indicates periodic execution.
- name String
- Rule Name.
- redirect String
- If the action is a Redirect, it represents the redirect address; Other situations can be left blank.
- status String
- The status of the rule, 1(open), 0(close).
- waf
Custom StringRule Id - ID of the resource.
Outputs
All input properties are implicitly available as output properties. Additionally, the WafCustomRule resource produces the following output properties:
Look up Existing WafCustomRule Resource
Get an existing WafCustomRule 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?: WafCustomRuleState, opts?: CustomResourceOptions): WafCustomRule
@staticmethod
def get(resource_name: str,
id: str,
opts: Optional[ResourceOptions] = None,
action_type: Optional[str] = None,
domain: Optional[str] = None,
expire_time: Optional[str] = None,
job_date_time: Optional[WafCustomRuleJobDateTimeArgs] = None,
job_type: Optional[str] = None,
name: Optional[str] = None,
redirect: Optional[str] = None,
rule_id: Optional[str] = None,
sort_id: Optional[str] = None,
status: Optional[str] = None,
strategies: Optional[Sequence[WafCustomRuleStrategyArgs]] = None,
waf_custom_rule_id: Optional[str] = None) -> WafCustomRule
func GetWafCustomRule(ctx *Context, name string, id IDInput, state *WafCustomRuleState, opts ...ResourceOption) (*WafCustomRule, error)
public static WafCustomRule Get(string name, Input<string> id, WafCustomRuleState? state, CustomResourceOptions? opts = null)
public static WafCustomRule get(String name, Output<String> id, WafCustomRuleState state, CustomResourceOptions options)
resources: _: type: tencentcloud:WafCustomRule 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.
- Action
Type string - Action type, 1(Block), 2(Captcha), 3(log), 4(Redirect).
- Domain string
- Domain.
- Expire
Time string - Expiration time in second-level timestamp, for example, 1677254399 indicates the expiration time is 2023-02-24 23:59:59; 0 indicates it will never expire.
- Job
Date WafTime Custom Rule Job Date Time - Rule execution time.
- Job
Type string - Rule execution mode: TimedJob indicates scheduled execution. CronJob indicates periodic execution.
- Name string
- Rule Name.
- Redirect string
- If the action is a Redirect, it represents the redirect address; Other situations can be left blank.
- Rule
Id string - rule ID.
- Sort
Id string - Priority, value range 0-100.
- Status string
- The status of the rule, 1(open), 0(close).
- Strategies
List<Waf
Custom Rule Strategy> - Strategies detail.
- Waf
Custom stringRule Id - ID of the resource.
- Action
Type string - Action type, 1(Block), 2(Captcha), 3(log), 4(Redirect).
- Domain string
- Domain.
- Expire
Time string - Expiration time in second-level timestamp, for example, 1677254399 indicates the expiration time is 2023-02-24 23:59:59; 0 indicates it will never expire.
- Job
Date WafTime Custom Rule Job Date Time Args - Rule execution time.
- Job
Type string - Rule execution mode: TimedJob indicates scheduled execution. CronJob indicates periodic execution.
- Name string
- Rule Name.
- Redirect string
- If the action is a Redirect, it represents the redirect address; Other situations can be left blank.
- Rule
Id string - rule ID.
- Sort
Id string - Priority, value range 0-100.
- Status string
- The status of the rule, 1(open), 0(close).
- Strategies
[]Waf
Custom Rule Strategy Args - Strategies detail.
- Waf
Custom stringRule Id - ID of the resource.
- action
Type String - Action type, 1(Block), 2(Captcha), 3(log), 4(Redirect).
- domain String
- Domain.
- expire
Time String - Expiration time in second-level timestamp, for example, 1677254399 indicates the expiration time is 2023-02-24 23:59:59; 0 indicates it will never expire.
- job
Date WafTime Custom Rule Job Date Time - Rule execution time.
- job
Type String - Rule execution mode: TimedJob indicates scheduled execution. CronJob indicates periodic execution.
- name String
- Rule Name.
- redirect String
- If the action is a Redirect, it represents the redirect address; Other situations can be left blank.
- rule
Id String - rule ID.
- sort
Id String - Priority, value range 0-100.
- status String
- The status of the rule, 1(open), 0(close).
- strategies
List<Waf
Custom Rule Strategy> - Strategies detail.
- waf
Custom StringRule Id - ID of the resource.
- action
Type string - Action type, 1(Block), 2(Captcha), 3(log), 4(Redirect).
- domain string
- Domain.
- expire
Time string - Expiration time in second-level timestamp, for example, 1677254399 indicates the expiration time is 2023-02-24 23:59:59; 0 indicates it will never expire.
- job
Date WafTime Custom Rule Job Date Time - Rule execution time.
- job
Type string - Rule execution mode: TimedJob indicates scheduled execution. CronJob indicates periodic execution.
- name string
- Rule Name.
- redirect string
- If the action is a Redirect, it represents the redirect address; Other situations can be left blank.
- rule
Id string - rule ID.
- sort
Id string - Priority, value range 0-100.
- status string
- The status of the rule, 1(open), 0(close).
- strategies
Waf
Custom Rule Strategy[] - Strategies detail.
- waf
Custom stringRule Id - ID of the resource.
- action_
type str - Action type, 1(Block), 2(Captcha), 3(log), 4(Redirect).
- domain str
- Domain.
- expire_
time str - Expiration time in second-level timestamp, for example, 1677254399 indicates the expiration time is 2023-02-24 23:59:59; 0 indicates it will never expire.
- job_
date_ Waftime Custom Rule Job Date Time Args - Rule execution time.
- job_
type str - Rule execution mode: TimedJob indicates scheduled execution. CronJob indicates periodic execution.
- name str
- Rule Name.
- redirect str
- If the action is a Redirect, it represents the redirect address; Other situations can be left blank.
- rule_
id str - rule ID.
- sort_
id str - Priority, value range 0-100.
- status str
- The status of the rule, 1(open), 0(close).
- strategies
Sequence[Waf
Custom Rule Strategy Args] - Strategies detail.
- waf_
custom_ strrule_ id - ID of the resource.
- action
Type String - Action type, 1(Block), 2(Captcha), 3(log), 4(Redirect).
- domain String
- Domain.
- expire
Time String - Expiration time in second-level timestamp, for example, 1677254399 indicates the expiration time is 2023-02-24 23:59:59; 0 indicates it will never expire.
- job
Date Property MapTime - Rule execution time.
- job
Type String - Rule execution mode: TimedJob indicates scheduled execution. CronJob indicates periodic execution.
- name String
- Rule Name.
- redirect String
- If the action is a Redirect, it represents the redirect address; Other situations can be left blank.
- rule
Id String - rule ID.
- sort
Id String - Priority, value range 0-100.
- status String
- The status of the rule, 1(open), 0(close).
- strategies List<Property Map>
- Strategies detail.
- waf
Custom StringRule Id - ID of the resource.
Supporting Types
WafCustomRuleJobDateTime, WafCustomRuleJobDateTimeArgs
- Crons
List<Waf
Custom Rule Job Date Time Cron> - Time parameters for periodic execution. Note: This field may return null, indicating that no valid values can be obtained.
- Time
TZone string - Time zone. Note: This field may return null, indicating that no valid values can be obtained.
- Timeds
List<Waf
Custom Rule Job Date Time Timed> - Time parameters for scheduled execution. Note: This field may return null, indicating that no valid values can be obtained.
- Crons
[]Waf
Custom Rule Job Date Time Cron - Time parameters for periodic execution. Note: This field may return null, indicating that no valid values can be obtained.
- Time
TZone string - Time zone. Note: This field may return null, indicating that no valid values can be obtained.
- Timeds
[]Waf
Custom Rule Job Date Time Timed - Time parameters for scheduled execution. Note: This field may return null, indicating that no valid values can be obtained.
- crons
List<Waf
Custom Rule Job Date Time Cron> - Time parameters for periodic execution. Note: This field may return null, indicating that no valid values can be obtained.
- time
TZone String - Time zone. Note: This field may return null, indicating that no valid values can be obtained.
- timeds
List<Waf
Custom Rule Job Date Time Timed> - Time parameters for scheduled execution. Note: This field may return null, indicating that no valid values can be obtained.
- crons
Waf
Custom Rule Job Date Time Cron[] - Time parameters for periodic execution. Note: This field may return null, indicating that no valid values can be obtained.
- time
TZone string - Time zone. Note: This field may return null, indicating that no valid values can be obtained.
- timeds
Waf
Custom Rule Job Date Time Timed[] - Time parameters for scheduled execution. Note: This field may return null, indicating that no valid values can be obtained.
- crons
Sequence[Waf
Custom Rule Job Date Time Cron] - Time parameters for periodic execution. Note: This field may return null, indicating that no valid values can be obtained.
- time_
t_ strzone - Time zone. Note: This field may return null, indicating that no valid values can be obtained.
- timeds
Sequence[Waf
Custom Rule Job Date Time Timed] - Time parameters for scheduled execution. Note: This field may return null, indicating that no valid values can be obtained.
- crons List<Property Map>
- Time parameters for periodic execution. Note: This field may return null, indicating that no valid values can be obtained.
- time
TZone String - Time zone. Note: This field may return null, indicating that no valid values can be obtained.
- timeds List<Property Map>
- Time parameters for scheduled execution. Note: This field may return null, indicating that no valid values can be obtained.
WafCustomRuleJobDateTimeCron, WafCustomRuleJobDateTimeCronArgs
- Days List<double>
- Days in each month for execution. Note: This field may return null, indicating that no valid values can be obtained.
- End
Time string - End time. Note: This field may return null, indicating that no valid values can be obtained.
- Start
Time string - Start time. Note: This field may return null, indicating that no valid values can be obtained.
- WDays List<double>
- Days of each week for execution. Note: This field may return null, indicating that no valid values can be obtained.
- Days []float64
- Days in each month for execution. Note: This field may return null, indicating that no valid values can be obtained.
- End
Time string - End time. Note: This field may return null, indicating that no valid values can be obtained.
- Start
Time string - Start time. Note: This field may return null, indicating that no valid values can be obtained.
- WDays []float64
- Days of each week for execution. Note: This field may return null, indicating that no valid values can be obtained.
- days List<Double>
- Days in each month for execution. Note: This field may return null, indicating that no valid values can be obtained.
- end
Time String - End time. Note: This field may return null, indicating that no valid values can be obtained.
- start
Time String - Start time. Note: This field may return null, indicating that no valid values can be obtained.
- w
Days List<Double> - Days of each week for execution. Note: This field may return null, indicating that no valid values can be obtained.
- days number[]
- Days in each month for execution. Note: This field may return null, indicating that no valid values can be obtained.
- end
Time string - End time. Note: This field may return null, indicating that no valid values can be obtained.
- start
Time string - Start time. Note: This field may return null, indicating that no valid values can be obtained.
- w
Days number[] - Days of each week for execution. Note: This field may return null, indicating that no valid values can be obtained.
- days Sequence[float]
- Days in each month for execution. Note: This field may return null, indicating that no valid values can be obtained.
- end_
time str - End time. Note: This field may return null, indicating that no valid values can be obtained.
- start_
time str - Start time. Note: This field may return null, indicating that no valid values can be obtained.
- w_
days Sequence[float] - Days of each week for execution. Note: This field may return null, indicating that no valid values can be obtained.
- days List<Number>
- Days in each month for execution. Note: This field may return null, indicating that no valid values can be obtained.
- end
Time String - End time. Note: This field may return null, indicating that no valid values can be obtained.
- start
Time String - Start time. Note: This field may return null, indicating that no valid values can be obtained.
- w
Days List<Number> - Days of each week for execution. Note: This field may return null, indicating that no valid values can be obtained.
WafCustomRuleJobDateTimeTimed, WafCustomRuleJobDateTimeTimedArgs
- End
Date doubleTime - End timestamp, in seconds. Note: This field may return null, indicating that no valid values can be obtained.
- Start
Date doubleTime - Start timestamp, in seconds. Note: This field may return null, indicating that no valid values can be obtained.
- End
Date float64Time - End timestamp, in seconds. Note: This field may return null, indicating that no valid values can be obtained.
- Start
Date float64Time - Start timestamp, in seconds. Note: This field may return null, indicating that no valid values can be obtained.
- end
Date DoubleTime - End timestamp, in seconds. Note: This field may return null, indicating that no valid values can be obtained.
- start
Date DoubleTime - Start timestamp, in seconds. Note: This field may return null, indicating that no valid values can be obtained.
- end
Date numberTime - End timestamp, in seconds. Note: This field may return null, indicating that no valid values can be obtained.
- start
Date numberTime - Start timestamp, in seconds. Note: This field may return null, indicating that no valid values can be obtained.
- end_
date_ floattime - End timestamp, in seconds. Note: This field may return null, indicating that no valid values can be obtained.
- start_
date_ floattime - Start timestamp, in seconds. Note: This field may return null, indicating that no valid values can be obtained.
- end
Date NumberTime - End timestamp, in seconds. Note: This field may return null, indicating that no valid values can be obtained.
- start
Date NumberTime - Start timestamp, in seconds. Note: This field may return null, indicating that no valid values can be obtained.
WafCustomRuleStrategy, WafCustomRuleStrategyArgs
- Arg string
- Matching parameter There are two types of configuration parameters: unsupported parameters and supported parameters. The matching parameter can be entered only when the matching field is one of the following four. Otherwise, the parameter is not supported. GET (GET parameter value) POST (POST parameter value) ARGS_COOKIE (Cookie parameter value) ARGS_HEADER (Header parameter value) Note: This field may return null, indicating that no valid values can be obtained.
- Compare
Func string - Logic symbol Logical symbols are divided into the following types: empty (content is empty) null (do not exist) eq (equal to) neq (not equal to) contains (contain) ncontains (do not contain) strprefix (prefix matching) strsuffix (suffix matching) len_eq (length equals to) len_gt (length is greater than) len_lt (length is less than) ipmatch (belong to) ipnmatch (do not belong to) numgt (number greater than) numlt (number less than) geo_in (IP geo belongs to) geo_not_in (IP geo not belongs to) rematch (regex match) Different matching fields correspond to different logical operators. For details, see the matching field table above. Note: This field may return null, indicating that no valid values can be obtained.
- Content string
- Matching content Currently, when the matching field is COOKIE (cookie), the matching content is not required. In other scenes, the matching content is required. Note: This field may return null, indicating that no valid values can be obtained.
- Field string
- Matching field Different matching fields result in different matching parameters, logical operators, and matching contents. The details are as follows:
- Case
Not doubleSensitive - 0: case-sensitive, 1: case-insensitive. Note: This field may return null, indicating that no valid values can be obtained.
- Arg string
- Matching parameter There are two types of configuration parameters: unsupported parameters and supported parameters. The matching parameter can be entered only when the matching field is one of the following four. Otherwise, the parameter is not supported. GET (GET parameter value) POST (POST parameter value) ARGS_COOKIE (Cookie parameter value) ARGS_HEADER (Header parameter value) Note: This field may return null, indicating that no valid values can be obtained.
- Compare
Func string - Logic symbol Logical symbols are divided into the following types: empty (content is empty) null (do not exist) eq (equal to) neq (not equal to) contains (contain) ncontains (do not contain) strprefix (prefix matching) strsuffix (suffix matching) len_eq (length equals to) len_gt (length is greater than) len_lt (length is less than) ipmatch (belong to) ipnmatch (do not belong to) numgt (number greater than) numlt (number less than) geo_in (IP geo belongs to) geo_not_in (IP geo not belongs to) rematch (regex match) Different matching fields correspond to different logical operators. For details, see the matching field table above. Note: This field may return null, indicating that no valid values can be obtained.
- Content string
- Matching content Currently, when the matching field is COOKIE (cookie), the matching content is not required. In other scenes, the matching content is required. Note: This field may return null, indicating that no valid values can be obtained.
- Field string
- Matching field Different matching fields result in different matching parameters, logical operators, and matching contents. The details are as follows:
- Case
Not float64Sensitive - 0: case-sensitive, 1: case-insensitive. Note: This field may return null, indicating that no valid values can be obtained.
- arg String
- Matching parameter There are two types of configuration parameters: unsupported parameters and supported parameters. The matching parameter can be entered only when the matching field is one of the following four. Otherwise, the parameter is not supported. GET (GET parameter value) POST (POST parameter value) ARGS_COOKIE (Cookie parameter value) ARGS_HEADER (Header parameter value) Note: This field may return null, indicating that no valid values can be obtained.
- compare
Func String - Logic symbol Logical symbols are divided into the following types: empty (content is empty) null (do not exist) eq (equal to) neq (not equal to) contains (contain) ncontains (do not contain) strprefix (prefix matching) strsuffix (suffix matching) len_eq (length equals to) len_gt (length is greater than) len_lt (length is less than) ipmatch (belong to) ipnmatch (do not belong to) numgt (number greater than) numlt (number less than) geo_in (IP geo belongs to) geo_not_in (IP geo not belongs to) rematch (regex match) Different matching fields correspond to different logical operators. For details, see the matching field table above. Note: This field may return null, indicating that no valid values can be obtained.
- content String
- Matching content Currently, when the matching field is COOKIE (cookie), the matching content is not required. In other scenes, the matching content is required. Note: This field may return null, indicating that no valid values can be obtained.
- field String
- Matching field Different matching fields result in different matching parameters, logical operators, and matching contents. The details are as follows:
- case
Not DoubleSensitive - 0: case-sensitive, 1: case-insensitive. Note: This field may return null, indicating that no valid values can be obtained.
- arg string
- Matching parameter There are two types of configuration parameters: unsupported parameters and supported parameters. The matching parameter can be entered only when the matching field is one of the following four. Otherwise, the parameter is not supported. GET (GET parameter value) POST (POST parameter value) ARGS_COOKIE (Cookie parameter value) ARGS_HEADER (Header parameter value) Note: This field may return null, indicating that no valid values can be obtained.
- compare
Func string - Logic symbol Logical symbols are divided into the following types: empty (content is empty) null (do not exist) eq (equal to) neq (not equal to) contains (contain) ncontains (do not contain) strprefix (prefix matching) strsuffix (suffix matching) len_eq (length equals to) len_gt (length is greater than) len_lt (length is less than) ipmatch (belong to) ipnmatch (do not belong to) numgt (number greater than) numlt (number less than) geo_in (IP geo belongs to) geo_not_in (IP geo not belongs to) rematch (regex match) Different matching fields correspond to different logical operators. For details, see the matching field table above. Note: This field may return null, indicating that no valid values can be obtained.
- content string
- Matching content Currently, when the matching field is COOKIE (cookie), the matching content is not required. In other scenes, the matching content is required. Note: This field may return null, indicating that no valid values can be obtained.
- field string
- Matching field Different matching fields result in different matching parameters, logical operators, and matching contents. The details are as follows:
- case
Not numberSensitive - 0: case-sensitive, 1: case-insensitive. Note: This field may return null, indicating that no valid values can be obtained.
- arg str
- Matching parameter There are two types of configuration parameters: unsupported parameters and supported parameters. The matching parameter can be entered only when the matching field is one of the following four. Otherwise, the parameter is not supported. GET (GET parameter value) POST (POST parameter value) ARGS_COOKIE (Cookie parameter value) ARGS_HEADER (Header parameter value) Note: This field may return null, indicating that no valid values can be obtained.
- compare_
func str - Logic symbol Logical symbols are divided into the following types: empty (content is empty) null (do not exist) eq (equal to) neq (not equal to) contains (contain) ncontains (do not contain) strprefix (prefix matching) strsuffix (suffix matching) len_eq (length equals to) len_gt (length is greater than) len_lt (length is less than) ipmatch (belong to) ipnmatch (do not belong to) numgt (number greater than) numlt (number less than) geo_in (IP geo belongs to) geo_not_in (IP geo not belongs to) rematch (regex match) Different matching fields correspond to different logical operators. For details, see the matching field table above. Note: This field may return null, indicating that no valid values can be obtained.
- content str
- Matching content Currently, when the matching field is COOKIE (cookie), the matching content is not required. In other scenes, the matching content is required. Note: This field may return null, indicating that no valid values can be obtained.
- field str
- Matching field Different matching fields result in different matching parameters, logical operators, and matching contents. The details are as follows:
- case_
not_ floatsensitive - 0: case-sensitive, 1: case-insensitive. Note: This field may return null, indicating that no valid values can be obtained.
- arg String
- Matching parameter There are two types of configuration parameters: unsupported parameters and supported parameters. The matching parameter can be entered only when the matching field is one of the following four. Otherwise, the parameter is not supported. GET (GET parameter value) POST (POST parameter value) ARGS_COOKIE (Cookie parameter value) ARGS_HEADER (Header parameter value) Note: This field may return null, indicating that no valid values can be obtained.
- compare
Func String - Logic symbol Logical symbols are divided into the following types: empty (content is empty) null (do not exist) eq (equal to) neq (not equal to) contains (contain) ncontains (do not contain) strprefix (prefix matching) strsuffix (suffix matching) len_eq (length equals to) len_gt (length is greater than) len_lt (length is less than) ipmatch (belong to) ipnmatch (do not belong to) numgt (number greater than) numlt (number less than) geo_in (IP geo belongs to) geo_not_in (IP geo not belongs to) rematch (regex match) Different matching fields correspond to different logical operators. For details, see the matching field table above. Note: This field may return null, indicating that no valid values can be obtained.
- content String
- Matching content Currently, when the matching field is COOKIE (cookie), the matching content is not required. In other scenes, the matching content is required. Note: This field may return null, indicating that no valid values can be obtained.
- field String
- Matching field Different matching fields result in different matching parameters, logical operators, and matching contents. The details are as follows:
- case
Not NumberSensitive - 0: case-sensitive, 1: case-insensitive. Note: This field may return null, indicating that no valid values can be obtained.
Import
waf custom rule can be imported using the id, e.g.
$ pulumi import tencentcloud:index/wafCustomRule:WafCustomRule example test.com#1100310609
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.