Closed michaeldeman closed 4 years ago
i am not fan of terraform Workspaces
. If I am going to use it, i will use terragrunt
directly.
If you have any suggestions about workspaces, maybe you can raise PR to improve it.
I remembered, several reasons why I don't use workspaces.
Workspaces
are hard to be managed in CICD. I can't find a nice way to make sure a workspace is exist or not without any scriptings. I have to write an if-else
condition to make sure the workspace is exist, otherwise, I need create it.
some developers will be confused if they want to review the real tfstate file later.
Seems this is not a problem for me, i will close this issue.
terraform cli support to set workspace and create the Terraform workspace if it doesn't exist with -or-create
terraform workspace select -or-create <workspace_name>
Now, it is useful. I will update the document
In the field I have seen mixed opinions about using terraform workspaces. Is there a reason you are not recommending that, and instead using per-environment configuration files?
One nice thing about workspaces, is that all the outputs on per-environment basis are cascaded down to other teams that are consuming resources or other enterprise-wide configurations.