Skip to content

Commit 080ec87

Browse files
authored
doc: port fmt (#2465)
1 parent e99226a commit 080ec87

File tree

3 files changed

+7
-7
lines changed

3 files changed

+7
-7
lines changed

tencentcloud/services/vpc/resource_tc_vpc_acl.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -43,13 +43,13 @@ func ResourceTencentCloudVpcACL() *schema.Resource {
4343
Type: schema.TypeList,
4444
Optional: true,
4545
Elem: &schema.Schema{Type: schema.TypeString},
46-
Description: "Ingress rules. A rule must match the following format: [action]#[cidr_ip]#[port]#[protocol]. The available value of 'action' is `ACCEPT` and `DROP`. The 'cidr_ip' must be an IP address network or segment. The 'port' valid format is `80`, `80,443`, `80-90` or `ALL`. The available value of 'protocol' is `TCP`, `UDP`, `ICMP` and `ALL`. When 'protocol' is `ICMP` or `ALL`, the 'port' must be `ALL`.",
46+
Description: "Ingress rules. A rule must match the following format: [action]#[cidr_ip]#[port]#[protocol]. The available value of 'action' is `ACCEPT` and `DROP`. The 'cidr_ip' must be an IP address network or segment. The 'port' valid format is `80`, `80-90` or `ALL`. The available value of 'protocol' is `TCP`, `UDP`, `ICMP` and `ALL`. When 'protocol' is `ICMP` or `ALL`, the 'port' must be `ALL`.",
4747
},
4848
"egress": {
4949
Type: schema.TypeList,
5050
Optional: true,
5151
Elem: &schema.Schema{Type: schema.TypeString},
52-
Description: "Egress rules. A rule must match the following format: [action]#[cidr_ip]#[port]#[protocol]. The available value of 'action' is `ACCEPT` and `DROP`. The 'cidr_ip' must be an IP address network or segment. The 'port' valid format is `80`, `80,443`, `80-90` or `ALL`. The available value of 'protocol' is `TCP`, `UDP`, `ICMP` and `ALL`. When 'protocol' is `ICMP` or `ALL`, the 'port' must be `ALL`.",
52+
Description: "Egress rules. A rule must match the following format: [action]#[cidr_ip]#[port]#[protocol]. The available value of 'action' is `ACCEPT` and `DROP`. The 'cidr_ip' must be an IP address network or segment. The 'port' valid format is `80`, `80-90` or `ALL`. The available value of 'protocol' is `TCP`, `UDP`, `ICMP` and `ALL`. When 'protocol' is `ICMP` or `ALL`, the 'port' must be `ALL`.",
5353
},
5454
"tags": {
5555
Type: schema.TypeMap,

tencentcloud/services/vpc/service_tencentcloud_vpc.go

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2300,7 +2300,7 @@ func parseRule(str string) (liteRule VpcSecurityGroupLiteRule, err error) {
23002300

23012301
liteRule.port = port
23022302
if port != "ALL" && !portRE.MatchString(port) && !protocolTemplateRE.MatchString(protocol) {
2303-
err = fmt.Errorf("invalid port %s, allow port format is `ALL`, `53`, `80,443` or `80-90`", liteRule.port)
2303+
err = fmt.Errorf("invalid port %s, allow port format is `ALL`, `53` or `80-90`", liteRule.port)
23042304
return
23052305
}
23062306

@@ -3706,8 +3706,8 @@ func parseACLRule(str string) (liteRule VpcACLRule, err error) {
37063706
}
37073707
}
37083708

3709-
if liteRule.port != "ALL" && !regexp.MustCompile(`^(\d{1,5},)*\d{1,5}$|^\d{1,5}-\d{1,5}$`).MatchString(liteRule.port) {
3710-
err = fmt.Errorf("invalid port %s, allow port format is `ALL`, `53`, `80,443` or `80-90`", liteRule.port)
3709+
if liteRule.port != "ALL" && !regexp.MustCompile(`^(\d{1,5}|(\d{1,5}-\d{1,5}))$`).MatchString(liteRule.port) {
3710+
err = fmt.Errorf("invalid port %s, allow port format is `ALL`, `53` or `80-90`", liteRule.port)
37113711
return
37123712
}
37133713

website/docs/r/vpc_acl.html.markdown

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -39,8 +39,8 @@ The following arguments are supported:
3939

4040
* `name` - (Required, String) Name of the network ACL.
4141
* `vpc_id` - (Required, String) ID of the VPC instance.
42-
* `egress` - (Optional, List: [`String`]) Egress rules. A rule must match the following format: [action]#[cidr_ip]#[port]#[protocol]. The available value of 'action' is `ACCEPT` and `DROP`. The 'cidr_ip' must be an IP address network or segment. The 'port' valid format is `80`, `80,443`, `80-90` or `ALL`. The available value of 'protocol' is `TCP`, `UDP`, `ICMP` and `ALL`. When 'protocol' is `ICMP` or `ALL`, the 'port' must be `ALL`.
43-
* `ingress` - (Optional, List: [`String`]) Ingress rules. A rule must match the following format: [action]#[cidr_ip]#[port]#[protocol]. The available value of 'action' is `ACCEPT` and `DROP`. The 'cidr_ip' must be an IP address network or segment. The 'port' valid format is `80`, `80,443`, `80-90` or `ALL`. The available value of 'protocol' is `TCP`, `UDP`, `ICMP` and `ALL`. When 'protocol' is `ICMP` or `ALL`, the 'port' must be `ALL`.
42+
* `egress` - (Optional, List: [`String`]) Egress rules. A rule must match the following format: [action]#[cidr_ip]#[port]#[protocol]. The available value of 'action' is `ACCEPT` and `DROP`. The 'cidr_ip' must be an IP address network or segment. The 'port' valid format is `80`, `80-90` or `ALL`. The available value of 'protocol' is `TCP`, `UDP`, `ICMP` and `ALL`. When 'protocol' is `ICMP` or `ALL`, the 'port' must be `ALL`.
43+
* `ingress` - (Optional, List: [`String`]) Ingress rules. A rule must match the following format: [action]#[cidr_ip]#[port]#[protocol]. The available value of 'action' is `ACCEPT` and `DROP`. The 'cidr_ip' must be an IP address network or segment. The 'port' valid format is `80`, `80-90` or `ALL`. The available value of 'protocol' is `TCP`, `UDP`, `ICMP` and `ALL`. When 'protocol' is `ICMP` or `ALL`, the 'port' must be `ALL`.
4444
* `tags` - (Optional, Map) Tags of the vpc acl.
4545

4646
## Attributes Reference

0 commit comments

Comments
 (0)