Your organization is establishing an automated, reliable environment provisioning workflow using Terraform and Cloud Build on Google Cloud. What is the correct sequence of steps to safely establish the infrastructure configuration pipeline from initial state storage setup to resource deployment?
- 1Create a dedicated Google Cloud Storage (GCS) bucket configured with Uniform Bucket-Level Access and Object Versioning enabled.
- 2Create a dedicated IAM service account for pipeline execution and grant it least-privilege roles on target resources and GCS bucket access.
- 3Write the Terraform configuration files specifying the Google provider and configuring the GCS remote backend block.
- 4Execute terraform init in the automated CI/CD pipeline using service account impersonation.
- 5Execute terraform plan to preview infrastructure changes, followed by terraform apply upon automated review approval.
Answer
The correct operational sequence begins with creating the GCS state bucket with versioning, configuring the execution service account and IAM permissions, writing Terraform configurations referencing the GCS backend, running terraform init to configure the backend connection, and finally executing terraform plan and terraform apply.
Establishing IaC automation requires creating prerequisites (GCS state bucket and IAM Service Account), defining configuration code referencing those prerequisites, running terraform init to link the environment, and executing terraform plan and terraform apply to deploy resources safely.
Step-by-Step Solution
Key Concept
Terraform Automated Environment Provisioning Sequence