HashiCorp Certified: Terraform Associate — Question 202
What is the workflow for deploying new infrastructure with Terraform?
Answer options
- A. Write Terraform configuration, run terraform init to initialize the working directory or workspace, and run terraform apply
- B. Write Terraform configuration, run terraform show to view proposed changes, and terraform apply to create new infrastructure
- C. Write Terraform configuration, run terraform apply to create infrastructure, use terraform validate to confirm Terraform deployed resources correctly
- D. Write Terraform configuration, run terraform plan to initialize the working directory or workspace, and terraform apply to create the infrastructure
Correct answer: A
Explanation
The correct answer is A because it accurately describes the necessary steps of initializing the workspace and applying the configuration to deploy resources. Option B incorrectly includes 'terraform show', which does not deploy any infrastructure. Option C suggests using 'terraform validate' after applying, which is not part of the deployment process. Option D incorrectly states that 'terraform plan' is used to initialize the workspace, while it is actually used to preview changes.