Skip to content

Commit e7e702c

Browse files
authored
Merge pull request #1885 from tencentcloudstack/fix/sg-rule-set
fix/sg-rule-set
2 parents 619bf5a + 1cc0e88 commit e7e702c

File tree

3 files changed

+10
-3
lines changed

3 files changed

+10
-3
lines changed

.changelog/1885.txt

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
```release-note:enhancement
2+
resource/tencentcloud_cos_bucket: Update the validation rules for the `bucket` parameter
3+
```
4+
5+
```release-note:enhancement
6+
resource/tencentcloud_security_group_rule_set: Add default values for the protocol and port fields.
7+
```

tencentcloud/resource_tc_security_group_rule_set.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -122,13 +122,13 @@ func resourceTencentCloudSecurityGroupRuleSet() *schema.Resource {
122122
"protocol": {
123123
Type: schema.TypeString,
124124
Optional: true,
125-
Computed: true,
125+
Default: "ALL",
126126
Description: "Type of IP protocol. Valid values: `TCP`, `UDP` and `ICMP`. Default to all types protocol, and conflicts with `service_template_*`.",
127127
},
128128
"port": {
129129
Type: schema.TypeString,
130130
Optional: true,
131-
Computed: true,
131+
Default: "ALL",
132132
Description: "Range of the port. The available value can be one, multiple or one segment. E.g. `80`, `80,90` and `80-90`. Default to all ports, and conflicts with `service_template_*`.",
133133
},
134134
}

tencentcloud/validators.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -243,7 +243,7 @@ func validateCosBucketName(v interface{}, k string) (ws []string, errors []error
243243
errors = append(errors, fmt.Errorf("the length of %s must be 1-60: %s", k, value))
244244
}
245245

246-
pattern := `^[a-z0-9]+[a-z0-9-]+[a-z0-9]+-[0-9]{10}$`
246+
pattern := `^[a-z0-9]([a-z0-9-]*[a-z0-9])?-[0-9]{10}$`
247247
if match, _ := regexp.Match(pattern, []byte(value)); !match {
248248
errors = append(errors, fmt.Errorf("%s is not valid, please refer to the official documents: %s", k, value))
249249
}

0 commit comments

Comments
 (0)