HashiCorp Certified: Terraform Associate — Question 41
What is the workflow for deploying new infrastructure with Terraform?
Answer options
- A. terraform plan to import the current infrastructure to the state file, make code changes, and terraform apply to update the infrastructure.
- B. Write a Terraform configuration, run terraform show to view proposed changes, and terraform apply to create new infrastructure.
- C. terraform import to import the current infrastructure to the state file, make code changes, and terraform apply to update the infrastructure.
- D. Write a Terraform configuration, run terraform init, run terraform plan to view planned infrastructure changes, and terraform apply to create new infrastructure.
Correct answer: D
Explanation
The correct answer is D because it accurately outlines the necessary steps to provision new infrastructure, including initializing the Terraform environment, planning changes, and applying them. Options A, B, and C contain incorrect steps or sequences that do not fully represent the correct workflow for deploying new infrastructure with Terraform.