1

Currently we're having a dev environment in a gcp project. We're using GDM templates and other stuffs along with repo in bitbucket. Whenever we push any changes in bitbucket it builds and deploy to this dev environment. Suddenly, we've decided to have a new gcp project as test environment and we want to deploy automatically to this environment like dev environment. Our preference will be to deploy to this environment from the cloudbuild execution in dev environment. Can you suggest us any guideline that'll help us to set up things in one place that'll automatically deploy this in multiple projects as multiple environments automatically?

2
  • Can you provide more information on your deployment? Which GCP services does it utilize?
    – Sergiusz
    Commented Jul 6, 2021 at 14:16
  • We're using gcs bucket, cloud function, bigquery, firestore, pubsub mainly for all our services along with google deployment manager. At this point, we're able to solve this problem by using externally defining project id in GDM templates and allowing cloud service account to new project(new environment). thank you for the heads up @Sergiusz
    – xalien
    Commented Jul 6, 2021 at 17:15

2 Answers 2

1

You can use Terraform to achieve this.
There's a lot of information on how to start here.
However, I would suggest having projects in separate deployments. This way you limit the blast radius and protect production from errors occurring in other environments.

2
  • We've already gone too far with google deployment manager. If we want to return to Terrafrom it'll be difficult. Is google limiting support for Google Deployment Manager? Do they want their user to move to Terraform instead of GDM? @Sergiusz
    – xalien
    Commented Jul 7, 2021 at 17:54
  • 2
    Google doesn't limit support of Google Deployment Manager. If you won't find answer here, you can contact Google Cloud Support for technical assistance. There were no recommendations from the the Google side related to using any 3rd party tools like Hashicorp Terraform instead of Google Deployment Manager. I recommended Terraform because for me it's easier to work with and it has pretty big community.
    – Sergiusz
    Commented Jul 8, 2021 at 7:49
0

You need separate calls for separate projects. Just like almost all Google API resources deploymentmanager/deployments lives inside a project (https://www.googleapis.com/deploymentmanager/v2/projects/[PROJECT]/global/deployments), thus you cannot deploy to multiple projects in one call.

Not the answer you're looking for? Browse other questions tagged or ask your own question.