Handling Delete calls once terraform tasks end

We got an issue wrt Terraform and we need recommendation/guidance from Hashicorp on this : https://github.com/F5Networks/terraform-provider-bigip/issues/401

The challenge is the following: Is there a way to know when Terraform is done executing all the tasks ? is there a way to trigger specific activities when reaching this stage?

When we start a terraform activity (terraform plan/apply/…), we create an auth token with the BIG-IP to execute all the required tasks. We will create a new Auth token every time Terraform will be executed again. The challenge is that we don’t know when to DELETE those auth tokens from the BIG-IP.

The default auth token TTL is 20 min. It’s tricky to consider changing it for a smaller value since it may then be expired in the middle of a terraform activity. So if the BIG-IP is under several tasks, we may reach the maximum limit of 100 auth tokens being created. This is why we need to be able to delete those auth token.

The engineering team did some research and couldn’t find a reliable way to launch this kind of activity (ie delete auth token when Terraform is done). Could we check with Hashicorp if they have recommendation/guidance on how to deal with this ? I don’t think we will be the first vendor asking for more details on this