`depends_on` on a data source makes every plan show `(known after apply)` for things that never change.
AdvancedTroubleshootingDependencies, Cycles and Providers
Answer
Likely causes → A data source with depends_on (or inside a module with module-level depends_on) is deferred until apply whenever the dependency has any pending change. All values derived from it become unknown, causing noisy diffs and sometimes replacements.
Diagnose → In the plan, look for <= data "..." ... (depends on a resource or a module with changes pending) lines.
Fix → Remove depends_on and make the data source reference a specific attribute (for example vpc_id = aws_vpc.main.id) so the dependency is precise.
Prevent → Ban module-level depends_on in review unless documented.
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