Below you will find pages that utilize the taxonomy term “Iac”
Reverse engineering an existing GCP project with terraformer
It can be tough to try to reverse engineer an existing project that has never used terraform. Terraformer can look at an existing project and generate the corresponding terraform code for you. I tried it out on an existing legacy project which used Google Cloud Storage, BigQuery and various service accounts. The setup was a little tricky so I put together a script to simply things. The script assumes you have gcloud setup or a service account key/impersonation and you may need to adjust the –resources parameter.
Terraform init in the real world
Rather than fully configuring your backend.tf in a file.```
terraform {
backend “gcs” {
bucket = “my-bucket-123”
prefix = “terraform/state”
}
I prefer to use the command line in order avoid polluting the code with any environment specific names.
terraform init \
-backend-config=“bucket=my-bucket-123” \
-backend-config=“prefix=terraform/state