mirror of https://github.com/hashicorp/terraform
Merge pull request #22597 from pselle/for-each-wholly-known
Ensure for_each values wholly known for setspull/22707/head
commit
555ed961b2
@ -0,0 +1,20 @@
|
||||
# expressions with variable reference
|
||||
variable "foo" {
|
||||
type = string
|
||||
}
|
||||
|
||||
resource "aws_instance" "foo" {
|
||||
for_each = toset(
|
||||
[for i in range(0,3) : sha1("${i}${var.foo}")]
|
||||
)
|
||||
foo = "foo"
|
||||
}
|
||||
|
||||
# referencing another resource, which means it has some unknown values in it
|
||||
resource "aws_instance" "one" {
|
||||
for_each = toset(["a", "b"])
|
||||
}
|
||||
|
||||
resource "aws_instance" "two" {
|
||||
for_each = aws_instance.one
|
||||
}
|
||||
Loading…
Reference in new issue