Closed gaba-xyz closed 6 years ago
@Gabology have you resolved your issue? Hit the same problem.
@cemo An alternative solution is to manage the RDS/db infra in a separate plan/module, then reference the remote state in the main plan/module. Probably not ideal if you didn't plan on using modules.
@cemo Unfortunately not. What I did to workaround the issue was to comment out the module that depended on the ip address of the Cloud SQL instance and then run terraform apply. After it had created the CloudSQL instance I uncommented the code and ran terraform apply again. Not a very good solution so let's hope they fix it.
Hi @Gabology ! I have the same issue that you. I saw the provider try to connect (for some reason) to the mysql server, but it didn't try with the GCP's mysql server, it try with locally. Also I saw in the message error, the IP changes if you use Docker or not (172.x.x.x or 172.x.x.x) So my workaround was to create a Docker container with mysql 5.7, after that I created an mysql's User without password (with the same name as I use to connect to GCP's mysql) and "terraform plan/apply" worked (I still don't know why...)
I think this isn't a good solution either, so let's hope they fix it. Sorry for my awful English.
we have the same problem :(
Hi @Gabology and @cemo with @quinont we sended a PR to fix this situation. The problem is the default configure in mysql provider, because create a sql connection when it's initialized. We changed the way to use the connection.
https://github.com/terraform-providers/terraform-provider-mysql/pull/37
We tested the solution and works fine with GCP provider. We created databases in GCP and changed the default grants with mysql (all in the same terraform file).
(sorry for our awful english)
When attempting to use the mysql provider with an uncreated GCP Cloud SQL DB instance it is not able to generate a plan.
Terraform Version
Affected Resource(s)
Please list the resources as a list, for example:
Terraform Configuration Files
mysql-users
Expected Behavior
Terraform should generate and display a plan successfully.
Actual Behavior
Receiving the following error message: