Skip to content

Commit 1336e8f

Browse files
committed
add
1 parent 5f3a2c2 commit 1336e8f

File tree

3 files changed

+21
-2
lines changed

3 files changed

+21
-2
lines changed

tencentcloud/services/cynosdb/extension_cynosdb.go

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -181,7 +181,6 @@ func TencentCynosdbClusterBaseInfo() map[string]*schema.Schema {
181181
"password": {
182182
Type: schema.TypeString,
183183
Required: true,
184-
ForceNew: true,
185184
Sensitive: true,
186185
Description: "Password of `root` account.",
187186
},

tencentcloud/services/cynosdb/resource_tc_cynosdb_cluster.go

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -795,6 +795,26 @@ func resourceTencentCloudCynosdbClusterUpdate(d *schema.ResourceData, meta inter
795795
}
796796
}
797797

798+
// update root pwd
799+
if d.HasChange("password") {
800+
request := cynosdb.NewResetAccountPasswordRequest()
801+
request.ClusterId = helper.String(clusterId)
802+
request.AccountName = helper.String("root")
803+
request.AccountPassword = helper.String(d.Get("password").(string))
804+
err := resource.Retry(tccommon.WriteRetryTimeout, func() *resource.RetryError {
805+
_, err := meta.(tccommon.ProviderMeta).GetAPIV3Conn().UseCynosdbClient().ResetAccountPassword(request)
806+
if err != nil {
807+
return tccommon.RetryError(err)
808+
}
809+
810+
return nil
811+
})
812+
813+
if err != nil {
814+
return err
815+
}
816+
}
817+
798818
// update tags
799819
if d.HasChange("tags") {
800820
oldTags, newTags := d.GetChange("tags")

website/docs/r/cynosdb_cluster.html.markdown

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -198,7 +198,7 @@ The following arguments are supported:
198198
* `cluster_name` - (Required, String) Name of CynosDB cluster.
199199
* `db_type` - (Required, String, ForceNew) Type of CynosDB, and available values include `MYSQL`.
200200
* `db_version` - (Required, String, ForceNew) Version of CynosDB, which is related to `db_type`. For `MYSQL`, available value is `5.7`, `8.0`.
201-
* `password` - (Required, String, ForceNew) Password of `root` account.
201+
* `password` - (Required, String) Password of `root` account.
202202
* `subnet_id` - (Required, String) ID of the subnet within this VPC.
203203
* `vpc_id` - (Required, String) ID of the VPC.
204204
* `auto_pause_delay` - (Optional, Int) Specify auto-pause delay in second while `db_mode` is `SERVERLESS`. Value range: `[600, 691200]`. Default: `600`.

0 commit comments

Comments
 (0)