Your team uses Terraform to manage infrastructure on Google Cloud. You have a main.tf file that defines a new VPC network. After running terraform init, what is the correct sequence of commands to preview the changes and then apply them?
- A.
terraform refreshthenterraform run - B.
terraform validatethenterraform deploy - C.
terraform planthenterraform apply✓ Correct - D.
terraform diffthenterraform push
Explanation
terraform plan generates an execution plan showing what changes Terraform will make without actually applying them. terraform apply then executes those changes. This is the standard Terraform workflow. terraform deploy and terraform push are not valid Terraform CLI commands. terraform diff is not a Terraform command (it is used in other tools like Pulumi). terraform refresh updates the local state file to match real-world infrastructure but does not preview or apply configuration changes, and terraform run is not a valid command.