Error: Error in function call

From wikieduonline
Revision as of 12:56, 20 September 2021 by Welcome (talk | contribs) (Created page with " │ Error: Error in function call │ │ on ../path/to/your/terraformodule.tf line 7, in resource "aws_instance" "this": │ 7: subnet_id = element(var.su...")
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigation Jump to search
│ Error: Error in function call
│
│   on ../path/to/your/terraformodule.tf line 7, in resource "aws_instance" "this":
│    7:   subnet_id = element(var.subnet_ids,count.index)
│     ├────────────────
│     │ count.index is 0
│     │ var.subnet_ids is empty list of string
│
│ Call to function "element" failed: cannot use element function with an empty list.
  • Solution: if your element if from type list make user provide values using proper format: [value1, value2]


See also

Advertising: