I have a standalone module that previously used implicit provider inheritence. I now need to pass the providers explicitly. As I need to reference resources in multiple regions. After making the change to the module, before publishing it, if I run terraform validate
then I get several Error: Provider configuration not present
errors.
│ Error: Provider configuration not present
│
│ To work with aws_api_gateway_method.function_proxy_root its original provider configuration at
│ provider["registry.terraform.io/hashicorp/aws"].env 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 aws_api_gateway_method.function_proxy_root, after which you can remove the provider configuration again.
I have read Terraform - refactoring modules: Error: Provider configuration not present. However, I don't believe this is my problem. As this is a standalone module, so there is no state for it to reference. I must not understand something; as I cannot see how Terraform can know that I have made the change.
Any advice would be greatly appreciated.