Interview Prep/Terraform/State Internals

How did `terraform import` work before import blocks?

IntermediateConceptState Internals
Answer

terraform import aws_s3_bucket.logs acme-logs attached an existing object to a resource address already written in config, updating state only. It did not write configuration, so you wrote the resource block first and iterated until the plan was clean. Import IDs differ per resource; check the docs' Import section.

All Terraform questions Roadmap: Terraform in production

More on State Internals