Parameter validation
We are trying to use parameter validation with a "coder_param" that has no default value. We use the cli tool to push the template in our gitlab ci. Unfortunately this seems to be impossible as the cli runs terraform plan which fails due to an empty parameter.
Has anybody found a solution to this? Am I missing something obvious?
10 Replies
<#1328695129455853568>
Category
Help needed
Product
Coder (v2)
Platform
Linux
Logs
Please post any relevant logs/error messages.
hey @jozef, could you send your template over and describe what you're trying to achieve with an empty
coder_parameter
?essentially, I have a git repo param that I do not want to have a default for as it is mandatory for the template, and setting a default means that the param is shown as optional in the control plane UI.
I want to have validation to ensure that users use an https git repo URI rather than an SSH git repo URI.
I'll see if I can send over the template, just need to check it for company related things
Hopefully this explains things a bit
We use the coder cli tool to push templates from gitlab ci and here the tool always runs terraform plan, at this point the param is empty therefore plan fails and the template is not pushed. As I type this though, it occurs to me that I shuld be able to pass a var to the pipeline in order to fill this during the plan phase
Sadly, it seems that this is simply not doable, at least from my testing I haven't figured it out
yeah i've struggled with this in the past as well
@Atif do you have an idea?
Custom Conditions - Configuration Language | Terraform | HashiCorp Developer
Custom Conditions - Configuration Language | Terraform | HashiCorp ...
Check custom requirements for variables, outputs, data sources, and resources and provide better error messages in context.
But how would I tie that to the UI? doesn't seem feasible
you are right, it would likely fail afterwards