-
Notifications
You must be signed in to change notification settings - Fork 1.8k
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
can't modify google_sql_database_instance after patching it through gcloud sql instances patch command #7922
Comments
@vladyege help me understand what you want to achieve. Did you want to run the gcloud command each time you call |
@edwardmedia Hi, notwithstanding I have a lifecycle block with ignoring changes in binary_log_enabled and enabled |
@vladyege I see. Looking at the error |
@vladyege have you verified if the gcloud command actually has changed the behavior that causes the error in further TF run? |
@vladyege Closing, assuming it is no longer an issue |
@edwardmedia |
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. If you feel this issue should be reopened, we encourage creating a new issue linking back to this one for added context. If you feel I made an error 🤖 🙉 , please reach out to my human friends 👉 hashibot-feedback@hashicorp.com. Thanks! |
Community Note
modular-magician
user, it is either in the process of being autogenerated, or is planned to be autogenerated soon. If an issue is assigned to a user, that user is claiming responsibility for the issue. If an issue is assigned tohashibot
, a community member has claimed the issue already.Terraform Version
Terraform v0.13.5
provider google v3.47.0
provider google-beta v3.47.0
Affected Resource(s)
Terraform Configuration Files
Debug Output
https://gist.github.com/vladyege/853f7c104fb1c2e6a8b8143778d61d7b
Expected Behavior
As it's known binary logs on google sql instance can be enabled if backup is enabled. Back in its turn may not be enabled on read only replica instances. Nevertheless Google allows to enable binary logs on a read only replica instance after it's created by using the following CLI command
gcloud sql instances patch --enable-bin-log [instance]
So we start an instance with the following settings
backup_configuration {
enabled = false
binary_log_enabled = false
}
lifecycle block
lifecycle {
ignore_changes = [
settings[0].backup_configuration[0]
]
}
After patching an instance and changing binary_log_enabled parameter to "true" and ignoring it during next apply, an instance should be successfully modified if any other changes on resource.
Actual Behavior
During modification, the following error is reproduced
Error: Error, failed to update instance settings for : googleapi: Error 400: Invalid request: Binary log must be disabled when backup is disabled or the instance must be a replica instance with a MySQL 5.7 or above version., invalid
Steps to Reproduce
terraform apply
terraform apply
The text was updated successfully, but these errors were encountered: