Skip to content

Commit c91fc5b

Browse files
committed
add
1 parent ed15a03 commit c91fc5b

10 files changed

+118
-65
lines changed

tencentcloud/provider.go

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2117,9 +2117,9 @@ func Provider() *schema.Provider {
21172117
"tencentcloud_dlc_bind_work_groups_to_user_attachment": dlc.ResourceTencentCloudDlcBindWorkGroupsToUserAttachment(),
21182118
"tencentcloud_dlc_update_row_filter_operation": dlc.ResourceTencentCloudDlcUpdateRowFilterOperation(),
21192119
"tencentcloud_dlc_user_data_engine_config": dlc.ResourceTencentCloudDlcUserDataEngineConfig(),
2120-
"tencentcloud_waf_custom_rule": waf.ResourceTencentCloudWafCustomRule(),
2121-
"tencentcloud_waf_custom_white_rule": waf.ResourceTencentCloudWafCustomWhiteRule(),
2122-
"tencentcloud_waf_clb_domain": waf.ResourceTencentCloudWafClbDomain(),
2120+
"tencentcloud_waf_custom_rule": waf.ResourceTencentCloudWafCustomWhiteRule(),
2121+
"tencentcloud_waf_clb_domain": waf.ResourceTencentCloudWafCustomRule(),
2122+
"tencentcloud_waf_custom_white_rule": waf.ResourceTencentCloudWafClbDomain(),
21232123
"tencentcloud_waf_saas_domain": waf.ResourceTencentCloudWafSaasDomain(),
21242124
"tencentcloud_waf_clb_instance": waf.ResourceTencentCloudWafClbInstance(),
21252125
"tencentcloud_waf_saas_instance": waf.ResourceTencentCloudWafSaasInstance(),

tencentcloud/services/cfw/resource_tc_cfw_edge_policy.go

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -94,6 +94,7 @@ func ResourceTencentCloudCfwEdgePolicy() *schema.Resource {
9494
},
9595
"param_template_id": {
9696
Type: schema.TypeString,
97+
Optional: true,
9798
Computed: true,
9899
Description: "Parameter template id.",
99100
},
@@ -157,6 +158,10 @@ func resourceTencentCloudCfwEdgePolicyCreate(d *schema.ResourceData, meta interf
157158
createRuleItem.Scope = helper.String(v.(string))
158159
}
159160

161+
if v, ok := d.GetOk("param_template_id"); ok {
162+
createRuleItem.ParamTemplateId = helper.String(v.(string))
163+
}
164+
160165
request.Rules = append(request.Rules, &createRuleItem)
161166

162167
err := resource.Retry(tccommon.WriteRetryTimeout, func() *resource.RetryError {
@@ -251,6 +256,10 @@ func resourceTencentCloudCfwEdgePolicyRead(d *schema.ResourceData, meta interfac
251256
_ = d.Set("protocol", edgePolicy.Protocol)
252257
}
253258

259+
if edgePolicy.RuleAction != nil {
260+
_ = d.Set("rule_action", edgePolicy.RuleAction)
261+
}
262+
254263
if edgePolicy.Port != nil {
255264
_ = d.Set("port", edgePolicy.Port)
256265
}
@@ -348,6 +357,10 @@ func resourceTencentCloudCfwEdgePolicyUpdate(d *schema.ResourceData, meta interf
348357
modifyRuleItem.Scope = helper.String(v.(string))
349358
}
350359

360+
if v, ok := d.GetOk("param_template_id"); ok {
361+
modifyRuleItem.ParamTemplateId = helper.String(v.(string))
362+
}
363+
351364
request.Rules = append(request.Rules, &modifyRuleItem)
352365

353366
err := resource.Retry(tccommon.WriteRetryTimeout, func() *resource.RetryError {

tencentcloud/services/cfw/resource_tc_cfw_edge_policy.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
Provides a resource to create a cfw edge_policy
1+
Provides a resource to create a CFW edge policy
22

33
Example Usage
44

@@ -38,8 +38,8 @@ resource "tencentcloud_cfw_edge_policy" "example" {
3838

3939
Import
4040

41-
cfw edge_policy can be imported using the id, e.g.
41+
CFW edge policy can be imported using the id, e.g.
4242

4343
```
44-
terraform import tencentcloud_cfw_edge_policy.example edge_policy_id
44+
terraform import tencentcloud_cfw_edge_policy.example 1859582
4545
```

tencentcloud/services/cfw/resource_tc_cfw_nat_policy.go

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -85,9 +85,21 @@ func ResourceTencentCloudCfwNatPolicy() *schema.Resource {
8585
},
8686
"param_template_id": {
8787
Type: schema.TypeString,
88+
Optional: true,
8889
Computed: true,
8990
Description: "Parameter template id. Note: This field may return null, indicating that no valid value can be obtained.",
9091
},
92+
"internal_uuid": {
93+
Type: schema.TypeInt,
94+
Computed: true,
95+
Description: "Internal ID.",
96+
},
97+
"scope": {
98+
Type: schema.TypeString,
99+
Optional: true,
100+
Default: "ALL",
101+
Description: "Scope of effective rules. ALL: Global effectiveness; ap-guangzhou: Effective territory; cfwnat-xxx: Effectiveness based on instance dimension.",
102+
},
91103
},
92104
}
93105
}
@@ -144,6 +156,14 @@ func resourceTencentCloudCfwNatPolicyCreate(d *schema.ResourceData, meta interfa
144156
createNatRuleItem.Description = helper.String(v.(string))
145157
}
146158

159+
if v, ok := d.GetOk("param_template_id"); ok {
160+
createNatRuleItem.ParamTemplateId = helper.String(v.(string))
161+
}
162+
163+
if v, ok := d.GetOk("scope"); ok {
164+
createNatRuleItem.Scope = helper.String(v.(string))
165+
}
166+
147167
request.Rules = append(request.Rules, &createNatRuleItem)
148168

149169
err := resource.Retry(tccommon.WriteRetryTimeout, func() *resource.RetryError {
@@ -212,6 +232,10 @@ func resourceTencentCloudCfwNatPolicyRead(d *schema.ResourceData, meta interface
212232
_ = d.Set("protocol", natPolicy.Protocol)
213233
}
214234

235+
if natPolicy.RuleAction != nil {
236+
_ = d.Set("rule_action", natPolicy.RuleAction)
237+
}
238+
215239
if natPolicy.Port != nil {
216240
_ = d.Set("port", natPolicy.Port)
217241
}
@@ -240,6 +264,10 @@ func resourceTencentCloudCfwNatPolicyRead(d *schema.ResourceData, meta interface
240264
_ = d.Set("param_template_id", natPolicy.ParamTemplateId)
241265
}
242266

267+
if natPolicy.InternalUuid != nil {
268+
_ = d.Set("internal_uuid", natPolicy.InternalUuid)
269+
}
270+
243271
return nil
244272
}
245273

@@ -305,6 +333,14 @@ func resourceTencentCloudCfwNatPolicyUpdate(d *schema.ResourceData, meta interfa
305333
modifyRuleItem.Description = helper.String(v.(string))
306334
}
307335

336+
if v, ok := d.GetOk("param_template_id"); ok {
337+
modifyRuleItem.ParamTemplateId = helper.String(v.(string))
338+
}
339+
340+
if v, ok := d.GetOk("scope"); ok {
341+
modifyRuleItem.Scope = helper.String(v.(string))
342+
}
343+
308344
request.Rules = append(request.Rules, &modifyRuleItem)
309345

310346
err := resource.Retry(tccommon.WriteRetryTimeout, func() *resource.RetryError {

tencentcloud/services/cfw/resource_tc_cfw_nat_policy.md

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
Provides a resource to create a cfw nat_policy
1+
Provides a resource to create a CFW nat policy
22

33
Example Usage
44

@@ -14,13 +14,14 @@ resource "tencentcloud_cfw_nat_policy" "example" {
1414
direction = 1
1515
enable = "true"
1616
description = "policy description."
17+
scope = "ALL"
1718
}
1819
```
1920

2021
Import
2122

22-
cfw nat_policy can be imported using the id, e.g.
23+
CFW nat policy can be imported using the id, e.g.
2324

2425
```
25-
terraform import tencentcloud_cfw_nat_policy.example nat_policy_id
26+
terraform import tencentcloud_cfw_nat_policy.example 134123
2627
```

website/docs/r/cfw_edge_policy.html.markdown

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -4,12 +4,12 @@ layout: "tencentcloud"
44
page_title: "TencentCloud: tencentcloud_cfw_edge_policy"
55
sidebar_current: "docs-tencentcloud-resource-cfw_edge_policy"
66
description: |-
7-
Provides a resource to create a cfw edge_policy
7+
Provides a resource to create a CFW edge policy
88
---
99

1010
# tencentcloud_cfw_edge_policy
1111

12-
Provides a resource to create a cfw edge_policy
12+
Provides a resource to create a CFW edge policy
1313

1414
## Example Usage
1515

@@ -61,22 +61,22 @@ The following arguments are supported:
6161
* `target_type` - (Required, String) Access purpose type: For inbound rules, the type can be net, instance, tag, template, group; for outbound rules, it can be net, location, vendor, template.
6262
* `description` - (Optional, String) Description.
6363
* `enable` - (Optional, String) Rule status, true means enabled, false means disabled. Default is true.
64+
* `param_template_id` - (Optional, String) Parameter template id.
6465
* `scope` - (Optional, String) Effective range. serial: serial; side: bypass; all: global, Default is all.
6566

6667
## Attributes Reference
6768

6869
In addition to all arguments above, the following attributes are exported:
6970

7071
* `id` - ID of the resource.
71-
* `param_template_id` - Parameter template id.
7272
* `uuid` - The unique id corresponding to the rule, no need to fill in when creating the rule.
7373

7474

7575
## Import
7676

77-
cfw edge_policy can be imported using the id, e.g.
77+
CFW edge policy can be imported using the id, e.g.
7878

7979
```
80-
terraform import tencentcloud_cfw_edge_policy.example edge_policy_id
80+
terraform import tencentcloud_cfw_edge_policy.example 1859582
8181
```
8282

website/docs/r/cfw_nat_policy.html.markdown

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -4,12 +4,12 @@ layout: "tencentcloud"
44
page_title: "TencentCloud: tencentcloud_cfw_nat_policy"
55
sidebar_current: "docs-tencentcloud-resource-cfw_nat_policy"
66
description: |-
7-
Provides a resource to create a cfw nat_policy
7+
Provides a resource to create a CFW nat policy
88
---
99

1010
# tencentcloud_cfw_nat_policy
1111

12-
Provides a resource to create a cfw nat_policy
12+
Provides a resource to create a CFW nat policy
1313

1414
## Example Usage
1515

@@ -25,6 +25,7 @@ resource "tencentcloud_cfw_nat_policy" "example" {
2525
direction = 1
2626
enable = "true"
2727
description = "policy description."
28+
scope = "ALL"
2829
}
2930
```
3031

@@ -42,21 +43,23 @@ The following arguments are supported:
4243
* `target_type` - (Required, String) Access purpose type: For inbound rules, the type can be net, instance, tag, template, group; for outbound rules, it can be net, location, vendor, template.
4344
* `description` - (Optional, String) Description.
4445
* `enable` - (Optional, String) Rule status, true means enabled, false means disabled. Default is true.
46+
* `param_template_id` - (Optional, String) Parameter template id. Note: This field may return null, indicating that no valid value can be obtained.
47+
* `scope` - (Optional, String) Scope of effective rules. ALL: Global effectiveness; ap-guangzhou: Effective territory; cfwnat-xxx: Effectiveness based on instance dimension.
4548

4649
## Attributes Reference
4750

4851
In addition to all arguments above, the following attributes are exported:
4952

5053
* `id` - ID of the resource.
51-
* `param_template_id` - Parameter template id. Note: This field may return null, indicating that no valid value can be obtained.
54+
* `internal_uuid` - Internal ID.
5255
* `uuid` - The unique id corresponding to the rule, no need to fill in when creating the rule.
5356

5457

5558
## Import
5659

57-
cfw nat_policy can be imported using the id, e.g.
60+
CFW nat policy can be imported using the id, e.g.
5861

5962
```
60-
terraform import tencentcloud_cfw_nat_policy.example nat_policy_id
63+
terraform import tencentcloud_cfw_nat_policy.example 134123
6164
```
6265

website/docs/r/waf_clb_domain.html.markdown

Lines changed: 16 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -114,40 +114,28 @@ resource "tencentcloud_waf_clb_domain" "example" {
114114

115115
The following arguments are supported:
116116

117-
* `domain` - (Required, String) Domain name.
118-
* `instance_id` - (Required, String) Instance unique ID.
119-
* `region` - (Required, String) Regions of LB bound by domain.
120-
* `alb_type` - (Optional, String) Load balancer type: clb, apisix or tsegw, default clb.
121-
* `api_safe_status` - (Optional, Int) Whether to enable api safe, 1 enable, 0 disable.
122-
* `bot_status` - (Optional, Int) Whether to enable bot, 1 enable, 0 disable.
123-
* `cls_status` - (Optional, Int) Whether to enable access logs, 1 enable, 0 disable.
124-
* `engine` - (Optional, Int) Protection Status: 10: Rule Observation&&AI Off Mode, 11: Rule Observation&&AI Observation Mode, 12: Rule Observation&&AI Interception Mode, 20: Rule Interception&&AI Off Mode, 21: Rule Interception&&AI Observation Mode, 22: Rule Interception&&AI Interception Mode, Default 20.
125-
* `flow_mode` - (Optional, Int) WAF traffic mode, 1 cleaning mode, 0 mirroring mode.
126-
* `ip_headers` - (Optional, List: [`String`]) When is_cdn=3, this parameter needs to be filled in to indicate a custom header.
127-
* `is_cdn` - (Optional, Int) Whether a proxy has been enabled before WAF, 0 no deployment, 1 deployment and use first IP in X-Forwarded-For as client IP, 2 deployment and use remote_addr as client IP, 3 deployment and use values of custom headers as client IP.
128-
* `load_balancer_set` - (Optional, List) List of bound LB.
129-
* `status` - (Optional, Int) Binding status between waf and LB, 0:not bind, 1:binding.
130-
131-
The `load_balancer_set` object supports the following:
132-
133-
* `listener_id` - (Required, String) Unique ID of listener in LB.
134-
* `listener_name` - (Required, String) Listener name.
135-
* `load_balancer_id` - (Required, String) LoadBalancer unique ID.
136-
* `load_balancer_name` - (Required, String) LoadBalancer name.
137-
* `protocol` - (Required, String) Protocol of listener, http or https.
138-
* `region` - (Required, String) LoadBalancer region.
139-
* `vip` - (Required, String) LoadBalancer IP.
140-
* `vport` - (Required, Int) LoadBalancer port.
141-
* `zone` - (Required, String) LoadBalancer zone.
142-
* `load_balancer_type` - (Optional, String) Network type for load balancer.
143-
* `numerical_vpc_id` - (Optional, Int) VPCID for load balancer, public network is -1, and internal network is filled in according to actual conditions.
117+
* `action_type` - (Required, String) Action type, 1 represents blocking, 2 represents captcha, 3 represents observation, and 4 represents redirection.
118+
* `domain` - (Required, String) Domain name that needs to add policy.
119+
* `expire_time` - (Required, String) Expiration time, measured in seconds, such as 1677254399, which means the expiration time is 2023-02-24 23:59:59 0 means never expires.
120+
* `name` - (Required, String) Rule Name.
121+
* `sort_id` - (Required, String) Priority, value range 0-100.
122+
* `strategies` - (Required, List) Strategies detail.
123+
* `redirect` - (Optional, String) If the action is a redirect, it represents the redirect address; Other situations can be left blank.
124+
* `status` - (Optional, String) The status of the switch, 1 is on, 0 is off, default 1.
125+
126+
The `strategies` object supports the following:
127+
128+
* `arg` - (Required, String) Matching parameters.
129+
* `compare_func` - (Required, String) Logical symbol.
130+
* `content` - (Required, String) Matching Content.
131+
* `field` - (Required, String) Matching Fields.
144132

145133
## Attributes Reference
146134

147135
In addition to all arguments above, the following attributes are exported:
148136

149137
* `id` - ID of the resource.
150-
* `domain_id` - Domain id.
138+
* `rule_id` - rule ID.
151139

152140

153141
## Import

website/docs/r/waf_custom_rule.html.markdown

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -37,13 +37,12 @@ resource "tencentcloud_waf_custom_rule" "example" {
3737

3838
The following arguments are supported:
3939

40-
* `action_type` - (Required, String) Action type, 1 represents blocking, 2 represents captcha, 3 represents observation, and 4 represents redirection.
40+
* `bypass` - (Required, String) Details of bypass.
4141
* `domain` - (Required, String) Domain name that needs to add policy.
4242
* `expire_time` - (Required, String) Expiration time, measured in seconds, such as 1677254399, which means the expiration time is 2023-02-24 23:59:59 0 means never expires.
4343
* `name` - (Required, String) Rule Name.
44-
* `sort_id` - (Required, String) Priority, value range 0-100.
44+
* `sort_id` - (Required, String) Priority, value range 1-100, The smaller the number, the higher the execution priority of this rule.
4545
* `strategies` - (Required, List) Strategies detail.
46-
* `redirect` - (Optional, String) If the action is a redirect, it represents the redirect address; Other situations can be left blank.
4746
* `status` - (Optional, String) The status of the switch, 1 is on, 0 is off, default 1.
4847

4948
The `strategies` object supports the following:

website/docs/r/waf_custom_white_rule.html.markdown

Lines changed: 28 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -36,27 +36,40 @@ resource "tencentcloud_waf_custom_white_rule" "example" {
3636

3737
The following arguments are supported:
3838

39-
* `bypass` - (Required, String) Details of bypass.
40-
* `domain` - (Required, String) Domain name that needs to add policy.
41-
* `expire_time` - (Required, String) Expiration time, measured in seconds, such as 1677254399, which means the expiration time is 2023-02-24 23:59:59 0 means never expires.
42-
* `name` - (Required, String) Rule Name.
43-
* `sort_id` - (Required, String) Priority, value range 1-100, The smaller the number, the higher the execution priority of this rule.
44-
* `strategies` - (Required, List) Strategies detail.
45-
* `status` - (Optional, String) The status of the switch, 1 is on, 0 is off, default 1.
46-
47-
The `strategies` object supports the following:
48-
49-
* `arg` - (Required, String) Matching parameters.
50-
* `compare_func` - (Required, String) Logical symbol.
51-
* `content` - (Required, String) Matching Content.
52-
* `field` - (Required, String) Matching Fields.
39+
* `domain` - (Required, String) Domain name.
40+
* `instance_id` - (Required, String) Instance unique ID.
41+
* `region` - (Required, String) Regions of LB bound by domain.
42+
* `alb_type` - (Optional, String) Load balancer type: clb, apisix or tsegw, default clb.
43+
* `api_safe_status` - (Optional, Int) Whether to enable api safe, 1 enable, 0 disable.
44+
* `bot_status` - (Optional, Int) Whether to enable bot, 1 enable, 0 disable.
45+
* `cls_status` - (Optional, Int) Whether to enable access logs, 1 enable, 0 disable.
46+
* `engine` - (Optional, Int) Protection Status: 10: Rule Observation&&AI Off Mode, 11: Rule Observation&&AI Observation Mode, 12: Rule Observation&&AI Interception Mode, 20: Rule Interception&&AI Off Mode, 21: Rule Interception&&AI Observation Mode, 22: Rule Interception&&AI Interception Mode, Default 20.
47+
* `flow_mode` - (Optional, Int) WAF traffic mode, 1 cleaning mode, 0 mirroring mode.
48+
* `ip_headers` - (Optional, List: [`String`]) When is_cdn=3, this parameter needs to be filled in to indicate a custom header.
49+
* `is_cdn` - (Optional, Int) Whether a proxy has been enabled before WAF, 0 no deployment, 1 deployment and use first IP in X-Forwarded-For as client IP, 2 deployment and use remote_addr as client IP, 3 deployment and use values of custom headers as client IP.
50+
* `load_balancer_set` - (Optional, List) List of bound LB.
51+
* `status` - (Optional, Int) Binding status between waf and LB, 0:not bind, 1:binding.
52+
53+
The `load_balancer_set` object supports the following:
54+
55+
* `listener_id` - (Required, String) Unique ID of listener in LB.
56+
* `listener_name` - (Required, String) Listener name.
57+
* `load_balancer_id` - (Required, String) LoadBalancer unique ID.
58+
* `load_balancer_name` - (Required, String) LoadBalancer name.
59+
* `protocol` - (Required, String) Protocol of listener, http or https.
60+
* `region` - (Required, String) LoadBalancer region.
61+
* `vip` - (Required, String) LoadBalancer IP.
62+
* `vport` - (Required, Int) LoadBalancer port.
63+
* `zone` - (Required, String) LoadBalancer zone.
64+
* `load_balancer_type` - (Optional, String) Network type for load balancer.
65+
* `numerical_vpc_id` - (Optional, Int) VPCID for load balancer, public network is -1, and internal network is filled in according to actual conditions.
5366

5467
## Attributes Reference
5568

5669
In addition to all arguments above, the following attributes are exported:
5770

5871
* `id` - ID of the resource.
59-
* `rule_id` - rule ID.
72+
* `domain_id` - Domain id.
6073

6174

6275
## Import

0 commit comments

Comments
 (0)