mirror of https://github.com/hashicorp/terraform
Just as when we resolve single output values we must check to see if there is a planned new value for an output before using the value in state, because the planned new value might contain unknowns that can't be represented directly in the state (and would thus be incorrectly returned as null).pull/19237/head
parent
bbf8dacac8
commit
21577a5f15
@ -0,0 +1,17 @@
|
||||
resource "test_resource" "root" {
|
||||
required = local.object.id
|
||||
}
|
||||
|
||||
locals {
|
||||
# This indirection is here to force the evaluator to produce the whole
|
||||
# module object here rather than just fetching the single "object" output.
|
||||
# This makes this fixture different than plan-required-output, which just
|
||||
# accesses module.mod.object.id directly and thus visits a different
|
||||
# codepath in the evaluator.
|
||||
mod = module.mod
|
||||
object = local.mod.object
|
||||
}
|
||||
|
||||
module "mod" {
|
||||
source = "./mod"
|
||||
}
|
||||
@ -0,0 +1,7 @@
|
||||
resource "test_resource" "for_output" {
|
||||
required = "val"
|
||||
}
|
||||
|
||||
output "object" {
|
||||
value = test_resource.for_output
|
||||
}
|
||||
Loading…
Reference in new issue