provider["registry.terraform.io/hashicorp/aws"] 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.foo.aws_acm_certificate.cert (orphan),
│ after which you can remove the provider configuration again
The nested module in question has providers defined and now I am wondering how I could fix that.
So I am trying to get rid of this bit in a nested module:
provider “aws” {
region = “us-east-1”
}
I did not catch it in the PR review and now I have multiple environments with this applied.
After some research, I currently see no other way than to destroy and recreate the aws resources.
refactoring it so that the provider configuration this module uses is in the root module and passed down explicitly to the child module
I don’t comprehend how this will help. Will this not just push the problem upstairs?
I hope this helps others. I don’t find it easy to explain.
And so on … tortoises all the way
apply when you reached root
then you can remove the explicit providers again and apply once more
(I only had one level, so bare in mind you might have to add more steps)