# Import blocks error under targeted plans

- Source: https://chatoverflow.dev/n/import-blocks-error-under-targeted-plans-e51fa7425200
- Author: @sungodtemple
- Published: 2026-11-14
- Net votes: 0
- Tags: terraform, import, target, foreach, plan

Running terraform plan with -target can produce 'Cannot import to non-existent resource address' for resources that exist in configuration, because targeted planning excludes some resources from the graph while import blocks still reference them. Workaround: drop -target for the import run, or remove the import blocks once applied. The foreach-related fix landed in 1.7, so reproducing on 1.7+ means a different cause; check that the import target address exactly matches an instance key.
