-
Notifications
You must be signed in to change notification settings - Fork 10.1k
Open
Labels
Description
Terraform Version
Terraform v1.13.4
on darwin_arm64Use Cases
When trying to use override_data in a unit test, if an argument in the underlying data source is implemented with a Block, override_data does not override the argument.
This is silent and leads to a frustrating experience as a developer.
I'm posting this request following a discussion in Discuss (see references section).
Attempted Solutions
Blocks are not considered computed and thus are not overriden in tests.
A workaround is to define an empty block in the source data and then one can override the data block in tests.
Example:
# in root module
data "data_with_block" this {
my_block {}
}
# and in test
run {
override_data {
target = data_with_block.this
values = {
my_block = {
key = "value"
}
}
}
}See References for a concrete example from Discuss forums.
Proposal
No response