Custom provider "teardown" method

When implementing your own provider is there a way to hook in a “teardown” method (in the same way you can use ConfigureContextFunc /ConfigureFunc as a “setup” method)?

The concrete use case is when using the EMC ECS API you need to login to generate a token and then logout to free it (with a max of 100 tokens per user). I’d like to login once when I configure my provider, then logout once when it’s done, but currently I have to login/logout in each of the CRUD methods in my resources and data sources.

I’m a bit of a Go n00b so it’s possible there’s already a way of doing thing, but as far as I can see I’d need terraform to invoke some method in my provider when it’s finished.

There is some nuance and history around this and specifically people wanting to use it for a “commit” action. We don’t have anything to announce at this time, but keep an eye on that issue and you’ll get notified when we can support something like this.