Skip to main content

12. State operations: import, mv, rm, refresh

Manipulating state safely; importing existing resources.

⏱ ≈ 30 min this module · 📚 ≈ 5.8 h full track

🔒 Unlock this course to read the material and run the labs.

See options to unlock →
🔒 The written material unlocks with the course.
🧪 Hands-on lab Hard · 180 XP · 30min

Goal

A bucket certland-labs-legacy already exists, created outside Terraform. Bring it under management with terraform import, then make the plan clean.

Steps

  1. Write the matching aws_s3_bucket "legacy" resource block
  2. terraform init
  3. terraform import aws_s3_bucket.legacy certland-labs-legacy
  4. terraform plan — it must report No changes

🔒 Unlock the course to run this lab.