Exam Terraform Associate All QuestionsBrowse all questions from this 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?

    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
amrith501Option: B

Workspace is the right answer

Ahmad_TerraformOption: B

workspace = different state file

EltoothOption: B

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

090200fOption: B

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

eduvar4Option: B

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

Ni33Option: B

BBBBBBBBBB