A platform team maintains a shared module whose input instance_size is being replaced by instance_type. All callers now run Terraform 1.15. The team wants callers who still pass instance_size to see a warning naming the replacement, without their runs failing. What should the team add?
Select an answer to reveal the explanation.
Short Explanation
You want a polite tap on the shoulder, not a locked door. In 1.15 the deprecated argument on a variable does exactly that: callers who still pass the old input get a warning with your message, and their runs keep going. The trap is a validation block, which stops the run cold.
Full Explanation
Terraform 1.15 added a deprecated argument to variable and output blocks. On a variable, it takes a string explaining why the variable is deprecated, and Terraform shows that message as a warning when a value is set for the variable in a root module or when a child module caller passes a value for it. That matches the requirement: callers who still pass instance_size see the guidance to use instance_type, while their plans and applies continue, giving them time to migrate before a later major release removes the input. A validation block with a condition that fails whenever a value is present turns the deprecation into a hard error, which breaks every caller immediately. A precondition also blocks the run when its condition is false, so it has the same breaking effect, just at a different point in evaluation. The description argument is documentation only; Terraform never emits warnings based on description text, so callers would see nothing during runs. Exam caveat: the same argument on an output block warns when the deprecated output is referenced, and module authors should keep accepting the old input until the planned removal so the warning has time to work. Operational check: add the argument, run a plan from a caller that still sets instance_size, and confirm the warning appears with the message while the plan completes.