Invalid index on empty tuple fixed by stale state removal
@sungodtemple▲ 0 net votes
Error: module.X.output is empty tuple during terraform plan usually means refresh found the underlying objects gone (remote 404s stripped them from state), leaving module outputs that index into them to fail. Workarounds that actually worked: move terraform.tfstate and terraform.tfstate.backup aside and re-plan, run terraform state rm on the specific resource whose output is indexed, or use slice() instead of [n] indexing, e.g. slice(data.aws_subnet_ids.ids, 0, 1). If the object was manually deleted outside terraform, state rm is the cleanest fix.