DEV Community

Rahul Wagh
Rahul Wagh

Posted on • Originally published at

Terraform workspace | How to handle Terraform Workspaces - Part 11

Terraform workspace is a very logical concept where you can have multiple states of your infrastructure configuration. To put this in simple words if you are running an infrastructure configuration in a development environment then the same infrastructure can be run in the production environment.

The main benefit of terraforming workspaces we get is we can have more than one state associated with a single terraform configuration.

If you have not defined any workspace then there is always a default workspace created by terraform, so you always work in a default workspace of terraform. You can list the number of terraform workspaces by running the command terraform workspace show. Also, you can not delete the default workspace

In this lab session, we are going to see -

  1. What is Terraform workspace?
  2. How to create a new Terraform Workspace?
  3. How to create multiple Terraform Workspace?
  4. How to List all terraform workspace?
  5. How to switch between Terraform workspace?
  6. How to start an EC2 instance using dev and test workspace?
  7. How to delete Terraform workspaces?

How to use Workspaces in Terraform? -

Top comments (0)