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
It seems empty arrays defined in .tf.json files are not interpreted as set variables. I was able to reduce this problem to a very small test case on Terraform v0.7.3.
Thanks! I have a PR open for the HCL project that will fix this. Once that is merged, I'll also add a failing test for your case here in Terraform (to avoid regressions in this project) and update the HCL vendor.
I'm going to lock this issue because it has been closed for 30 days ⏳. This helps our maintainers find and focus on the active issues.
If you have found a problem that seems similar to this, please open a new issue and complete the issue template so we can capture all the details necessary to investigate further.
ghost
locked and limited conversation to collaborators
Apr 21, 2020
Sign up for freeto subscribe to this conversation on GitHub.
Already have an account?
Sign in.
It seems empty arrays defined in .tf.json files are not interpreted as set variables. I was able to reduce this problem to a very small test case on Terraform v0.7.3.
provision.tf
After
terraform plan
ing with an empty variable in an hcl-style config, the plan comes out as empty as expected:tfvars/variables.tfvars
foo = []
However, if I try this with an equivalent json file, I'm prompted for input.
json/variables.tf.json
{ "foo": [] }
This is specifically a problem with empty arrays in json, because if I populate the array with a value, terraform becomes aware that it has been set.
json/variables.tf.json
It would be great if empty arrays read from JSON files were actually interpreted as such.
The text was updated successfully, but these errors were encountered: