Skip to content

Commit 84dc1db

Browse files
committed
fix/sg-rule-set
1 parent 38905ef commit 84dc1db

File tree

4 files changed

+5
-5
lines changed

4 files changed

+5
-5
lines changed

tencentcloud/resource_tc_cos_bucket.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -392,7 +392,7 @@ func resourceTencentCloudCosBucket() *schema.Resource {
392392
Required: true,
393393
ForceNew: true,
394394
ValidateFunc: validateCosBucketName,
395-
Description: "The name of a bucket to be created. Bucket format should be [custom name]-[appid], for example `mycos-1258798060`.",
395+
Description: "The name of a bucket to be created. Bucket format should be [custom name]-[appid], for example `mycos-1258798060`.The name cannot start or end with `-`. It only supports English Minuscule and numbers [a-z, 0-9, -] and their combinations. The total number of characters in the name of the complete request field can be up to 60 characters.",
396396
},
397397
"acl": {
398398
Type: schema.TypeString,

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
}

website/docs/r/cos_bucket.html.markdown

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -241,7 +241,7 @@ resource "tencentcloud_cos_bucket" "mycos" {
241241

242242
The following arguments are supported:
243243

244-
* `bucket` - (Required, String, ForceNew) The name of a bucket to be created. Bucket format should be [custom name]-[appid], for example `mycos-1258798060`.
244+
* `bucket` - (Required, String, ForceNew) The name of a bucket to be created. Bucket format should be [custom name]-[appid], for example `mycos-1258798060`.The name cannot start or end with `-`. It only supports English Minuscule and numbers [a-z, 0-9, -] and their combinations. The total number of characters in the name of the complete request field can be up to 60 characters.
245245
* `acceleration_enable` - (Optional, Bool) Enable bucket acceleration.
246246
* `acl_body` - (Optional, String) ACL XML body for multiple grant info. NOTE: this argument will overwrite `acl`. Check https://intl.cloud.tencent.com/document/product/436/7737 for more detail.
247247
* `acl` - (Optional, String) The canned ACL to apply. Valid values: private, public-read, and public-read-write. Defaults to private.

0 commit comments

Comments
 (0)