Open-Awesome
CategoriesAlternativesStacksSelf-HostedExplore
Open-Awesome

© 2026 Open-Awesome. Curated for the developer elite.

TermsPrivacyAboutGitHubRSS
  1. Home
  2. Terraform
  3. aws2tf

aws2tf

MIT-0Pythonv6.53.2

Import existing AWS infrastructure into Terraform and automatically generate corresponding HCL configuration files.

GitHubGitHub
767 stars119 forks0 contributors

What is aws2tf?

aws2tf is a Python-based tool that automates the import of existing AWS infrastructure into Terraform configurations. It scans AWS accounts, discovers resources, and generates the corresponding Terraform HCL code, solving the problem of manually writing Terraform files for pre-existing cloud resources. The tool also resolves dependencies and replaces hardcoded values with Terraform references to create production-ready configurations.

Target Audience

DevOps engineers, cloud infrastructure teams, and platform engineers who are adopting Terraform for Infrastructure as Code (IaC) and need to migrate existing AWS resources into Terraform management.

Value Proposition

Developers choose aws2tf because it dramatically reduces the time and effort required to onboard existing AWS infrastructure to Terraform, with comprehensive support for 1,612 AWS resources and intelligent dependency resolution that ensures generated configurations are complete and functional.

Overview

aws2tf - automates the importing of existing AWS resources into Terraform and outputs the Terraform HCL code.

Use Cases

Best For

  • Migrating existing AWS infrastructure to Terraform IaC
  • Generating Terraform configurations for legacy AWS environments
  • Importing resources from AWS CloudFormation stacks into Terraform
  • Automating the discovery and documentation of AWS resources
  • Incrementally adding AWS resources to existing Terraform codebases
  • Reducing manual errors when transcribing AWS configurations to HCL

Not Ideal For

  • Teams with complex, modular Terraform setups using custom modules or advanced features like workspaces, as aws2tf generates flat configurations without module integration.
  • Environments requiring immediate production deployment without validation, since generated code may need manual tweaking for policies or edge cases.
  • Multi-cloud or hybrid cloud infrastructures, because aws2tf is strictly AWS-focused and cannot import resources from other providers.
  • Organizations using Terraform remote state backends (e.g., S3, Terraform Cloud), as aws2tf uses its own local state directory and doesn't support external state management.

Pros & Cons

Pros

Comprehensive Resource Coverage

Supports 1,612 Terraform AWS provider resources with 100% coverage, ensuring nearly all existing AWS infrastructure can be imported, as documented in the README's recent improvements.

Intelligent Dependency Resolution

Automatically finds and imports dependent resources, reducing manual effort and creating complete Terraform configurations that aim for zero changes in terraform plan.

Incremental Merge Functionality

Allows adding resources to existing Terraform files using the -m flag, enabling gradual migration without starting from scratch, as shown in the usage guide.

CloudFormation Stack Import

Can import resources from deployed AWS CloudFormation stacks via the -s option, streamlining transitions from CloudFormation to Terraform for legacy deployments.

Cons

Complex Setup Dependencies

Requires specific versions of Python, AWS CLI, Terraform, and jq, which can be cumbersome to install and maintain, as noted in the prerequisites section.

Local State Limitation

Uses its own local state directory and cannot integrate with remote backends like S3, hindering team collaboration and scalability, as admitted in the README.

Error-Prone in Edge Cases

The README warns that errors can occur due to diverse AWS configurations, requiring manual issue reporting and fixes, which may delay migrations.

Performance Issues for Large Accounts

Scanning everything in an account is not recommended due to long runtimes, and fast mode is experimental, indicating scalability challenges for extensive infrastructures.

Frequently Asked Questions

Quick Stats

Stars767
Forks119
Contributors0
Open Issues1
Last commit9 days ago
CreatedSince 2020

Tags

#aws-cli#devops#hcl#terraform#infrastructure-as-code#python#cloud-migration#aws#automation#boto3

Built With

T
Terraform
P
Python
D
Docker
b
boto3
p
pytest

Included in

Terraform6.3k
Auto-fetched 10 hours ago

Related Projects

terraformerterraformer

CLI tool to generate terraform files from existing infrastructure (reverse Terraform). Infrastructure to Code

Stars14,539
Forks1,834
Last commit8 months ago
InfracostInfracost

Cloud cost intelligence for engineers, AI coding agents, and CI/CD 💰📉 Shift FinOps Left!

Stars12,627
Forks703
Last commit21 hours ago
TerragruntTerragrunt

Terragrunt is a flexible orchestration tool that allows Infrastructure as Code written in OpenTofu/Terraform to scale.

Stars9,931
Forks1,250
Last commit13 hours ago
atlantisatlantis

Terraform Pull Request Automation

Stars9,366
Forks1,385
Last commit11 hours ago
Community-curated · Updated weekly · 100% open source

Found a gem we're missing?

Open-Awesome is built by the community, for the community. Submit a project, suggest an awesome list, or help improve the catalog on GitHub.

Submit a projectStar on GitHub