-
Notifications
You must be signed in to change notification settings - Fork 173
Description
Use-cases
When we create a workspace using this provider, we follow the process:
- Create the "tfe_workspace" object
- Create the "tfe_variable" objects, using the workspace ID from above (effectively triggering an implicit dependency).
However, due to Terraform destroy rules, the "tfe_variable" objects are destroyed before the "tfe_workspace" destroy is triggered. This results in that workspace unable to be destroyed, as "mandatory workspace variables" are missing. Effectively, we have a chicken-and-egg issue that stops during "destroy planning".
Attempted Solutions
At present there is really no workaround we have found. In general, the only way around this situation is to manually add the variables back into the "workspace to be destroyed" and re-run the "terraform apply" (which skips by the variable deletion because it happened on the previous execution).
Proposal
The fact that the "tfe_variable" object has an implicit dependency upon "tfe_workspace", the only solution I can come up with is to allow the variables to be an inherent class member (similar to tags) that can reside directly within the "tfe_workspace" object. Then, the provider can create the workspace and variables during its provisioning activity, but SKIP the destruction of the variables when running the destroy of the "tfe_workspace".
Alternatively, maybe there is a better answer that I'm unaware of.