Skip to content

Commit

Permalink
feat(redis): [119914522] support postpaid force_delete (#2861)
Browse files Browse the repository at this point in the history
* feat(redis):[00000000] support postpaid force_delete

* add changelog
  • Loading branch information
lyu571 authored Sep 29, 2024
1 parent 6bf97e3 commit 343cd45
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 3 deletions.
3 changes: 3 additions & 0 deletions .changelog/2861.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
```release-note:enhancement
resource/tencentcloud_redis_instance: support force_delete to postpaid instance
```
3 changes: 1 addition & 2 deletions tencentcloud/services/crs/resource_tc_redis_instance.go
Original file line number Diff line number Diff line change
Expand Up @@ -237,7 +237,7 @@ func ResourceTencentCloudRedisInstance() *schema.Resource {
"force_delete": {
Type: schema.TypeBool,
Optional: true,
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.",
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.",
},
"auto_renew_flag": {
Type: schema.TypeInt,
Expand Down Expand Up @@ -1093,7 +1093,6 @@ func resourceTencentCloudRedisInstanceDelete(d *schema.ResourceData, meta interf

forceDelete := d.Get("force_delete").(bool)
if chargeType == REDIS_CHARGE_TYPE_POSTPAID {
forceDelete = true
taskId, err := service.DestroyPostpaidInstance(ctx, d.Id())
if err != nil {
log.Printf("[CRITAL]%s redis %s fail, reason:%s\n", logId, "DestroyPostpaidInstance", err.Error())
Expand Down
2 changes: 1 addition & 1 deletion website/docs/r/redis_instance.html.markdown
Original file line number Diff line number Diff line change
Expand Up @@ -282,7 +282,7 @@ The following arguments are supported:
* `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.
* `auto_renew_flag` - (Optional, Int, ForceNew) Auto-renew flag. 0 - default state (manual renewal); 1 - automatic renewal; 2 - explicit no automatic renewal.
* `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.
* `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.
* `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.
* `ip` - (Optional, String) IP address of an instance. When the `operation_network` is `changeVip`, this parameter needs to be configured.
* `name` - (Optional, String) Instance name.
* `no_auth` - (Optional, Bool) Indicates whether the redis instance support no-auth access. NOTE: Only available in private cloud environment.
Expand Down

0 comments on commit 343cd45

Please sign in to comment.