No explicit declaration for local provider

I saw the following output in terraform plan where terraform is upgraded from 0.13.7 to 1.7.2:

Terraform has compared your real infrastructure against your configuration and found no differences, so no changes are needed.

Warning: Reference to undefined provider

  on line 5, in module "secondary":
   5:     aws = aws.staging-secondary

There is no explicit declaration for local provider name "aws" in module.secondary, so Terraform is assuming you mean to pass a configuration for "hashicorp/aws".

If you also control the child module, add a required_providers entry named "aws" with the source address "hashicorp/aws".

I want to know the implication for the warning, especially in the context of the first sentence.
In, we have

provider "aws" {
  alias   = "staging-secondary"
  region  = "us-east-2"
  profile = "staging"

In the scenario of disaster recovery, is the aws provider in the secondary region in danger of being missed ?


This warning is returned to be explicit about Terraform’s backward-compatibility behavior of assuming that a provider belongs to the “hashicorp” namespace when dealing with older modules that haven’t yet been updated to include explicit dependency declarations.

That behavior was intended to allow preexisting modules to work with Terraform v0.13, which was the first release to support other provider namespaces. Terraform v0.13 didn’t emit a warning because it was the first minor release with this behavior and module authors needed time to update their modules to declare dependencies explicitly. Later Terraform versions emit more warnings about this situation because it has been a common point of confusion for those who, for example, make a typo in a provider name and wonder why Terraform is proposing to install a HashiCorp provider that doesn’t exist.

This backward compatibility behavior is protected by the Terraform v1.x compatibility promises, and this warning does not itself reflect a direct problem. Instead, it’s trying to encourage you to update your module to include an explicit dependency declaration so that there’s no ambiguity about which “aws” provider the module is intended to use

You can quiet the warning by adding a required_providers block to the child module that declares that the local name aws represents the provider hashicorp/aws. However, if you can tolerate the warning for now then you can wait to deal with that until after you’ve dealt with any other upgrade tasks, because in your case the compatibility behavior has selected the provider that you intended to use anyway.

thanks for detailed response.