Search code examples
google-app-enginegoogle-cloud-platformgoogle-compute-enginegoogle-cloud-buildgoogle-iam

GC Cloud Build access to Compute Engine through internal IP


I try to deploy my Python app on AppEngine. During deploy, I have to download dependency from a private repository on the GC Compute Engine instance. I've added all needed row into requirements.txt and it works when I use external IP of my private repository. But it much better to use internal IP. In the GC IAM system, I've changed permissions for Cloud Build account and AppEngine account, but it still doesn't work and show connection timeout. Maybe you can help with it.
Thanks in advance!


Solution

  • In order for your build to access your Compute Engine instance via internal IP, they'd have to run in the same network.

    By default, a build runs in a tenant project, so a separate network. One option to overcome this limitation is to use the remote-builder Cloud Builder. It allows you to execute your build step on a configurable Compute Engine VM in your project. You can use the complete list of flags available when creating a Compute Engine instance so you can configure it to run on the same network via the --network parameter.