terraform-plugin-sdk icon indicating copy to clipboard operation
terraform-plugin-sdk copied to clipboard

Add `DeleteWarning` message to resource level

Open paultyng opened this issue 5 years ago • 1 comments

Deletion of some resources is inherently problematic (data loss, money, etc). In cases where there is significant potential user issues from an accidental deletion, we want to provide additional warning messages at plan time about the deletion.

paultyng avatar Apr 27 '20 19:04 paultyng

Currently, Terraform CLI never calls the PlanResourceChange RPC during destroy plans, so there is not an opportunity for providers to even "see" the planned resource destroy operation. They are investigating the feasibility of turning that on, since provider implementations may not be expecting null data. Upon quick investigation, it might be safe with this SDK (due to a well placed early return), but it could break terraform-plugin-go or other implementations. In that case, it could be introduced as a separate RPC, although doing that introduces its own complexities.

bflad avatar Mar 16 '22 19:03 bflad