'Removed a reference to a Terraform module - now I can't destroy
I've removed a reference to a Terraform module, and I was hoping TF would then delete that resource - but as it can no longer find the module (its in GIT) - it doesn't know how to remove it.
Suggestions?
Given this is an automated process - I'd just expect TF to cope with it, TF Destory
isn't really an option
Provider configuration not present
│
│ To work with module.cosmos_account.azurerm_cosmosdb_account.db (orphan) its
│ original provider configuration at
│ module.cosmos_account.provider["registry.terraform.io/hashicorp/azurerm"]
│ is required, but it has been removed. This occurs when a provider
│ configuration is removed while objects created by that provider still exist
│ in the state. Re-add the provider configuration to destroy
│ module.cosmos_account.azurerm_cosmosdb_account.db (orphan), after which you
│ can remove the provider configuration again.
My reference looks like so:
module "cosmos_database" {
source = "git::[email protected]:v3/../../azure-cosmossql_database"
...
...
}
Solution 1:[1]
Resolved - my module had a provider reference in it.
Removed the reference from my module - deployed.
Removed the module from my deployment - deployed and destroyed.
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
Solution | Source |
---|---|
Solution 1 | Stuart.Sklinar |