Welcome to the forum - please reformat your message…
Terraform provider definitions inside non-root modules are deprecated, because of the problem you are experiencing here.
-
You have previously created resources via a module,
module.palo_alto_nat_nva_region_a
with a provider configured inside it -module.palo_alto_nat_nva_region_a.provider[“Terraform Registry”]
-
You have now removed this module
-
Terraform now does not have access to the provider configuration needed to destroy these resources
-
It does not matter that you have a separate
azurerm
provider defined in the root module - Terraform has no way to know it points at the same tenant/subscription/etc. -
Therefore as the error message says, Terraform now requires you to re-add a module named
palo_alto_nat_nva_region_a
and re-add a provider configuration within it to tell it how to destroy those resources.
One option open to you is to add a module that is defined locally - i.e.:
module "palo_alto_nat_nva_region_a" {
source = "./some_local_directory_name"
}
and within some_local_directory_name
add just a single provider "azurerm"
block specifying how to connect to azure to handle those resources.