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.
More on State Internals
What does the state file contain?BeginnerWhat is the difference between local and remote state?BeginnerHow do you configure the S3 backend?BeginnerWhat is state locking and why does it matter?IntermediateHow does S3-native locking work and how does it replace DynamoDB?AdvancedHow do you inspect resources in state?Beginner