github.com/hashicorp/terraform-plugin-sdk@v1.17.2/terraform/testdata/plan-for-each-unknown-value/main.tf (about)

     1  # expressions with variable reference
     2  variable "foo" {
     3    type = string
     4  }
     5  
     6  resource "aws_instance" "foo" {
     7    for_each = toset(
     8         [for i in range(0,3) : sha1("${i}${var.foo}")]
     9      )
    10    foo = "foo"
    11  }
    12  
    13  # referencing another resource, which means it has some unknown values in it
    14  resource "aws_instance" "one" {
    15    for_each = toset(["a", "b"])
    16  }
    17  
    18  resource "aws_instance" "two" {
    19    for_each = aws_instance.one
    20  }