Is there a finalize "hook" for terraform providers?

We would like to submit telemetry information about the resources and endpoints we are hitting, as well as the verbs. something like:


We would like to bulk up this information until the provider is “done” and it isn’t obvious to me how since that really all depends on what the user decides to do.

So, is there some function I can implement to intercept these various phases?

Hi @chb0github :wave: currently providers do not receive a hook from Terraform when all actions have been completed [1], therefore the SDKs cannot provide this type of functionality at the moment. The best feature request I can point you at today is Cleanup, sync and commit actions for Providers · Issue #63 · hashicorp/terraform-plugin-sdk · GitHub, which is capturing various use cases for this type of functionality.

[1]: There is the StopProvider RPC, however that is explicitly designed for exiting the provider server process.