google-cloud-platformgoogle-cloud-sqlgoogle-cloud-mlgcp-ai-platform-training

Is it possible to connect to the private IP of a Cloud SQL instance in GCP Vertex AI pipeline?


I am working on a pipeline to perform data transformation of data residing on GCP cloud SQL with private IP on a different project by using the Vertex AI pipeline. I am not able to get any documents regarding connecting to Cloud SQL in it. Does anyone have any idea how to connect Cloud SQL with Private IP to the Vertex AI pipeline?


Solution

  • I implemented something similar using the AI Platform. Relevant post here: How can I grant AI Platform training jobs access to Cloud SQL resources in the same project?

    1. Use the Google provide custom Cloud SQL connector in your code.
    2. Create a service account with the appropriate permissions including Cloud SQL Client. Permissions requirements under service account here.
    3. Launch the job using the api. The code in the above linked post would need to be modified. Use the Vertex AI job create function and replace Platform AI job with the vertex AI customJob.