|
|
|
|
|
by orangejewce
1803 days ago
|
|
workspaces are specifically _not_ intended to be used as environment replacements. And it wouldn't have caught the OPs issue to begin with. His problem was he didn't read the plan, because it's pretty basic that any change of a resource name or a change of type equates deletion and TF will report back saying it will destroy a resource that is missing in the config but in the state. To solve his problem, after switching to the data source type from resource he needed to manually run `terraform state rm` to get rid of the resource from the state. |
|
From Terraform's "An Overview of Our Recommended Workflow"[1]:
So 1 workspace != 1 environment but workspaces are indeed intended to handle multiple environments.I've personally struggled with managing multiple environments using Terraform so I'm interested in what the best practices are.
[1]: https://www.terraform.io/docs/cloud/guides/recommended-pract...