nerdexam
HashiCorp

TA-002-P · Question #211

You have created two workspaces PROD and DEV. You have switched to DEV and provisioned DEV infrastructure from this workspace. Where is your state file stored?

The correct answer is D. terraform.tfstate.d. Terraform stores the workspace states in a directory called terraform.tfstate.d. This directory should be treated similarly to default workspace state file terraform.tfstate main.tf terraform.tfstate.d terraform.tfstate # DEV workspace state file terraform.tfstate # PROD…

Implement and maintain state

Question

You have created two workspaces PROD and DEV. You have switched to DEV and provisioned DEV infrastructure from this workspace. Where is your state file stored?

Options

  • Aterraform.d
  • Bterraform.tfstate
  • Cterraform.tfstate.DEV
  • Dterraform.tfstate.d

How the community answered

(30 responses)
  • B
    3% (1)
  • C
    3% (1)
  • D
    93% (28)

Explanation

Terraform stores the workspace states in a directory called terraform.tfstate.d. This directory should be treated similarly to default workspace state file terraform.tfstate main.tf terraform.tfstate.d terraform.tfstate # DEV workspace state file terraform.tfstate # PROD workspace state file terraform.tfvars # Default workspace state file

Topics

#Terraform Workspaces#State Management#Local State#Terraform CLI

Community Discussion

No community discussion yet for this question.

Full TA-002-P Practice