-
Notifications
You must be signed in to change notification settings - Fork 886
rich parameters: Manage template-wide Terraform variable
#5980
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
Some notes from @ElliotG: (1) Make it more clear that these are environment variables, and include a sensitive option where you can’t read the result from the UI. Also likely obfuscate from the logs. When I was using Spacelift, they made it extremely difficult to access these by both obfuscating the logs, and just refusing to print the results. (2) Include a file upload option, that can be sourced from either an uploaded file that Coder hangs onto, or a remote Github URL. If Coder is responsible for hosting the file, we would likely need an object store and/or limits on file sizes or something. We’d want to think about this more carefully. Continuing with the thoughts around (2), if we wanted to support file uploads, we might require that someone plugins in an object store configuration, with keys for uploading/downloading, etc. This would mean there are features in the app that only work if they’ve been configured serverside. This could be a huge trap |
I think that we should start with a UI visualization or mockup of where the env vars form should land, and what extra features we need like sensitivity, restricted vars, variable format, and maybe a common vault to import secrets?
👍
This might be risky as we will lock Coder for Terraform as the only provider. |
I'm going with this issue. |
Hey @kylecarbs @bpmct, I'd like to hear your thoughts about this issue. I spent more time researching this issue, especially the existing Parameter Schema. I have a few questions affecting the design:
My preference: no, as their model structure doesn't reflect what we're trying to achieve: {
"id": "34e53c7a-6664-4495-9ae8-51eddda48f8f",
"created_at": "2023-02-08T14:10:24.669539+01:00",
"job_id": "0fce30e8-8ea2-4518-a380-227dbbe7f5d8",
"name": "use_kubeconfig",
"description": "Use host kubeconfig? (true/false)\n\nSet this to false if the Coder host is itself running as a Pod on the same\nKubernetes cluster as you are deploying workspaces to.\n\nSet this to true if the Coder host is running outside the Kubernetes cluster\nfor workspaces. A valid \"~/.kube/config\" must be present on the Coder host.\n",
"default_source_scheme": "none",
"default_source_value": "",
"allow_override_source": false,
"default_destination_scheme": "provisioner_variable",
"allow_override_destination": false,
"default_refresh": "",
"redisplay_value": false,
"validation_error": "",
"validation_condition": "",
"validation_type_system": "none",
"validation_value_type": "bool"
} There is a lot of unnecessary properties like Apart from this, mixing old params with refactored variables, can be cause issues like this, where you are trying to combine both parameters.
|
I don't believe we should parse Terraform variables at all anymore, and can completely get rid of that old schema. I think if a Terraform variable is missing the build can just fail, and the template author can check the logs to see why. |
I agree. I don't think we should combine old parameters and template variables. It also seems like they should probably have a separate database table/structure. |
@kylecarbs For an AWS template, for example, how will the template author (from the UI), know what variables to set for their access key, secret, and region? Outside of template parsing for |
We synced offline with @bpmct and @kylecarbs and got the following conclusions:
|
Battle plan:
|
We had a discord chat with @BrunoQuaresma, who agreed to take over left frontend work here: create a template with managed variables (+ "example" workflow). |
Hey @BrunoQuaresma! Do you see any leftovers here or should we close this issue? |
With parameters being managed by
coder_paramater
, thevariable
is free for being only template-wide! We can add a panel in the UI for template admins to edit the variables for templates.Some notes:
TF_VAR_{name}={value}
env vars during provision-timeThis can be used during POCs to set AWS access keys, a "main" repo for every template user to clone, or simply values that an admin would prefer to control with more ease (e.g. base AMI).
The text was updated successfully, but these errors were encountered: