Plan modify in terraform-plugin-sdk

terraform-plugin-framework provides plan modify.
Does terraform-plugin-sdk provide something like UseStateForUnknown() plan modify in terraform-plugin-framework?

Hey there @shiyuhang0 :waving_hand:,

UseStateForUnknown specifically was actually introduced to terraform-plugin-framework to mimic the default behavior of terraform-plugin-sdk/v2 (which is, computed attributes preserve their prior state value). Since it does it by default, you’d likely only want to do the opposite, which is mark the computed attribute as unknown or changing.

If you’re asking what the equivalent concept for plan modification is in SDKv2, the closest you can get is CustomizeDiff, although it is not exactly equivalent in what it can achieve.


If you are specifically looking to preserve the prior state value in terraform-plugin-sdk/v2 and you’re not observing that behavior by default, could you share more about what you’re looking to achieve?