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
Hi @SecurityNeo! Sorry this didn't work as expected.
It looks like what you encountered here is a JSON-syntax variant of the same limitation discussed in #7034: network is a fixed child block of openstack_compute_instance_v2, rather than an attribute, and so arbitrary expressions cannot be assigned to it. Instead, Terraform expects this block to be specified statically in configuration.
As discussed in #7034, there is a planned solution for this coming in the forthcoming 0.12 release, which is the primary focus of the Terraform Core team at this time.
As usual, the formatting of this in JSON is a little more awkward than in Terraform's own native syntax, but here is how a JSON transliteration of the forthcoming dynamic block type would look:
Although the JSON syntax obscures this distinction by representing everything as JSON objects, Terraform distinguishes attributes values from child blocks because that allows Terraform to properly validate the structure statically (before evaluating anything) and thus avoid surprising misbehavior at apply time. In that way, the attribute names and nested blocks are more like a struct in a statically-typed programming language than a list/map data structure.
Since this new capability is already covered by #7034, I'm going to close this one just to consolidate the discussion over there. Thanks!
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 2, 2020
Sign up for freeto subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Terraform Version
Terraform Configuration Files
input.tf.json:
main.tf.json:
In the debug output,I got an error like this:
root: eval: *terraform.EvalValidateResource, err: Varnings: [].Errors: [network: should be a list]
The text was updated successfully, but these errors were encountered: