Mermaid and infrastructure as code¶
Both importers produce an ordinary spec that you can edit and render with finalize. They report what they could not map instead of guessing silently.
Mermaid → spec¶
archify-azure import mermaid flow.mmd -o spec.json --title "Orders" [--number] [--render]
cat flow.mmd | archify-azure import mermaid - -o spec.json
flowchart/graph: node shapes,A --> B --> Cchains,A & B, labelled (-->|x|,-- x -->) and dashed edges, nestedsubgraphs. Subgraph titles that name Azure boundaries (Azure, Management group, Subscription, Region, Resource group, VNet, Subnet, public/private subnet, NSG, Availability zone/set, on-prem/data center) become those group kinds; others become generic groups. Nodes are layered left → right (LR) or top → down (TD) from the edges.sequenceDiagram: participants and actors (asaliases),->>sync,-->>return,-)async, self messages,Note over, andloop/alt/opt/par … else/and … end.- Icons are guessed conservatively: exact service name or alias → Azure keyword table → strict catalog search → a generic icon. The command lists everything that was not an exact match; review those. Mermaid colours and
classDefstyling are ignored;stateDiagramis not supported. --numbernumbers the edges as steps;--renderrenders immediately.
Terraform / Bicep / ARM → spec¶
- Reads Terraform
azurerm_*resources (*.tf), Bicep (*.bicep:resource sym 'Type@version' = {…}, includingexisting) and ARM JSON templates. The scanners are zero-dependency and not full parsers: no modules,for_each/copyloops or conditional expansion — runbicep buildand import the ARM JSON if a Bicep file is too dynamic. - A resource that references another becomes an edge ("uses"). Glue resources (Event Grid subscriptions, API Management APIs and backends, diagnostic settings, role assignments, Key Vault secrets and access policies, private DNS links…) are not drawn; they are resolved into edges between the real services. ARM
dependsOnandresourceId()references are followed. - Resources with virtual network wiring (
subnet_id,virtual_network_subnet_id,delegated_subnet_id,vnet_integration_subnet_id,subnetId…) are grouped inside a virtual network. - Resource groups, role assignments, diagnostic settings, secrets, subnets and unknown types are skipped and counted;
--include logs,iamalso shows Log Analytics workspaces and managed identities.
Treat the result as a draft
A reference shows dependency, not necessarily runtime traffic. Add step numbers, labels and usage after importing, then run finalize.
Examples: examples/mermaid/ and examples/iac/ (a Terraform stack and a Bicep file with their generated specs and pages).