-
Notifications
You must be signed in to change notification settings - Fork 1.8k
google_sql_database_instance incorrectly handles optional insights_config #18918
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
google_sql_database_instance incorrectly handles optional insights_config #18918
Comments
The workaround is to enable query insights via Web GUI (it doesn't mention restart on Save )
Nevertheless... still a bug of course. |
We want it left disabled, the major issue for us is that this is showing up as drift in our internal systems |
Yes, unfortunately I don't see the possibility to use |
Same issue using the |
Another workaround that works for me is to add a block inside the resource of Terraform:
|
This unfortunately won't work for modules |
For the person who works on this ticket, some relevant info is in this comment: #18943 (comment) |
Hey folks, apologies for the perma-diff here. I've reached out internally to see if we can get the API change that caused this rolled back. In the meantime, GoogleCloudPlatform/magic-modules#11327 should fix this in the next release. To mitigate this now in current and previous provider versions, the lifecycle argument mentioned in #18918 (comment) is available. Unfortunately this will not apply for modules due to hashicorp/terraform#27360 |
v5.40.0 has the fix in the provider The internal backend team is investigating a backend fix as well that would be able to resolve for older provider versions. (b/356874854 for internal people) |
I've received word from the internal team that a fix preventing this behavior in the API has also rolled out. |
I'm going to lock this issue because it has been closed for 30 days ⏳. This helps our maintainers find and focus on the active issues. |
Community Note
Terraform Version & Provider Version(s)
Terraform v1.9.3
on linux_amd64
Affected Resource(s)
google_sql_database_instance
Terraform Configuration
Debug Output
No response
Expected Behavior
Expect the terraform plan to show no changes
Actual Behavior
Plan shows changes to be applied:
Steps to reproduce
terraform plan
Important Factoids
If we set the
insights_config
block to be what is shown in the changes to be applied the plan errors becausequery_string_length
must be between 256 - 4500.If we then remove the
query_string_length
from theinsights_config
section we get the following:However in the documentation it states that updating the query_string_length requires an instance restart so this is not something we want to apply without verification
References
https://registry.terraform.io/providers/hashicorp/google/latest/docs/resources/sql_database_instance#query_string_length
https://cloud.google.com/sql/docs/postgres/using-query-insights
b/356874854
The text was updated successfully, but these errors were encountered: