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
@matifali can you clarify what you mean by "fix them". I was trying combinations and could not get it to not ask / throw an error. I'm sure it's a simple fix and I'm just not getting it. Thanks!
We're reworking some of our parameter behavior in #4311 and plan on slowly deprecating the prompts for Terrraform variables.
In the meantime, you can avoid user prompts by setting sensitive = true and default = "value". I believe the TF_VAR_ variables will be respected as long as they are set before the Coder server is running.
But when I start a workspace it's not honouring the environment variable. Note how it's just used value instead of my environment variable.
terraform environment variable: TF_VAR_namespace=<value redacted>
terraform environment variable: TF_VAR_venture=<value redacted>
Initializing the backend...
Initializing provider plugins...
...
...
Error: serviceaccounts is forbidden: User "system:serviceaccount:REDACTED:coder" cannot create resource "serviceaccounts" in API group "" in the namespace "value"
Error: configmaps is forbidden: User "system:serviceaccount:REDACTED:coder" cannot create resource "configmaps" in API group "" in the namespace "value"
@matifali can you clarify what you mean by "fix them". I was trying combinations and could not get it to not ask / throw an error. I'm sure it's a simple fix and I'm just not getting it. Thanks!
I think I misunderstood your question and I thought it is related to some terraform variables so I said fix/initialize them in main.tf
This issue is becoming stale. In order to keep the tracker readable and actionable, I'm going close to this issue in 7 days if there isn't more activity.
Activity
matifali commentedon Oct 13, 2022
you can fix them in
main.tfand it will not askdcarrion87 commentedon Oct 13, 2022
@matifali can you clarify what you mean by "fix them". I was trying combinations and could not get it to not ask / throw an error. I'm sure it's a simple fix and I'm just not getting it. Thanks!
bpmct commentedon Oct 13, 2022
We're reworking some of our parameter behavior in #4311 and plan on slowly deprecating the prompts for Terrraform variables.
In the meantime, you can avoid user prompts by setting
sensitive = trueanddefault = "value". I believe the TF_VAR_ variables will be respected as long as they are set before the Coder server is running.dcarrion87 commentedon Oct 13, 2022
@bpmct is that in a particular version?
If I do as you suggest it detects a default value as well as the environment variable...So far so good:
But when I start a workspace it's not honouring the environment variable. Note how it's just used
valueinstead of my environment variable.matifali commentedon Oct 13, 2022
I think I misunderstood your question and I thought it is related to some terraform variables so I said fix/initialize them in
main.tfbpmct commentedon Oct 13, 2022
Ah gotcha. I guess the default value is consumed instead of the
TF_VAR_value.@kylecarbs any idea if we could work around this before the new parameter stuff is in and variables are only consumable via Terraform?
The only thing I can think of is using an
externaldata source instead of using variables: https://support.hashicorp.com/hc/en-us/articles/4547786359571-Reading-and-using-environment-variables-in-Terraform-runsdcarrion87 commentedon Oct 13, 2022
Thanks @bpmct I will look at a workaround like that for the moment.
By the way, the proposed UI inputs look great!
dcarrion87 commentedon Oct 14, 2022
@bpmct this worked a charm and is an acceptable workaround for us for now:
github-actions commentedon Dec 14, 2022
This issue is becoming stale. In order to keep the tracker readable and actionable, I'm going close to this issue in 7 days if there isn't more activity.
dcarrion87 commentedon Dec 14, 2022
We're still doing this hack (if you'd call it that).
kylecarbs commentedon Dec 14, 2022
I think it's fine to do this! Once we have the new parameter system, this won't be a thing anyways!
dcarrion87 commentedon Dec 14, 2022
Cool beans. I guess OK to close off then.