How Terraform adopts an existing remote object into state and how to inspect recorded resource addresses safely.
Terraform import associates an existing remote object with a resource address in state; it does not create the object or automatically write a complete configuration. Define the intended resource configuration first, import the object, then run a plan to reconcile configuration and remote reality.
1terraform import aws_s3_bucket.reports example-company-reports
2terraform plan
Use terraform state list to see tracked addresses and terraform state show ADDRESS to inspect an individual record. Do not directly edit a state file. Ensure an object is bound to only one Terraform resource address, particularly during an adoption or refactor.
Review the provider’s import identifier format before running import; it varies by resource. HashiCorp’s import documentation covers the CLI workflow.