A module uses `provider = aws.us_east_1` for an ACM certificate (CloudFront) and fails: the module doesn't receive that provider.
IntermediateTroubleshootingDependencies, Cycles and Providers
Answer
Likely causes → The module didn't declare the alias in configuration_aliases, or the caller didn't pass it in providers.
Diagnose → Check the module's required_providers and the call's providers = {} map.
Fix →
# in the module
terraform {
required_providers {
aws = {
source = "hashicorp/aws"
configuration_aliases = [aws.us_east_1]
}
}
}
# in the root
module "cdn" {
source = "./modules/cdn"
providers = { aws = aws, aws.us_east_1 = aws.us_east_1 }
}
Prevent → Document required provider aliases in each module's README.
More on Dependencies, Cycles and Providers
`Error: Cycle: aws_security_group.app, aws_security_group.db`.Beginner`Error: Cycle: local.name_prefix, local.tags`.BeginnerA cycle appears only after adding `depends_on = [module.app]` to a module. The error lists dozens of nodes.IntermediateAdding `create_before_destroy = true` to a launch template causes `Error: Cycle: ... (destroy deposed ...)`.Advanced`terraform init` fails: `Could not retrieve the list of available versions for provider hashicorp/aws: no available releases match the given constraints ~> 4.0, >= 5.30.0`.Intermediate`Error: Inconsistent dependency lock file` with `locked version selection 5.31.0 doesn't match the updated version constraints ">= 5.40.0"`.Beginner