A module reads data.aws_ami.base and passes its id to aws_instance.web. The team's unit test uses mock_provider "aws" {} and a default apply-mode run block, and it must assert that aws_instance.web.ami equals ami-0123456789abcdef0 instead of a random generated string. Which addition to the test file makes the data source return that exact value?
Select an answer to reveal the explanation.
Short Explanation
Think of override_data as a stunt double for one data source: Terraform skips the provider call and hands back exactly the values you scripted. The trap is grabbing the wrong block. mock_resource is for resources, override_module is for whole modules, and a variables block only feeds input variables.
Full Explanation
Terraform tests provide three override blocks, each aimed at one kind of object. override_data replaces the result of a data source: its target names the data source address and its values attribute supplies the attributes to return, and Terraform does not call the underlying provider for that object. It can sit at the root of a test file, inside a run block (where it takes precedence over a file-level override), or inside a mock_provider block. With a mocked provider, any attribute not set this way would otherwise be generated, and generated strings are random eight-character values that can never match a fixed image ID. A mock_resource block sets defaults for managed resources of a type; the matching construct for data sources is mock_data, so a mock_resource for aws_ami does not affect a data source lookup. The variables block in a test assigns input variables only and cannot write into a data source's attributes. override_module targets a module call and replaces its outputs, so it cannot address a data source and uses outputs rather than values. Exam caveat: override values are produced during apply by default; a plan-only run that needs them must also set override_during = plan. Operational check: run terraform test -verbose and confirm the run's state shows the overridden id on data.aws_ami.base and the same value on aws_instance.web.ami.