Difference between revisions of "Terraform: subnet id"

From wikieduonline
Jump to navigation Jump to search
Line 13: Line 13:
 
  │
 
  │
 
  │  on ../path_to_your/plan.tf line 7, in resource "[[aws_instance]]" "this":
 
  │  on ../path_to_your/plan.tf line 7, in resource "[[aws_instance]]" "this":
  │    7:  subnet_id = element(var.subnet_ids,count.index)
+
  │    7:  subnet_id = element([[var.subnet_ids]],count.index)
 
  │    ├────────────────
 
  │    ├────────────────
 
  │    │ count.index is 0
 
  │    │ count.index is 0

Revision as of 17:23, 6 April 2023

Terraform subnet_id argument.

Examples

Errors

│ Error: Error in function call
│
│   on ../path_to_your/plan.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.

Related

tf show | grep subnet_id
tf show | egrep "subnet_id|connectivity_type"

See also

Advertising: