Kamal
Kamal

Reputation: 61

How to access GCP source repository from private VM?

I am trying to access GCP source repos from a private VM. I have tried using VPC service connect and "private service access". But it just times out. Is there any way to clone a source repository on private VM?

Upvotes: 1

Views: 576

Answers (1)

Iñigo González
Iñigo González

Reputation: 3945

Cloud Source repositories are not APIs endpoints; but "internet" services.

In order to get access from your private compute instance, you must first access to source.developers.google.com in your VPC firewall rules.

If you are not allowed to do that (due to regulatory issues, for example), then you could use a f1-micro instance as proxy for your private instance (btw: a crazy idea could be configure SSH tunneling to map localhost:443 to source.developers.google.com:443, setting your git remote to localhost:443/p/[PROJECT_ID]/r/[REPO_NAME], and using a git hook to connect via ssh to the proxy).

Upvotes: 2

Related Questions