- Notifications
You must be signed in to change notification settings - Fork909
Description
In order to support some use-cases around caching Terraform modules and provisioners, we need to allow setting some environment variablesspecifically for certain Terraform invocations.
One such example would be settingHTTP_PROXY
/HTTPS_PROXY
to a caching proxy duringterraform init
, so that cached versions of providers and modules can be retrieved from the proxy instead of upstream.
ExposeCODER_PROVISIONER_TERRAFORM_{INIT,PLAN,APPLY}_ENV
on bothcoderd
andprovisionerd
that will allow passing an array of environment variables intoterraform.provisionEnv
.
For the above example, an administrator could setCODER_PROVISIONER_TERRAFORM_INIT_ENV_0=HTTP_PROXY=http://proxy.corp.int:8080
.
NOTE: It shouldnot allow overriding any environment variable starting with the prefixCODER_
.