Skip to content

Commit 343cd45

Browse files
authored
feat(redis): [119914522] support postpaid force_delete (#2861)
* feat(redis):[00000000] support postpaid force_delete * add changelog
1 parent 6bf97e3 commit 343cd45

File tree

3 files changed

+5
-3
lines changed

3 files changed

+5
-3
lines changed

.changelog/2861.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_redis_instance: support force_delete to postpaid instance
3+
```

tencentcloud/services/crs/resource_tc_redis_instance.go

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -237,7 +237,7 @@ func ResourceTencentCloudRedisInstance() *schema.Resource {
237237
"force_delete": {
238238
Type: schema.TypeBool,
239239
Optional: true,
240-
Description: "Indicate whether to delete Redis instance directly or not. Default is false. If set true, the instance will be deleted instead of staying recycle bin. Note: only works for `PREPAID` instance.",
240+
Description: "Indicate whether to delete Redis instance directly or not. Default is false. If set true, the instance will be deleted instead of staying recycle bin.",
241241
},
242242
"auto_renew_flag": {
243243
Type: schema.TypeInt,
@@ -1093,7 +1093,6 @@ func resourceTencentCloudRedisInstanceDelete(d *schema.ResourceData, meta interf
10931093

10941094
forceDelete := d.Get("force_delete").(bool)
10951095
if chargeType == REDIS_CHARGE_TYPE_POSTPAID {
1096-
forceDelete = true
10971096
taskId, err := service.DestroyPostpaidInstance(ctx, d.Id())
10981097
if err != nil {
10991098
log.Printf("[CRITAL]%s redis %s fail, reason:%s\n", logId, "DestroyPostpaidInstance", err.Error())

website/docs/r/redis_instance.html.markdown

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -282,7 +282,7 @@ The following arguments are supported:
282282
* `mem_size` - (Required, Int) The memory volume of an available instance(in MB), please refer to `tencentcloud_redis_zone_config.list[zone].shard_memories`. When redis is standard type, it represents total memory size of the instance; when Redis is cluster type, it represents memory size of per sharding. `512MB` is supported only in master-slave instance.
283283
* `auto_renew_flag` - (Optional, Int, ForceNew) Auto-renew flag. 0 - default state (manual renewal); 1 - automatic renewal; 2 - explicit no automatic renewal.
284284
* `charge_type` - (Optional, String, ForceNew) The charge type of instance. Valid values: `PREPAID` and `POSTPAID`. Default value is `POSTPAID`. Note: TencentCloud International only supports `POSTPAID`. Caution that update operation on this field will delete old instances and create new with new charge type.
285-
* `force_delete` - (Optional, Bool) Indicate whether to delete Redis instance directly or not. Default is false. If set true, the instance will be deleted instead of staying recycle bin. Note: only works for `PREPAID` instance.
285+
* `force_delete` - (Optional, Bool) Indicate whether to delete Redis instance directly or not. Default is false. If set true, the instance will be deleted instead of staying recycle bin.
286286
* `ip` - (Optional, String) IP address of an instance. When the `operation_network` is `changeVip`, this parameter needs to be configured.
287287
* `name` - (Optional, String) Instance name.
288288
* `no_auth` - (Optional, Bool) Indicates whether the redis instance support no-auth access. NOTE: Only available in private cloud environment.

0 commit comments

Comments
 (0)