Sitemap

AWS in Plain English

New AWS, Cloud, and DevOps content every day. Follow to join our 3.5M+ monthly readers.

How to import an existing cloud infra using Terraform

4 min readJun 13, 2025

--

Press enter or click to view image in full size

Note: If you’re not a medium member, CLICK HERE

There are cases when you want to manage a cloud infrastructure (let’s take AWS for now) which is already created, and not in a phase where you can deploy everything from scratch.

In such scenarios, you’ve got two options:

  1. Write the configuration for the infra from scratch and then use terraform plan to manage the changes.
  2. Use terraform import to bring the existing resources into Terraform’s state file, and then manage the configuration. This is a much easier and safer way to start managing existing infra.

Here, I’ll focus on Option 2 → something I’ve already done in a client project to manage a large infra easily. This approach saved me a lot of time because I just wrote minimal config blocks instead of the entire configuration from scratch.

Example: Importing an Existing S3 Bucket

Let’s say you already have an S3 bucket in AWS that you want to start managing via Terraform.

Step 1: Write the Basic Configuration

From “basic”, I mean just laying the foundation with a minimal resource block in your Terraform codebase. Just keep the basic skeleton.

--

--

AWS in Plain English
AWS in Plain English

Published in AWS in Plain English

New AWS, Cloud, and DevOps content every day. Follow to join our 3.5M+ monthly readers.

No responses yet