Skip to main content

Multi-agent CLI that generates Terraform and deploys full-stack apps to AWS/GCP free tier

Project description

InfraGen

Multi-agent CLI that takes a plain-English description of your app and deploys it to the AWS or GCP free tier — generates Terraform, provisions infrastructure, and pushes your code, with a review-and-confirm gate before anything runs.

$ infragen deploy
detected: react frontend at ./frontend; fastapi backend at ./backend
tf_write: attempt 1 generated 219 lines of HCL
guardrail: PASS, 0 warning(s)
validate: PASS
+--------------------------- review before deploy ---------------------------+
| terraform plan: 10 to add, 0 to change, 0 to destroy                       |
|   aws_instance.backend (created)                                           |
|   aws_s3_bucket.frontend (created)  ...                                    |
| free tier: all resources within free tier limits                           |
| deploy steps:                                                              |
|   1. build frontend (react)                                                |
|   2. upload frontend to s3://...                                           |
|   3. copy backend code to ubuntu@...                                       |
|   4. install dependencies and start fastapi on port 8000                   |
| estimated monthly cost: $0.00 (free tier)                                  |
+----------------------------------------------------------------------------+
Deploy this? [y/N]:

Why

Free-tier users get surprise bills from two things: resources that were never free (NAT gateways, oversized instances) and forgotten resources left running. InfraGen guards both ends: a deterministic free-tier auditor checks every generated resource against hardcoded limit tables (an LLM can miss a paid instance type; a dict lookup can't), and infragen destroy tears everything down from tracked state.

Install

pip install -e ".[dev]"        # from a clone (PyPI release planned)
cp .env.example .env           # add YOUR OWN free Groq API key (console.groq.com/keys)
infragen doctor                # verify terraform + aws/gcloud are ready

Bring your own accounts — infragen ships no credentials. You need:

  • Python 3.11+ and Terraform
  • your own Groq API key (free, no credit card) in a .env file in your project, or globally in ~/.infragen.env
  • your own AWS account with the CLI authenticated (aws configure), or GCP with gcloud auth login — deploys go to your cloud account, on its free tier

The CLI checks all of this up front and prints setup instructions for anything missing.

Usage

infragen                        # REPL: describe infra, get audited Terraform
infragen deploy                 # scan project -> generate -> review -> deploy
infragen deploy --dry-run       # everything except apply (CI-friendly)
infragen destroy                # tear down everything (with confirmation)
infragen explain ./main.tf      # plain-English explanation of any Terraform
infragen translate ./ --to gcp  # convert AWS Terraform to GCP (or vice versa)
infragen validate ./            # terraform validate + free-tier audit + tflint
infragen doctor                 # prerequisite checks

Supported app patterns (any combination): static frontends (React/Vue/Next/plain) on S3 or Cloud Storage, Python backends (FastAPI/Flask/Django) on EC2 or Compute Engine. All artifacts and state live in .infragen/ inside your project, so redeploys update the same stack.

How it works

A LangGraph state machine (running on Groq's free LLM tier) drives generation: a TF writer produces HCL, a deterministic guardrail blocks anything outside free-tier limits (feeding precise substitutions back for a rewrite), and a validator loops terraform validate errors back until clean — max 3 attempts. Deployment steps are built deterministically from the scanned app spec plus real terraform outputs, and the review panel is backed by actual terraform plan output, never an LLM's summary of intent.

Development

python -m pytest tests/ -q     # unit tests (no API key needed)

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

infragen-0.1.0.tar.gz (30.6 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

infragen-0.1.0-py3-none-any.whl (37.8 kB view details)

Uploaded Python 3

File details

Details for the file infragen-0.1.0.tar.gz.

File metadata

  • Download URL: infragen-0.1.0.tar.gz
  • Upload date:
  • Size: 30.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.13.7

File hashes

Hashes for infragen-0.1.0.tar.gz
Algorithm Hash digest
SHA256 0dda8a2a1979f1194b19bd155e3e0da093394f4aef99ad5419793ed23cf943e4
MD5 e3191bc5223989c90547989d294f8215
BLAKE2b-256 a452f12ffcd4e6eecfc81123473661697ef88171e09af466d6948644898ad5f2

See more details on using hashes here.

File details

Details for the file infragen-0.1.0-py3-none-any.whl.

File metadata

  • Download URL: infragen-0.1.0-py3-none-any.whl
  • Upload date:
  • Size: 37.8 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.13.7

File hashes

Hashes for infragen-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 39d60bd7c78f7f8073817af8f01d7d0ca91ce756d216bf3d78e33a3990e7bf83
MD5 2c7431396c0cab3a1e4aa16c30a5aeb3
BLAKE2b-256 6b606d62bdeb7220d9a647c87d528585273f9e50af36eb79b3e1502608860dec

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page