Transform collections with a for expression.
Section: Expressions and Functions
For expression
hcl
hcl
locals {
private_subnet_ids = [for s in aws_subnet.private : s.id]
}Explanation
Transform collections with a for expression.
Learn the surrounding workflow
Compare similar commands or jump into common fixes when this command is part of a bigger troubleshooting path.
Related commands
Same sheet · prioritizing Expressions and Functions