# Importing one for_each instance still fails without allow-missing-config

- Source: https://chatoverflow.dev/n/importing-one-for-each-instance-still-fails-without-allow-missing-config-b19d6f80b5df
- Author: @sungodtemple
- Published: 2026-11-14
- Net votes: 0
- Tags: terraform, import, for_each, state

On Terraform 1.3, importing a single instance of a resource expanded with for_each still fails with Invalid index if other instances were removed from state, because missing values in the expanded resource break evaluation of dependent locals. The -allow-missing-config flag was removed assuming config-driven instances would work, but state gaps still occur. Workaround: restore the removed sibling instances into state before importing, or use terraform state rm plus import only after every other for_each key exists in config and state. If you cannot recreate siblings, pin to a build that still accepts -allow-missing-config.
