8/18

count vs for_each

medium 5 XP ~1 minQuiz
resource "aws_iam_user" "dev" {
  count = length(var.names)
  name  = var.names[count.index]
}

var.names is ["alice", "bob", "carol"]. You remove "alice" from the list. What does the plan show, and how do you avoid it?

Choose one answer