Hey all, I am currently switching the CloudSQL Po...
# google-cloud
r
Hey all, I am currently switching the CloudSQL Postgres instances to use Private IP. I am a bit stuck on how to setup the VPC peering / Private Service Connection in Pulumi correctly... When spinning up a CloudSQL Instance in the Console with Private IP enabled and Public IP disable the VPC peering / Private Service Connection connection is configured automatically in the background. As I haven't configured the peering manually so far, Pulumi fails when trying to spin up the CloudSQL instance with the following error message:
Copy code
gcp:sql:DatabaseInstance (dev-test-primary):
    error: Error, failed to create instance dev-test-primary-9c7d79d: googleapi: Error 400: Invalid request: Incorrect Service Networking config for instance: dev-test:dev-test-primary-9c7d79d:NETWORK_NOT_PEERED., invalid
I hope that someone already has done all the needed steps and can point me to an example or something...
g
Sorry for the late response I had the answer but it was in Terraform resources and I didn't have the time to convert till now. In case you still need it this is how we do
Then you can link the CloudSQL instances to a network using the
settings.ipConfiguration.network
field in
DatabaseInstance
r
Hi Luiz, I somehow missed the Slack notification. Thanks for providing the example. I now "learned" to use Terraform examples to find working solutions and to map to the right API calls... The learning was greatly simplified by tips from @billowy-army-68599 😉