terraform import aws_instance.web i-1234567890abcdef0

Category: IaC & Automation

terraform import aws_instance.web i-1234567890abcdef0

Import an existing resource into the state

Brings the real EC2 instance i-1234567890abcdef0 under Terraform management at the address aws_instance.web. Write the matching resource block in configuration first, then run plan to reconcile differences. Import never modifies the resource itself. Related: terraform state show aws_instance.web.
Looking for more? Search all 7,657 commands — works offline, in English or Spanish, and fixes typos.