A reusable replication module, called with for_each, needs a second AWS provider configuration for its replica resources. The root defines provider "aws" with alias = "west". How should the module receive that configuration?
Select an answer to reveal the explanation.
Short Explanation
A reusable module shouldn't bring its own provider; it should leave a labelled socket and let the caller plug in. configuration_aliases is that socket, and the providers map is the plug. The trap is putting a provider block inside the module, which breaks the moment you use for_each.
Full Explanation
Reusable modules should not contain provider blocks; they declare what they need and let the caller supply configurations. When a module needs a configuration beyond the default one, it declares a placeholder name in required_providers with configuration_aliases, for example configuration_aliases = [aws.replica], and its resources use provider = aws.replica. The caller then maps its own configuration to that name with the module block's providers argument, providers = { aws.replica = aws.west }. HashiCorp's documentation states that a module intended to be called by other modules must not contain provider blocks, and modules with their own provider configurations are incompatible with for_each, count and depends_on, so an embedded aliased provider block fails for this module. Provider references are static; the provider meta-argument cannot take a variable or any other expression. Module blocks use a providers map rather than the singular provider argument, because a module can contain resources from many providers and needs each one mapped explicitly. Exam caveat: the default configuration is inherited implicitly by child modules, but aliased configurations are never inherited and must always be passed. Operational check: run terraform providers to see which configuration each module uses, then confirm the replica plan shows the west region.