Skip to content

Commit 8179e2d

Browse files
tongyimingmikatong
andauthored
fix mongodb sharding mongos memory unit (#1573)
* fix mongodb sharding mongos memory unit * add changelog --------- Co-authored-by: mikatong <mikatong@tencent.com>
1 parent f1dcdcd commit 8179e2d

8 files changed

+19
-10
lines changed

.changelog/1573.txt

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
```release-note:bug
2+
resource/tencentcloud_mongodb_instance: clean mongos params
3+
```
4+
5+
```release-note:bug
6+
resource/tencentcloud_mongodb_sharding_instance: fix mongos_memory unit
7+
```
8+
9+
```release-note:bug
10+
resource/tencentcloud_mongodb_standby_instance: clean mongos params
11+
```

tencentcloud/extension_mongodb.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -165,7 +165,7 @@ func TencentMongodbBasicInfo() map[string]*schema.Schema {
165165
Type: schema.TypeInt,
166166
Optional: true,
167167
Computed: true,
168-
Description: "Mongos memory size.",
168+
Description: "Mongos memory size in GB.",
169169
},
170170
"mongos_node_num": {
171171
Type: schema.TypeInt,

tencentcloud/resource_tc_mongodb_instance.go

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -65,6 +65,10 @@ func resourceTencentCloudMongodbInstance() *schema.Resource {
6565
},
6666
}
6767
basic := TencentMongodbBasicInfo()
68+
conflictList := []string{"mongos_cpu", "mongos_memory", "mongos_node_num"}
69+
for _, item := range conflictList {
70+
delete(basic, item)
71+
}
6872
for k, v := range basic {
6973
mongodbInstanceInfo[k] = v
7074
}

tencentcloud/resource_tc_mongodb_sharding_instance.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -371,7 +371,7 @@ func resourceMongodbShardingInstanceRead(d *schema.ResourceData, meta interface{
371371
_ = d.Set("vport", instance.Vport)
372372
_ = d.Set("create_time", instance.CreateTime)
373373
_ = d.Set("mongos_cpu", instance.MongosCpuNum)
374-
_ = d.Set("mongos_memory", instance.MongosMemory)
374+
_ = d.Set("mongos_memory", *instance.MongosMemory/1024)
375375
_ = d.Set("mongos_node_num", instance.MongosNodeNum)
376376
_ = d.Set("auto_renew_flag", instance.AutoRenewFlag)
377377

tencentcloud/resource_tc_mongodb_standby_instance.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -102,7 +102,7 @@ func resourceTencentCloudMongodbStandbyInstance() *schema.Resource {
102102
},
103103
}
104104
basic := TencentMongodbBasicInfo()
105-
conflictList := []string{"engine_version", "machine_type", "password", "available_zone"}
105+
conflictList := []string{"engine_version", "machine_type", "password", "available_zone", "mongos_cpu", "mongos_memory", "mongos_node_num"}
106106
for _, item := range conflictList {
107107
delete(basic, item)
108108
}

website/docs/r/mongodb_instance.html.markdown

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -40,9 +40,6 @@ The following arguments are supported:
4040
* `volume` - (Required, Int) Disk size. The minimum value is 25, and unit is GB. Memory and volume must be upgraded or degraded simultaneously.
4141
* `auto_renew_flag` - (Optional, Int) Auto renew flag. Valid values are `0`(NOTIFY_AND_MANUAL_RENEW), `1`(NOTIFY_AND_AUTO_RENEW) and `2`(DISABLE_NOTIFY_AND_MANUAL_RENEW). Default value is `0`. Note: only works for PREPAID instance. Only supports`0` and `1` for creation.
4242
* `charge_type` - (Optional, String, ForceNew) The charge type of instance. Valid values are `PREPAID` and `POSTPAID_BY_HOUR`. Default value is `POSTPAID_BY_HOUR`. Note: TencentCloud International only supports `POSTPAID_BY_HOUR`. Caution that update operation on this field will delete old instances and create new one with new charge type.
43-
* `mongos_cpu` - (Optional, Int) Number of mongos cpu.
44-
* `mongos_memory` - (Optional, Int) Mongos memory size.
45-
* `mongos_node_num` - (Optional, Int) Number of mongos.
4643
* `password` - (Optional, String) Password of this Mongodb account.
4744
* `prepaid_period` - (Optional, Int) The tenancy (time unit is month) of the prepaid instance. Valid values are 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 24, 36. NOTE: it only works when charge_type is set to `PREPAID`.
4845
* `project_id` - (Optional, Int) ID of the project which the instance belongs.

website/docs/r/mongodb_sharding_instance.html.markdown

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ The following arguments are supported:
4848
* `auto_renew_flag` - (Optional, Int) Auto renew flag. Valid values are `0`(NOTIFY_AND_MANUAL_RENEW), `1`(NOTIFY_AND_AUTO_RENEW) and `2`(DISABLE_NOTIFY_AND_MANUAL_RENEW). Default value is `0`. Note: only works for PREPAID instance. Only supports`0` and `1` for creation.
4949
* `charge_type` - (Optional, String, ForceNew) The charge type of instance. Valid values are `PREPAID` and `POSTPAID_BY_HOUR`. Default value is `POSTPAID_BY_HOUR`. Note: TencentCloud International only supports `POSTPAID_BY_HOUR`. Caution that update operation on this field will delete old instances and create new one with new charge type.
5050
* `mongos_cpu` - (Optional, Int) Number of mongos cpu.
51-
* `mongos_memory` - (Optional, Int) Mongos memory size.
51+
* `mongos_memory` - (Optional, Int) Mongos memory size in GB.
5252
* `mongos_node_num` - (Optional, Int) Number of mongos.
5353
* `password` - (Optional, String) Password of this Mongodb account.
5454
* `prepaid_period` - (Optional, Int) The tenancy (time unit is month) of the prepaid instance. Valid values are 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 24, 36. NOTE: it only works when charge_type is set to `PREPAID`.

website/docs/r/mongodb_standby_instance.html.markdown

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -66,9 +66,6 @@ The following arguments are supported:
6666
* `volume` - (Required, Int) Disk size. The minimum value is 25, and unit is GB. Memory and volume must be upgraded or degraded simultaneously.
6767
* `auto_renew_flag` - (Optional, Int) Auto renew flag. Valid values are `0`(NOTIFY_AND_MANUAL_RENEW), `1`(NOTIFY_AND_AUTO_RENEW) and `2`(DISABLE_NOTIFY_AND_MANUAL_RENEW). Default value is `0`. Note: only works for PREPAID instance. Only supports`0` and `1` for creation.
6868
* `charge_type` - (Optional, String, ForceNew) The charge type of instance. Valid values are `PREPAID` and `POSTPAID_BY_HOUR`. Default value is `POSTPAID_BY_HOUR`. Note: TencentCloud International only supports `POSTPAID_BY_HOUR`. Caution that update operation on this field will delete old instances and create new one with new charge type.
69-
* `mongos_cpu` - (Optional, Int) Number of mongos cpu.
70-
* `mongos_memory` - (Optional, Int) Mongos memory size.
71-
* `mongos_node_num` - (Optional, Int) Number of mongos.
7269
* `prepaid_period` - (Optional, Int) The tenancy (time unit is month) of the prepaid instance. Valid values are 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 24, 36. NOTE: it only works when charge_type is set to `PREPAID`.
7370
* `project_id` - (Optional, Int) ID of the project which the instance belongs.
7471
* `security_groups` - (Optional, Set: [`String`], ForceNew) ID of the security group. NOTE: for instance which `engine_version` is `MONGO_40_WT`, `security_groups` is not supported.

0 commit comments

Comments
 (0)