0
votes

We have a requirement to deploy our application in multiple GCP projects with new projects being provisioned by Terraform. We have Terraform configured Cloud Build in each project, but we run into issues when the Cloud Build attempts to access the Source Repo in our centralized project.

We would prefer not to clone the repo, but rather instruct Cloud Build to consume and deploy from the central repo. It is also important that we have Cloud Build update each project as new code is deployed.

1
Please provide a repro of what you're trying to do with details of the errors you're encountering. There's no reason why you should not be able to provision and deploy this way.DazWilkin

1 Answers

2
votes

You should use a central project to run a single Cloud Build trigger that will build, push built container image in the project and deploy to Cloud Run services in other projects.

In order for the Cloud Build trigger to be allowed to deploy to Cloud Run in other projects, follow these instructions to grant the Cloud Build service agent the appropriate permission on the other projects

In order for Cloud Run to be able to import images from the central project, make sure you follow these instructions for each Service agent of each project.