In Terraform, there is the concept of workspaces, which enables the same Terraform configuration to be used in order to build multiple environments.
Each of these configurations will be written to a different Terraform state file and will thus be isolated from the other configurations. Workspaces can be used to create several environments of our infrastructure.
In this recipe, we will study the use of Terraform workspaces in the Terraform configuration, with the execution of Terraform commands.