0
0
Terraformcloud~20 mins

Workspaces vs directory-based separation in Terraform - Practice Questions

Choose your learning style9 modes available
Challenge - 5 Problems
🎖️
Terraform Workspace Mastery
Get all challenges correct to earn this badge!
Test your skills under time pressure!
🧠 Conceptual
intermediate
1:30remaining
Understanding Terraform Workspaces

What is the primary purpose of Terraform workspaces?

ATo manage multiple distinct state files within the same configuration for different environments
BTo separate Terraform configurations into different directories for better organization
CTo create isolated virtual machines in the cloud
DTo automatically backup Terraform state files to cloud storage
Attempts:
2 left
💡 Hint

Think about how Terraform handles state files for different environments.

Architecture
intermediate
1:30remaining
Directory-based Separation in Terraform

Which statement best describes directory-based separation in Terraform?

AUsing separate directories with their own Terraform configurations and state files for different environments or projects
BUsing Terraform modules to share code between environments
CUsing workspaces to switch between environments within the same directory
DUsing a single directory with multiple state files stored remotely
Attempts:
2 left
💡 Hint

Consider how physical file organization affects Terraform state and configuration.

Best Practice
advanced
2:00remaining
Choosing Between Workspaces and Directory Separation

Which scenario is best suited for using Terraform workspaces instead of directory-based separation?

AWhen you want to share state files across multiple teams
BWhen you want to keep all environment configurations in separate version control repositories
CManaging completely different projects with unrelated infrastructure
DManaging multiple similar environments with mostly identical infrastructure and small differences
Attempts:
2 left
💡 Hint

Think about when sharing the same configuration but separating state is helpful.

security
advanced
2:00remaining
Security Implications of Workspaces vs Directory Separation

Which security risk is more likely when using Terraform workspaces compared to directory-based separation?

ADifficulty in managing access controls on state files stored locally
BState file corruption from multiple directories accessing the same backend
CAccidental modification of the wrong environment's infrastructure due to shared configuration
DIncreased risk of code duplication leading to inconsistent security policies
Attempts:
2 left
💡 Hint

Consider how workspaces share the same configuration but differ only by state.

service_behavior
expert
2:30remaining
Terraform Workspace State Behavior

Given the following Terraform commands run in sequence, what is the output of terraform workspace show after the last command?

terraform workspace new staging
terraform workspace select default
terraform workspace list
terraform workspace show
Astaging
Bdefault
CError: workspace does not exist
DNo workspace selected
Attempts:
2 left
💡 Hint

Remember the effect of terraform workspace select on the active workspace.