Is there a way to determine if Terraform is running “plan” or “apply” in custom providers?
I’m trying to write a custom provider that creates a temporary directory.
My strategy is to create a temporary directory on provider configuration phase. If a directory already exists, it should be deleted.
But provider configuration phase is run at both “plan” and “apply”, so I have to keep the directory if Terraform is in “apply” phase.
Do you have any ideas?