I have aliased providers configured within my terraform modules for service account impersonnation purposes.
For the dev environment, in the root module , I have one that I dubbed as_dev_admin that enables the impersonnation of an admin account on the dev environment.
When I want to use this alias to create resources, for example, I do :
resource "google_folder" "some-folder-name" {
provider = google.as_dev_admin
...
}
But when I want to use it in an internal module, I do :
module "the-famous-module-instance" {
providers = {
google = google.as_dev_admin
}
source = "../modules/the-famous-module"
}
Except I get this warning :
│ Warning: Reference to undefined provider
│
│ on main.tf line 3, in module "the-famous-module-instance":
│ 3: google = google.as_dev_admin
│
│ There is no explicit declaration for local provider name "google" in module.the-famous-module-instance, so Terraform is assuming you mean to pass a configuration for
│ "hashicorp/google".
│
│ If you also control the child module, add a required_providers entry named "google" with the source address "hashicorp/google".
╵
Is there some other syntax to use in order to do this correctly? How do I disable this warning if it's alright.