-
Notifications
You must be signed in to change notification settings - Fork 888
feat: Update CLI to handle managed variables #6220
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
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good.
I think users could confuse the help of variables-file
and parameters-file
, maybe that's something to look at before merge.
The original form:
It's hard to figure out a good description as we don't invent anything new. These are just Terraform variables. A couple of ideas:
Any preference here, @kylecarbs @bpmct? The task will be harder once we replace the Terraform with something else. |
I like "Specify a file path with values for Terraform-managed variables." |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Any plans to support something like TF_VAR=
, -var
, or --set
as well?
In a CI pipeline when a new image is pushed, how could we set that output (ami-21912383
) as a variable when a Coder template update is also pushed as the next step in the pipeline? Writing to a file and then referencing is a strange workaround.
Yes, it depends. If you have multiple variables you need to reference, then a file would be more convenient. Same with sensitive values, you don't want somebody to sniff them via Anyway, I can add an extra command option ( |
Sounds fair 👍🏼 |
Done! |
Related: #5980
This PR extends the CLI commands
create
andpush
to let user pass thevariables.yml
file with Terraform variable values.Extra changes:
/variables
: redact value and default value for sensitive parameters.variable.default == nil
not justvariable.default == ""
.Testing:
variables
file to pass initial values for the new template