Skip to content

Commit ec6b1f4

Browse files
authored
Fix/cynosdb storage limit (#880)
* fix: cynosdb - make storage_limit optional * fix: update cynosdb storage_limit desc
1 parent 7b644b2 commit ec6b1f4

File tree

3 files changed

+7
-4
lines changed

3 files changed

+7
-4
lines changed

tencentcloud/extension_cynosdb.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -144,9 +144,9 @@ func TencentCynosdbClusterBaseInfo() map[string]*schema.Schema {
144144
},
145145
"storage_limit": {
146146
Type: schema.TypeInt,
147-
Required: true,
147+
Optional: true,
148148
ForceNew: true,
149-
Description: "Storage limit of CynosDB cluster instance, unit in GB.",
149+
Description: "Storage limit of CynosDB cluster instance, unit in GB. The maximum storage of a non-serverless instance in GB. NOTE: If db_type is `MYSQL` and charge_type is `PREPAID`, the value cannot exceed the maximum storage corresponding to the CPU and memory specifications, when charge_type is `POSTPAID_BY_HOUR`, this argument is unnecessary.",
150150
},
151151
"cluster_name": {
152152
Type: schema.TypeString,

tencentcloud/resource_tc_cynosdb_cluster.go

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -102,11 +102,14 @@ func resourceTencentCloudCynosdbClusterCreate(d *schema.ResourceData, meta inter
102102
request.Port = helper.IntInt64(d.Get("port").(int))
103103
request.DbType = helper.String(d.Get("db_type").(string))
104104
request.DbVersion = helper.String(d.Get("db_version").(string))
105-
request.StorageLimit = helper.IntInt64(d.Get("storage_limit").(int))
106105
request.ClusterName = helper.String(d.Get("cluster_name").(string))
107106
request.AdminPassword = helper.String(d.Get("password").(string))
108107
request.RollbackStrategy = helper.String("noneRollback")
109108

109+
if v, ok := d.GetOk("storage_limit"); ok {
110+
request.StorageLimit = helper.IntInt64(v.(int))
111+
}
112+
110113
// instance info
111114
request.Cpu = helper.IntInt64(d.Get("instance_cpu_core").(int))
112115
request.Memory = helper.IntInt64(d.Get("instance_memory_size").(int))

website/docs/r/cynosdb_cluster.html.markdown

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,6 @@ The following arguments are supported:
6464
* `instance_cpu_core` - (Required) The number of CPU cores of read-write type instance in the CynosDB cluster. Note: modification of this field will take effect immediately, if want to upgrade on maintenance window, please upgrade from console.
6565
* `instance_memory_size` - (Required) Memory capacity of read-write type instance, unit in GB. Note: modification of this field will take effect immediately, if want to upgrade on maintenance window, please upgrade from console.
6666
* `password` - (Required, ForceNew) Password of `root` account.
67-
* `storage_limit` - (Required, ForceNew) Storage limit of CynosDB cluster instance, unit in GB.
6867
* `subnet_id` - (Required, ForceNew) ID of the subnet within this VPC.
6968
* `vpc_id` - (Required, ForceNew) ID of the VPC.
7069
* `auto_renew_flag` - (Optional, ForceNew) Auto renew flag. Valid values are `0`(MANUAL_RENEW), `1`(AUTO_RENEW). Default value is `0`. Only works for PREPAID cluster.
@@ -78,6 +77,7 @@ The following arguments are supported:
7877
* `project_id` - (Optional, ForceNew) ID of the project. `0` by default.
7978
* `ro_group_sg` - (Optional) IDs of security group for `ro_group`.
8079
* `rw_group_sg` - (Optional) IDs of security group for `rw_group`.
80+
* `storage_limit` - (Optional, ForceNew) Storage limit of CynosDB cluster instance, unit in GB. The maximum storage of a non-serverless instance in GB. NOTE: If db_type is `MYSQL` and charge_type is `PREPAID`, the value cannot exceed the maximum storage corresponding to the CPU and memory specifications, when charge_type is `POSTPAID_BY_HOUR`, this argument is unnecessary.
8181
* `tags` - (Optional) The tags of the CynosDB cluster.
8282

8383
## Attributes Reference

0 commit comments

Comments
 (0)