Difference between revisions of "Terraform: for each"
Jump to navigation
Jump to search
Line 37: | Line 37: | ||
== See also == | == See also == | ||
+ | * {{for_each}} | ||
* {{tf functions}} | * {{tf functions}} | ||
[[Category:Terraform]] | [[Category:Terraform]] |
Revision as of 18:00, 14 May 2023
for_each
Examples
Official examples
resource "azurerm_resource_group" "rg" { for_each = { a_group = "eastus" another_group = "westus2" } name = each.key location = each.value }
resource "aws_ssm_parameter" "secret" { for_each = toset(var.secrets) name = each.key description = each.key type = "SecureString" value = "1" lifecycle { ignore_changes = [value] } }
Errors
Related
See also
for_each, each.
, Terraform: dynamic_blocks- Terraform functions, Terraform collection functions:
tolist
,toset
,length
,sum
,file
,join
,depends_on
,zipmap
,replace
,lookup
,read files
,concat
,merge, templatefile, for_each, format, element, slice, try, filebase64, upper, filemd5, coalesce, formatlist, flatten
Advertising: