Search code examples
google-cloud-platformgoogle-cloud-sqlgoogle-cloud-data-fusion

Public Cloud SQL, private Data Fusion instance


I am new to GCP, so I got some questions regarding Cloud SQL. From what I read I need to install a proxy once I want a private Data Fusion instance to connect to a private Cloud SQL instance. But do I also need one, if I want to connect a private Data Fusion instance to a public cloud SQL instance and if so, why?

My current setup allows me to connect to the public cloud SQL instance using a public Data Fusion instance, but once I switch to a private Data Fusion instance it’s not working anymore and results in a Timeout Error. Any help is appreciated.


Solution

  • It's a network issue. If you have a private datafusion, you only have private IP. If you reach public IPs, you need a public IP. You can solve that in 2 different ways

    • If you need a public IP (for Cloud SQL or other APIs), you can add a Cloud Nat on your VPC to NAT your private IPs in public ones. Like that, you can go to the internet
    • In you have a Cloud SQL, you can create add a private IP to the instance and use this private IP to reach it. Be careful to use the same VPC as your datafusion instance.