Description
Currently, the workspace ID is generated from a UUID.
As an infrastructure admin, occasionally I have a workspace that fails to delete or the state is otherwise corrupted. In such cases, I may want to use a script to delete the orphaned resources. Since the workspace ID should be used in the persistent resource ID (see #3000 (comment)), we should include some identifying information in the workspace ID.
Here's an example of a possible format:
- template ID fragment: the first 8 hex characters of the template ID
- user ID fragment: the first 8 hex characters of the user ID
- random: 10 random hexadecimal chars (40 bits of entropy)
This leads to an ID that looks like:
abababab-cdcdcdcd-efefefefefefefefefefefefef
Which would have a 50% chance of collision if there were 1 million workspaces under the same template and same user.
Whoever implements this should run the birthday problem calculations as there's only a few bits of entropy in the template ID and user ID.