RFC: Claify scenarios that don't work

Signed-off-by: Christian Mesh <christianmesh1@gmail.com>
This commit is contained in:
Christian Mesh 2024-10-30 07:28:56 -04:00 committed by Martin Atkins
parent a11251cb67
commit b8d4b24964

View File

@ -184,7 +184,13 @@ resource "example_thing" "example" {
# provider configuration block remains static, so effectively all
# of the instances of this resource _must_ belong to the one
# single provider configuration block above.
# This is valid as "example.foo" is statically known
provider = example.foo[each.key]
# Whereas something like this is not supported as it could refer to
# many potential providers depending on the result of local.alias
provider = example[local.alias][each.key]
}
```
@ -208,7 +214,12 @@ module "example" {
# use. Each one is bound to a different instance from the provider
# block above, but they must still nonetheless all be bound to
# the same block.
example = example.foo[each.key]
example = example.foo[each.key] # Supported
# However, if we add uncertainty to which provider configuration is
# being referenced, the above assertions do not hold and become much
# more complex to reason about.
example = example[local.alias][each.key] # Unsupported
}
}
```