Terraform Associate Exam QuestionsBrowse all questions from this exam

Terraform Associate Exam - Question 68


You would like to reuse the same Terraform configuration for your development and production environments with a different state file for each.

Which command would you use?

Show Answer
Correct Answer: B

To reuse the same Terraform configuration for both development and production environments while using different state files, you should use the 'terraform workspace' command. This command allows you to create and switch between multiple workspaces, each with its own state file, enabling you to manage different environments effectively.

Discussion

6 comments
Sign in to comment
amrith501Option: B
Jun 12, 2022

Workspace is the right answer

Ahmad_TerraformOption: B
Jul 14, 2022

workspace = different state file

EltoothOption: B
Jun 28, 2022

B is correct answer : Workspaces. https://www.terraform.io/language/state/workspaces#when-to-use-multiple-workspaces

eduvar4Option: B
Sep 27, 2022

https://developer.hashicorp.com/terraform/language/state/workspaces#when-to-use-multiple-workspaces

090200fOption: B
Jul 12, 2024

terraform workspace new dev (or prod) , terraform apply -var-file dev.tfvars so terraform workspace is the answer

Ni33Option: B
May 9, 2023

BBBBBBBBBB