Cleanup/Teardown function in Provider

I am using the new plugin framework to develop a provider for a dns server.
After changes are made via the api a deployment of the dns server is needed to make the changes available on the dns servers.
I was wondering if it would be possible to define some data structure shared between resources via the provider’s Configure method and then, based of information in the data structure at the end of the tf run one could trigger a deployment. The provider interface only allows Metadata, Schema, Resources,DataSources and Configure functions. While Configure is run before execution of changes there is now function run at the end. Is it possible to define such a function or is this a usecase that should be handled outside of tf in a pipeline.

Hi @marcohelmerich,
If the deployment of the DNS servers is a workflow separate from API that you are writing your provider against, then we recommend doing this outside of the Terraform workflow. Our own DNS utility provider only manages DNS records and requires the DNS server to be deployed before use.

As a last resort, you can try to use a Terraform provisioner for the deployment, however if you can solve it in your pipeline that would be preferred. I recommend reading the Terraform Declaring Provisioners page in full before deciding to use a Terraform provisioner.