0
0
Terraformcloud~20 mins

Workspace naming conventions in Terraform - Practice Problems & Coding Challenges

Choose your learning style9 modes available
Challenge - 5 Problems
🎖️
Workspace Naming Master
Get all challenges correct to earn this badge!
Test your skills under time pressure!
🧠 Conceptual
intermediate
2:00remaining
Why use workspace naming conventions in Terraform?

Which of the following is the main reason to use workspace naming conventions in Terraform?

ATo organize infrastructure environments clearly and avoid resource conflicts
BTo encrypt sensitive variables within each workspace
CTo automatically generate resource names without manual input
DTo speed up Terraform plan execution by caching workspace names
Attempts:
2 left
💡 Hint

Think about how naming helps manage multiple environments like dev, test, and prod.

Architecture
intermediate
2:00remaining
Choosing workspace names for multiple regions and environments

You manage infrastructure in two regions (us-east-1 and eu-west-1) and three environments (dev, staging, prod). Which workspace naming convention below best supports clear identification?

Aenv-region (e.g., dev-us-east-1, prod-eu-west-1)
Benv only (e.g., dev, staging, prod)
Cregion-env (e.g., us-east-1-dev, eu-west-1-prod)
Drandom unique IDs for each workspace
Attempts:
2 left
💡 Hint

Consider which order helps you quickly identify region and environment.

Configuration
advanced
2:00remaining
Terraform workspace selection with naming conventions

Given the following Terraform CLI commands, which command correctly switches to the production workspace in the us-west-2 region if the naming convention is region-env?

terraform workspace list
* default
  us-west-2-dev
  us-west-2-prod
  us-east-1-prod
Aterraform workspace select prod
Bterraform workspace select prod-us-west-2
Cterraform workspace select us-east-1-prod
Dterraform workspace select us-west-2-prod
Attempts:
2 left
💡 Hint

Match the exact workspace name from the list.

security
advanced
2:00remaining
Security risks of poor workspace naming

What is a potential security risk if Terraform workspaces are named inconsistently or unclearly?

AAccidental deployment of sensitive resources to wrong environments
BTerraform automatically encrypts all workspace data regardless of name
CWorkspaces with unclear names run slower due to overhead
DTerraform disables state locking for ambiguous workspace names
Attempts:
2 left
💡 Hint

Think about how confusion in naming can cause mistakes.

service_behavior
expert
2:00remaining
Effect of workspace naming on Terraform state storage

In Terraform Cloud, how does the workspace name affect the storage and isolation of state files?

AAll workspaces share a single state file regardless of name
BEach workspace name corresponds to a separate state file, isolating resources per workspace
CWorkspace names only affect logs, not state storage
DTerraform Cloud merges states of workspaces with similar names automatically
Attempts:
2 left
💡 Hint

Consider how Terraform Cloud manages state isolation.