A proof-of-concept web application that turns Azure architecture diagrams into deployable Terraform configurations, runs Terraform against Azure, and produces testing/build documentation from the resulting infrastructure state.
Upload or draw an architecture diagram, let agents interpret it into Terraform variables, deploy to Azure, and receive test/build documents — all stored with history, login, and configurable LLM settings.
- Login page (single-user authentication).
- Diagram upload page (PDF/image) and in-browser editor page (React Flow-style node/edge editor).
- "Run deployment" wizard showing diagram, tfvars preview, and plan/apply controls.
- LLM settings page for provider, API key, and default model selection.
- History/results view with artifact downloads (tfvars, test plan, build doc, logs).
- API server exposing auth, project, diagram, generation, deployment, settings, and artifact endpoints.
- Agent Orchestrator that loads personas from
agents.md, manages pipelines, and calls configured LLM models. - Terraform Runner that writes per-run working directories and wraps
terraform init/plan/apply. - Document Generator that builds
.docxtest plans and build documents.
- Relational DB (PostgreSQL or SQLite for POC) for users, projects, runs, LLM configs, and documents.
- Azure Blob Storage for diagrams, generated tfvars, Terraform logs/state, and Word documents.
- Hosting: Azure App Service or Azure Container Apps.
- Database: Azure Database for PostgreSQL (flexible server recommended for POC simplicity).
- Storage: Azure Blob Storage (for diagrams, docs, tf artifacts).
- Identity: Managed identity or service principal for the Terraform AzureRM provider.
-
Upload/draw diagram
- POST
/api/projects/{projectId}/diagram/uploadaccepts PDF/image, validates, and stores in Blob Storage with DB record. - Diagram editor saves structured JSON via POST
/api/projects/{projectId}/diagram/editor-json(preferred source for generation).
- POST
-
Generate Terraform parameters
- POST
/api/projects/{id}/generate-tfvarskicks off job. - Pipeline steps:
- Diagram Parser (vision, gpt-4o) →
infra_modelJSON of Azure resources/relationships. - Terraform Parameter Generator (reasoning, gpt-5.1) →
tfvars_jsonmatching module schema. - Terraform Validator (pro, gpt-4.1) → quality checks, corrections, warnings.
- Diagram Parser (vision, gpt-4o) →
- Renders
.tfvarsfile to Blob Storage and marks run asready_for_deploy.
- POST
-
Deploy with Terraform
- POST
/api/projects/{id}/deploywithrun_mode(planorapply). - Writes working dir (
/tf-runs/{run_id}/), runsterraform init/plan/apply, captures logs/state, uploads to Blob Storage, updates run status (planned,deployed,failed).
- POST
-
Generate documents
- After plan/apply, read Terraform state or Azure resource list.
- Test Plan Designer (gpt-4.1/gpt-5.1) outputs structured test cases → converted to
.docxtest plan. - Build Doc Structurer (gpt-4.1) groups resources for tabular build doc →
.docxfile. - Documents stored and linked to the run.
-
History & artifacts
- UI shows runs with statuses, tfvars JSON preview, plan/apply logs, and download links for tfvars/test-plan/build-doc.
- users: id, username, password_hash, created_at.
- projects: id, name, description, created_by_user_id, created_at.
- diagrams: id, project_id, file_url, editor_json, mime_type, created_at.
- runs: id, project_id, status, infra_model_json, tfvars_json, tfvars_file_url, terraform_log_url, terraform_state_url, started_at, finished_at.
- documents: id, run_id, type (
test_plan,build_doc), file_url, created_at. - llm_configs: id, user_id, provider, api_key_encrypted, base_url, default_vision_model, default_reasoning_model, default_pro_model, created_at.
- agents: id, name, role, model, prompt_template, config_json, source.
- Store secrets (LLM keys, Azure credentials) in environment variables/Key Vault; encrypt API keys at rest.
- Use HTTPS, secure cookies/JWT even for single-user mode.
- Maintain audit logs per run (timestamps, artifacts). Provide a kill-switch to disable
terraform applyfor demo environments.
- Vision:
gpt-4ofor diagram parsing. - Reasoning:
gpt-5.1for Terraform and complex orchestration. - Pro/validator:
gpt-4.1for checks, summaries, and fast responses. - Optional:
gpt-image-1-minifor future diagram generation.
- Agents/personas are parsed from a remote
agents.md(configurable URL) into a registry. - Pipelines:
diagram_to_tfvars: DiagramParser → TerraformArchitect → TerraformValidator.deploy_and_docs: TerraformRunner → TestPlanWriter → BuildDocWriter.
- Inputs/outputs are stored per run; avoid logging secrets.
- Login, dashboard, project list, "New design" action.
- Diagram upload/editor pages with palette (resource group, VNet, subnet, VM, AKS, storage account, etc.).
- Run page showing diagram, tfvars preview, plan/apply actions, and status.
- Results: artifact downloads and log links.
- Settings → LLM: provider, API key (write-only), model choices, agents source + reload control.
- Package backend + frontend for Azure App Service/Container Apps; include Terraform CLI in image or sidecar.
- Use managed identity/service principal for AzureRM provider authentication.
- Prefer remote Terraform state (Azure Storage backend) for multi-run safety; fall back to local state uploaded to Blob for POC.