Skip to content

Commit 08d73e9

Browse files
tongyimingmikatong
andauthored
Fix/cos bucket multi az (#1957)
* remove multi_za limit * update doc * add changelog --------- Co-authored-by: mikatong <mikatong@tencent.com>
1 parent a5d86f1 commit 08d73e9

File tree

3 files changed

+7
-8
lines changed

3 files changed

+7
-8
lines changed

.changelog/1957.txt

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
```release-note:enhancement
2+
resource/tencentcloud_cos_bucket: remove `multi_az` limit
3+
```

tencentcloud/resource_tc_cos_bucket.go

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -462,7 +462,7 @@ func resourceTencentCloudCosBucket() *schema.Resource {
462462
Type: schema.TypeBool,
463463
Optional: true,
464464
Default: false,
465-
Description: "Enable bucket versioning.",
465+
Description: "Enable bucket versioning. NOTE: The `multi_az` feature is true for the current bucket, cannot disable version control.",
466466
},
467467
"acceleration_enable": {
468468
Type: schema.TypeBool,
@@ -757,7 +757,7 @@ func resourceTencentCloudCosBucket() *schema.Resource {
757757
Type: schema.TypeBool,
758758
Optional: true,
759759
ForceNew: true,
760-
Description: "Indicates whether to create a bucket of multi available zone. NOTE: If set to true, the versioning must enable.",
760+
Description: "Indicates whether to create a bucket of multi available zone.",
761761
},
762762
"enable_intelligent_tiering": {
763763
Type: schema.TypeBool,
@@ -800,17 +800,13 @@ func resourceTencentCloudCosBucketCreate(d *schema.ResourceData, meta interface{
800800
role, roleOk := d.GetOk("replica_role")
801801
rule, ruleOk := d.GetOk("replica_rules")
802802
versioning := d.Get("versioning_enable").(bool)
803-
isMAZ := d.Get("multi_az").(bool)
804803

805804
if !versioning {
806805
if roleOk || role.(string) != "" {
807806
return fmt.Errorf("cannot configure role unless versioning enable")
808807
} else if ruleOk || len(rule.([]interface{})) > 0 {
809808
return fmt.Errorf("cannot configure replica rule unless versioning enable")
810809
}
811-
if isMAZ {
812-
return fmt.Errorf("cannot create MAZ bucket unless versioning enable")
813-
}
814810
}
815811

816812
cosService := CosService{client: meta.(*TencentCloudClient).apiV3Conn}

website/docs/r/cos_bucket.html.markdown

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -288,13 +288,13 @@ The following arguments are supported:
288288
* `log_enable` - (Optional, Bool) Indicate the access log of this bucket to be saved or not. Default is `false`. If set `true`, the access log will be saved with `log_target_bucket`. To enable log, the full access of log service must be granted. [Full Access Role Policy](https://intl.cloud.tencent.com/document/product/436/16920).
289289
* `log_prefix` - (Optional, String) The prefix log name which saves the access log of this bucket per 5 minutes. Eg. `MyLogPrefix/`. The log access file format is `log_target_bucket`/`log_prefix`{YYYY}/{MM}/{DD}/{time}_{random}_{index}.gz. Only valid when `log_enable` is `true`.
290290
* `log_target_bucket` - (Optional, String) The target bucket name which saves the access log of this bucket per 5 minutes. The log access file format is `log_target_bucket`/`log_prefix`{YYYY}/{MM}/{DD}/{time}_{random}_{index}.gz. Only valid when `log_enable` is `true`. User must have full access on this bucket.
291-
* `multi_az` - (Optional, Bool, ForceNew) Indicates whether to create a bucket of multi available zone. NOTE: If set to true, the versioning must enable.
291+
* `multi_az` - (Optional, Bool, ForceNew) Indicates whether to create a bucket of multi available zone.
292292
* `origin_domain_rules` - (Optional, List) Bucket Origin Domain settings.
293293
* `origin_pull_rules` - (Optional, List) Bucket Origin-Pull settings.
294294
* `replica_role` - (Optional, String) Request initiator identifier, format: `qcs::cam::uin/<owneruin>:uin/<subuin>`. NOTE: only `versioning_enable` is true can configure this argument.
295295
* `replica_rules` - (Optional, List) List of replica rule. NOTE: only `versioning_enable` is true and `replica_role` set can configure this argument.
296296
* `tags` - (Optional, Map) The tags of a bucket.
297-
* `versioning_enable` - (Optional, Bool) Enable bucket versioning.
297+
* `versioning_enable` - (Optional, Bool) Enable bucket versioning. NOTE: The `multi_az` feature is true for the current bucket, cannot disable version control.
298298
* `website` - (Optional, List) A website object(documented below).
299299

300300
The `cors_rules` object supports the following:

0 commit comments

Comments
 (0)