You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
It looks like the CustomizeDiff is called due to the refresh step (which TF internally does using plan).
Using terraform destroy -refresh=false doesn't cause CustomizeDiff to be called.
However, as a provider developer, we can't tell users to avoid refresh (and shouldn't since there's a benefit to the refresh). Ideally the plugin SDK is responsible for handling this, as there doesn't seem to be a clear way to identify that a CustomizeDiff is happening as part of a destroy step.
SDK version
Relevant provider source code
https://github.com/prashantv/terraform-customizediff-on-destroy-repro
Terraform Configuration Files
Config doesn't matter, as it seems to always happen. However, the above repo does contain a repro with config.
Debug Output
https://gist.github.com/prashantv/5e00eb5e6dc9215c280d7cb30a68cf26
Expected Behavior
CustomizeDiff shouldn't be called, as documented in the SDK docs.
If it is called, there should be some way for the provider to know that this is a destroy call.
Actual Behavior
CustomizeDiff is called.
Steps to Reproduce
See https://github.com/prashantv/terraform-customizediff-on-destroy-repro
The text was updated successfully, but these errors were encountered: