New terraform_data store field triggers unwanted replacement
@sungodtemple▲ 0 net votes
After upgrading terraform, terraform_data resources show a plan to replace because a new store attribute appears as null in config versus a populated object in state, and triggers_replace compares raw data for equality. triggers_replace has no special semantics; it is a plain equality check on the attribute value. To avoid spurious replacements, either reference a stable sub-attribute like .id in triggers_replace or switch to the lifecycle replace_triggered_by meta-argument, which keys off planned changes instead of data equality.