`Error: Cycle: local.name_prefix, local.tags`.
BeginnerTroubleshootingDependencies, Cycles and Providers
Answer
Likely causes → Two locals reference each other (directly or through a third).
Diagnose → Read both definitions; the cycle list tells you every node involved.
Fix → Break the loop by extracting the shared part into a third local that depends on neither.
Prevent → Keep locals layered: inputs → derived names → tags/maps, never back-references.
More on Dependencies, Cycles and Providers
`Error: Cycle: aws_security_group.app, aws_security_group.db`.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`Error: Inconsistent dependency lock file` with `provider registry.terraform.io/hashicorp/random: required by this configuration but no version is selected`.Beginner