CICD with Terraform on GCP and multiple environments

Hey everybody,

I‘m fairly new to Terraform and GCP but I do have a good tech understanding in general. 

I have two requirements:

- use GCP (cloud run, sql, secretmanager, dns)

- CICD with multiple environments 

 

so far I try to achieve this with Terraform with inconsistent results. I am able to create a project and provision a sql instance f.e. but handling all the IAM stuff is kind of a PITA and also reproducibility isn‘t reliable. Sometime things work sometimes they don‘t. 

so the idea is „just“ to have IaC and continuous deployments etc to reliably and predictably deliver…

maybe the approach with a dedicated project isn‘t ideal and I don‘t know the usual best practices yet…

 

so, any hints appreciated 🙂

3 REPLIES 3

I hope if you check this doc will help you.
Tools for using Terraform with Google Cloud link:[1]
[1] https://cloud.google.com/docs/terraform#tools_for_using_terraform_with

Hi

This will help you definitely. You can use these source codes.

https://github.com/GoogleCloudPlatform/cloud-foundation-fabric/tree/master/modules

 

I like to use Terragrunt for managing multiple environments. https://terragrunt.gruntwork.io/docs/

It's also good to know about the pattern of module creation.
https://developer.hashicorp.com/terraform/tutorials/modules/pattern-module-creation