Closed pawelrosada closed 2 months ago
@pawelrosada your code is incorrect variable is ssl_mode. Your code is using sslMode.
@imrannayer, of course... my bad :)
I fixed the initial issue, but it’s still not working as expected.
Error:
Error: Error, failed to update instance settings for : googleapi: Error 400: Invalid request: For a MySQL instance, sslMode value TRUSTED_CLIENT_CERTIFICATE_REQUIRED and requireSsl value false are conflicting. When sslMode=TRUSTED_CLIENT_CERTIFICATE_REQUIRED, requireSsl must be true. When requireSsl=false, sslMode must be ALLOW_UNENCRYPTED_AND_ENCRYPTED or ENCRYPTED_ONLY. It's recommended that you only set sslMode., invalid
Steps I Tried:
ssl_mode
and updated the module.enable_ssl
to null: ~ ip_configuration {
- require_ssl = true -> null
ssl_mode = "TRUSTED_CLIENT_CERTIFICATE_REQUIRED"
This resulted in the above warning.
Expected Behavior:
When setting ssl_mode = "TRUSTED_CLIENT_CERTIFICATE_REQUIRED"
, SSL should be properly configured without conflicting with require_ssl
.
Actual Behavior:
The configuration is throwing an error about conflicting settings, even though ssl_mode
and require_ssl
should work together according to the documentation.
Question:
Any idea on how to resolve this conflict or what configuration might be missing?
We are experiencing the same issue, and we also have to use google
v5.44.0 because not all the GCP terraform modules have been updated to support v6.
@pawelrosada have you updated provider version >6? Can you run terraform --version
and see if you are using provider version > 6.01. If not then u will need to first execute terraform init --upgrade
and make sure provider version >= 6.01. If not then u may be using some other code which may be restricting provider upgrade.
@imrannayer, we have updated the version, but we are using multiple different modules that don’t allow us to upgrade further. Our current stack for this project is:
• provider registry.terraform.io/hashicorp/google v5.44.0
• provider registry.terraform.io/hashicorp/google-beta v5.44.0
At the moment, we are unable to move past this. However, the terraform-google-sql-db
module in the previous version, specifically 21.0.2, works correctly (just showing a deprecation warning).
TL;DR
After upgrading from version 21.0.1 to 22.0.0, enabling SSL on the instance is no longer possible. The sslMode option doesn’t work and consistently disables SSL, regardless of the configuration.
Expected behavior
The sslMode option should enable SSL as configured. When set to the appropriate value (e.g., TRUSTED_CLIENT_CERTIFICATE_REQUIRED), SSL should be activated on the instance, ensuring secure communication between the client and server.
Observed behavior
After upgrading to version 22.0.0, the sslMode option fails to function correctly. Regardless of its setting, SSL is consistently disabled, leading to unsecured connections, contrary to the expected behavior.
Terraform Configuration
Terraform Version
Additional information