-
Notifications
You must be signed in to change notification settings - Fork 112
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
TF_WORKSPACE not parsed for empty Cloud block #341
Comments
Correction: I only specified the workspace name (equivalent to |
sergiorivera50
changed the title
Environment variables not taken into account when using empty Cloud block
TF_WORKSPACE not parsed for empty Cloud block
Nov 7, 2022
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
I have the following
versions.tf
Note the empty cloud block; its fields should be parsed from the environment variables
TF_WORKSPACE
&TF_CLOUD_ORGANIZATION
. Running the CLI myself, I manage to get it working.I'm getting my environment variables from a dot env file using the following snippet of code
I have verified that I have correct access to the env variables after the previous statements are executed. But whenever I initialise terraform with
tf.Init(context.Background(), tfexec.Upgrade(true))
, it complains about not specifying a workspace (something that does not happen when using the CLI directly).The interesting thing is, if I do manually specify TF variables in the HCL files, it all works. So it seems not to be a problem from not parsing environment variables but outright ignoring TF_WORKSPACE? Is this a possibility?
The following is my main, in case you need to see the entire code:
The text was updated successfully, but these errors were encountered: