nerdexam
HashiCorp

TA-002-P · Question #119

What allows you to conveniently switch between multiple instances of a single configuration within its single backend?

The correct answer is D. Workspaces. Workspaces allow you to manage multiple distinct state files for the same configuration within a single backend. For example, you can have dev, staging, and prod workspaces that all use the same Terraform code but maintain separate state. You switch between them using terraform…

Use the Terraform CLI (terraform plan, apply, destroy, fmt, init, validate, workspace, import, taint, providers, output)

Question

What allows you to conveniently switch between multiple instances of a single configuration within its single backend?

Options

  • ALocal backends
  • BProviders
  • CRemote backends
  • DWorkspaces

How the community answered

(16 responses)
  • A
    6% (1)
  • D
    94% (15)

Explanation

Workspaces allow you to manage multiple distinct state files for the same configuration within a single backend. For example, you can have dev, staging, and prod workspaces that all use the same Terraform code but maintain separate state. You switch between them using terraform workspace select <name>. Local backends (A) refer to where state is stored locally, not isolation between instances. Providers (B) are plugins for API interaction. Remote backends (C) are a storage mechanism for state, not an isolation/switching mechanism by themselves.

Topics

#Workspaces#Terraform CLI#State management#Multiple environments

Community Discussion

No community discussion yet for this question.

Full TA-002-P Practice