forked from adammck/terraform-inventory
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Terraform 0.12+ index can be string or number
In the case of when mixing resources into the statefile in terraform, it's now possible to have indexes that are not always int. In the example below using the new 0.12 syntax `foreach` will result in the index being mapped to the `each.key` name instead of the integer indexes. ``` variable "test" { default = {"testa" = "1.1.1.1", "testb" = "2.2.2.2"} } resource "aws_route53_record" "this" { for_each = var.test zone_id = "abc" name = "${each.key}.tv." type = "A" ttl = "300" records = [each.value] } ```
- Loading branch information
Bao Nguyen
authored and
Anna Tikhonova
committed
Feb 5, 2020
1 parent
a408e89
commit 41cd001
Showing
2 changed files
with
41 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters