canada-ca / accelerators_accelerateurs-gcp

[GCP] Tools and templates to accelerate GC service delivery. Outils et modèles pour accélérer la prestation de services du GC.
MIT License
10 stars 8 forks source link

Add procedure/sync via gsutil to keep tfstate in a bucket - out of the local shell #12

Open obriensystems opened 2 years ago

obriensystems commented 2 years ago

by default running terraform off the 1 folder creates the terraform state locally

Will look at a best practice where we can keep the tfstate file in sync on a cloud storage bucket

michael@cloudshell:~/accelerators_accelerateurs-gcp/deployment-templates/Terraform/guardrails/1-guardrails (certification-sbx)$ ls -la .terraform
drwxr-xr-x 10 michael michael 4096 Feb  2 20:43 modules
drwxr-xr-x  3 michael michael 4096 Feb  2 20:43 providers
-rw-r--r--  1 michael michael  697 Feb  2 20:43 terraform.tfstate
fmichaelobrien commented 2 years ago

https://cloud.google.com/architecture/managing-infrastructure-as-code#configuring_terraform_to_store_state_in_a_cloud_storage_bucket reviewing above