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
{{ message }}
Repository navigation
Evaluate coder_workspace_tags during template create/push #15427
The coder_workspace_tags data source is not respected or read from the template during template imports, but it works for template builds. As a workaround, the admin must run a generic provisioner simply for template imports AND/OR set tags manually in the template UI.
This is a bad workaround as certain provisioners must be run just for template imports. From #15047:
It's definitely a bug that we don't process coder_workspace_tags for template import jobs. A full fix would have us directly inspect the HCL on coderd to find the coder_workspace_tags and the coder_parameters, then resolve the tags based on the parameters passed to the import job.
changed the title [-]Evaluate `coder_workspace_tags` during template imports[/-][+]Evaluate `coder_workspace_tags` during template create/push[/+]on Nov 7, 2024
One potential issue with this approach is that the use of functions will be severely limited.
Terraform does not export its default set of functions, to be used while evaluating Terraform. Even if we were to copy that directly, there are a number of functions also defined in internal/lang.
In order to allow using the full set of functions while taking the current 'static analysis' approach, we'd essentially have to manually vendor all of the function definitions.
One potential issue with this approach is that the use of functions will be severely limited. Terraform does not export its default set of functions, to be used while evaluating Terraform. Even if we were to copy that directly, there are a number of functions also defined in internal/lang. In order to allow using the full set of functions while taking the current 'static analysis' approach, we'd essentially have to manually vendor all of the function definitions.
This applies to workspace builds too, right? Not just template builds. We may want to extract function handling or these other edge cases into another issue such as #15087.
But yeah, it seems like it probably would not be best to support any Terraform functions as we'd essentially have to rewrite their stuff.
Activity
[-]Evaluate `coder_workspace_tags` during template imports[/-][+]Evaluate `coder_workspace_tags` during template create/push[/+]johnstcn commentedon Nov 8, 2024
One potential issue with this approach is that the use of functions will be severely limited.
Terraform does not export its default set of functions, to be used while evaluating Terraform. Even if we were to copy that directly, there are a number of functions also defined in
internal/lang.In order to allow using the full set of functions while taking the current 'static analysis' approach, we'd essentially have to manually vendor all of the function definitions.
bpmct commentedon Nov 8, 2024
This applies to workspace builds too, right? Not just template builds. We may want to extract function handling or these other edge cases into another issue such as #15087.
But yeah, it seems like it probably would not be best to support any Terraform functions as we'd essentially have to rewrite their stuff.
feat(provisioner/terraform/tfparse): implement WorkspaceTagDefaultsFr…
feat(provisionersdk): allow variadic tags in provisionersdk.MutateTags (
feat!: extract provisioner tags from coder_workspace_tags data source (…
chore(docs): update documentation for coder_workspace_tags (#15620)
johnstcn commentedon Nov 25, 2024
#15578 adds logic to extract and validate tags from uploaded templates.
Docs are updated in #15620.