You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When a template is configured with prebuilds, we terraform apply the template first to provision the prebuild using the prebuilds identity, and then once more once it has been claimed by a user.
The second apply could result in resources being replaced if the resource definition relies upon the identity.
Upon first apply the name of this resource will be coder-prebuilds-prebuild-1234-root, the second one coder-danny-myfirstworkspaceyay-root. GCP and other providers generally do not allow resource names to be reconfigured after provisioning, so the resource would be replaced with a new one, obviating the benefit of prebuilds.
There are many situations under which a replacement could occur, not just for the name attribute, and it's impossible to warn upfront comprehensively.
We may need to augment the template import process to allow for prebuild validation.
This would entail creating a prebuild imperatively and performing a terraform plan using a new identity to determine the proposed changes. This would incur some cost, but it's likely negligible.
The flow could be something like this:
Template admin imports a new template/version
Prebuilds are detected
Popup appears offering to validate prebuild configuration
"OK" is pressed, kicking off the provisioning of a prebuild
The UI follows the logs and waits for the workspace to provision
Once completed, it runs a terraform plan with a different identity injected, to detect replacements
If found, UI displays warnings for all resource attributes which will cause a replacement, and offer docs / advice on how to rectify (i.e. add ignore_changes)
The text was updated successfully, but these errors were encountered:
When a template is configured with prebuilds, we
terraform apply
the template first to provision the prebuild using theprebuilds
identity, and then once more once it has been claimed by a user.The second
apply
could result in resources being replaced if the resource definition relies upon the identity.Example:
Upon first
apply
the name of this resource will becoder-prebuilds-prebuild-1234-root
, the second onecoder-danny-myfirstworkspaceyay-root
. GCP and other providers generally do not allow resource names to be reconfigured after provisioning, so the resource would be replaced with a new one, obviating the benefit of prebuilds.There are many situations under which a replacement could occur, not just for the
name
attribute, and it's impossible to warn upfront comprehensively.In the current implementation we're detecting this replacement and providing a warning, but this may be missed by template admins.
We may need to augment the template import process to allow for prebuild validation.
This would entail creating a prebuild imperatively and performing a
terraform plan
using a new identity to determine the proposed changes. This would incur some cost, but it's likely negligible.The flow could be something like this:
terraform plan
with a different identity injected, to detect replacementsignore_changes
)The text was updated successfully, but these errors were encountered: