0
0
Terraformcloud~20 mins

Default workspace in Terraform - Practice Problems & Coding Challenges

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
2:00remaining
Understanding Terraform Default Workspace Behavior

What is the default workspace name when you initialize a new Terraform configuration without creating any additional workspaces?

Aterraform
Bmain
Cdefault
Dprod
Attempts:
2 left
💡 Hint

Think about the workspace Terraform uses if you never switch or create a new one.

service_behavior
intermediate
2:00remaining
Effect of Workspace on Terraform State Files

When you switch from the default workspace to a new workspace named dev, what happens to the Terraform state files?

ATerraform creates a separate state file for the <code>dev</code> workspace.
BTerraform merges the <code>dev</code> workspace state with the default workspace state file.
CTerraform overwrites the existing default workspace state file with the <code>dev</code> workspace state.
DTerraform deletes the default workspace state file.
Attempts:
2 left
💡 Hint

Think about how Terraform isolates environments using workspaces.

Architecture
advanced
3:00remaining
Workspace Usage in Multi-Environment Terraform Architecture

You want to manage production and staging environments using Terraform workspaces. Which approach correctly uses workspaces to separate these environments?

ACreate separate Terraform configurations for production and staging without using workspaces.
BCreate two workspaces named <code>production</code> and <code>staging</code>, and switch between them to apply changes to each environment.
CUse the default workspace for production and create a <code>staging</code> workspace for staging environment.
DUse one workspace and manage both environments by passing different variables during apply.
Attempts:
2 left
💡 Hint

Workspaces are designed to isolate state for different environments.

security
advanced
3:00remaining
Security Implications of Using Default Workspace

What is a potential security risk of using the default workspace for multiple environments in Terraform?

AState files for different environments can overwrite each other, leading to accidental resource changes.
BDefault workspace encrypts state files with weak encryption.
CDefault workspace automatically exposes state files publicly.
DDefault workspace disables Terraform state locking.
Attempts:
2 left
💡 Hint

Consider what happens if multiple environments share the same state file.

Best Practice
expert
4:00remaining
Best Practice for Managing Terraform Workspaces in Team Environments

In a team environment, what is the best practice to manage Terraform workspaces to avoid conflicts and ensure smooth collaboration?

AUse the default workspace only and manually rename state files to separate environments.
BEach team member uses their own local default workspace without sharing state remotely.
CAvoid using workspaces and manage environments by duplicating Terraform code for each environment.
DUse remote backend with workspace support and enforce workspace naming conventions for each environment.
Attempts:
2 left
💡 Hint

Think about how teams can share state safely and avoid conflicts.