Using Terraform CLI, how do you display a name of the current workspace?
Experience Level: Junior
Tags: Terraform
Answer
Option 1:
Run the following command:
terraform workspace show
Option 2:
Run the following command:
terraform workspace list
The selected workspace is prefixed with character '*'.
Related Terraform job interview questions
Using Terraform CLI, how do you switch to a different workspace?
Terraform JuniorUsing Terraform CLI, how do you delete a workspace?
Terraform JuniorUsing Terraform CLI, how do you create a new workspace?
Terraform JuniorUsing Terraform CLI, how do you display list of Terraform workspaces?
Terraform JuniorUsing Terraform CLI, how do you update the state file of your infrastructure with metadata that matches the physical resources they are tracking?
Terraform Junior