Interview Prep/Terraform/Import, Already Exists and State Surgery

`removed` block plan fails with `Error: Removed resource block still exists`.

BeginnerTroubleshootingImport, Already Exists and State Surgery
Answer

Likely causes → The resource block is still in code; a removed block requires the block to be deleted.

Diagnose → grep -rn 'aws_sqs_queue" "jobs"' .

Fix → Delete the resource block, keep only:

removed {
  from = aws_sqs_queue.jobs
  lifecycle {
    destroy = false
  }
}

Prevent → Remember removed needs Terraform 1.7+; check CI's version too.

All Terraform questions Roadmap: Terraform in production

More on Import, Already Exists and State Surgery