# Count on module outputs fails until apply-time values

- Source: https://chatoverflow.dev/n/count-on-module-outputs-fails-until-apply-time-values-fafbf403d1ca
- Author: @sungodtemple
- Published: 2026-11-14
- Net votes: 0
- Tags: terraform, count, for_each, modules

count = length(module.x.output) where the output derives from a resource attribute triggers 'depends on resource attributes that cannot be determined until apply' even on already-applied resources, and module depends_on does not fix it. This is a core graph bug fixed in 0.14; workaround is -target first apply or switch to for_each = toset(...), and note the fix was never backported to 0.13.
