Skip to content

Commit

Permalink
resource/alicloud_db_instance: sql_collector_config_value insert diff…
Browse files Browse the repository at this point in the history
…SuppressFunc
  • Loading branch information
chaitiansheng0524 committed Feb 14, 2025
1 parent 93b7511 commit e226664
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 0 deletions.
6 changes: 6 additions & 0 deletions alicloud/resource_alicloud_db_instance.go
Original file line number Diff line number Diff line change
Expand Up @@ -359,6 +359,12 @@ func resourceAliCloudDBInstance() *schema.Resource {
Optional: true,
ValidateFunc: IntInSlice([]int{30, 180, 365, 1095, 1825}),
Default: 30,
DiffSuppressFunc: func(k, old, new string, d *schema.ResourceData) bool {
if v, ok := d.GetOk("sql_collector_status"); ok && strings.ToLower(v.(string)) == "enabled" {
return false
}
return true
},
},
"resource_group_id": {
Type: schema.TypeString,
Expand Down
1 change: 1 addition & 0 deletions website/docs/r/db_instance.html.markdown
Original file line number Diff line number Diff line change
Expand Up @@ -579,6 +579,7 @@ The following arguments are supported:

-> **NOTE:** You can specify the time zone when you create a primary instance. You cannot specify the time zone when you create a read-only instance. Read-only instances inherit the time zone of their primary instance. If you do not specify this parameter, the system assigns the default time zone of the region where the instance resides.
* `sql_collector_status` - (Optional, Available since 1.70.0) The sql collector status of the instance. Valid values are `Enabled`, `Disabled`, Default to `Disabled`.
-> **NOTE:** The default return value of this parameter has been updated from 30 to 0. To avoid affecting existing instances, the parameter's DiffSuppressFunc has been updated to ensure that the parameter is not affected when sql_collector_status is set to Disabled.
* `sql_collector_config_value` - (Optional, Available since 1.70.0) The sql collector keep time of the instance. Valid values are `30`, `180`, `365`, `1095`, `1825`, Default to `30`.

* `instance_name` - (Optional) The name of DB instance. It a string of 2 to 256 characters.
Expand Down

0 comments on commit e226664

Please sign in to comment.