A Cloud Engineer is initializing a new infrastructure environment on Google Cloud using Terraform. The working directory contains valid `.tf` configuration files. What is the correct chronological sequence of Terraform CLI commands to initialize the working directory, preview proposed infrastructure changes, provision the GCP resources, and finally decommission the resources when no longer needed?
- 1Run `terraform init` to download provider plugins and initialize the backend configuration.
- 2Run `terraform plan` to create and review an infrastructure execution plan.
- 3Run `terraform apply` to provision the resources on Google Cloud.
- 4Run `terraform destroy` to tear down all managed infrastructure resources.
Cevap
The correct sequence begins with workspace initialization using `terraform init`, followed by generating an execution preview with `terraform plan`, executing infrastructure creation with `terraform apply`, and ending with resource teardown via `terraform destroy`.
The standard Terraform workflow requires preparing the environment (`init`), validating proposed actions (`plan`), executing provisioning calls (`apply`), and lastly performing cleanup (`destroy`).
Adım Adım Çözüm
Anahtar Kavram
Terraform Deployment Lifecycle Command Sequence