Scenario YAML
Declare resources, cloud target, and acceptance criteria in one small contract.
{ Infrastructure factory for AI agents }
InfraFactory turns scenario YAML into OpenTofu, runs it through deterministic cloud mocks for AWS, GCP, and Scaleway, then feeds structured failures back into the next agent iteration.
$ make build
$ make mocks-up
$ ./bin/infrafactory run scenarios/training/gcp-full-stack.yaml
scenario gcp-full-stack
cloud gcp
generation plan -> hcl -> self-review
validation static -> fakegcp -> destroy
Status: success
terminal_reason: target_reached
What you get
Describe what should exist, define the checks that prove it works, and let the factory generate, apply, inspect, repair, and destroy the infrastructure.
Declare resources, cloud target, and acceptance criteria in one small contract.
Agent loop plans architecture, writes HCL, and self-reviews before validation.
Run generated infrastructure against fakeaws, fakegcp, or mockway locally.
OPA checks run against both planned state and applied mock state.
Ask whether compute can reach databases, load balancers are public, and resources connect.
Validation failures become machine-readable context for the next agent attempt.
Promote the same scenario to real cloud APIs with sandbox deployment enabled.
Every run can prove cleanup by destroying resources and checking for orphans.
Scenario contract
The scenario is not a replacement for Terraform. It is the contract the agent works against: resources describe intent, acceptance criteria describe evidence, and the validation loop decides whether the generated infrastructure is good enough.
scenario: full-stack-paris
cloud: scaleway
resources:
compute: { purpose: web-server, size: small }
networking: { vpc: true, private_network: true }
database: { engine: postgresql, size: small }
redis: { purpose: cache, size: small }
acceptance_criteria:
- type: policy
check: encryption_at_rest
expect: pass
- type: destruction
expect: no_orphans
Validation
`tofu init`, `validate`, `plan`, provider schema checks, and OPA rules over plan JSON.
Apply against a deterministic cloud twin and inspect the resulting state.
Optional sandbox apply against real AWS, GCP, or Scaleway APIs with probes.
Run destroy, check for orphans, and keep the run artefacts as evidence.
Demo
Get started
InfraFactory expects sibling mock repositories for local cloud validation.
git clone https://github.com/redscaresu/infrafactory.git
Start mockway, fakegcp, and fakeaws on local ports.
make build && make mocks-up
No cloud credentials are required for Layer 2 mock validation.
./bin/infrafactory run scenarios/training/gcp-full-stack.yaml
Why this exists
FAQ
No. InfraFactory generates OpenTofu/Terraform-compatible HCL, executes it, validates it, and stores the evidence.
No for local mock validation. Real cloud deployment is optional and explicitly gated.
InfraFactory currently targets AWS, GCP, and Scaleway through fakeaws, fakegcp, and mockway.
It gives agents a feedback loop: apply the generated infrastructure, inspect what happened, and repair with concrete evidence instead of guesswork.
Open source, scenario-driven, and designed for agentic infrastructure workflows.
View on GitHub