InfraFactory InfraFactory, an open-source infrastructure-as-code tool, now generates and validates OpenTofu configurations across AWS, GCP, and Scaleway using LLMs against deterministic mock servers in seconds, eliminating the need for cloud credentials or real API calls. The tool closes the slow, expensive feedback loop of hand-iterating Terraform against real clouds by running scenario YAML through a four-layer validation pipeline—static analysis, mock deployment, real deployment, and destruction—with structured failures fed back into subsequent LLM iterations. Users can run end-to-end infrastructure validation locally in approximately 60 seconds using three commands, with the system converging on successful deployments after an average of two LLM iterations. Scenario-driven OpenTofu generation and validation across AWS , GCP , and Scaleway — generated by an LLM, validated against deterministic mock servers in seconds, optionally deployed against real cloud APIs. Hand-iterating IaC against real cloud APIs is slow, expensive, and flaky. LLMs are good at writing terraform but bad at debugging "why didn't this apply" — the error messages are layers deep and the feedback loop is 90 seconds per attempt against a real cloud. InfraFactory closes that loop. You write a scenario YAML declaring intent resources + acceptance criteria . The pipeline generates HCL with an LLM, validates it through four layers static → mock-deploy → real-deploy → destruction , and feeds structured failures back into the next iteration's prompt. Subsecond mock validation, no cloud credentials required. infrafactory run scenarios/training/gcp-pubsub.yaml against fakegcp : scenario YAML → 3-phase LLM generation → 3-layer validation → AI's first iteration fails fakegcp rejects google project service → feedback fed into the next iteration's prompt → second iteration converges to Status: success . Demonstrates the feedback loop that makes the pipeline robust against partial mock coverage. Re-record with ./docs/demo/record.sh requires make mocks-up + an LLM credential in env . Actually runs gcp-pubsub through the UI: scenario page → click Run → Live page populates with iteration stages live as the AI tries to build the topic + subscription against fakegcp → iteration 1 fails fakegcp doesn't model google project service yet → AI sees the feedback in iteration 2's prompt and converges → success banner → per-run IaC viewer shows the converged HCL with auto-injected custom endpoint overrides pointing at fakegcp. ~2min end-to-end, 2 LLM iterations. Re-record with make demo-ui-run needs make mocks-up + Claude CLI authenticated . Browser walkthrough of full-stack-paris the most resource-dense scenario — no infrafactory run , just a tour of the Scenario / Runs / Compare / Pitfalls / Diagnostics pages so viewers see the UI surface 24s, no LLM credit needed . Re-record with make demo-ui . Three commands gets you a working LLM-driven infra pipeline against local mock servers, validates a real terraform scenario end-to-end, and tears everything down cleanly. No cloud credentials. No real cloud calls. ~60 seconds. 1. Clone the four repos side-by-side sibling layout . mkdir -p ~/dev && cd ~/dev for repo in infrafactory fakeaws fakegcp mockway; do git clone https://github.com/redscaresu/$repo.git done cd infrafactory 2. Bring up the full stack — mockway + fakegcp + fakeaws + SeaweedFS S3 + the SvelteKit UI — in one command, backgrounded. make up 3. Run the fastest scenario end-to-end ~30s, 1 iteration . ./bin/infrafactory run scenarios/training/block-paris.yaml --config infrafactory.yaml 4. Optional point a browser at http://127.0.0.1:4173 to see the same scenario in the UI with per-iteration stage breakdown. 5. Tear it all down. make down You should see Status: success and run/terminal reason: pass target reached after step 3. The LLM generated a Scaleway Block Storage volume in HCL, the static validator + mockway apply + topology test + destroy/orphan-check all passed. The default run tears the resources down at the end of the test cycle the scenario's destruction: no orphans acceptance criterion , so http://127.0.0.1:8080/mock/state reports empty collections. To inspect the post-apply state, add --no-destroy to the run command. Use make status at any time to see which of the six ports 8080 , 8081 , 8082 , 9090 , 9091 , 4173 are listening. - Go 1.25+ - OpenTofu https://opentofu.org https://opentofu.org on PATH - Docker for the SeaweedFS S3 backend used by AWS scenarios — only needed when running AWS-cloud scenarios; Scaleway-only and GCP-only demos don't require it - An LLM credential, see below InfraFactory drives generation through the Claude CLI by default — sign in with claude login once and it works out of the box. To use a different model via OpenRouter instead, export OPENROUTER API KEY and set agent.type: openrouter in infrafactory.yaml . Both paths hit the same 3-phase generation pipeline plan → write HCL → self-review ; pick whichever fits your budget/latency profile. | Port | Service | Why | |---|---|---| | 8080 | mockway | Scaleway HTTP API mock | | 8081 | fakegcp | GCP API mock | | 8082 | fakeaws | AWS API mock | | 9090 | SeaweedFS | S3-compatible backend Docker; AWS-only scenarios | | 9091 | s3router S80 | HTTP shim that fans S3 traffic across SeaweedFS data plane and fakeaws ?publicAccessBlock subresource SeaweedFS doesn't model . infrafactory.yaml s3.url points here, not directly at SeaweedFS. See cmd/s3router/ . | | 4173 | infrafactory UI | SvelteKit dashboard + scenario runner | After make up , any of these run against the same stack: ./bin/infrafactory run scenarios/training/gcp-full-stack.yaml cloud: gcp → fakegcp ./bin/infrafactory run scenarios/training/aws-full-stack.yaml cloud: aws → fakeaws ./bin/infrafactory run scenarios/training/full-stack-paris.yaml cloud: scaleway → mockway There are 39 scenarios under scenarios/training/ . Inspect generated HCL at output/