Master programming syntax, solve interactive challenges & run live code in Syntaxis Explore Arena →
menu_book Course Curriculum (Terraform) expand_more
Terraform / Expressions

for_each

Learn for_each in Terraform through a focused explanation, a topic-specific example, an engineering warning, and a mastery check.

12 min read • Intermediate
terraform-014.tf
hcl
resource "aws_s3_bucket" "logs" { for_each=toset(["api","worker"]) bucket="syntaxis-${each.key}-logs" }
What to watch
Content source & attribution
Original Syntaxis Content · Original Syntaxis Content