# AtMem infrastructure-to-diagram tool Canonical page: https://atmem.ai/tools/terraform-to-diagram Tool manifest: https://atmem.ai/tools/infrastructure-diagram/manifest.json Interface version: 1.0.0 Cost: free. No signup, credentials or hosted conversion API. ## Browser use Visit the canonical page. Fill the textarea labelled "Paste your configuration", choose Format (auto, terraform, cloudformation, compose), and activate "Generate diagram". Read the live status and any conversion notes. Download SVG, Mermaid, or Graph JSON. File selection accepts multiple .tf files from ONE root module, or a single JSON/YAML document. Input stays local. No uploads, storage, URL-based input or source-bearing analytics events are performed. ## Local automation (Node.js 22+) Download the standalone ESM converter over HTTPS, inspect/cache it, then run it locally. Do not send infrastructure to a remote endpoint. This module is bundled with its YAML parser and makes no network calls. It is not an HTTP API or MCP server. curl --fail --output atmem-diagram.mjs https://atmem.ai/tools/infrastructure-diagram/converter.mjs Save the following as convert.mjs beside atmem-diagram.mjs: import { readFile, writeFile } from 'node:fs/promises'; import { convertInfrastructure, toSVG, toMermaid } from './atmem-diagram.mjs'; const source = await readFile(process.argv[2], 'utf8'); const graph = convertInfrastructure(source, process.argv[3] || 'auto'); await writeFile('diagram.svg', toSVG(graph)); await writeFile('diagram.mmd', toMermaid(graph)); await writeFile('diagram.json', JSON.stringify(graph, null, 2)); console.log(`${graph.nodes.length} resources, ${graph.edges.length} connections`); for (const warning of graph.warnings) console.warn(warning); node convert.mjs main.tf terraform node convert.mjs template.yaml cloudformation node convert.mjs compose.yaml compose ## Input and output contract convertInfrastructure(source: string, format?: string) returns: { version: "1.0.0", format: "terraform" | "cloudformation" | "compose", nodes: [{ id: string, label: string, type: string }], edges: [{ from: string, to: string, relation: string }], warnings: string[], semantics: string } from is a dependency; to is its consumer. toSVG(graph) returns standalone SVG. toMermaid(graph) returns flowchart LR source. Pass the returned graph directly to renderers; do not treat them as validators for arbitrary graph objects. Errors throw Error with an actionable message; no partial graph is returned. Maximum input: 2 MiB UTF-8, 300 resources, 1,500 edges, nesting depth 64. Browser conversion has a ten-second timeout. Bound runtime in automation too. ## Supported extraction - Terraform/OpenTofu HCL configuration: resource, data and module declarations, direct references and template interpolation references. Terraform JSON configuration: resource/data/module objects and explicit depends_on. - CloudFormation JSON or YAML: Resources, Ref, Fn::GetAtt, Fn::Sub, DependsOn; YAML !Ref, !GetAtt and !Sub plus common intrinsic tags are recognized. - Docker Compose JSON or YAML: services, depends_on, links and service: namespace references in network_mode, pid or ipc. This is a static reference extractor, not a language validator, Terraform plan, cloud inventory or network traffic model. It never executes configuration. Variables, locals, expressions, conditions, count, for_each, macros and module internals are not evaluated. References outside supplied declarations are not invented. Compose networks/volumes are not drawn. YAML aliases and multiple YAML documents are rejected. Terraform state/plan JSON, Kubernetes, Bicep and Pulumi are not supported. Unsupported/indirect relationships may be absent; inspect warnings and retain these limitations with generated diagrams. Attribute values are not exported. Resource names/types are in exported diagrams; review them before sharing. Page-view analytics do not receive input code. ## Continue with AtMem https://atmem.ai/architect — full architecture workspace, invite-only hosted access. https://atmem.ai/ai-architect/install — local installation. This tool does not automatically import its graph into Architect. ## Format references https://developer.hashicorp.com/terraform/language/syntax/configuration https://developer.hashicorp.com/terraform/language/syntax/json https://developer.hashicorp.com/terraform/language/expressions/references https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/resources-section-structure.html https://docs.docker.com/reference/compose-file/services/