<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>Forem: Raghvendra Pandey</title>
    <description>The latest articles on Forem by Raghvendra Pandey (@pandey-raghvendra).</description>
    <link>https://forem.com/pandey-raghvendra</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F3031233%2F3db6d024-1e58-41bb-983a-cb43818587d0.png</url>
      <title>Forem: Raghvendra Pandey</title>
      <link>https://forem.com/pandey-raghvendra</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://forem.com/feed/pandey-raghvendra"/>
    <language>en</language>
    <item>
      <title>Generate IaC Architecture Diagrams Inside Claude Code and Cursor with InfraSketch MCP</title>
      <dc:creator>Raghvendra Pandey</dc:creator>
      <pubDate>Thu, 14 May 2026 00:51:46 +0000</pubDate>
      <link>https://forem.com/pandey-raghvendra/generate-iac-architecture-diagrams-inside-claude-code-and-cursor-with-infrasketch-mcp-43be</link>
      <guid>https://forem.com/pandey-raghvendra/generate-iac-architecture-diagrams-inside-claude-code-and-cursor-with-infrasketch-mcp-43be</guid>
      <description>&lt;p&gt;&lt;strong&gt;TL;DR:&lt;/strong&gt; Install the InfraSketch MCP server with one command (&lt;code&gt;claude mcp add infrasketch -- npx infrasketch-mcp&lt;/code&gt;), then ask Claude Code to diagram any Terraform, Kubernetes, or Pulumi code without leaving your editor. The diagram opens in your browser, your code never leaves your machine.&lt;/p&gt;

&lt;h2&gt;
  
  
  The context-switching problem: diagrams while you code
&lt;/h2&gt;

&lt;p&gt;AI editors like Claude Code, Cursor, and Windsurf have gotten surprisingly good at infrastructure work. You can paste a 2,000-line Terraform module into context, ask it to refactor a subnet configuration, and get a working diff in seconds. But ask it to show you an architecture diagram of that same code? Until recently, the answer was "open a browser, paste it somewhere else, render it there."&lt;/p&gt;

&lt;p&gt;That break is annoying in a specific way. It's not just the thirty seconds — it's that you lose the thread. The AI has been building context about your codebase, your constraints, what you're trying to do. When you jump to another tool and come back, you're starting that context fresh.&lt;/p&gt;

&lt;p&gt;The InfraSketch MCP server fixes this by adding diagram generation as a tool your AI assistant can call natively. Two tools: &lt;code&gt;generate_diagram&lt;/code&gt; and &lt;code&gt;detect_iac_format&lt;/code&gt;. Ask Claude "can you show me a diagram of this?" and it calls the tool, gets a URL, and includes it in its response. You never left the editor.&lt;/p&gt;

&lt;h2&gt;
  
  
  What is MCP and why it matters for infrastructure teams
&lt;/h2&gt;

&lt;p&gt;Model Context Protocol (MCP) is an open standard developed by Anthropic that lets AI assistants communicate with external tools and services through a standardized interface. Instead of an AI assistant being limited to the text in its context window, MCP lets it call out to tools — read files, run searches, query APIs, generate artifacts — and incorporate the results back into the conversation.&lt;/p&gt;

&lt;p&gt;For infrastructure teams the implication is straightforward: your AI assistant can now do things that previously required leaving the editor:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Look up the current state of a Terraform resource in a cloud account&lt;/li&gt;
&lt;li&gt;Check a security scanner for misconfigurations&lt;/li&gt;
&lt;li&gt;Generate an architecture diagram of whatever code it's currently looking at&lt;/li&gt;
&lt;li&gt;Figure out what IaC format a file is before processing it&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;MCP servers are lightweight processes that run locally alongside your editor. They communicate with the AI assistant over a stdio or SSE transport — there's no cloud intermediary. The InfraSketch MCP server is published as &lt;code&gt;infrasketch-mcp&lt;/code&gt; on npm and requires only Node.js to run.&lt;/p&gt;

&lt;h2&gt;
  
  
  Installing infrasketch-mcp (npx, global, Claude Code one-liner)
&lt;/h2&gt;

&lt;p&gt;The fastest way to install is the Claude Code one-liner, which registers the MCP server in your Claude Code configuration in a single command:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;claude mcp add infrasketch &lt;span class="nt"&gt;--&lt;/span&gt; npx infrasketch-mcp
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;This tells Claude Code to start the InfraSketch MCP server on demand using npx, which downloads and runs the package without a global install. The server starts fresh each session and exits when Claude Code closes — no persistent daemon.&lt;/p&gt;

&lt;p&gt;If you prefer a global install to avoid npx startup overhead:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;npm &lt;span class="nb"&gt;install&lt;/span&gt; &lt;span class="nt"&gt;-g&lt;/span&gt; infrasketch-mcp
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Then reference it directly in your MCP configuration as &lt;code&gt;infrasketch-mcp&lt;/code&gt; instead of &lt;code&gt;npx infrasketch-mcp&lt;/code&gt;.&lt;/p&gt;

&lt;h2&gt;
  
  
  Setup: Claude Code (claude mcp add command + settings.json method)
&lt;/h2&gt;

&lt;p&gt;After running the &lt;code&gt;claude mcp add&lt;/code&gt; command above, the server is registered automatically. To verify it's registered correctly, run:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;claude mcp list
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;You should see &lt;code&gt;infrasketch&lt;/code&gt; in the list. If you prefer to configure it manually, or if you're deploying a shared configuration to a team, edit your Claude Code MCP settings file at &lt;code&gt;~/.claude/settings.json&lt;/code&gt; and add the server to the &lt;code&gt;mcpServers&lt;/code&gt; object:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight json"&gt;&lt;code&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="w"&gt;
&lt;/span&gt;&lt;span class="nl"&gt;"mcpServers"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="w"&gt;
&lt;/span&gt;&lt;span class="nl"&gt;"infrasketch"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="w"&gt;
&lt;/span&gt;&lt;span class="nl"&gt;"command"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"npx"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
&lt;/span&gt;&lt;span class="nl"&gt;"args"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="s2"&gt;"infrasketch-mcp"&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt;&lt;span class="w"&gt;
&lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="w"&gt;
&lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="w"&gt;
&lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="w"&gt;
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;For project-level configuration (useful when you want to check the MCP config into your repository so the whole team gets it automatically), create or edit &lt;code&gt;.claude/settings.json&lt;/code&gt; in your project root:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight json"&gt;&lt;code&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="w"&gt;
&lt;/span&gt;&lt;span class="nl"&gt;"mcpServers"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="w"&gt;
&lt;/span&gt;&lt;span class="nl"&gt;"infrasketch"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="w"&gt;
&lt;/span&gt;&lt;span class="nl"&gt;"command"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"npx"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
&lt;/span&gt;&lt;span class="nl"&gt;"args"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="s2"&gt;"infrasketch-mcp"&lt;/span&gt;&lt;span class="p"&gt;],&lt;/span&gt;&lt;span class="w"&gt;
&lt;/span&gt;&lt;span class="nl"&gt;"description"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"Generate architecture diagrams from IaC code"&lt;/span&gt;&lt;span class="w"&gt;
&lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="w"&gt;
&lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="w"&gt;
&lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="w"&gt;
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;After editing the settings file, restart Claude Code for the changes to take effect. The MCP server will be available in all sessions in that project.&lt;/p&gt;

&lt;h2&gt;
  
  
  Setup: Cursor and Windsurf
&lt;/h2&gt;

&lt;p&gt;Cursor uses the same MCP configuration format. Create or edit &lt;code&gt;~/.cursor/mcp.json&lt;/code&gt; (for global configuration) or &lt;code&gt;.cursor/mcp.json&lt;/code&gt; in your project root:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight json"&gt;&lt;code&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="w"&gt;
&lt;/span&gt;&lt;span class="nl"&gt;"mcpServers"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="w"&gt;
&lt;/span&gt;&lt;span class="nl"&gt;"infrasketch"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="w"&gt;
&lt;/span&gt;&lt;span class="nl"&gt;"command"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"npx"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
&lt;/span&gt;&lt;span class="nl"&gt;"args"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="s2"&gt;"infrasketch-mcp"&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt;&lt;span class="w"&gt;
&lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="w"&gt;
&lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="w"&gt;
&lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="w"&gt;
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;In Cursor, go to &lt;strong&gt;Settings → MCP&lt;/strong&gt; to verify the server appears and shows a green connected status. You may need to click "Reload MCP Servers" after saving the config file.&lt;/p&gt;

&lt;p&gt;Windsurf follows the same pattern. Edit &lt;code&gt;~/.windsurf/mcp.json&lt;/code&gt; with the same configuration block. Once the server is connected, both Cursor's Composer and Windsurf's Cascade will have access to the InfraSketch tools and can call them in response to natural language prompts about your infrastructure code.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Node.js required:&lt;/strong&gt; The MCP server requires Node.js 18 or later. Run &lt;code&gt;node --version&lt;/code&gt; to check. If you're using a version manager like nvm or fnm, make sure the active version is 18+ before starting your editor.&lt;/p&gt;

&lt;h2&gt;
  
  
  The generate_diagram tool in action (with example prompt + example output)
&lt;/h2&gt;

&lt;p&gt;Once the MCP server is connected, you can ask Claude to generate diagrams in natural language. You don't need to know the tool name or its parameters — just describe what you want:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight terraform"&gt;&lt;code&gt;&lt;span class="nx"&gt;Generate&lt;/span&gt; &lt;span class="nx"&gt;a&lt;/span&gt; &lt;span class="nx"&gt;diagram&lt;/span&gt; &lt;span class="nx"&gt;for&lt;/span&gt; &lt;span class="nx"&gt;this&lt;/span&gt; &lt;span class="k"&gt;terraform&lt;/span&gt; &lt;span class="nx"&gt;code&lt;/span&gt;&lt;span class="err"&gt;:&lt;/span&gt;

&lt;span class="k"&gt;resource&lt;/span&gt; &lt;span class="s2"&gt;"aws_vpc"&lt;/span&gt; &lt;span class="s2"&gt;"main"&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
&lt;span class="nx"&gt;cidr_block&lt;/span&gt; &lt;span class="p"&gt;=&lt;/span&gt; &lt;span class="s2"&gt;"10.0.0.0/16"&lt;/span&gt;
&lt;span class="nx"&gt;tags&lt;/span&gt; &lt;span class="p"&gt;=&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="nx"&gt;Name&lt;/span&gt; &lt;span class="p"&gt;=&lt;/span&gt; &lt;span class="s2"&gt;"main-vpc"&lt;/span&gt; &lt;span class="p"&gt;}&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;

&lt;span class="k"&gt;resource&lt;/span&gt; &lt;span class="s2"&gt;"aws_subnet"&lt;/span&gt; &lt;span class="s2"&gt;"public"&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
&lt;span class="nx"&gt;vpc_id&lt;/span&gt;            &lt;span class="p"&gt;=&lt;/span&gt; &lt;span class="nx"&gt;aws_vpc&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;main&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;id&lt;/span&gt;
&lt;span class="nx"&gt;cidr_block&lt;/span&gt;        &lt;span class="p"&gt;=&lt;/span&gt; &lt;span class="s2"&gt;"10.0.1.0/24"&lt;/span&gt;
&lt;span class="nx"&gt;availability_zone&lt;/span&gt; &lt;span class="p"&gt;=&lt;/span&gt; &lt;span class="s2"&gt;"us-east-1a"&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;

&lt;span class="k"&gt;resource&lt;/span&gt; &lt;span class="s2"&gt;"aws_internet_gateway"&lt;/span&gt; &lt;span class="s2"&gt;"igw"&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
&lt;span class="nx"&gt;vpc_id&lt;/span&gt; &lt;span class="p"&gt;=&lt;/span&gt; &lt;span class="nx"&gt;aws_vpc&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;main&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;id&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;

&lt;span class="k"&gt;resource&lt;/span&gt; &lt;span class="s2"&gt;"aws_route_table"&lt;/span&gt; &lt;span class="s2"&gt;"public"&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
&lt;span class="nx"&gt;vpc_id&lt;/span&gt; &lt;span class="p"&gt;=&lt;/span&gt; &lt;span class="nx"&gt;aws_vpc&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;main&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;id&lt;/span&gt;
&lt;span class="nx"&gt;route&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
&lt;span class="nx"&gt;cidr_block&lt;/span&gt; &lt;span class="p"&gt;=&lt;/span&gt; &lt;span class="s2"&gt;"0.0.0.0/0"&lt;/span&gt;
&lt;span class="nx"&gt;gateway_id&lt;/span&gt; &lt;span class="p"&gt;=&lt;/span&gt; &lt;span class="nx"&gt;aws_internet_gateway&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;igw&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;id&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;

&lt;span class="k"&gt;resource&lt;/span&gt; &lt;span class="s2"&gt;"aws_route_table_association"&lt;/span&gt; &lt;span class="s2"&gt;"public"&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
&lt;span class="nx"&gt;subnet_id&lt;/span&gt;      &lt;span class="p"&gt;=&lt;/span&gt; &lt;span class="nx"&gt;aws_subnet&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;public&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;id&lt;/span&gt;
&lt;span class="nx"&gt;route_table_id&lt;/span&gt; &lt;span class="p"&gt;=&lt;/span&gt; &lt;span class="nx"&gt;aws_route_table&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;public&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;id&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Claude will call the &lt;code&gt;generate_diagram&lt;/code&gt; MCP tool with the code and format, and return something like:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;Here's your architecture diagram:

**[View Interactive Diagram](https://infrasketch.cloud/#eJyVVdtu2zgQffdXEH...)**

The diagram shows:
- **VPC** (10.0.0.0/16) as the top-level container
- **Public Subnet** (10.0.1.0/24) in us-east-1a inside the VPC
- **Internet Gateway** attached to the VPC
- **Route Table** with a default route (0.0.0.0/0) pointing to the IGW
- **Route Table Association** linking the public subnet to the route table

You can click the link to open an interactive, zoomable diagram in your browser.

&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The diagram URL is a permanent shareable link. The iframe embed lets you paste the diagram directly into documentation, Notion, Confluence, or any HTML page. The AI assistant also provides a human-readable summary of what the diagram shows, which is useful for accessibility and for quickly confirming the rendering is correct without opening a browser.&lt;/p&gt;

&lt;h2&gt;
  
  
  The detect_iac_format tool
&lt;/h2&gt;

&lt;p&gt;The second tool exposed by the MCP server is &lt;code&gt;detect_iac_format&lt;/code&gt;. This is useful when you have an ambiguous file and want the AI to determine its format before processing it. You can invoke it explicitly:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight yaml"&gt;&lt;code&gt;&lt;span class="s"&gt;What IaC format is this file?&lt;/span&gt;

&lt;span class="na"&gt;apiVersion&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;apps/v1&lt;/span&gt;
&lt;span class="na"&gt;kind&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;Deployment&lt;/span&gt;
&lt;span class="na"&gt;metadata&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;
&lt;span class="na"&gt;name&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;nginx-deployment&lt;/span&gt;
&lt;span class="na"&gt;spec&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;
&lt;span class="na"&gt;replicas&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="m"&gt;3&lt;/span&gt;
&lt;span class="na"&gt;selector&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;
&lt;span class="na"&gt;matchLabels&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;
&lt;span class="na"&gt;app&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;nginx&lt;/span&gt;
&lt;span class="na"&gt;template&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;
&lt;span class="na"&gt;metadata&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;
&lt;span class="na"&gt;labels&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;
&lt;span class="na"&gt;app&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;nginx&lt;/span&gt;
&lt;span class="na"&gt;spec&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;
&lt;span class="na"&gt;containers&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;
&lt;span class="pi"&gt;-&lt;/span&gt; &lt;span class="na"&gt;name&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;nginx&lt;/span&gt;
&lt;span class="na"&gt;image&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;nginx:1.21&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The tool returns the detected format (&lt;code&gt;kubernetes&lt;/code&gt; in this case) along with a confidence score. Claude Code will then use this information to call &lt;code&gt;generate_diagram&lt;/code&gt; with the correct &lt;code&gt;type&lt;/code&gt; parameter, producing an accurate diagram for Kubernetes resources rather than trying to parse it as Terraform or CloudFormation.&lt;/p&gt;

&lt;p&gt;In practice, the format detection runs automatically when you ask for a diagram — you rarely need to invoke it explicitly. It's most useful in agentic workflows where code is being passed programmatically and the format isn't known in advance.&lt;/p&gt;

&lt;h2&gt;
  
  
  Real workflow: reviewing a Terraform PR with Claude + InfraSketch
&lt;/h2&gt;

&lt;p&gt;Concrete example. A teammate opens a PR adding an ECS cluster with autoscaling to an existing VPC. You're reviewing it in Claude Code:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Ask Claude to show you what changed: "What's different in the terraform/ directory compared to main?" It reads the diff and summarizes.&lt;/li&gt;
&lt;li&gt;"Generate a diagram of the full terraform/environments/prod/ directory so I can see how the ECS cluster fits in." Claude calls &lt;code&gt;generate_diagram&lt;/code&gt;, gets a URL back.&lt;/li&gt;
&lt;li&gt;Click the URL. You get an interactive, zoomable diagram — ECS cluster, task definitions, ALB, target groups, VPC subnets, security groups, all in one view.&lt;/li&gt;
&lt;li&gt;Back in Claude: "The ECS tasks are in the public subnet. Intentional?" Claude already has all the code in context and can answer immediately.&lt;/li&gt;
&lt;li&gt;Your review comment is specific — "the ECS tasks should be in the private subnet per our networking standards, the security group on line 43 is too permissive" — not just "looks good" or a vague worry about networking.&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;Reading HCL line by line is fine for small changes. For anything spanning multiple resources and subnets, the diagram gets you oriented in about ten seconds instead of ten minutes.&lt;/p&gt;

&lt;p&gt;For teams that want this diagram to appear automatically on every PR without any manual step, the &lt;a href="///blog/github-action-terraform-diagram.html"&gt;GitHub Action (&lt;code&gt;pandey-raghvendra/infrasketch@v4&lt;/code&gt;)&lt;/a&gt; posts the diagram as a PR comment whenever Terraform files change.&lt;/p&gt;

&lt;h2&gt;
  
  
  How the URL is generated (no upload, privacy-first, works offline)
&lt;/h2&gt;

&lt;p&gt;The MCP server uses the same URL-encoding approach as the CLI and browser tool. When &lt;code&gt;generate_diagram&lt;/code&gt; is called:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;The code is serialized into a JSON envelope with the detected format&lt;/li&gt;
&lt;li&gt;The JSON is compressed with gzip and base64-encoded&lt;/li&gt;
&lt;li&gt;The encoded string is appended as a URL fragment to &lt;code&gt;https://infrasketch.cloud/&lt;/code&gt;
&lt;/li&gt;
&lt;li&gt;The resulting URL is returned to the AI assistant, which includes it in its response&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;The MCP server process runs entirely on your machine. It never makes outbound HTTP requests to InfraSketch servers. The URL it generates encodes your code in the fragment, which — by the HTTP specification — is never transmitted to a server. When you open the URL in a browser, the InfraSketch web app decodes and renders the diagram entirely client-side.&lt;/p&gt;

&lt;p&gt;This means the tool works in air-gapped environments (as long as your browser can load the web app), needs no API keys, stores nothing server-side, and leaves no audit trail. If your team has strict data residency requirements, that matters. Cloud-hosted diagramming APIs typically process your code on their servers — this one doesn't, by design.&lt;/p&gt;

&lt;h2&gt;
  
  
  Combining MCP with CLI and embed for full workflow
&lt;/h2&gt;

&lt;p&gt;The MCP server, CLI, and embed component are designed to complement each other across different parts of the development lifecycle:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;MCP server&lt;/strong&gt; — Use during active coding and code review inside your AI editor. Get diagrams inline without leaving your editor or conversation.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;CLI (npx infrasketch)&lt;/strong&gt; — Use for quick local checks, scripting, and CI pipelines. See the &lt;a href="///blog/infrasketch-cli-terraform-diagram.html"&gt;CLI guide&lt;/a&gt; for full details.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;GitHub Action&lt;/strong&gt; — Use for automated PR comments. Zero friction for reviewers — the diagram appears without anyone running a command.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Embed web component&lt;/strong&gt; — Use for documentation, runbooks, and internal wikis. Keep diagrams live and synchronized with the source code.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;In practice, a team that's using all four ends up with: MCP for daily coding and reviews, CLI for pre-commit sanity checks and one-off scripting, the GitHub Action for automated PR comments, and embed for the internal docs wiki. Every diagram comes from the same source of truth. Nothing ever gets uploaded.&lt;/p&gt;

&lt;h2&gt;
  
  
  Supported formats and limitations
&lt;/h2&gt;

&lt;p&gt;The MCP server supports the same eight IaC formats as the web tool and CLI:&lt;/p&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Format&lt;/th&gt;
&lt;th&gt;Auto-detected&lt;/th&gt;
&lt;th&gt;Multi-file support&lt;/th&gt;
&lt;th&gt;Notes&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;terraform&lt;/td&gt;
&lt;td&gt;Yes (.tf extension)&lt;/td&gt;
&lt;td&gt;Yes (concatenated)&lt;/td&gt;
&lt;td&gt;Best coverage of all formats&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;kubernetes&lt;/td&gt;
&lt;td&gt;Yes (apiVersion field)&lt;/td&gt;
&lt;td&gt;Yes&lt;/td&gt;
&lt;td&gt;Helm chart values not rendered&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;pulumi&lt;/td&gt;
&lt;td&gt;Partial (Pulumi.yaml)&lt;/td&gt;
&lt;td&gt;Partial&lt;/td&gt;
&lt;td&gt;Heuristic extraction from source&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;cloudformation&lt;/td&gt;
&lt;td&gt;Yes (Resources key)&lt;/td&gt;
&lt;td&gt;Yes&lt;/td&gt;
&lt;td&gt;Nested stacks shown as references&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;cdk&lt;/td&gt;
&lt;td&gt;Partial&lt;/td&gt;
&lt;td&gt;Partial&lt;/td&gt;
&lt;td&gt;Works best with synthesized output&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;bicep&lt;/td&gt;
&lt;td&gt;Yes (.bicep extension)&lt;/td&gt;
&lt;td&gt;Yes&lt;/td&gt;
&lt;td&gt;Modules shown as references&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;terragrunt&lt;/td&gt;
&lt;td&gt;Yes (terragrunt.hcl)&lt;/td&gt;
&lt;td&gt;Yes&lt;/td&gt;
&lt;td&gt;Module dependency graph included&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;docker-compose&lt;/td&gt;
&lt;td&gt;Yes (services key)&lt;/td&gt;
&lt;td&gt;Single file&lt;/td&gt;
&lt;td&gt;Networks and volumes visualized&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;p&gt;The main limitation to be aware of is code size. The URL fragment approach has a practical ceiling around 2 MB of raw IaC content before browser URL limits become a concern. For most individual modules and services this is not an issue, but for very large monorepos you should point the tool at a specific subdirectory rather than the entire repository root.&lt;/p&gt;

&lt;h2&gt;
  
  
  FAQ
&lt;/h2&gt;

&lt;h3&gt;
  
  
  Does the MCP server require any API key or account?
&lt;/h3&gt;

&lt;p&gt;No. Completely free, no authentication. It runs locally and talks to your AI editor over stdio. No InfraSketch account, no key, no usage limits. Just Node.js.&lt;/p&gt;

&lt;h3&gt;
  
  
  Does my Terraform code get sent to InfraSketch servers?
&lt;/h3&gt;

&lt;p&gt;No. The MCP server encodes your code into a URL fragment. Fragments are never transmitted in HTTP requests — that's part of the HTTP spec, not something special we're doing. The InfraSketch web app decodes and renders everything in the browser. The InfraSketch server only ever serves the static HTML/JS/CSS files, same as any website.&lt;/p&gt;

&lt;h3&gt;
  
  
  Can I use the MCP server with VS Code or other editors?
&lt;/h3&gt;

&lt;p&gt;Anything that supports Model Context Protocol over stdio will work. Claude Code, Cursor, and Windsurf are the most common. VS Code has MCP support in some extensions. For editors that don't support MCP at all, the CLI and browser tool still cover most of the same use cases.&lt;/p&gt;

&lt;h3&gt;
  
  
  What happens if the diagram looks wrong?
&lt;/h3&gt;

&lt;p&gt;The MCP server passes your code to the renderer exactly as-is — no modification, no interpretation. So if the diagram is wrong, it's the renderer's parsing that's off, not how the AI called the tool. Open the interactive diagram in your browser, check what's there, and if you spot a bug file it on GitHub with the example code.&lt;/p&gt;

&lt;h3&gt;
  
  
  Can I use the MCP server in a team setting with a shared configuration?
&lt;/h3&gt;

&lt;p&gt;Yes, and this is actually the easiest setup. Add the MCP config to &lt;code&gt;.claude/settings.json&lt;/code&gt; (Claude Code) or &lt;code&gt;.cursor/mcp.json&lt;/code&gt; (Cursor) at the project root and check it into your repo. Anyone who clones gets it automatically. Since it uses &lt;code&gt;npx&lt;/code&gt;, nobody needs to install anything manually.&lt;/p&gt;

&lt;blockquote&gt;
&lt;h3&gt;
  
  
  Diagram your infrastructure without leaving your editor Add the InfraSketch MCP server to Claude Code in one command, or try the browser tool right now — no account needed. &lt;a href="https://dev.to/"&gt;Try InfraSketch Free →&lt;/a&gt;
&lt;/h3&gt;
&lt;/blockquote&gt;

</description>
      <category>mcpserveriacdiagram</category>
      <category>claudecodeterraformdiagram</category>
      <category>cursorterraformvisualization</category>
      <category>infrasketchmcp</category>
    </item>
    <item>
      <title>Visualize Terraform, Kubernetes, and Pulumi from the Terminal with npx infrasketch</title>
      <dc:creator>Raghvendra Pandey</dc:creator>
      <pubDate>Thu, 14 May 2026 00:51:43 +0000</pubDate>
      <link>https://forem.com/pandey-raghvendra/visualize-terraform-kubernetes-and-pulumi-from-the-terminal-with-npx-infrasketch-1l4k</link>
      <guid>https://forem.com/pandey-raghvendra/visualize-terraform-kubernetes-and-pulumi-from-the-terminal-with-npx-infrasketch-1l4k</guid>
      <description>&lt;p&gt;&lt;strong&gt;TL;DR:&lt;/strong&gt; Run &lt;code&gt;npx infrasketch .&lt;/code&gt; in any IaC repository to instantly open an interactive architecture diagram in your browser. No login, no install, no file upload. Works with Terraform, Kubernetes, Pulumi, CloudFormation, CDK, Bicep, Terragrunt, and Docker Compose.&lt;/p&gt;

&lt;h2&gt;
  
  
  The copy-paste problem with IaC diagrams
&lt;/h2&gt;

&lt;p&gt;You finish a Terraform module, open Lucidchart or draw.io, manually drag in an EC2 box, an RDS cylinder, an ALB arrow — 45 minutes recreating what the code already describes. Two weeks later the code changes, the diagram doesn't, and you've got a lie pinned to your Confluence page. I've seen this on every team I've worked with.&lt;/p&gt;

&lt;p&gt;The browser-based InfraSketch tool at &lt;a href="https://dev.to/"&gt;infrasketch.cloud&lt;/a&gt; cuts most of that: paste your HCL, YAML, or JSON and get an interactive diagram instantly, no account required. But there was still friction. You had to leave your terminal, copy the file contents, navigate to a website. For anyone living in the command line, that adds up over a day.&lt;/p&gt;

&lt;p&gt;The CLI removes that last step. Point it at a file, a directory, or a raw GitHub URL, and it generates the diagram and opens your browser — usually in under two seconds. In CI where there's no browser to open, &lt;code&gt;--no-open&lt;/code&gt; prints the shareable URL to stdout so you can pipe it wherever you need it.&lt;/p&gt;

&lt;h2&gt;
  
  
  What npx infrasketch does (and what it doesn't)
&lt;/h2&gt;

&lt;p&gt;The CLI is a thin Node.js wrapper published to npm as &lt;code&gt;infrasketch&lt;/code&gt;. When you run it, it reads your IaC file or directory, serializes the content into a base64-encoded JSON fragment, appends that fragment to the InfraSketch web app URL, and opens the result in your default browser.&lt;/p&gt;

&lt;p&gt;What it &lt;em&gt;doesn't&lt;/em&gt; do matters more than you'd expect:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Your code never leaves your machine — no upload, no server processing.&lt;/li&gt;
&lt;li&gt;No account, no API key, nothing to sign up for.&lt;/li&gt;
&lt;li&gt;It doesn't touch your IaC files. Read-only.&lt;/li&gt;
&lt;li&gt;No background process. It runs, opens the browser, and exits.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;The diagram is rendered entirely in the browser using the URL fragment. Browsers don't send the hash to the server — they only transmit the path and query string. So when you open &lt;code&gt;https://infrasketch.cloud/#eJy...&lt;/code&gt;, the server gets a plain &lt;code&gt;GET /&lt;/code&gt; with no idea what's in the fragment. That's not a hack; it's just how HTTP works, and we're leaning into it deliberately. It also means the tool works in air-gapped environments as long as the browser can load the InfraSketch page.&lt;/p&gt;

&lt;h2&gt;
  
  
  Zero-install usage: your first diagram in 10 seconds
&lt;/h2&gt;

&lt;p&gt;Because the CLI is on npm, you can run it immediately with &lt;code&gt;npx&lt;/code&gt; without installing anything globally. Navigate to any directory that contains IaC files and run:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;npx infrasketch &lt;span class="nb"&gt;.&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;That's it. The CLI will scan the current directory, detect the format automatically, and open your browser. If you have a mixed repository with, say, a &lt;code&gt;terraform/&lt;/code&gt; subdirectory and a &lt;code&gt;k8s/&lt;/code&gt; subdirectory, run it from the root — it will pick the dominant format or let you point it at a subdirectory.&lt;/p&gt;

&lt;p&gt;If you prefer a permanent global install to skip the npx overhead on every invocation, add it to your PATH once:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;npm &lt;span class="nb"&gt;install&lt;/span&gt; &lt;span class="nt"&gt;-g&lt;/span&gt; infrasketch
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;After that, &lt;code&gt;infrasketch .&lt;/code&gt; works from any directory, just like &lt;code&gt;terraform&lt;/code&gt; or &lt;code&gt;kubectl&lt;/code&gt;.&lt;/p&gt;

&lt;h2&gt;
  
  
  Single file mode
&lt;/h2&gt;

&lt;p&gt;When you want to diagram a specific file rather than an entire directory, pass the file path directly:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;npx infrasketch main.tf
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Single file mode is useful when you're working on a large module and want to check just the resources you're currently editing. The CLI reads only that file, so it's faster for large repositories where a full directory scan would pull in many files you don't care about right now.&lt;/p&gt;

&lt;p&gt;The format is auto-detected from the file extension and content. &lt;code&gt;.tf&lt;/code&gt; files are parsed as Terraform HCL, &lt;code&gt;.yaml&lt;/code&gt; and &lt;code&gt;.yml&lt;/code&gt; files trigger heuristic detection to distinguish between Kubernetes manifests, Docker Compose files, and CloudFormation templates. For ambiguous cases you can override with the &lt;code&gt;--type&lt;/code&gt; flag:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;npx infrasketch template.yaml &lt;span class="nt"&gt;--type&lt;/span&gt; cloudformation
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Supported values for &lt;code&gt;--type&lt;/code&gt; are: &lt;code&gt;terraform&lt;/code&gt;, &lt;code&gt;kubernetes&lt;/code&gt;, &lt;code&gt;pulumi&lt;/code&gt;, &lt;code&gt;cloudformation&lt;/code&gt;, &lt;code&gt;cdk&lt;/code&gt;, &lt;code&gt;bicep&lt;/code&gt;, &lt;code&gt;terragrunt&lt;/code&gt;, &lt;code&gt;docker-compose&lt;/code&gt;.&lt;/p&gt;

&lt;h2&gt;
  
  
  Directory scan mode — multi-file Terraform projects
&lt;/h2&gt;

&lt;p&gt;Real Terraform projects rarely live in a single file. A production module typically spans &lt;code&gt;main.tf&lt;/code&gt;, &lt;code&gt;variables.tf&lt;/code&gt;, &lt;code&gt;outputs.tf&lt;/code&gt;, &lt;code&gt;locals.tf&lt;/code&gt;, and any number of resource-specific files. Directory scan mode reads all of them and stitches them into one diagram:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;npx infrasketch ./terraform/environments/prod/
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The CLI recursively finds all &lt;code&gt;.tf&lt;/code&gt; files under the given path, concatenates their contents, and feeds the combined HCL to the diagram renderer. This gives you a complete picture of the environment rather than a partial view of whichever file you happened to open first.&lt;/p&gt;

&lt;p&gt;For Terragrunt projects where each module lives in its own subdirectory with a &lt;code&gt;terragrunt.hcl&lt;/code&gt;, point the CLI at the root of the deployment tree:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;npx infrasketch ./live/prod/ &lt;span class="nt"&gt;--type&lt;/span&gt; terragrunt
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;It will discover all &lt;code&gt;terragrunt.hcl&lt;/code&gt; files and combine the dependency graph across modules, giving you visibility into how modules reference each other — something that's notoriously hard to visualize manually.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Tip:&lt;/strong&gt; For very large Terraform codebases (hundreds of files), consider running the CLI against a specific module subdirectory rather than the repository root. The URL fragment has a practical size limit around 2 MB of raw content, which covers most real-world modules comfortably.&lt;/p&gt;

&lt;h2&gt;
  
  
  Kubernetes and Pulumi projects
&lt;/h2&gt;

&lt;p&gt;Kubernetes works the same way. Point it at a directory of YAML files and it picks up Deployments, Services, Ingresses, ConfigMaps, StatefulSets, DaemonSets — and renders how they connect:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;npx infrasketch ./k8s/ &lt;span class="nt"&gt;--type&lt;/span&gt; kubernetes
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The &lt;code&gt;--type&lt;/code&gt; flag is optional here if your YAML files have the standard &lt;code&gt;apiVersion&lt;/code&gt; and &lt;code&gt;kind&lt;/code&gt; fields — the auto-detector recognizes Kubernetes manifests reliably. But if you have a directory that mixes Kubernetes YAML with other YAML (for example, a Helm chart with both templates and values files), being explicit avoids ambiguity.&lt;/p&gt;

&lt;p&gt;For more detail on the Kubernetes diagram format and what relationships are visualized, see the &lt;a href="///blog/kubernetes-diagram-generator.html"&gt;Kubernetes diagram generator guide&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;Pulumi projects work similarly. Navigate to a Pulumi project directory (the one containing &lt;code&gt;Pulumi.yaml&lt;/code&gt;) and run:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;npx infrasketch &lt;span class="nb"&gt;.&lt;/span&gt; &lt;span class="nt"&gt;--type&lt;/span&gt; pulumi
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The CLI reads the Pulumi program source — TypeScript, Python, Go, or YAML — and extracts resource declarations. Because Pulumi programs are general-purpose code rather than declarative config, the extraction is necessarily heuristic: it looks for &lt;code&gt;new aws.ec2.Instance()&lt;/code&gt;-style patterns in TypeScript/Python and equivalent patterns in other languages. Coverage is good for standard resource declarations but may miss resources created inside complex loops or conditional logic.&lt;/p&gt;

&lt;h2&gt;
  
  
  Remote GitHub raw URL mode
&lt;/h2&gt;

&lt;p&gt;You don't have to clone a repository to diagram it. Pass any raw GitHub URL (or any other URL that returns plain text) and the CLI will fetch it, parse it, and open the diagram:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;npx infrasketch https://raw.githubusercontent.com/hashicorp/terraform-provider-aws/main/examples/two-tier/main.tf
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;This mode is particularly useful for:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Reviewing open-source Terraform modules before adding them as dependencies&lt;/li&gt;
&lt;li&gt;Quickly understanding the architecture of a reference implementation you found&lt;/li&gt;
&lt;li&gt;Sharing a diagram of a public repository without cloning it locally&lt;/li&gt;
&lt;li&gt;Generating diagrams in documentation pipelines where the source lives in a separate repo&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;The URL is fetched by the CLI process on your machine (not by the browser or any server), parsed locally, and then encoded into the diagram URL. Your network request goes to GitHub's raw content CDN, not to InfraSketch servers.&lt;/p&gt;

&lt;h2&gt;
  
  
  CI/CD pipeline integration (--no-open flag)
&lt;/h2&gt;

&lt;p&gt;In a headless CI environment there's no browser to open, so the default behavior would hang or error. The &lt;code&gt;--no-open&lt;/code&gt; flag suppresses browser launch and instead prints the diagram URL to stdout:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;npx infrasketch main.tf &lt;span class="nt"&gt;--no-open&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;This emits a single line like:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;https://infrasketch.cloud/#eJyVVdtu2zgQ...
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;You can capture this URL and use it anywhere: a PR comment, a Slack notification, a build artifact, a release note. Here's a complete GitHub Actions workflow that posts the diagram URL as a PR comment whenever Terraform files change:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight yaml"&gt;&lt;code&gt;&lt;span class="na"&gt;name&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;Terraform Diagram&lt;/span&gt;

&lt;span class="na"&gt;on&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;
&lt;span class="na"&gt;pull_request&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;
&lt;span class="na"&gt;paths&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;
&lt;span class="pi"&gt;-&lt;/span&gt; &lt;span class="s1"&gt;'&lt;/span&gt;&lt;span class="s"&gt;**.tf'&lt;/span&gt;
&lt;span class="pi"&gt;-&lt;/span&gt; &lt;span class="s1"&gt;'&lt;/span&gt;&lt;span class="s"&gt;**.tfvars'&lt;/span&gt;

&lt;span class="na"&gt;jobs&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;
&lt;span class="na"&gt;diagram&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;
&lt;span class="na"&gt;runs-on&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;ubuntu-latest&lt;/span&gt;
&lt;span class="na"&gt;permissions&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;
&lt;span class="na"&gt;pull-requests&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;write&lt;/span&gt;
&lt;span class="na"&gt;steps&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;
&lt;span class="pi"&gt;-&lt;/span&gt; &lt;span class="na"&gt;uses&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;actions/checkout@v4&lt;/span&gt;

&lt;span class="pi"&gt;-&lt;/span&gt; &lt;span class="na"&gt;name&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;Setup Node.js&lt;/span&gt;
&lt;span class="na"&gt;uses&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;actions/setup-node@v4&lt;/span&gt;
&lt;span class="na"&gt;with&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;
&lt;span class="na"&gt;node-version&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s1"&gt;'&lt;/span&gt;&lt;span class="s"&gt;20'&lt;/span&gt;

&lt;span class="pi"&gt;-&lt;/span&gt; &lt;span class="na"&gt;name&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;Generate diagram URL&lt;/span&gt;
&lt;span class="na"&gt;id&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;diagram&lt;/span&gt;
&lt;span class="na"&gt;run&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="pi"&gt;|&lt;/span&gt;
&lt;span class="err"&gt;U&lt;/span&gt;&lt;span class="s"&gt;RL=$(npx infrasketch . --no-open)&lt;/span&gt;
&lt;span class="err"&gt;e&lt;/span&gt;&lt;span class="s"&gt;cho "url=$URL" &amp;gt;&amp;gt; "$GITHUB_OUTPUT"&lt;/span&gt;

&lt;span class="err"&gt;-&lt;/span&gt;&lt;span class="s"&gt; name: Post diagram comment&lt;/span&gt;
&lt;span class="err"&gt;u&lt;/span&gt;&lt;span class="s"&gt;ses: actions/github-script@v7&lt;/span&gt;
&lt;span class="err"&gt;w&lt;/span&gt;&lt;span class="s"&gt;ith:&lt;/span&gt;
&lt;span class="err"&gt;s&lt;/span&gt;&lt;span class="s"&gt;cript: |&lt;/span&gt;
&lt;span class="err"&gt;c&lt;/span&gt;&lt;span class="s"&gt;onst url = '${{ steps.diagram.outputs.url }}';&lt;/span&gt;
&lt;span class="err"&gt;a&lt;/span&gt;&lt;span class="s"&gt;wait github.rest.issues.createComment({&lt;/span&gt;
&lt;span class="err"&gt;o&lt;/span&gt;&lt;span class="s"&gt;wner: context.repo.owner,&lt;/span&gt;
&lt;span class="err"&gt;r&lt;/span&gt;&lt;span class="s"&gt;epo: context.repo.repo,&lt;/span&gt;
&lt;span class="err"&gt;i&lt;/span&gt;&lt;span class="s"&gt;ssue_number: context.issue.number,&lt;/span&gt;
&lt;span class="err"&gt;b&lt;/span&gt;&lt;span class="s"&gt;ody: `## Architecture Diagram\n\n[View interactive diagram](${url})\n\n&amp;gt; Generated by InfraSketch CLI`&lt;/span&gt;
&lt;span class="err"&gt;}&lt;/span&gt;&lt;span class="s"&gt;);&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;If you'd rather use the purpose-built GitHub Action instead of the raw CLI in CI, see the &lt;a href="///blog/github-action-terraform-diagram.html"&gt;GitHub Action guide&lt;/a&gt; — it handles the comment posting and diff detection automatically with less boilerplate.&lt;/p&gt;

&lt;h2&gt;
  
  
  How it works under the hood (URL encoding, no upload, privacy)
&lt;/h2&gt;

&lt;p&gt;If you're going to run a tool against production Terraform code, you should know what it actually does. Here's the full flow:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Reads file contents from disk (or fetches from URL). No preprocessing — the raw content goes through as-is, including variable references and module calls.&lt;/li&gt;
&lt;li&gt;Wraps the content in a JSON envelope: &lt;code&gt;{"type":"terraform","code":"..."}&lt;/code&gt;. Multi-file mode concatenates everything into the &lt;code&gt;code&lt;/code&gt; field with separator comments between files.&lt;/li&gt;
&lt;li&gt;Gzip-compresses the JSON and base64-encodes the result into a compact ASCII string.&lt;/li&gt;
&lt;li&gt;Appends the encoded string to the InfraSketch URL as a hash fragment: &lt;code&gt;https://infrasketch.cloud/#&lt;/code&gt;.&lt;/li&gt;
&lt;li&gt;Opens that URL in your default browser (&lt;code&gt;open&lt;/code&gt; on macOS, &lt;code&gt;xdg-open&lt;/code&gt; on Linux, &lt;code&gt;start&lt;/code&gt; on Windows). The web app decodes the fragment entirely client-side.&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;The key detail is step 5. The URL fragment — everything after the &lt;code&gt;#&lt;/code&gt; — is never transmitted in HTTP requests. When your browser loads &lt;code&gt;https://infrasketch.cloud/#eJy...&lt;/code&gt;, the actual HTTP request to the server is just &lt;code&gt;GET /&lt;/code&gt;. No server ever sees your infrastructure code. That's a browser standard, not something we're doing specially — we're just building on top of it.&lt;/p&gt;

&lt;p&gt;This also means the diagram URL is a permanent, shareable link with no expiry. The entire diagram state is encoded in the URL itself — there's no server-side session or storage. You can bookmark it, share it in Slack, or save it in documentation and it will work forever, as long as the InfraSketch web app is running.&lt;/p&gt;

&lt;h2&gt;
  
  
  Combining CLI with GitHub Action for full automation
&lt;/h2&gt;

&lt;p&gt;The CLI is for you while you're coding. The GitHub Action is for your reviewers when they're not.&lt;/p&gt;

&lt;p&gt;Practically, the workflow goes: you write a new Terraform module for a VPC peering connection, run &lt;code&gt;npx infrasketch .&lt;/code&gt; locally to make sure the diagram looks right (subnets, route tables, peering connections all there), then open a PR. The &lt;a href="///blog/github-action-terraform-diagram.html"&gt;GitHub Action (&lt;code&gt;pandey-raghvendra/infrasketch@v4&lt;/code&gt;)&lt;/a&gt; fires automatically and posts the diagram as a comment. Reviewers click the link, see the architecture interactively, no tooling required on their end.&lt;/p&gt;

&lt;p&gt;The CLI is fast and zero-ceremony — just a command. The Action is automated and requires no one to remember to run anything. They cover different moments in the same workflow, not the same moment twice.&lt;/p&gt;

&lt;h2&gt;
  
  
  Comparison table: CLI vs browser vs GitHub Action vs MCP
&lt;/h2&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Method&lt;/th&gt;
&lt;th&gt;Best for&lt;/th&gt;
&lt;th&gt;Install needed&lt;/th&gt;
&lt;th&gt;Works in CI&lt;/th&gt;
&lt;th&gt;Opens browser&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;Browser&lt;/td&gt;
&lt;td&gt;Quick one-off diagrams, paste-and-view&lt;/td&gt;
&lt;td&gt;None&lt;/td&gt;
&lt;td&gt;No&lt;/td&gt;
&lt;td&gt;Already in browser&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;CLI (npx infrasketch)&lt;/td&gt;
&lt;td&gt;Local dev, scripting, remote URLs&lt;/td&gt;
&lt;td&gt;Node.js (npx auto-installs)&lt;/td&gt;
&lt;td&gt;Yes (--no-open)&lt;/td&gt;
&lt;td&gt;Yes (default)&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;GitHub Action&lt;/td&gt;
&lt;td&gt;Automated PR comments on IaC changes&lt;/td&gt;
&lt;td&gt;None (uses Action)&lt;/td&gt;
&lt;td&gt;Yes (built for it)&lt;/td&gt;
&lt;td&gt;No&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;MCP Server&lt;/td&gt;
&lt;td&gt;AI-assisted coding in Claude Code / Cursor&lt;/td&gt;
&lt;td&gt;Node.js (npx auto-installs)&lt;/td&gt;
&lt;td&gt;No&lt;/td&gt;
&lt;td&gt;Yes (via AI prompt)&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;h2&gt;
  
  
  FAQ
&lt;/h2&gt;

&lt;h3&gt;
  
  
  Does npx infrasketch work without internet access?
&lt;/h3&gt;

&lt;p&gt;First run via npx needs to download the package, so yes, internet required there. After that, &lt;code&gt;npm install -g infrasketch&lt;/code&gt; once and it runs offline. The generated URL needs a browser to load the InfraSketch web app — so some internet to load the page initially, though your IaC code never gets uploaded to any server regardless.&lt;/p&gt;

&lt;h3&gt;
  
  
  What happens with .tfvars files that contain secrets?
&lt;/h3&gt;

&lt;p&gt;The code goes into the URL fragment, which is never sent to a server. But the fragment does show up in browser history and in any URL you share. So treat the URL like you'd treat the source code — don't paste it in a public Slack channel if the file has real credentials in it. Stick to &lt;code&gt;main.tf&lt;/code&gt; or module directories for diagramming; leave the &lt;code&gt;.tfvars&lt;/code&gt; with the actual secrets out of it.&lt;/p&gt;

&lt;h3&gt;
  
  
  Can I use the CLI with Terraform workspaces?
&lt;/h3&gt;

&lt;p&gt;Yes, workspaces only affect state — the HCL source files are the same regardless of which workspace you're on. &lt;code&gt;npx infrasketch .&lt;/code&gt; works normally. If you have workspace-specific variable files like &lt;code&gt;prod.tfvars&lt;/code&gt;, you can point the CLI at them directly.&lt;/p&gt;

&lt;h3&gt;
  
  
  How large can the IaC file be before the URL gets too long?
&lt;/h3&gt;

&lt;p&gt;HCL compresses well — gzip typically gets 5-10x reduction before base64, so a 500 KB Terraform project ends up under 100 KB in the URL. In practice, URL length limits never bite you with normal module-sized codebases. If you're running against an entire monorepo root with hundreds of files, run it against a subdirectory instead.&lt;/p&gt;

&lt;h3&gt;
  
  
  Can I get the diagram URL without opening the browser, even locally?
&lt;/h3&gt;

&lt;p&gt;&lt;code&gt;--no-open&lt;/code&gt; works anywhere, not just CI. &lt;code&gt;npx infrasketch main.tf --no-open&lt;/code&gt; on your laptop prints the URL to stdout without touching the browser. Pipe it to &lt;code&gt;pbcopy&lt;/code&gt;, drop it in a script, whatever you need.&lt;/p&gt;

&lt;blockquote&gt;
&lt;h3&gt;
  
  
  Diagram your infrastructure in 10 seconds Run &lt;code&gt;npx infrasketch .&lt;/code&gt; in your IaC repo right now — or try the browser tool directly with no install required. &lt;a href="https://dev.to/"&gt;Try InfraSketch Free →&lt;/a&gt;
&lt;/h3&gt;
&lt;/blockquote&gt;

</description>
      <category>terraformdiagramcli</category>
      <category>npxinfrasketch</category>
      <category>kubernetesdiagramcommandline</category>
      <category>iacvisualizationterminal</category>
    </item>
    <item>
      <title>How to Embed a Live IaC Architecture Diagram on Any Website with &amp;lt;infra-sketch&amp;gt;</title>
      <dc:creator>Raghvendra Pandey</dc:creator>
      <pubDate>Thu, 14 May 2026 00:28:11 +0000</pubDate>
      <link>https://forem.com/pandey-raghvendra/how-to-embed-a-live-iac-architecture-diagram-on-any-website-with-ltinfra-sketchgt-2dfh</link>
      <guid>https://forem.com/pandey-raghvendra/how-to-embed-a-live-iac-architecture-diagram-on-any-website-with-ltinfra-sketchgt-2dfh</guid>
      <description>&lt;p&gt;&lt;strong&gt;TL;DR:&lt;/strong&gt; Add one script tag to your page, then use `` or inline your IaC code between the tags. The diagram renders interactively, updates when you update the source, and never sends your code to a server.&lt;/p&gt;

&lt;h2&gt;
  
  
  Why living diagrams beat static images in docs
&lt;/h2&gt;

&lt;p&gt;There's a specific kind of documentation rot that hits infrastructure teams hard: the architecture diagram that was accurate when someone drew it, is now pinned to a Confluence page, and describes an environment that no longer exists. Someone added an RDS read replica. Someone else swapped EC2 for ECS Fargate. The diagram stayed put.&lt;/p&gt;

&lt;p&gt;Static diagram images — PNGs and SVGs exported from draw.io or Lucidchart — have a structural problem. Keeping them current requires someone to remember to update them, have the original tool open, export a new image, and re-upload it. That chain breaks constantly in practice. Not because people are careless; they're just busy.&lt;/p&gt;

&lt;p&gt;A living diagram solves this by rendering from the actual IaC file every time the page loads. When the Terraform changes, the diagram changes. No export, no re-upload, no manual step. It's accurate because it's always generated from the current code, not from a snapshot.&lt;/p&gt;

&lt;p&gt;The InfraSketch embed component makes this work on any website, docs platform, or wiki that accepts custom HTML: one script tag, then drop the `` element wherever you want the diagram.&lt;/p&gt;

&lt;h2&gt;
  
  
  Two ways to embed: iframe vs web component
&lt;/h2&gt;

&lt;p&gt;Two ways to embed, and which one you use depends on your platform:&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;The iframe approach&lt;/strong&gt; works everywhere — Confluence, Notion, GitHub Pages, internal wikis, anything that allows an HTML iframe. You generate a diagram URL first (browser tool, CLI, or MCP server), then paste the iframe tag. It's a bit more manual but totally reliable across any platform, including those that restrict JavaScript.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;The web component&lt;/strong&gt; is cleaner for HTML-based sites. One script tag in the head, then use `` anywhere on your page — point it at a source URL or write IaC code inline between the tags. The component fetches, detects the format, and renders. For docs sites built with MkDocs, Docusaurus, Hugo, or Jekyll, this is the approach I'd recommend.&lt;/p&gt;

&lt;h2&gt;
  
  
  Getting the iframe embed code (from the app)
&lt;/h2&gt;

&lt;p&gt;If you have an existing diagram open in the InfraSketch web app, the fastest way to get embed code is the share button. The app generates both an iframe snippet and a direct link:&lt;/p&gt;

&lt;p&gt;`&lt;code&gt;&lt;/code&gt;plaintext&lt;/p&gt;

&lt;p&gt;&lt;code&gt;&lt;/code&gt;`&lt;/p&gt;

&lt;p&gt;Paste this into any HTML page or any platform with an HTML/embed block. The iframe is fully self-contained — the diagram state is in the URL, so there are no external dependencies beyond the InfraSketch web app itself.&lt;/p&gt;

&lt;p&gt;For platforms that strip the &lt;code&gt;src&lt;/code&gt; attribute from iframes for security reasons (some wiki platforms and CMS editors do this), see the CORS considerations section below.&lt;/p&gt;

&lt;h2&gt;
  
  
  The infra-sketch web component: one-line setup
&lt;/h2&gt;

&lt;p&gt;The web component is loaded with a single script tag that you add once to your page's &lt;code&gt; or just before &lt;/code&gt;:&lt;/p&gt;

&lt;p&gt;`&lt;code&gt;&lt;/code&gt;plaintext&lt;/p&gt;

&lt;p&gt;&lt;code&gt;&lt;/code&gt;`&lt;/p&gt;

&lt;p&gt;After loading, the `` custom element is registered and available anywhere on the page. It renders as a responsive iframe-like widget with pan and zoom support, the same interactive experience as the full web app.&lt;/p&gt;

&lt;p&gt;The script is small, loads from a CDN, and is cached aggressively. Including it on a documentation page adds negligible overhead — the component only fetches and renders when an `` element is actually present in the DOM, so unused script inclusions don't trigger any work.&lt;/p&gt;

&lt;h2&gt;
  
  
  Embedding by URL: the src= attribute
&lt;/h2&gt;

&lt;p&gt;The simplest way to embed a diagram is to point the component at a URL that returns IaC code. The component fetches the URL, detects the format, and renders the diagram:&lt;/p&gt;

&lt;p&gt;`&lt;code&gt;&lt;/code&gt;plaintext&lt;/p&gt;

&lt;p&gt;&lt;code&gt;&lt;/code&gt;`&lt;/p&gt;

&lt;p&gt;When the page loads, the component fetches the &lt;code&gt;src&lt;/code&gt; URL, reads the content, auto-detects the IaC format, and renders the interactive diagram. If the file changes in GitHub, the diagram on your documentation page changes the next time someone loads it — without any manual intervention.&lt;/p&gt;

&lt;p&gt;You can also pass an explicit &lt;code&gt;type&lt;/code&gt; attribute to skip format detection and ensure correct rendering for ambiguous files:&lt;/p&gt;

&lt;p&gt;`&lt;code&gt;&lt;/code&gt;plaintext&lt;/p&gt;

&lt;p&gt;&lt;code&gt;&lt;/code&gt;`&lt;/p&gt;

&lt;p&gt;The &lt;code&gt;height&lt;/code&gt; attribute sets the diagram height in pixels. If omitted, a default of 480px is used. Width is always 100% of the container element, making the component responsive to its parent layout.&lt;/p&gt;

&lt;h2&gt;
  
  
  Embedding inline code
&lt;/h2&gt;

&lt;p&gt;For documentation where you want to show a specific, curated snippet rather than an entire file, write the IaC code directly between the `` tags:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight yaml"&gt;&lt;code&gt;
&lt;span class="na"&gt;apiVersion&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;apps/v1&lt;/span&gt;
&lt;span class="na"&gt;kind&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;Deployment&lt;/span&gt;
&lt;span class="na"&gt;metadata&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;
&lt;span class="na"&gt;name&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;api-server&lt;/span&gt;
&lt;span class="na"&gt;namespace&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;production&lt;/span&gt;
&lt;span class="na"&gt;spec&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;
&lt;span class="na"&gt;replicas&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="m"&gt;3&lt;/span&gt;
&lt;span class="na"&gt;selector&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;
&lt;span class="na"&gt;matchLabels&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;
&lt;span class="na"&gt;app&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;api-server&lt;/span&gt;
&lt;span class="na"&gt;template&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;
&lt;span class="na"&gt;spec&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;
&lt;span class="na"&gt;containers&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;
&lt;span class="pi"&gt;-&lt;/span&gt; &lt;span class="na"&gt;name&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;api&lt;/span&gt;
&lt;span class="na"&gt;image&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;your-org/api:latest&lt;/span&gt;
&lt;span class="na"&gt;ports&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;
&lt;span class="pi"&gt;-&lt;/span&gt; &lt;span class="na"&gt;containerPort&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="m"&gt;8080&lt;/span&gt;
&lt;span class="nn"&gt;---&lt;/span&gt;
&lt;span class="na"&gt;apiVersion&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;v1&lt;/span&gt;
&lt;span class="na"&gt;kind&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;Service&lt;/span&gt;
&lt;span class="na"&gt;metadata&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;
&lt;span class="na"&gt;name&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;api-service&lt;/span&gt;
&lt;span class="na"&gt;spec&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;
&lt;span class="na"&gt;selector&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;
&lt;span class="na"&gt;app&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;api-server&lt;/span&gt;
&lt;span class="na"&gt;ports&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;
&lt;span class="pi"&gt;-&lt;/span&gt; &lt;span class="na"&gt;port&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="m"&gt;80&lt;/span&gt;
&lt;span class="na"&gt;targetPort&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="m"&gt;8080&lt;/span&gt;
&lt;span class="na"&gt;type&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;ClusterIP&lt;/span&gt;

&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;When no &lt;code&gt;src&lt;/code&gt; attribute is provided, the component uses the element's text content as the IaC code. The &lt;code&gt;type&lt;/code&gt; attribute is recommended for inline code since there's no file extension to auto-detect from. The content is treated as plain text — HTML entities inside the element are decoded before parsing, so you can use `&lt;br&gt;
&lt;strong&gt;Tip:&lt;/strong&gt; For documentation sites that process Markdown, wrap inline IaC code in a raw HTML block to prevent the Markdown parser from mangling the whitespace or escaping characters inside the element.&lt;/p&gt;

&lt;h2&gt;
  
  
  All supported attributes (src, type, height, width)
&lt;/h2&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Attribute&lt;/th&gt;
&lt;th&gt;Required&lt;/th&gt;
&lt;th&gt;Default&lt;/th&gt;
&lt;th&gt;Description&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;src&lt;/td&gt;
&lt;td&gt;No&lt;/td&gt;
&lt;td&gt;—&lt;/td&gt;
&lt;td&gt;URL of the IaC file to fetch and render. Omit to use inline content.&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;type&lt;/td&gt;
&lt;td&gt;No&lt;/td&gt;
&lt;td&gt;auto-detect&lt;/td&gt;
&lt;td&gt;IaC format: terraform, kubernetes, pulumi, cloudformation, cdk, bicep, terragrunt, docker-compose&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;height&lt;/td&gt;
&lt;td&gt;No&lt;/td&gt;
&lt;td&gt;480&lt;/td&gt;
&lt;td&gt;Height of the diagram widget in pixels&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;width&lt;/td&gt;
&lt;td&gt;No&lt;/td&gt;
&lt;td&gt;100%&lt;/td&gt;
&lt;td&gt;Width of the diagram widget. Accepts px or % values.&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;p&gt;The component also exposes a custom event, &lt;code&gt;infra-sketch-load&lt;/code&gt;, that fires when the diagram has finished rendering. You can listen to it for analytics, lazy-load triggers, or to show/hide a loading skeleton:&lt;/p&gt;

&lt;p&gt;&lt;code&gt;&lt;/code&gt;&lt;code&gt;javascript&lt;br&gt;
document.querySelector('infra-sketch').addEventListener('infra-sketch-load', (e) =&amp;gt; {&lt;br&gt;
console.log('Diagram rendered:', e.detail.resourceCount, 'resources');&lt;br&gt;
});&lt;br&gt;
&lt;/code&gt;&lt;code&gt;&lt;/code&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  Real examples: GitHub Pages docs, Backstage, Confluence, Notion
&lt;/h2&gt;

&lt;h3&gt;
  
  
  GitHub Pages / Jekyll / Hugo / MkDocs
&lt;/h3&gt;

&lt;p&gt;For static site generators, add the embed script to your theme's base template and use the component in any page. For MkDocs with the Material theme, add the script to &lt;code&gt;overrides/main.html&lt;/code&gt;. For Jekyll, add it to &lt;code&gt;_layouts/default.html&lt;/code&gt;. Then use the component in any Markdown file within a raw HTML block:&lt;/p&gt;

&lt;p&gt;&lt;code&gt;&lt;/code&gt;`markdown&lt;/p&gt;

&lt;h2&gt;
  
  
  Network Architecture
&lt;/h2&gt;

&lt;p&gt;The following diagram shows the production VPC layout:&lt;/p&gt;

&lt;p&gt;`&lt;code&gt;&lt;/code&gt;&lt;/p&gt;

&lt;h3&gt;
  
  
  Backstage TechDocs
&lt;/h3&gt;

&lt;p&gt;Backstage TechDocs is built on MkDocs and renders Markdown for service catalogs. The same pattern applies — add the script to the TechDocs theme override and embed diagrams inline in your service's &lt;code&gt;docs/&lt;/code&gt; directory. Because TechDocs serves content from the same origin as Backstage, there are no CORS restrictions when fetching from GitHub raw URLs.&lt;/p&gt;

&lt;h3&gt;
  
  
  Confluence
&lt;/h3&gt;

&lt;p&gt;Confluence's HTML macro lets you paste raw HTML including script tags. Create an HTML macro block on your page, paste in the embed script tag and the &lt;code&gt;&lt;/code&gt; element. Alternatively, use the iframe approach — generate the iframe URL from the InfraSketch app and paste it using Confluence's iframe macro. The iframe approach is more reliable across Confluence versions since some restrict JavaScript in HTML macros by default.&lt;/p&gt;

&lt;h3&gt;
  
  
  Notion
&lt;/h3&gt;

&lt;p&gt;Notion doesn't support arbitrary HTML or script tags in pages, but it does have an Embed block that accepts iframe URLs. Generate the diagram URL from the InfraSketch app (or via the CLI with &lt;code&gt;--no-open&lt;/code&gt;), then use Notion's &lt;code&gt;/embed&lt;/code&gt; command and paste the URL. Notion will render it as an embedded iframe. The result is an interactive diagram inside your Notion page that anyone with page access can pan and zoom.&lt;/p&gt;

&lt;h2&gt;
  
  
  Loading from GitHub raw URLs — the recommended pattern
&lt;/h2&gt;

&lt;p&gt;Pointing the &lt;code&gt;src&lt;/code&gt; attribute at a GitHub raw URL is the most maintainable pattern for living diagrams. The URL format is:&lt;/p&gt;

&lt;p&gt;&lt;code&gt;&lt;/code&gt;&lt;code&gt;plaintext&lt;br&gt;
https://raw.githubusercontent.com/{owner}/{repo}/{branch}/{path}&lt;br&gt;
&lt;/code&gt;&lt;code&gt;&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;For example:&lt;/p&gt;

&lt;p&gt;&lt;code&gt;&lt;/code&gt;`plaintext&lt;/p&gt;

&lt;p&gt;`&lt;code&gt;&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;When &lt;code&gt;main.tf&lt;/code&gt; is updated and merged, the next page load will show the updated diagram. No documentation update required. No diagram export needed. The diagram is always synchronized with the code in your default branch.&lt;/p&gt;

&lt;p&gt;For branch-specific documentation — for example, showing the architecture as it will look after a specific feature branch is merged — use the branch name in the URL:&lt;/p&gt;

&lt;p&gt;&lt;code&gt;&lt;/code&gt;`plaintext&lt;/p&gt;

&lt;p&gt;`&lt;code&gt;&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;This is particularly useful when combined with the &lt;a href="///blog/github-action-terraform-diagram.html"&gt;GitHub Action&lt;/a&gt;, which posts a diagram to the PR. You can also link to branch-specific documentation that shows what the architecture will look like after the PR is merged, and the diagram will automatically become the "post-merge" diagram once the branch is merged to main.&lt;/p&gt;

&lt;p&gt;For private repositories, GitHub raw URLs require authentication. In that case, you can either use the inline code approach (copy the relevant code into your documentation page directly) or host your own IaC files on an authenticated endpoint and point &lt;code&gt;src&lt;/code&gt; at that.&lt;/p&gt;

&lt;h2&gt;
  
  
  Error handling and CORS considerations
&lt;/h2&gt;

&lt;p&gt;When using the &lt;code&gt;src&lt;/code&gt; attribute, the web component fetches the URL from the browser using the Fetch API. This means the target URL must be accessible from the user's browser and must allow cross-origin requests via CORS headers.&lt;/p&gt;

&lt;p&gt;GitHub raw URLs (&lt;code&gt;raw.githubusercontent.com&lt;/code&gt;) are served with permissive CORS headers — they allow requests from any origin, so they work out of the box. Most public file hosting services and CDNs also support CORS for public content.&lt;/p&gt;

&lt;p&gt;If the &lt;code&gt;src&lt;/code&gt; URL is on a private server or an origin that doesn't send CORS headers, the fetch will fail with a network error. In that case:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Use inline content instead of &lt;code&gt;src&lt;/code&gt;
&lt;/li&gt;
&lt;li&gt;Configure your server to send &lt;code&gt;Access-Control-Allow-Origin: *&lt;/code&gt; for the IaC files&lt;/li&gt;
&lt;li&gt;Use a CORS proxy (only for non-sensitive content)&lt;/li&gt;
&lt;li&gt;Generate the diagram URL server-side and embed it as a static iframe URL instead of using the web component's dynamic fetch&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;When a fetch fails, the component shows a visible error state — it doesn't silently disappear. Non-200 response, empty body, network error — you get "Could not load diagram source" in the widget and the actual error in the browser console, so you know what went wrong.&lt;/p&gt;

&lt;p&gt;For inline content, there's no network request and no CORS consideration — the content is right there in the DOM, and the component reads it synchronously.&lt;/p&gt;

&lt;h2&gt;
  
  
  Privacy: what the embed does and doesn't send
&lt;/h2&gt;

&lt;p&gt;Same privacy model as the rest of InfraSketch: your IaC code never touches InfraSketch servers. Here's exactly what happens when you use &lt;code&gt;src&lt;/code&gt;:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;The browser fetches the &lt;code&gt;src&lt;/code&gt; URL — request goes to GitHub or wherever you're hosting the file, not to InfraSketch&lt;/li&gt;
&lt;li&gt;File content lands in the browser&lt;/li&gt;
&lt;li&gt;The component encodes it into a URL fragment (gzip + base64) in-memory&lt;/li&gt;
&lt;li&gt;Creates an iframe pointing to &lt;code&gt;https://infrasketch.cloud/#&lt;/code&gt;
&lt;/li&gt;
&lt;li&gt;Browser loads the InfraSketch web app — the HTTP request goes to our CDN, but fragments are never included in HTTP requests (that's the HTTP spec)&lt;/li&gt;
&lt;li&gt;The web app decodes the fragment client-side and renders&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;What InfraSketch servers actually see: a request for the embed script, a request for the web app assets. That's it. No IaC code, no diagram content, no infrastructure metadata. Standard CDN logs with IP, user agent, timestamp — same as any website.&lt;/p&gt;

&lt;p&gt;With inline content, step 1 doesn't happen at all. The only network contact is loading the web app assets.&lt;/p&gt;

&lt;h2&gt;
  
  
  A complete minimal embed page
&lt;/h2&gt;

&lt;p&gt;Here's a full, self-contained HTML page that embeds a Terraform diagram using the web component. You can use this as a starting point for a GitHub Pages documentation page or any static HTML site:&lt;/p&gt;

&lt;p&gt;&lt;code&gt;&lt;/code&gt;`css&lt;/p&gt;

&lt;p&gt;Network Architecture - Internal Docs&lt;/p&gt;

&lt;p&gt;body { font-family: system-ui, sans-serif; max-width: 900px; margin: 40px auto; padding: 0 20px; }&lt;br&gt;
h1 { font-size: 24px; margin-bottom: 8px; }&lt;br&gt;
p { color: #555; margin-bottom: 24px; }&lt;/p&gt;

&lt;p&gt;Production Network Architecture&lt;br&gt;
This diagram is generated live from the Terraform source in the infra repository.&lt;/p&gt;

&lt;p&gt;Diagram always reflects the current &lt;code&gt;main&lt;/code&gt; branch. &lt;a href="https://github.com/your-org/infra/blob/main/terraform/networking/main.tf" rel="noopener noreferrer"&gt;View source&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;`&lt;code&gt;&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;This page requires no build step, no server-side processing, and no InfraSketch account. It works as a standalone HTML file served from any static host.&lt;/p&gt;

&lt;h2&gt;
  
  
  FAQ
&lt;/h2&gt;

&lt;h3&gt;
  
  
  Does the embed component work with private GitHub repositories?
&lt;/h3&gt;

&lt;p&gt;The &lt;code&gt;src&lt;/code&gt; fetch runs in the user's browser, so private GitHub raw URLs would need a token — which you obviously can't bake into a public HTML page. For private repos, use inline content instead: copy the relevant Terraform or Kubernetes code between the tags. Or generate the URL server-side with &lt;code&gt;npx infrasketch main.tf --no-open&lt;/code&gt; and embed it as a static iframe. The state is in the fragment, so it doesn't expire.&lt;/p&gt;

&lt;h3&gt;
  
  
  Will the diagram break if infrasketch.cloud goes down?
&lt;/h3&gt;

&lt;p&gt;If the web app is unavailable, iframes and components pointing to it will show an error. If you need high reliability for critical docs, pre-generate the URL with the CLI and embed it as a static iframe — then if you ever want to self-host the web app, the same URL works unchanged.&lt;/p&gt;

&lt;h3&gt;
  
  
  Can I control the diagram layout or colors through the embed?
&lt;/h3&gt;

&lt;p&gt;Not through attributes currently. Users can pan, zoom, and move nodes interactively inside the embedded diagram. If you want a specific layout, open the diagram in the full web app, arrange it, and use the "share" URL — it encodes the adjusted node positions in the fragment. Custom theming via attributes is on the roadmap.&lt;/p&gt;

&lt;h3&gt;
  
  
  Does the component support lazy loading for pages with many diagrams?
&lt;/h3&gt;

&lt;p&gt;Yes — it uses &lt;code&gt;IntersectionObserver&lt;/code&gt; internally to defer fetching and rendering until the element is near the viewport. Put 10 diagrams on a page and only the visible ones actually load. The rest wait until you scroll to them. This makes diagram-heavy runbooks and wikis load fast enough to be practical.&lt;/p&gt;

&lt;h3&gt;
  
  
  Can I use the embed component with React, Vue, or other frameworks?
&lt;/h3&gt;

&lt;p&gt;Web components work natively in all modern browsers, so any framework is fine. React treats it like any other HTML element. Vue might show an "unknown element" warning — add &lt;code&gt;infra-sketch&lt;/code&gt; to &lt;code&gt;compilerOptions.isCustomElement&lt;/code&gt; in your Vite/Vue config to silence it. No npm package needed — just the script tag.&lt;/p&gt;

&lt;blockquote&gt;
&lt;h3&gt;
  
  
  Turn your IaC docs into living architecture diagrams Add one script tag to your docs site and your diagrams stay synchronized with your code automatically. Try it in the browser first — no account needed. &lt;a href="https://dev.to/"&gt;Try InfraSketch Free →&lt;/a&gt;
&lt;/h3&gt;
&lt;/blockquote&gt;

</description>
      <category>embedterraformdiagram</category>
      <category>iacdiagramembed</category>
      <category>infrastructurediagramwebcompon</category>
      <category>embedkubernetesdiagramdocs</category>
    </item>
    <item>
      <title>Visualize Infracost on Your Architecture Diagram</title>
      <dc:creator>Raghvendra Pandey</dc:creator>
      <pubDate>Tue, 12 May 2026 01:21:28 +0000</pubDate>
      <link>https://forem.com/pandey-raghvendra/visualize-infracost-on-your-architecture-diagram-1fmg</link>
      <guid>https://forem.com/pandey-raghvendra/visualize-infracost-on-your-architecture-diagram-1fmg</guid>
      <description>&lt;p&gt;Infracost estimates your monthly cloud bill from Terraform code before you deploy. But its output — a long table of resource costs in the terminal — makes it hard to see which part of your architecture is driving spend. Is it the database? The NAT gateway? The EC2 fleet?&lt;/p&gt;

&lt;p&gt;InfraSketch's cost overlay answers this visually. Run &lt;code&gt;infracost breakdown --format json&lt;/code&gt;, paste the output, and every resource node in your architecture diagram gets a colour-coded cost pill showing its monthly cost. Green for cheap, red for expensive. See your cloud bill spatially, in context.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;TL;DR:&lt;/strong&gt; Generate your diagram → click &lt;strong&gt;💰 Cost&lt;/strong&gt; → paste &lt;code&gt;infracost breakdown --path . --format json&lt;/code&gt; output → colour-coded cost badges appear on every resource. Free, no login, stays in your browser.&lt;/p&gt;

&lt;h2&gt;
  
  
  The problem with cost tables
&lt;/h2&gt;

&lt;p&gt;Here's a typical Infracost breakdown summary:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;Name                                         Monthly Qty  Unit   Monthly Cost
aws_instance.web_server                               730  hours        $73.00
aws_db_instance.postgres                              730  hours       $185.10
aws_nat_gateway.main                                    1  months        $32.40
aws_elasticache_cluster.sessions                      730  hours        $25.55
...
TOTAL                                                                   $316.05
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;You can see the numbers, but not the relationships. The NAT gateway costs $32/month — but is it serving one subnet or eight? The RDS instance at $185/month — what's connected to it, and could you downsize it without breaking the data pipeline? The table doesn't tell you.&lt;/p&gt;

&lt;p&gt;A visual overlay does. You see the RDS instance sitting inside its private subnet, connected to the application servers and the analytics Lambda. You see the NAT gateway at the boundary of the public subnet serving the entire private tier. Cost becomes architectural context, not just numbers.&lt;/p&gt;

&lt;h2&gt;
  
  
  Step-by-step: generate and overlay
&lt;/h2&gt;

&lt;ol&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Install Infracost&lt;/strong&gt;&lt;br&gt;
&lt;br&gt;
&lt;code&gt;brew install infracost # macOS # or curl -fsSL https://raw.githubusercontent.com/infracost/infracost/master/scripts/install.sh | sh infracost auth login # free account needed for cost data&lt;/code&gt;&lt;br&gt;
&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Run the breakdown and save JSON&lt;/strong&gt;&lt;br&gt;
&lt;br&gt;
&lt;code&gt;infracost breakdown --path . --format json &amp;gt; infracost.json&lt;/code&gt;&lt;br&gt;
&lt;br&gt;
For a specific Terraform module: &lt;code&gt;infracost breakdown --path ./modules/networking --format json &amp;gt; infracost.json&lt;/code&gt; For Terragrunt: &lt;code&gt;infracost breakdown --path . --terragrunt-flags="--terragrunt-working-dir ." --format json &amp;gt; infracost.json&lt;/code&gt;&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Generate your architecture diagram&lt;/strong&gt; Open &lt;a href="https://infrasketch.cloud" rel="noopener noreferrer"&gt;infrasketch.cloud&lt;/a&gt;, paste your Terraform HCL (or plan JSON for the most accurate results), and click &lt;strong&gt;Generate Diagram&lt;/strong&gt;.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Open the Cost overlay&lt;/strong&gt; In the export bar at the bottom of the page, click the &lt;strong&gt;💰 Cost&lt;/strong&gt; button. A modal opens with a textarea.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Paste the Infracost JSON and apply&lt;/strong&gt; Copy the contents of &lt;code&gt;infracost.json&lt;/code&gt;, paste into the textarea, and click &lt;strong&gt;Apply&lt;/strong&gt;. Cost pills appear on every resource that Infracost priced.&lt;/p&gt;&lt;/li&gt;
&lt;/ol&gt;

&lt;h2&gt;
  
  
  Reading the cost colour scale
&lt;/h2&gt;

&lt;p&gt;Each node gets a pill badge at its bottom centre showing the monthly cost estimate. The colour indicates cost tier:&lt;/p&gt;

&lt;p&gt;Free / $0&lt;br&gt;
&amp;lt;$10/mo&lt;br&gt;
$10–$100/mo&lt;br&gt;
$100–$500/mo&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;$500/mo&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;Resources with no cost data (e.g., IAM roles, security groups, Route 53 records) don't get a badge. Resources Infracost estimates as free (Lambda free tier, CloudWatch basic metrics) get a grey "Free" pill.&lt;/p&gt;

&lt;p&gt;Hover over any pill to see the cost breakdown by component. For example, an RDS instance might show:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;aws_db_instance.postgres
Database instance (db.t3.medium): $60.74/mo
Storage (gp2, 100GB): $11.50/mo
Backup storage: $0.00/mo
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;This tells you exactly which component is driving cost — useful when deciding between instance types or storage tiers.&lt;/p&gt;

&lt;h2&gt;
  
  
  Common cost patterns to spot in the diagram
&lt;/h2&gt;

&lt;h3&gt;
  
  
  The hidden NAT gateway cost
&lt;/h3&gt;

&lt;p&gt;NAT gateways often appear as a single small node in the architecture but carry significant cost: $0.045/GB data processed plus the hourly charge. In the diagram, a yellow/orange NAT gateway node connected to dozens of private resources immediately flags a potential optimization — could some of those services use VPC endpoints (free) instead?&lt;/p&gt;

&lt;h3&gt;
  
  
  Idle or over-provisioned compute
&lt;/h3&gt;

&lt;p&gt;An EC2 cluster with red-tier cost badges ($500+/mo) that's only connected to a dev database and a single Lambda is a red flag. The spatial context makes over-provisioning obvious in a way that the cost table alone doesn't.&lt;/p&gt;

&lt;h3&gt;
  
  
  Cascading storage costs
&lt;/h3&gt;

&lt;p&gt;S3 buckets, EBS volumes attached to EC2 instances, and RDS storage often combine to form a significant portion of the bill. When you see multiple amber/orange storage nodes grouped in the same subnet, you can immediately identify candidates for lifecycle policies or right-sizing.&lt;/p&gt;

&lt;h3&gt;
  
  
  Multi-AZ vs single-AZ databases
&lt;/h3&gt;

&lt;p&gt;A Multi-AZ RDS setup doubles the instance cost. In the diagram, both the primary and standby show up as nodes. If the standby has a red cost badge and your app is internal-only, that's a candidate for a discussion about RTO/RPO tradeoffs vs. cost.&lt;/p&gt;

&lt;h2&gt;
  
  
  Combining with the security overlay
&lt;/h2&gt;

&lt;p&gt;InfraSketch supports both the Checkov security overlay (🛡) and the Infracost cost overlay (💰) simultaneously. Security badges appear top-right, cost pills appear bottom-centre — no overlap.&lt;/p&gt;

&lt;p&gt;The most actionable pattern is a resource that's both expensive and misconfigured: orange/red cost pill plus a red security border. That's a double priority — it's costing you money &lt;em&gt;and&lt;/em&gt; creating compliance risk.&lt;/p&gt;

&lt;p&gt;Conversely, a resource with many security failures but a "Free" cost pill might be lower priority to fix urgently — though you should still fix it. The combined view helps teams triage when they have limited sprint capacity.&lt;/p&gt;

&lt;h2&gt;
  
  
  Using Infracost in CI for cost-aware PR reviews
&lt;/h2&gt;

&lt;p&gt;Infracost has a native GitHub Action that posts cost diffs on pull requests. Combine it with the InfraSketch GitHub Action for full cost-and-architecture visibility on every IaC PR:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight yaml"&gt;&lt;code&gt;&lt;span class="c1"&gt;# .github/workflows/iac-review.yml&lt;/span&gt;
&lt;span class="na"&gt;name&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;IaC Review&lt;/span&gt;
&lt;span class="na"&gt;on&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;
&lt;span class="na"&gt;pull_request&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;
&lt;span class="na"&gt;paths&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="pi"&gt;[&lt;/span&gt;&lt;span class="s1"&gt;'&lt;/span&gt;&lt;span class="s"&gt;**/*.tf'&lt;/span&gt;&lt;span class="pi"&gt;]&lt;/span&gt;

&lt;span class="na"&gt;jobs&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;
&lt;span class="na"&gt;diagram&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;
&lt;span class="na"&gt;runs-on&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;ubuntu-latest&lt;/span&gt;
&lt;span class="na"&gt;permissions&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;
&lt;span class="na"&gt;pull-requests&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;write&lt;/span&gt;
&lt;span class="na"&gt;steps&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;
&lt;span class="pi"&gt;-&lt;/span&gt; &lt;span class="na"&gt;uses&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;actions/checkout@v4&lt;/span&gt;
&lt;span class="pi"&gt;-&lt;/span&gt; &lt;span class="na"&gt;uses&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;pandey-raghvendra/infrasketch@v4&lt;/span&gt;
&lt;span class="na"&gt;with&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;
&lt;span class="na"&gt;github-token&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;${{ secrets.GITHUB_TOKEN }}&lt;/span&gt;

&lt;span class="na"&gt;cost&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;
&lt;span class="na"&gt;runs-on&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;ubuntu-latest&lt;/span&gt;
&lt;span class="na"&gt;permissions&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;
&lt;span class="na"&gt;pull-requests&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;write&lt;/span&gt;
&lt;span class="na"&gt;steps&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;
&lt;span class="pi"&gt;-&lt;/span&gt; &lt;span class="na"&gt;uses&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;actions/checkout@v4&lt;/span&gt;
&lt;span class="pi"&gt;-&lt;/span&gt; &lt;span class="na"&gt;uses&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;infracost/actions/setup@v3&lt;/span&gt;
&lt;span class="na"&gt;with&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;
&lt;span class="na"&gt;api-key&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;${{ secrets.INFRACOST_API_KEY }}&lt;/span&gt;
&lt;span class="pi"&gt;-&lt;/span&gt; &lt;span class="na"&gt;run&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;infracost diff --path . --format json --out-file infracost.json&lt;/span&gt;
&lt;span class="pi"&gt;-&lt;/span&gt; &lt;span class="na"&gt;uses&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;infracost/actions/comment@v3&lt;/span&gt;
&lt;span class="na"&gt;with&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;
&lt;span class="na"&gt;path&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;infracost.json&lt;/span&gt;
&lt;span class="na"&gt;behavior&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;update&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The InfraSketch job posts diagram links for changed files. The Infracost job posts a cost diff table showing exactly how much the PR changes the monthly bill. Reviewers see both — architecture impact and cost impact — without leaving the PR page.&lt;/p&gt;

&lt;p&gt;Note: the Infracost GitHub Action requires an &lt;code&gt;INFRACOST_API_KEY&lt;/code&gt; secret (free account at infracost.io). The InfraSketch Action requires only the built-in &lt;code&gt;GITHUB_TOKEN&lt;/code&gt;.&lt;/p&gt;

&lt;h2&gt;
  
  
  Supported Terraform patterns
&lt;/h2&gt;

&lt;h3&gt;
  
  
  HCL files
&lt;/h3&gt;

&lt;p&gt;The simplest case: paste one or more &lt;code&gt;.tf&lt;/code&gt; files into InfraSketch, run Infracost against the same directory, and overlay. Resource names match directly since both tools read the same HCL.&lt;/p&gt;

&lt;h3&gt;
  
  
  Terraform plan JSON (most accurate)
&lt;/h3&gt;

&lt;p&gt;For accurate cost estimates — especially when your code uses &lt;code&gt;count&lt;/code&gt;, &lt;code&gt;for_each&lt;/code&gt;, or variable values — use plan JSON for both tools:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="c"&gt;# Generate plan JSON&lt;/span&gt;
terraform plan &lt;span class="nt"&gt;-out&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;tfplan
terraform show &lt;span class="nt"&gt;-json&lt;/span&gt; tfplan &lt;span class="o"&gt;&amp;gt;&lt;/span&gt; tfplan.json

&lt;span class="c"&gt;# Diagram: paste tfplan.json into InfraSketch&lt;/span&gt;
&lt;span class="c"&gt;# Cost: point Infracost at the plan&lt;/span&gt;
infracost breakdown &lt;span class="nt"&gt;--path&lt;/span&gt; tfplan.json &lt;span class="nt"&gt;--format&lt;/span&gt; json &lt;span class="o"&gt;&amp;gt;&lt;/span&gt; infracost.json
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;This gives Infracost the resolved resource counts (e.g., 3 EC2 instances from a &lt;code&gt;count = 3&lt;/code&gt; expression) and gives InfraSketch the same expanded resource list. Matching is more accurate.&lt;/p&gt;

&lt;h3&gt;
  
  
  Terragrunt
&lt;/h3&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;infracost breakdown &lt;span class="nt"&gt;--path&lt;/span&gt; &lt;span class="nb"&gt;.&lt;/span&gt; &lt;span class="nt"&gt;--format&lt;/span&gt; json &lt;span class="o"&gt;&amp;gt;&lt;/span&gt; infracost.json
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Infracost detects Terragrunt automatically. For the diagram, paste the underlying &lt;code&gt;.tf&lt;/code&gt; files (not &lt;code&gt;terragrunt.hcl&lt;/code&gt;) or use plan JSON.&lt;/p&gt;

&lt;h2&gt;
  
  
  Troubleshooting
&lt;/h2&gt;

&lt;h3&gt;
  
  
  No cost pills appear
&lt;/h3&gt;

&lt;p&gt;Check that you pasted the full JSON (starting with &lt;code&gt;{"version":&lt;/code&gt;). Infracost's JSON format starts with a &lt;code&gt;version&lt;/code&gt; field and a &lt;code&gt;projects&lt;/code&gt; array. If you pasted the summary output instead of the JSON, it won't parse.&lt;/p&gt;

&lt;p&gt;Also verify: run &lt;code&gt;cat infracost.json | python3 -m json.tool&lt;/code&gt; to confirm it's valid JSON. If Infracost errored silently, it may have written an empty or partial file.&lt;/p&gt;

&lt;h3&gt;
  
  
  Some resources have pills, others don't
&lt;/h3&gt;

&lt;p&gt;Infracost only prices resources with a known pricing model. IAM roles, security groups, VPCs, subnets, route tables, and many other resources are free in AWS and won't appear in Infracost's output — so they won't get a pill. This is expected behaviour.&lt;/p&gt;

&lt;h3&gt;
  
  
  Resource names don't match
&lt;/h3&gt;

&lt;p&gt;If you generated the diagram from plan JSON but ran Infracost on raw HCL (or vice versa), resource names may differ. Plan JSON includes module paths in resource names. Run both tools on the same input format for best matching.&lt;/p&gt;

&lt;h3&gt;
  
  
  Costs look wrong
&lt;/h3&gt;

&lt;p&gt;Infracost estimates are based on on-demand pricing in the region detected from your Terraform config. Reserved instance pricing, Savings Plans, enterprise discounts, and free tier credits are not included by default. The estimates are a useful relative comparison between resources, not an exact billing forecast.&lt;/p&gt;

&lt;h2&gt;
  
  
  Frequently asked questions
&lt;/h2&gt;

&lt;h3&gt;
  
  
  Does InfraSketch send my cost data to any server?
&lt;/h3&gt;

&lt;p&gt;No. The Infracost JSON is parsed entirely in your browser in JavaScript. No data is transmitted anywhere. Your infrastructure cost breakdown stays private.&lt;/p&gt;

&lt;h3&gt;
  
  
  Do I need an Infracost account to use the overlay?
&lt;/h3&gt;

&lt;p&gt;You need an Infracost account (free) to run &lt;code&gt;infracost breakdown&lt;/code&gt; — it calls the Infracost API to fetch cloud pricing data. You don't need any account to use InfraSketch or its cost overlay. Just paste the JSON output InfraSketch generates.&lt;/p&gt;

&lt;h3&gt;
  
  
  Can the overlay show hourly costs instead of monthly?
&lt;/h3&gt;

&lt;p&gt;Not currently. The pill shows monthly cost, which is the standard unit for comparing infrastructure spend. Hover on the pill to see the components breakdown, which is also monthly.&lt;/p&gt;

&lt;h3&gt;
  
  
  Does it work with AWS CDK, CloudFormation, or Bicep?
&lt;/h3&gt;

&lt;p&gt;Infracost natively supports Terraform and Terragrunt. For CDK and CloudFormation, Infracost has experimental support via the &lt;code&gt;--format=cloudformation&lt;/code&gt; flag. For Bicep (Azure), there's no native Infracost support yet — the &lt;code&gt;azure-cost&lt;/code&gt; CLI or Azure Cost Management export can serve a similar purpose, but InfraSketch's overlay only parses Infracost's JSON schema.&lt;/p&gt;

&lt;h3&gt;
  
  
  What if my infrastructure spans multiple Terraform workspaces or accounts?
&lt;/h3&gt;

&lt;p&gt;Run Infracost separately for each workspace and merge the outputs using &lt;code&gt;infracost output --path infra1.json --path infra2.json --format json &amp;gt; merged.json&lt;/code&gt;. Paste the merged JSON into InfraSketch for a combined overlay.&lt;/p&gt;

&lt;h3&gt;
  
  
  Can I keep the cost overlay when exporting to PNG or SVG?
&lt;/h3&gt;

&lt;p&gt;Yes. Export PNG or SVG with the overlay active — cost pills are rendered into the export. This is useful for attaching to Confluence pages, architecture review docs, or FinOps reports. The share link encodes the diagram structure but not the overlay state.&lt;/p&gt;

&lt;blockquote&gt;
&lt;h3&gt;
  
  
  Try the cost overlay now Generate your architecture diagram and see monthly costs per resource — free, no login, nothing leaves your browser. &lt;a href="https://infrasketch.cloud" rel="noopener noreferrer"&gt;Open InfraSketch →&lt;/a&gt;
&lt;/h3&gt;
&lt;/blockquote&gt;

&lt;h2&gt;
  
  
  Related guides
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;&lt;a href="///blog/checkov-diagram-visualization.html"&gt;Visualize Checkov security results on your architecture diagram&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="///blog/github-action-terraform-diagram.html"&gt;Auto-post architecture diagrams on IaC PRs with GitHub Actions&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="///blog/terraform-diagram-generator.html"&gt;Terraform diagram generator — visualize HCL instantly&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;

</description>
      <category>infracostdiagram</category>
      <category>visualizeinfracost</category>
      <category>infracostarchitecturediagram</category>
      <category>terraformcostdiagram</category>
    </item>
    <item>
      <title>GitHub Action: Auto-Post Architecture Diagrams on IaC PRs</title>
      <dc:creator>Raghvendra Pandey</dc:creator>
      <pubDate>Tue, 12 May 2026 01:20:56 +0000</pubDate>
      <link>https://forem.com/pandey-raghvendra/github-action-auto-post-architecture-diagrams-on-iac-prs-47l9</link>
      <guid>https://forem.com/pandey-raghvendra/github-action-auto-post-architecture-diagrams-on-iac-prs-47l9</guid>
      <description>&lt;p&gt;Every time your team opens a pull request that changes Terraform, Kubernetes, Bicep, or any other IaC file, reviewers face the same problem: they have to mentally simulate what the code change does to the actual infrastructure. The &lt;a href="https://github.com/marketplace/actions/infrasketch-architecture-diagram" rel="noopener noreferrer"&gt;InfraSketch GitHub Action&lt;/a&gt; solves this by automatically posting a clickable architecture diagram link in the PR comment — no secrets, no paid plan, no setup beyond a single workflow file.&lt;/p&gt;

&lt;blockquote&gt;
&lt;h3&gt;
  
  
  View on GitHub Marketplace Free, no secrets needed. Works with Terraform, Bicep, Pulumi, Kubernetes, CloudFormation, CDK, and Docker Compose. &lt;a href="https://github.com/marketplace/actions/infrasketch-architecture-diagram" rel="noopener noreferrer"&gt;Install the Action →&lt;/a&gt;
&lt;/h3&gt;
&lt;/blockquote&gt;

&lt;h2&gt;
  
  
  What the action does
&lt;/h2&gt;

&lt;p&gt;When a contributor opens or updates a pull request, the action:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Reads the list of changed files from the GitHub API&lt;/li&gt;
&lt;li&gt;Filters for IaC files — &lt;code&gt;.tf&lt;/code&gt;, &lt;code&gt;.bicep&lt;/code&gt;, &lt;code&gt;terragrunt.hcl&lt;/code&gt;, Kubernetes YAML, CloudFormation templates, Pulumi TypeScript/Python, and Docker Compose files&lt;/li&gt;
&lt;li&gt;Reads each file's content and auto-detects its format&lt;/li&gt;
&lt;li&gt;Encodes the content into a shareable &lt;a href="https://infrasketch.cloud" rel="noopener noreferrer"&gt;infrasketch.cloud&lt;/a&gt; URL&lt;/li&gt;
&lt;li&gt;Posts a PR comment with a table of diagram links — one per IaC file&lt;/li&gt;
&lt;li&gt;Updates the existing comment on subsequent pushes rather than spamming new ones&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;The PR comment looks like this:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight markdown"&gt;&lt;code&gt;&lt;span class="gu"&gt;## 🗺️ InfraSketch — Architecture Diagrams&lt;/span&gt;

Found 2 infrastructure files in this PR.

| File              | Format     | Status      | Diagram         |
|-------------------|------------|-------------|-----------------|
| infra/main.tf     | Terraform  | ✏️ modified | View diagram →  |
| k8s/deploy.yaml   | Kubernetes | 🆕 added    | View diagram →  |
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Clicking "View diagram →" opens InfraSketch in the browser with the file content pre-loaded. The diagram renders immediately — no login, no account, nothing to install.&lt;/p&gt;

&lt;h2&gt;
  
  
  Setup: 2 minutes
&lt;/h2&gt;

&lt;p&gt;Create the following file in your repository at &lt;code&gt;.github/workflows/infrasketch.yml&lt;/code&gt;:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight yaml"&gt;&lt;code&gt;&lt;span class="na"&gt;name&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;Architecture Diagram&lt;/span&gt;

&lt;span class="na"&gt;on&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;
&lt;span class="na"&gt;pull_request&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;
&lt;span class="na"&gt;types&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="pi"&gt;[&lt;/span&gt;&lt;span class="nv"&gt;opened&lt;/span&gt;&lt;span class="pi"&gt;,&lt;/span&gt; &lt;span class="nv"&gt;synchronize&lt;/span&gt;&lt;span class="pi"&gt;,&lt;/span&gt; &lt;span class="nv"&gt;reopened&lt;/span&gt;&lt;span class="pi"&gt;]&lt;/span&gt;
&lt;span class="na"&gt;paths&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;
&lt;span class="pi"&gt;-&lt;/span&gt; &lt;span class="s1"&gt;'&lt;/span&gt;&lt;span class="s"&gt;**/*.tf'&lt;/span&gt;
&lt;span class="pi"&gt;-&lt;/span&gt; &lt;span class="s1"&gt;'&lt;/span&gt;&lt;span class="s"&gt;**/*.tfvars'&lt;/span&gt;
&lt;span class="pi"&gt;-&lt;/span&gt; &lt;span class="s1"&gt;'&lt;/span&gt;&lt;span class="s"&gt;**/*.bicep'&lt;/span&gt;
&lt;span class="pi"&gt;-&lt;/span&gt; &lt;span class="s1"&gt;'&lt;/span&gt;&lt;span class="s"&gt;**/terragrunt.hcl'&lt;/span&gt;
&lt;span class="pi"&gt;-&lt;/span&gt; &lt;span class="s1"&gt;'&lt;/span&gt;&lt;span class="s"&gt;**/docker-compose*.yml'&lt;/span&gt;
&lt;span class="pi"&gt;-&lt;/span&gt; &lt;span class="s1"&gt;'&lt;/span&gt;&lt;span class="s"&gt;**/docker-compose*.yaml'&lt;/span&gt;
&lt;span class="pi"&gt;-&lt;/span&gt; &lt;span class="s1"&gt;'&lt;/span&gt;&lt;span class="s"&gt;**/__main__.py'&lt;/span&gt;
&lt;span class="pi"&gt;-&lt;/span&gt; &lt;span class="s1"&gt;'&lt;/span&gt;&lt;span class="s"&gt;**/index.ts'&lt;/span&gt;
&lt;span class="pi"&gt;-&lt;/span&gt; &lt;span class="s1"&gt;'&lt;/span&gt;&lt;span class="s"&gt;**/*.yaml'&lt;/span&gt;
&lt;span class="pi"&gt;-&lt;/span&gt; &lt;span class="s1"&gt;'&lt;/span&gt;&lt;span class="s"&gt;**/*.yml'&lt;/span&gt;

&lt;span class="na"&gt;jobs&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;
&lt;span class="na"&gt;diagram&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;
&lt;span class="na"&gt;runs-on&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;ubuntu-latest&lt;/span&gt;
&lt;span class="na"&gt;permissions&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;
&lt;span class="na"&gt;pull-requests&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;write&lt;/span&gt;
&lt;span class="na"&gt;steps&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;
&lt;span class="pi"&gt;-&lt;/span&gt; &lt;span class="na"&gt;uses&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;actions/checkout@v4&lt;/span&gt;

&lt;span class="pi"&gt;-&lt;/span&gt; &lt;span class="na"&gt;uses&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;pandey-raghvendra/infrasketch@v4&lt;/span&gt;
&lt;span class="na"&gt;with&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;
&lt;span class="na"&gt;github-token&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;${{ secrets.GITHUB_TOKEN }}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;Note:&lt;/strong&gt; &lt;code&gt;permissions: pull-requests: write&lt;/code&gt; must be set on the &lt;strong&gt;job&lt;/strong&gt;, not just the workflow. The &lt;code&gt;github-token&lt;/code&gt; input defaults to the automatic token — you don't need to create any secrets.&lt;/p&gt;

&lt;p&gt;That's it. Open a PR that touches a &lt;code&gt;.tf&lt;/code&gt; file and the action posts the comment automatically.&lt;/p&gt;

&lt;h2&gt;
  
  
  Supported formats
&lt;/h2&gt;

&lt;p&gt;The action auto-detects format from file extension and content — you don't need to configure anything per-format:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Terraform&lt;/strong&gt; — &lt;code&gt;*.tf&lt;/code&gt;, &lt;code&gt;*.tfvars&lt;/code&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Terragrunt&lt;/strong&gt; — &lt;code&gt;terragrunt.hcl&lt;/code&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Bicep / ARM&lt;/strong&gt; — &lt;code&gt;*.bicep&lt;/code&gt;, ARM JSON templates (detected by schema URL)&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Kubernetes&lt;/strong&gt; — &lt;code&gt;*.yaml&lt;/code&gt; / &lt;code&gt;*.yml&lt;/code&gt; files containing &lt;code&gt;apiVersion:&lt;/code&gt; and &lt;code&gt;kind:&lt;/code&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;CloudFormation&lt;/strong&gt; — YAML/JSON containing &lt;code&gt;AWSTemplateFormatVersion&lt;/code&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;CDK&lt;/strong&gt; — synthesized CloudFormation JSON with &lt;code&gt;Resources&lt;/code&gt; key&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Pulumi&lt;/strong&gt; — &lt;code&gt;__main__.py&lt;/code&gt; or &lt;code&gt;index.ts&lt;/code&gt; with &lt;code&gt;@pulumi/&lt;/code&gt; imports&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Docker Compose&lt;/strong&gt; — &lt;code&gt;docker-compose*.yml&lt;/code&gt;, &lt;code&gt;compose.yml&lt;/code&gt;
&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  How it differs from other diagram PR tools
&lt;/h2&gt;

&lt;p&gt;Several tools post infrastructure-related comments on PRs, but they all have meaningful trade-offs:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Pluralith&lt;/strong&gt; — purpose-built for Terraform visualization with a beautiful diff view. Excellent tool, but the CI integration starts at $250/month per workspace. Free tier is local-only.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Infracost&lt;/strong&gt; — posts cost estimates as text tables. Doesn't generate architecture diagrams.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Holori&lt;/strong&gt; — generates diagrams and posts PR comments. Requires signup and a connected cloud account for full functionality.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;InfraSketch GitHub Action&lt;/strong&gt; — fully free, no account, no secrets beyond the automatic &lt;code&gt;GITHUB_TOKEN&lt;/code&gt;. Diagram links open instantly in any browser. Supports 8 IaC formats without per-format configuration.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;The trade-off: InfraSketch does static analysis of the changed files rather than running &lt;code&gt;terraform plan&lt;/code&gt;. This means it works without cloud credentials and without Terraform being initialized, but it won't show resources created by &lt;code&gt;count&lt;/code&gt; or &lt;code&gt;for_each&lt;/code&gt; expressions that depend on variable values.&lt;/p&gt;

&lt;h2&gt;
  
  
  Customizing which files trigger the action
&lt;/h2&gt;

&lt;p&gt;The &lt;code&gt;paths&lt;/code&gt; filter in the workflow controls which file changes trigger the action. You can narrow it to specific directories:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight yaml"&gt;&lt;code&gt;&lt;span class="na"&gt;on&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;
&lt;span class="na"&gt;pull_request&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;
&lt;span class="na"&gt;paths&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;
&lt;span class="pi"&gt;-&lt;/span&gt; &lt;span class="s1"&gt;'&lt;/span&gt;&lt;span class="s"&gt;infra/**/*.tf'&lt;/span&gt;
&lt;span class="pi"&gt;-&lt;/span&gt; &lt;span class="s1"&gt;'&lt;/span&gt;&lt;span class="s"&gt;k8s/**/*.yaml'&lt;/span&gt;
&lt;span class="pi"&gt;-&lt;/span&gt; &lt;span class="s1"&gt;'&lt;/span&gt;&lt;span class="s"&gt;deployments/**'&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Or broaden it to catch all YAML files in a monorepo:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight yaml"&gt;&lt;code&gt;&lt;span class="na"&gt;on&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;
&lt;span class="na"&gt;pull_request&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;
&lt;span class="na"&gt;paths&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;
&lt;span class="pi"&gt;-&lt;/span&gt; &lt;span class="s1"&gt;'&lt;/span&gt;&lt;span class="s"&gt;**/*.tf'&lt;/span&gt;
&lt;span class="pi"&gt;-&lt;/span&gt; &lt;span class="s1"&gt;'&lt;/span&gt;&lt;span class="s"&gt;**/*.yaml'&lt;/span&gt;
&lt;span class="pi"&gt;-&lt;/span&gt; &lt;span class="s1"&gt;'&lt;/span&gt;&lt;span class="s"&gt;**/*.yml'&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;Large files:&lt;/strong&gt; Files over 200 KB are detected but skipped — a warning appears in the PR comment. For large Terraform projects, use plan JSON (&lt;code&gt;terraform show -json&lt;/code&gt;) pasted directly into &lt;a href="https://infrasketch.cloud" rel="noopener noreferrer"&gt;infrasketch.cloud&lt;/a&gt; for the most accurate diagram.&lt;/p&gt;

&lt;h2&gt;
  
  
  Using it with a monorepo
&lt;/h2&gt;

&lt;p&gt;InfraSketch works well in monorepos where infrastructure lives alongside application code. The action only processes files listed as changed in the PR — it won't scan the entire repository. A PR that changes &lt;code&gt;services/api/main.go&lt;/code&gt; and &lt;code&gt;infra/api/main.tf&lt;/code&gt; will post a diagram link only for &lt;code&gt;infra/api/main.tf&lt;/code&gt;.&lt;/p&gt;

&lt;p&gt;If you have multiple Terraform root modules in a monorepo (e.g. &lt;code&gt;infra/vpc/&lt;/code&gt;, &lt;code&gt;infra/eks/&lt;/code&gt;, &lt;code&gt;infra/rds/&lt;/code&gt;), changes to any of them generate separate diagram links in the same PR comment table.&lt;/p&gt;

&lt;h2&gt;
  
  
  Combining with Checkov and Infracost
&lt;/h2&gt;

&lt;p&gt;InfraSketch pairs naturally with other IaC PR tools. A common setup combines three GitHub Actions on the same PR:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;InfraSketch&lt;/strong&gt; — architecture diagram links for visual review&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Checkov&lt;/strong&gt; — security scan results as a text comment&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Infracost&lt;/strong&gt; — cost estimate diff as a text comment&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Beyond the PR comment, InfraSketch lets you paste the Checkov or Infracost JSON output directly into the diagram tool to overlay security findings or cost estimates visually on the architecture nodes. See the &lt;a href="///blog/checkov-diagram-visualization.html"&gt;Checkov overlay guide&lt;/a&gt; and &lt;a href="///blog/infracost-diagram-visualization.html"&gt;Infracost overlay guide&lt;/a&gt; for details.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight yaml"&gt;&lt;code&gt;&lt;span class="c1"&gt;# .github/workflows/iac-checks.yml — combine all three&lt;/span&gt;
&lt;span class="na"&gt;name&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;IaC Checks&lt;/span&gt;

&lt;span class="na"&gt;on&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;
&lt;span class="na"&gt;pull_request&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;
&lt;span class="na"&gt;paths&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="pi"&gt;[&lt;/span&gt;&lt;span class="s1"&gt;'&lt;/span&gt;&lt;span class="s"&gt;**/*.tf'&lt;/span&gt;&lt;span class="pi"&gt;,&lt;/span&gt; &lt;span class="s1"&gt;'&lt;/span&gt;&lt;span class="s"&gt;**/*.yaml'&lt;/span&gt;&lt;span class="pi"&gt;]&lt;/span&gt;

&lt;span class="na"&gt;jobs&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;
&lt;span class="na"&gt;diagram&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;
&lt;span class="na"&gt;runs-on&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;ubuntu-latest&lt;/span&gt;
&lt;span class="na"&gt;permissions&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;
&lt;span class="na"&gt;pull-requests&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;write&lt;/span&gt;
&lt;span class="na"&gt;steps&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;
&lt;span class="pi"&gt;-&lt;/span&gt; &lt;span class="na"&gt;uses&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;actions/checkout@v4&lt;/span&gt;
&lt;span class="pi"&gt;-&lt;/span&gt; &lt;span class="na"&gt;uses&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;pandey-raghvendra/infrasketch@v4&lt;/span&gt;
&lt;span class="na"&gt;with&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;
&lt;span class="na"&gt;github-token&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;${{ secrets.GITHUB_TOKEN }}&lt;/span&gt;

&lt;span class="na"&gt;cost&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;
&lt;span class="na"&gt;runs-on&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;ubuntu-latest&lt;/span&gt;
&lt;span class="na"&gt;permissions&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;
&lt;span class="na"&gt;pull-requests&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;write&lt;/span&gt;
&lt;span class="na"&gt;steps&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;
&lt;span class="pi"&gt;-&lt;/span&gt; &lt;span class="na"&gt;uses&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;actions/checkout@v4&lt;/span&gt;
&lt;span class="pi"&gt;-&lt;/span&gt; &lt;span class="na"&gt;uses&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;infracost/actions/setup@v3&lt;/span&gt;
&lt;span class="na"&gt;with&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;
&lt;span class="na"&gt;api-key&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;${{ secrets.INFRACOST_API_KEY }}&lt;/span&gt;
&lt;span class="pi"&gt;-&lt;/span&gt; &lt;span class="na"&gt;run&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;infracost diff --path . --format json --out-file infracost.json&lt;/span&gt;
&lt;span class="pi"&gt;-&lt;/span&gt; &lt;span class="na"&gt;uses&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;infracost/actions/comment@v3&lt;/span&gt;
&lt;span class="na"&gt;with&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;
&lt;span class="na"&gt;path&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;infracost.json&lt;/span&gt;
&lt;span class="na"&gt;behavior&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;update&lt;/span&gt;

&lt;span class="na"&gt;security&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;
&lt;span class="na"&gt;runs-on&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;ubuntu-latest&lt;/span&gt;
&lt;span class="na"&gt;steps&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;
&lt;span class="pi"&gt;-&lt;/span&gt; &lt;span class="na"&gt;uses&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;actions/checkout@v4&lt;/span&gt;
&lt;span class="pi"&gt;-&lt;/span&gt; &lt;span class="na"&gt;uses&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;bridgecrewio/checkov-action@v12&lt;/span&gt;
&lt;span class="na"&gt;with&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;
&lt;span class="na"&gt;directory&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;.&lt;/span&gt;
&lt;span class="na"&gt;output_format&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;cli&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  Frequently asked questions
&lt;/h2&gt;

&lt;h3&gt;
  
  
  Does the action need AWS, Azure, or GCP credentials?
&lt;/h3&gt;

&lt;p&gt;No. InfraSketch does static analysis of your HCL/YAML source code — it never calls cloud APIs. Only &lt;code&gt;GITHUB_TOKEN&lt;/code&gt; is needed, and that's provided automatically by GitHub Actions.&lt;/p&gt;

&lt;h3&gt;
  
  
  Does my code get sent to InfraSketch servers?
&lt;/h3&gt;

&lt;p&gt;No. The action encodes your file content as a base64 URL hash. The diagram link opens &lt;a href="https://infrasketch.cloud" rel="noopener noreferrer"&gt;infrasketch.cloud&lt;/a&gt; — a static website that decodes the hash in the browser and renders the diagram client-side. No content ever reaches InfraSketch servers.&lt;/p&gt;

&lt;h3&gt;
  
  
  The comment isn't appearing — what's wrong?
&lt;/h3&gt;

&lt;p&gt;Check that &lt;code&gt;permissions: pull-requests: write&lt;/code&gt; is set on the &lt;strong&gt;job&lt;/strong&gt; block, not just the workflow. Also verify the &lt;code&gt;paths&lt;/code&gt; filter matches your changed files — if no matching files changed, the action exits silently.&lt;/p&gt;

&lt;h3&gt;
  
  
  Can I use it with GitHub Enterprise?
&lt;/h3&gt;

&lt;p&gt;Yes. The action uses the standard GitHub API via &lt;code&gt;GITHUB_TOKEN&lt;/code&gt; — the same mechanism works on GitHub Enterprise Server 3.x+. No additional configuration needed.&lt;/p&gt;

&lt;h3&gt;
  
  
  Will it work with private repositories?
&lt;/h3&gt;

&lt;p&gt;Yes. The GitHub Action runs within your repository's GitHub Actions context. The generated diagram links encode content in the URL hash — they open InfraSketch in the browser locally. Private repo code is never transmitted anywhere.&lt;/p&gt;

&lt;blockquote&gt;
&lt;h3&gt;
  
  
  Install the InfraSketch GitHub Action Free, no secrets, works in 2 minutes. Supports Terraform, Bicep, Pulumi, Kubernetes, CloudFormation, CDK, Terragrunt, and Docker Compose. &lt;a href="https://github.com/marketplace/actions/infrasketch-architecture-diagram" rel="noopener noreferrer"&gt;View on GitHub Marketplace →&lt;/a&gt;
&lt;/h3&gt;
&lt;/blockquote&gt;

&lt;h2&gt;
  
  
  Related articles
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;&lt;a href="///blog/terraform-diagram-generator.html"&gt;Terraform Diagram Generator — Visualize HCL Architecture Instantly&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="///blog/checkov-diagram-visualization.html"&gt;Visualize Checkov Security Findings on Your Architecture Diagram&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="///blog/infracost-diagram-visualization.html"&gt;Visualize Infracost Estimates on Your Architecture Diagram&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;

</description>
      <category>terraformprdiagramgithubaction</category>
      <category>infrastructurediagrampullreque</category>
      <category>terraformdiagramcicd</category>
      <category>githubactionarchitecturediagra</category>
    </item>
    <item>
      <title>Visualize Checkov Results on Your Architecture Diagram</title>
      <dc:creator>Raghvendra Pandey</dc:creator>
      <pubDate>Tue, 12 May 2026 01:20:47 +0000</pubDate>
      <link>https://forem.com/pandey-raghvendra/visualize-checkov-results-on-your-architecture-diagram-42ed</link>
      <guid>https://forem.com/pandey-raghvendra/visualize-checkov-results-on-your-architecture-diagram-42ed</guid>
      <description>&lt;p&gt;Checkov finds hundreds of misconfigurations in your Terraform, Kubernetes, and CloudFormation code — but its output is a wall of terminal text. Resource names like &lt;code&gt;aws_s3_bucket.data_lake&lt;/code&gt; and check IDs like &lt;code&gt;CKV_AWS_18&lt;/code&gt; don't tell you much when you're looking at 60 resources across 12 files.&lt;/p&gt;

&lt;p&gt;InfraSketch's security overlay fixes this. Run &lt;code&gt;checkov -o json&lt;/code&gt;, paste the output, and every failing resource gets a red border directly on your architecture diagram. Hover for the failing check IDs. See at a glance which part of your infrastructure is the riskiest.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;TL;DR:&lt;/strong&gt; Generate your diagram in InfraSketch → click &lt;strong&gt;🛡 Security&lt;/strong&gt; → paste &lt;code&gt;checkov -d . -o json&lt;/code&gt; output → failing resources highlighted instantly. Free, no login, nothing leaves your browser.&lt;/p&gt;

&lt;h2&gt;
  
  
  Why "checkov diagram" matters
&lt;/h2&gt;

&lt;p&gt;When Checkov reports that &lt;code&gt;CKV_AWS_18&lt;/code&gt; failed on &lt;code&gt;aws_s3_bucket.access_logs&lt;/code&gt;, your next question is always: "Where does this bucket sit in my architecture? What connects to it? Is it public-facing or internal?" The terminal output can't answer that. You have to mentally map resource names to your architecture.&lt;/p&gt;

&lt;p&gt;A visual overlay eliminates this mental overhead. You see the bucket in context — inside its VPC, connected to the CloudFront distribution, adjacent to the Lambda that writes to it. The security failure becomes spatially meaningful, not just a name on a list.&lt;/p&gt;

&lt;p&gt;This matters even more when you're reviewing someone else's infrastructure. You can hand a reviewer a diagram link with security failures already highlighted, and they immediately understand scope without reading any code.&lt;/p&gt;

&lt;h2&gt;
  
  
  Step-by-step: generate and overlay
&lt;/h2&gt;

&lt;ol&gt;
&lt;li&gt;
&lt;strong&gt;Run Checkov and save JSON output&lt;/strong&gt;

&lt;code&gt;checkov -d . -o json &amp;gt; checkov-results.json&lt;/code&gt;

If you're scanning a specific file: &lt;code&gt;checkov -f main.tf -o json &amp;gt; checkov-results.json&lt;/code&gt; For Kubernetes manifests: &lt;code&gt;checkov -d ./k8s -o json &amp;gt; checkov-results.json&lt;/code&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Generate your architecture diagram&lt;/strong&gt; Open &lt;a href="https://infrasketch.cloud" rel="noopener noreferrer"&gt;infrasketch.cloud&lt;/a&gt;, paste your Terraform (or Kubernetes YAML, CloudFormation, etc.), and click &lt;strong&gt;Generate Diagram&lt;/strong&gt;. Your resources appear as nodes with official cloud icons.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Open the Security overlay&lt;/strong&gt; In the export bar at the bottom, click the &lt;strong&gt;🛡 Security&lt;/strong&gt; button. A modal opens with a textarea.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Paste the Checkov JSON output&lt;/strong&gt; Open &lt;code&gt;checkov-results.json&lt;/code&gt;, copy its contents, paste into the textarea, and click &lt;strong&gt;Apply&lt;/strong&gt;.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Review the highlighted diagram&lt;/strong&gt; Resources with failing checks get a red border ring and a red badge in the top-right corner showing the number of failing checks. Hover over any red badge to see the specific check IDs in a tooltip (e.g., &lt;em&gt;CKV_AWS_18, CKV_AWS_19, CKV_AWS_21&lt;/em&gt;).&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;The overlay is non-destructive — click &lt;strong&gt;Clear&lt;/strong&gt; in the modal to remove all highlighting without regenerating the diagram. You can also close and re-apply with different Checkov output (e.g., after a targeted scan).&lt;/p&gt;

&lt;h2&gt;
  
  
  What Checkov checks does InfraSketch cover?
&lt;/h2&gt;

&lt;p&gt;InfraSketch maps Checkov's resource IDs (e.g., &lt;code&gt;aws_s3_bucket.my_bucket&lt;/code&gt;) to diagram nodes using the &lt;code&gt;resource&lt;/code&gt; field from each failed check in the JSON output. Any check that Checkov reports a failure on will be highlighted — there's no fixed list on InfraSketch's side.&lt;/p&gt;

&lt;p&gt;That said, here are the most common AWS checks you'll see highlighted:&lt;/p&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Check ID&lt;/th&gt;
&lt;th&gt;Resource Type&lt;/th&gt;
&lt;th&gt;Description&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;CKV_AWS_18&lt;/td&gt;
&lt;td&gt;S3 Bucket&lt;/td&gt;
&lt;td&gt;Access logging enabled&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;CKV_AWS_19&lt;/td&gt;
&lt;td&gt;S3 Bucket&lt;/td&gt;
&lt;td&gt;Server-side encryption enabled&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;CKV_AWS_20&lt;/td&gt;
&lt;td&gt;S3 Bucket&lt;/td&gt;
&lt;td&gt;Bucket not publicly accessible&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;CKV_AWS_21&lt;/td&gt;
&lt;td&gt;S3 Bucket&lt;/td&gt;
&lt;td&gt;Versioning enabled&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;CKV_AWS_23&lt;/td&gt;
&lt;td&gt;CloudFront&lt;/td&gt;
&lt;td&gt;Minimum TLS 1.2 enforced&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;CKV_AWS_57&lt;/td&gt;
&lt;td&gt;S3 Bucket&lt;/td&gt;
&lt;td&gt;Block public ACLs&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;CKV_AWS_91&lt;/td&gt;
&lt;td&gt;ALB&lt;/td&gt;
&lt;td&gt;Access logging enabled&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;CKV_AWS_116&lt;/td&gt;
&lt;td&gt;Lambda&lt;/td&gt;
&lt;td&gt;Dead letter queue configured&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;CKV_AWS_149&lt;/td&gt;
&lt;td&gt;Secrets Manager&lt;/td&gt;
&lt;td&gt;KMS CMK used for encryption&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;CKV_K8S_14&lt;/td&gt;
&lt;td&gt;Pod&lt;/td&gt;
&lt;td&gt;Container does not run as root&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;p&gt;The same principle applies for Azure and GCP checks — as long as the resource name in the Checkov JSON matches the resource name in your IaC code, the overlay works.&lt;/p&gt;

&lt;h2&gt;
  
  
  Understanding the overlay: what the red badges mean
&lt;/h2&gt;

&lt;p&gt;Each highlighted node shows a number badge in the top-right corner. That number is the count of failing checks for that specific resource. A badge showing &lt;strong&gt;5&lt;/strong&gt; means Checkov found five distinct misconfigurations on that resource.&lt;/p&gt;

&lt;p&gt;Hover over the badge to see a tooltip listing the check IDs. For example:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;aws_s3_bucket.raw_data
CKV_AWS_18: Access logging not enabled
CKV_AWS_19: Server-side encryption not configured
CKV_AWS_20: Bucket is publicly readable
CKV_AWS_21: Versioning not enabled
CKV_AWS_57: Public ACLs not blocked
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;This tells you the full picture without leaving the diagram. A resource with a badge of 5 on a public-facing S3 bucket is an obvious priority. A badge of 1 on an internal Lambda with a missing dead-letter queue is much lower risk.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;High-risk pattern to watch for:&lt;/strong&gt; Any storage resource (S3, RDS, DynamoDB) with red borders that sits outside a VPC boundary in the diagram is likely exposed. Prioritize these above all else.&lt;/p&gt;

&lt;h2&gt;
  
  
  Combining security and cost overlays
&lt;/h2&gt;

&lt;p&gt;InfraSketch supports two overlays simultaneously: Checkov security (🛡) and Infracost cost (💰). You can apply both at once — security badges appear top-right, cost pills appear bottom-centre, so they don't overlap.&lt;/p&gt;

&lt;p&gt;This combination is especially useful for prioritization. A resource that's both expensive and misconfigured (red border + amber/red cost badge) is a double priority: it's costing you money &lt;em&gt;and&lt;/em&gt; creating risk. A cheap misconfigured resource can be triaged differently.&lt;/p&gt;

&lt;p&gt;To use both overlays:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Generate the diagram&lt;/li&gt;
&lt;li&gt;Apply Checkov overlay via 🛡 Security&lt;/li&gt;
&lt;li&gt;Apply Infracost overlay via 💰 Cost (see the &lt;a href="///blog/infracost-diagram-visualization.html"&gt;Infracost guide&lt;/a&gt;)&lt;/li&gt;
&lt;li&gt;Both overlays remain active — export as PNG or SVG to share&lt;/li&gt;
&lt;/ol&gt;

&lt;h2&gt;
  
  
  Using the overlay in pull request reviews
&lt;/h2&gt;

&lt;p&gt;The most powerful workflow is combining the Checkov overlay with the &lt;a href="///blog/github-action-terraform-diagram.html"&gt;InfraSketch GitHub Action&lt;/a&gt;. The action auto-posts diagram links on every IaC PR. Reviewers can then manually apply the Checkov overlay on their local scan, or you can run Checkov in CI and include results in the PR comment.&lt;/p&gt;

&lt;p&gt;Here's a CI workflow that posts both the diagram link and the Checkov scan summary:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight yaml"&gt;&lt;code&gt;&lt;span class="c1"&gt;# .github/workflows/infrasketch-security.yml&lt;/span&gt;
&lt;span class="na"&gt;name&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;IaC Diagram + Security Scan&lt;/span&gt;
&lt;span class="na"&gt;on&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;
&lt;span class="na"&gt;pull_request&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;
&lt;span class="na"&gt;paths&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="pi"&gt;[&lt;/span&gt;&lt;span class="s1"&gt;'&lt;/span&gt;&lt;span class="s"&gt;**/*.tf'&lt;/span&gt;&lt;span class="pi"&gt;,&lt;/span&gt; &lt;span class="s1"&gt;'&lt;/span&gt;&lt;span class="s"&gt;**/*.yaml'&lt;/span&gt;&lt;span class="pi"&gt;]&lt;/span&gt;

&lt;span class="na"&gt;jobs&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;
&lt;span class="na"&gt;diagram&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;
&lt;span class="na"&gt;runs-on&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;ubuntu-latest&lt;/span&gt;
&lt;span class="na"&gt;permissions&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;
&lt;span class="na"&gt;pull-requests&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;write&lt;/span&gt;
&lt;span class="na"&gt;steps&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;
&lt;span class="pi"&gt;-&lt;/span&gt; &lt;span class="na"&gt;uses&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;actions/checkout@v4&lt;/span&gt;
&lt;span class="pi"&gt;-&lt;/span&gt; &lt;span class="na"&gt;uses&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;pandey-raghvendra/infrasketch@v4&lt;/span&gt;
&lt;span class="na"&gt;with&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;
&lt;span class="na"&gt;github-token&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;${{ secrets.GITHUB_TOKEN }}&lt;/span&gt;

&lt;span class="na"&gt;checkov&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;
&lt;span class="na"&gt;runs-on&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;ubuntu-latest&lt;/span&gt;
&lt;span class="na"&gt;permissions&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;
&lt;span class="na"&gt;pull-requests&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;write&lt;/span&gt;
&lt;span class="na"&gt;steps&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;
&lt;span class="pi"&gt;-&lt;/span&gt; &lt;span class="na"&gt;uses&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;actions/checkout@v4&lt;/span&gt;
&lt;span class="pi"&gt;-&lt;/span&gt; &lt;span class="na"&gt;uses&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;bridgecrewio/checkov-action@master&lt;/span&gt;
&lt;span class="na"&gt;with&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;
&lt;span class="na"&gt;directory&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;.&lt;/span&gt;
&lt;span class="na"&gt;framework&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;terraform&lt;/span&gt;
&lt;span class="na"&gt;output_format&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;github_failed_only&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The diagram job posts a table with diagram links. The Checkov job posts inline PR annotations on the failing lines. Together, reviewers get both spatial context (which resources, where in the architecture) and precise line-level failures.&lt;/p&gt;

&lt;h2&gt;
  
  
  Supported IaC formats for the security overlay
&lt;/h2&gt;

&lt;p&gt;The security overlay works with any diagram InfraSketch can generate. Checkov supports the same formats — so you can overlay results from any Checkov-compatible scan:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Terraform HCL&lt;/strong&gt; — &lt;code&gt;checkov -d . --framework terraform -o json&lt;/code&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Terraform plan JSON&lt;/strong&gt; — &lt;code&gt;checkov -f tfplan.json --framework terraform_plan -o json&lt;/code&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;CloudFormation&lt;/strong&gt; — &lt;code&gt;checkov -d . --framework cloudformation -o json&lt;/code&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Kubernetes YAML&lt;/strong&gt; — &lt;code&gt;checkov -d ./k8s --framework kubernetes -o json&lt;/code&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Docker Compose&lt;/strong&gt; — &lt;code&gt;checkov -f docker-compose.yml --framework dockerfile -o json&lt;/code&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Bicep / ARM&lt;/strong&gt; — &lt;code&gt;checkov -f template.bicep --framework bicep -o json&lt;/code&gt;
&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Paste the resulting JSON into InfraSketch's Security overlay after generating the diagram for that format.&lt;/p&gt;

&lt;h2&gt;
  
  
  Exporting diagrams with security overlays
&lt;/h2&gt;

&lt;p&gt;Once you've applied the Checkov overlay, you can export the diagram with the security highlighting preserved:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;PNG (2× retina)&lt;/strong&gt; — best for Confluence pages, Notion, Slack, or Jira tickets. Red borders and badges export cleanly.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;SVG&lt;/strong&gt; — scalable, icons inlined. Good for design tools or documentation systems that support SVG.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Share link&lt;/strong&gt; — copies a URL that encodes your diagram state. The security overlay state is &lt;em&gt;not&lt;/em&gt; included in the share link (the receiver needs to apply it themselves), but the diagram structure is preserved.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;For PNG export: click &lt;strong&gt;Export PNG&lt;/strong&gt; in the export bar. The overlay renders at full resolution. For documentation-heavy teams, this is the fastest way to attach a security-annotated architecture snapshot to a ticket or post-mortem.&lt;/p&gt;

&lt;h2&gt;
  
  
  Troubleshooting common issues
&lt;/h2&gt;

&lt;h3&gt;
  
  
  No resources highlighted after pasting Checkov output
&lt;/h3&gt;

&lt;p&gt;The overlay matches on the resource name exactly as it appears in your IaC code (e.g., &lt;code&gt;aws_s3_bucket.my_bucket&lt;/code&gt;). If your diagram was generated from a Terraform plan JSON, resource names include a module path prefix (&lt;code&gt;module.storage.aws_s3_bucket.my_bucket&lt;/code&gt;). InfraSketch strips common module prefixes during matching, but if resources still don't match, try:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Regenerate the diagram from the same HCL files that Checkov scanned (not plan JSON)&lt;/li&gt;
&lt;li&gt;Check the Checkov JSON for the exact &lt;code&gt;resource&lt;/code&gt; field value and compare to node IDs in the diagram&lt;/li&gt;
&lt;li&gt;Ensure you're pasting the full JSON (not just the summary section)&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;
  
  
  Checkov output is an array, not a single object
&lt;/h3&gt;

&lt;p&gt;When scanning multiple frameworks together, Checkov sometimes wraps results in a JSON array (&lt;code&gt;[{...}, {...}]&lt;/code&gt;). InfraSketch handles both formats — array-wrapped and single-object — automatically.&lt;/p&gt;

&lt;h3&gt;
  
  
  Only some resources are highlighted, not all failing ones
&lt;/h3&gt;

&lt;p&gt;This usually means some resources in the Checkov scan correspond to files that weren't included in the diagram. For example, if your diagram shows only the networking layer but Checkov scanned the whole codebase, compute-layer failures won't have matching nodes to highlight. Generate a diagram from the same scope as the Checkov scan.&lt;/p&gt;

&lt;h2&gt;
  
  
  Frequently asked questions
&lt;/h2&gt;

&lt;h3&gt;
  
  
  Does InfraSketch send my Checkov output to any server?
&lt;/h3&gt;

&lt;p&gt;No. Everything runs in your browser. The Checkov JSON is parsed in JavaScript on your machine. Nothing is transmitted — no analytics, no logging, no server-side processing. Your security findings stay private.&lt;/p&gt;

&lt;h3&gt;
  
  
  Can I overlay Checkov results from a CI/CD pipeline?
&lt;/h3&gt;

&lt;p&gt;Yes. Run &lt;code&gt;checkov -d . -o json &amp;gt; checkov.json&lt;/code&gt; as a CI step, download the artifact, and paste it into the InfraSketch security overlay. The process is identical whether you ran Checkov locally or in GitHub Actions, GitLab CI, or Jenkins.&lt;/p&gt;

&lt;h3&gt;
  
  
  Does the overlay work with Checkov's SARIF output?
&lt;/h3&gt;

&lt;p&gt;Not currently. InfraSketch parses Checkov's &lt;code&gt;-o json&lt;/code&gt; format, which includes the &lt;code&gt;results.failed_checks&lt;/code&gt; array with &lt;code&gt;resource&lt;/code&gt; fields. SARIF is a different schema. Use &lt;code&gt;-o json&lt;/code&gt; (not &lt;code&gt;-o sarif&lt;/code&gt;) when generating output for InfraSketch.&lt;/p&gt;

&lt;h3&gt;
  
  
  Can I pass Checkov results while skipping certain checks?
&lt;/h3&gt;

&lt;p&gt;Yes — filter before scanning. Use &lt;code&gt;checkov --skip-check CKV_AWS_18,CKV_AWS_21 -d . -o json&lt;/code&gt; to exclude checks you've accepted as known risks. Only the remaining failures appear in the JSON, so only those get highlighted.&lt;/p&gt;

&lt;h3&gt;
  
  
  Does the overlay work with custom Checkov policies?
&lt;/h3&gt;

&lt;p&gt;Yes. Custom policies that output the standard Checkov JSON format (with &lt;code&gt;results.failed_checks[].resource&lt;/code&gt;) work identically to built-in checks. InfraSketch doesn't validate check IDs — it just reads the resource names and highlights them.&lt;/p&gt;

&lt;h3&gt;
  
  
  Can I use this with Bridgecrew / Prisma Cloud results?
&lt;/h3&gt;

&lt;p&gt;Bridgecrew and Prisma Cloud use Checkov under the hood and can export in the same JSON format. As long as the output includes a &lt;code&gt;results.failed_checks&lt;/code&gt; array with &lt;code&gt;resource&lt;/code&gt; fields, InfraSketch can parse it.&lt;/p&gt;

&lt;blockquote&gt;
&lt;h3&gt;
  
  
  Try the security overlay now Generate your architecture diagram and overlay Checkov results — free, no login, nothing leaves your browser. &lt;a href="https://infrasketch.cloud" rel="noopener noreferrer"&gt;Open InfraSketch →&lt;/a&gt;
&lt;/h3&gt;
&lt;/blockquote&gt;

&lt;h2&gt;
  
  
  Related guides
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;&lt;a href="///blog/infracost-diagram-visualization.html"&gt;Visualize Infracost results on your architecture diagram&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="///blog/github-action-terraform-diagram.html"&gt;Auto-post architecture diagrams on IaC PRs with GitHub Actions&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="///blog/terraform-diagram-generator.html"&gt;Terraform diagram generator — visualize HCL instantly&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;

</description>
      <category>checkovdiagram</category>
      <category>visualizecheckovresults</category>
      <category>checkovterraformdiagram</category>
      <category>iacsecuritydiagram</category>
    </item>
    <item>
      <title>Terraform Diagram Generator — Visualize HCL Architecture Instantly</title>
      <dc:creator>Raghvendra Pandey</dc:creator>
      <pubDate>Tue, 12 May 2026 00:28:34 +0000</pubDate>
      <link>https://forem.com/pandey-raghvendra/terraform-diagram-generator-visualize-hcl-architecture-instantly-2f00</link>
      <guid>https://forem.com/pandey-raghvendra/terraform-diagram-generator-visualize-hcl-architecture-instantly-2f00</guid>
      <description>&lt;p&gt;Paste your Terraform HCL into &lt;a href="https://infrasketch.cloud" rel="noopener noreferrer"&gt;InfraSketch&lt;/a&gt; and get a full architecture diagram in seconds — AWS, GCP, and Azure resources auto-detected, grouped by layer, with official cloud provider icons. No CLI, no credentials, no signup. Everything runs in your browser.&lt;/p&gt;

&lt;blockquote&gt;
&lt;h3&gt;
  
  
  Try it now — free Paste your &lt;code&gt;.tf&lt;/code&gt; files and see the architecture diagram instantly. &lt;a href="https://infrasketch.cloud" rel="noopener noreferrer"&gt;Open InfraSketch →&lt;/a&gt;
&lt;/h3&gt;
&lt;/blockquote&gt;

&lt;h2&gt;
  
  
  Why Terraform needs a diagram tool
&lt;/h2&gt;

&lt;p&gt;A real-world Terraform codebase is hard to read as architecture. Resources live across dozens of files, module calls hide what actually gets deployed, and &lt;code&gt;count&lt;/code&gt; / &lt;code&gt;for_each&lt;/code&gt; meta-arguments mean one block can create ten resources. Reviewing a PR with 500 lines of HCL changes requires mental simulation to understand what the resulting infrastructure looks like.&lt;/p&gt;

&lt;p&gt;Built-in options fall short. &lt;code&gt;terraform graph&lt;/code&gt; outputs DOT format that, when rendered, produces an unreadable tangle of every internal dependency edge — providers, variables, locals, outputs — alongside actual resources. The AWS console shows deployed resources but not their relationships or intended topology. Visio and draw.io require manual box-drawing that drifts from the real infrastructure the moment someone runs &lt;code&gt;terraform apply&lt;/code&gt;.&lt;/p&gt;

&lt;p&gt;InfraSketch parses your HCL statically — no plan, no state, no AWS credentials required — and generates a topology diagram grouped by logical layer: Internet, Ingress, Compute, Data, Messaging, Security, and more. It works for AWS, GCP, and Azure resources in the same file.&lt;/p&gt;

&lt;h2&gt;
  
  
  How to generate a Terraform diagram
&lt;/h2&gt;

&lt;p&gt;Open &lt;a href="https://infrasketch.cloud" rel="noopener noreferrer"&gt;infrasketch.cloud&lt;/a&gt;. The &lt;strong&gt;Terraform&lt;/strong&gt; tab is selected by default. Paste your HCL — one file, multiple concatenated files, or a partial module — and click &lt;strong&gt;Generate Diagram&lt;/strong&gt;. The diagram renders immediately.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight terraform"&gt;&lt;code&gt;&lt;span class="c1"&gt;# Example: paste this into the Terraform tab&lt;/span&gt;
&lt;span class="k"&gt;resource&lt;/span&gt; &lt;span class="s2"&gt;"aws_vpc"&lt;/span&gt; &lt;span class="s2"&gt;"main"&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
&lt;span class="nx"&gt;cidr_block&lt;/span&gt;           &lt;span class="p"&gt;=&lt;/span&gt; &lt;span class="s2"&gt;"10.0.0.0/16"&lt;/span&gt;
&lt;span class="nx"&gt;enable_dns_hostnames&lt;/span&gt; &lt;span class="p"&gt;=&lt;/span&gt; &lt;span class="kc"&gt;true&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;

&lt;span class="k"&gt;resource&lt;/span&gt; &lt;span class="s2"&gt;"aws_subnet"&lt;/span&gt; &lt;span class="s2"&gt;"private"&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
&lt;span class="nx"&gt;vpc_id&lt;/span&gt;            &lt;span class="p"&gt;=&lt;/span&gt; &lt;span class="nx"&gt;aws_vpc&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;main&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;id&lt;/span&gt;
&lt;span class="nx"&gt;cidr_block&lt;/span&gt;        &lt;span class="p"&gt;=&lt;/span&gt; &lt;span class="s2"&gt;"10.0.1.0/24"&lt;/span&gt;
&lt;span class="nx"&gt;availability_zone&lt;/span&gt; &lt;span class="p"&gt;=&lt;/span&gt; &lt;span class="s2"&gt;"us-east-1a"&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;

&lt;span class="k"&gt;resource&lt;/span&gt; &lt;span class="s2"&gt;"aws_eks_cluster"&lt;/span&gt; &lt;span class="s2"&gt;"app"&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
&lt;span class="nx"&gt;name&lt;/span&gt;     &lt;span class="p"&gt;=&lt;/span&gt; &lt;span class="s2"&gt;"production"&lt;/span&gt;
&lt;span class="nx"&gt;role_arn&lt;/span&gt; &lt;span class="p"&gt;=&lt;/span&gt; &lt;span class="nx"&gt;aws_iam_role&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;eks&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;arn&lt;/span&gt;

&lt;span class="nx"&gt;vpc_config&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
&lt;span class="nx"&gt;subnet_ids&lt;/span&gt; &lt;span class="p"&gt;=&lt;/span&gt; &lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="nx"&gt;aws_subnet&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;private&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;id&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;

&lt;span class="k"&gt;resource&lt;/span&gt; &lt;span class="s2"&gt;"aws_rds_cluster"&lt;/span&gt; &lt;span class="s2"&gt;"db"&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
&lt;span class="nx"&gt;cluster_identifier&lt;/span&gt; &lt;span class="p"&gt;=&lt;/span&gt; &lt;span class="s2"&gt;"app-db"&lt;/span&gt;
&lt;span class="nx"&gt;engine&lt;/span&gt;             &lt;span class="p"&gt;=&lt;/span&gt; &lt;span class="s2"&gt;"aurora-postgresql"&lt;/span&gt;
&lt;span class="nx"&gt;engine_version&lt;/span&gt;     &lt;span class="p"&gt;=&lt;/span&gt; &lt;span class="s2"&gt;"15.4"&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;

&lt;span class="k"&gt;resource&lt;/span&gt; &lt;span class="s2"&gt;"aws_elasticache_replication_group"&lt;/span&gt; &lt;span class="s2"&gt;"cache"&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
&lt;span class="nx"&gt;replication_group_id&lt;/span&gt; &lt;span class="p"&gt;=&lt;/span&gt; &lt;span class="s2"&gt;"app-cache"&lt;/span&gt;
&lt;span class="nx"&gt;description&lt;/span&gt;          &lt;span class="p"&gt;=&lt;/span&gt; &lt;span class="s2"&gt;"Redis for session data"&lt;/span&gt;
&lt;span class="nx"&gt;node_type&lt;/span&gt;            &lt;span class="p"&gt;=&lt;/span&gt; &lt;span class="s2"&gt;"cache.t4g.micro"&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;Tip:&lt;/strong&gt; You can paste multiple &lt;code&gt;.tf&lt;/code&gt; files concatenated together. InfraSketch parses the full block structure, so cross-file references like &lt;code&gt;aws_subnet.private.id&lt;/code&gt; resolve correctly for containment and connection detection.&lt;/p&gt;

&lt;h2&gt;
  
  
  What gets visualized
&lt;/h2&gt;

&lt;h4&gt;
  
  
  Resource grouping
&lt;/h4&gt;

&lt;p&gt;Resources grouped into swimlanes — Networking, Compute, Database, Messaging, Security — for instant topology understanding.&lt;/p&gt;

&lt;h4&gt;
  
  
  VPC containment
&lt;/h4&gt;

&lt;p&gt;Resources referencing a VPC via &lt;code&gt;vpc_id&lt;/code&gt; are drawn inside the VPC boundary. Subnets appear as nested lanes.&lt;/p&gt;

&lt;h4&gt;
  
  
  Reference arrows
&lt;/h4&gt;

&lt;p&gt;HCL references like &lt;code&gt;aws_subnet.private.id&lt;/code&gt; and &lt;code&gt;module.vpc.vpc_id&lt;/code&gt; become directed arrows between nodes.&lt;/p&gt;

&lt;h4&gt;
  
  
  Multi-cloud support
&lt;/h4&gt;

&lt;p&gt;AWS, GCP, and Azure resource types all parse in the same file. Mixed-provider setups diagram correctly.&lt;/p&gt;

&lt;h2&gt;
  
  
  Three common Terraform patterns
&lt;/h2&gt;

&lt;h3&gt;
  
  
  Pattern 1: VPC + EKS + RDS (three-tier web app)
&lt;/h3&gt;

&lt;p&gt;The most common AWS architecture: public subnets for load balancers, private subnets for application pods, isolated subnets for databases. InfraSketch detects the subnet references and draws each resource in its correct network zone.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight terraform"&gt;&lt;code&gt;&lt;span class="k"&gt;resource&lt;/span&gt; &lt;span class="s2"&gt;"aws_vpc"&lt;/span&gt; &lt;span class="s2"&gt;"main"&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
&lt;span class="nx"&gt;cidr_block&lt;/span&gt; &lt;span class="p"&gt;=&lt;/span&gt; &lt;span class="s2"&gt;"10.0.0.0/16"&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;

&lt;span class="k"&gt;resource&lt;/span&gt; &lt;span class="s2"&gt;"aws_subnet"&lt;/span&gt; &lt;span class="s2"&gt;"public"&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
&lt;span class="nx"&gt;vpc_id&lt;/span&gt;     &lt;span class="p"&gt;=&lt;/span&gt; &lt;span class="nx"&gt;aws_vpc&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;main&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;id&lt;/span&gt;
&lt;span class="nx"&gt;cidr_block&lt;/span&gt; &lt;span class="p"&gt;=&lt;/span&gt; &lt;span class="s2"&gt;"10.0.0.0/24"&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;

&lt;span class="k"&gt;resource&lt;/span&gt; &lt;span class="s2"&gt;"aws_subnet"&lt;/span&gt; &lt;span class="s2"&gt;"private"&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
&lt;span class="nx"&gt;vpc_id&lt;/span&gt;     &lt;span class="p"&gt;=&lt;/span&gt; &lt;span class="nx"&gt;aws_vpc&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;main&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;id&lt;/span&gt;
&lt;span class="nx"&gt;cidr_block&lt;/span&gt; &lt;span class="p"&gt;=&lt;/span&gt; &lt;span class="s2"&gt;"10.0.1.0/24"&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;

&lt;span class="k"&gt;resource&lt;/span&gt; &lt;span class="s2"&gt;"aws_lb"&lt;/span&gt; &lt;span class="s2"&gt;"app"&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
&lt;span class="nx"&gt;load_balancer_type&lt;/span&gt; &lt;span class="p"&gt;=&lt;/span&gt; &lt;span class="s2"&gt;"application"&lt;/span&gt;
&lt;span class="nx"&gt;subnets&lt;/span&gt;            &lt;span class="p"&gt;=&lt;/span&gt; &lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="nx"&gt;aws_subnet&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;public&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;id&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;

&lt;span class="k"&gt;resource&lt;/span&gt; &lt;span class="s2"&gt;"aws_eks_cluster"&lt;/span&gt; &lt;span class="s2"&gt;"app"&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
&lt;span class="nx"&gt;name&lt;/span&gt; &lt;span class="p"&gt;=&lt;/span&gt; &lt;span class="s2"&gt;"production"&lt;/span&gt;
&lt;span class="nx"&gt;vpc_config&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
&lt;span class="nx"&gt;subnet_ids&lt;/span&gt; &lt;span class="p"&gt;=&lt;/span&gt; &lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="nx"&gt;aws_subnet&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;private&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;id&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;

&lt;span class="k"&gt;resource&lt;/span&gt; &lt;span class="s2"&gt;"aws_db_instance"&lt;/span&gt; &lt;span class="s2"&gt;"postgres"&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
&lt;span class="nx"&gt;engine&lt;/span&gt;         &lt;span class="p"&gt;=&lt;/span&gt; &lt;span class="s2"&gt;"postgres"&lt;/span&gt;
&lt;span class="nx"&gt;instance_class&lt;/span&gt; &lt;span class="p"&gt;=&lt;/span&gt; &lt;span class="s2"&gt;"db.t4g.medium"&lt;/span&gt;
&lt;span class="nx"&gt;db_subnet_group_name&lt;/span&gt; &lt;span class="p"&gt;=&lt;/span&gt; &lt;span class="nx"&gt;aws_db_subnet_group&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;main&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;name&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The diagram shows ALB in the public subnet, EKS in the private subnet, and RDS in the isolated database tier — with arrows following the actual HCL references.&lt;/p&gt;

&lt;h3&gt;
  
  
  Pattern 2: Lambda + SQS + DynamoDB (serverless event pipeline)
&lt;/h3&gt;

&lt;p&gt;Serverless architectures have no VPC by default, so InfraSketch groups them by service category rather than network zone. Lambda functions, SQS queues, and DynamoDB tables each land in their logical tier.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight terraform"&gt;&lt;code&gt;&lt;span class="k"&gt;resource&lt;/span&gt; &lt;span class="s2"&gt;"aws_sqs_queue"&lt;/span&gt; &lt;span class="s2"&gt;"jobs"&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
&lt;span class="nx"&gt;name&lt;/span&gt; &lt;span class="p"&gt;=&lt;/span&gt; &lt;span class="s2"&gt;"job-queue"&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;

&lt;span class="k"&gt;resource&lt;/span&gt; &lt;span class="s2"&gt;"aws_lambda_function"&lt;/span&gt; &lt;span class="s2"&gt;"processor"&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
&lt;span class="nx"&gt;function_name&lt;/span&gt; &lt;span class="p"&gt;=&lt;/span&gt; &lt;span class="s2"&gt;"job-processor"&lt;/span&gt;
&lt;span class="nx"&gt;runtime&lt;/span&gt;       &lt;span class="p"&gt;=&lt;/span&gt; &lt;span class="s2"&gt;"python3.12"&lt;/span&gt;
&lt;span class="nx"&gt;handler&lt;/span&gt;       &lt;span class="p"&gt;=&lt;/span&gt; &lt;span class="s2"&gt;"handler.main"&lt;/span&gt;
&lt;span class="nx"&gt;filename&lt;/span&gt;      &lt;span class="p"&gt;=&lt;/span&gt; &lt;span class="s2"&gt;"lambda.zip"&lt;/span&gt;

&lt;span class="nx"&gt;environment&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
&lt;span class="nx"&gt;variables&lt;/span&gt; &lt;span class="p"&gt;=&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
&lt;span class="nx"&gt;QUEUE_URL&lt;/span&gt; &lt;span class="p"&gt;=&lt;/span&gt; &lt;span class="nx"&gt;aws_sqs_queue&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;jobs&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;url&lt;/span&gt;
&lt;span class="nx"&gt;TABLE&lt;/span&gt;     &lt;span class="p"&gt;=&lt;/span&gt; &lt;span class="nx"&gt;aws_dynamodb_table&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;results&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;name&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;

&lt;span class="k"&gt;resource&lt;/span&gt; &lt;span class="s2"&gt;"aws_lambda_event_source_mapping"&lt;/span&gt; &lt;span class="s2"&gt;"trigger"&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
&lt;span class="nx"&gt;event_source_arn&lt;/span&gt; &lt;span class="p"&gt;=&lt;/span&gt; &lt;span class="nx"&gt;aws_sqs_queue&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;jobs&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;arn&lt;/span&gt;
&lt;span class="nx"&gt;function_name&lt;/span&gt;    &lt;span class="p"&gt;=&lt;/span&gt; &lt;span class="nx"&gt;aws_lambda_function&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;processor&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;arn&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;

&lt;span class="k"&gt;resource&lt;/span&gt; &lt;span class="s2"&gt;"aws_dynamodb_table"&lt;/span&gt; &lt;span class="s2"&gt;"results"&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
&lt;span class="nx"&gt;name&lt;/span&gt;         &lt;span class="p"&gt;=&lt;/span&gt; &lt;span class="s2"&gt;"job-results"&lt;/span&gt;
&lt;span class="nx"&gt;billing_mode&lt;/span&gt; &lt;span class="p"&gt;=&lt;/span&gt; &lt;span class="s2"&gt;"PAY_PER_REQUEST"&lt;/span&gt;
&lt;span class="nx"&gt;hash_key&lt;/span&gt;     &lt;span class="p"&gt;=&lt;/span&gt; &lt;span class="s2"&gt;"jobId"&lt;/span&gt;

&lt;span class="nx"&gt;attribute&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
&lt;span class="nx"&gt;name&lt;/span&gt; &lt;span class="p"&gt;=&lt;/span&gt; &lt;span class="s2"&gt;"jobId"&lt;/span&gt;
&lt;span class="nx"&gt;type&lt;/span&gt; &lt;span class="p"&gt;=&lt;/span&gt; &lt;span class="s2"&gt;"S"&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  Pattern 3: GCP Terraform with Cloud Run + Cloud SQL
&lt;/h3&gt;

&lt;p&gt;InfraSketch supports GCP resources using the &lt;code&gt;google_*&lt;/code&gt; provider prefix. Cloud Run services, Cloud SQL instances, Pub/Sub topics, GKE clusters, Cloud Storage buckets, and more all render with GCP icons.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight terraform"&gt;&lt;code&gt;&lt;span class="k"&gt;resource&lt;/span&gt; &lt;span class="s2"&gt;"google_cloud_run_v2_service"&lt;/span&gt; &lt;span class="s2"&gt;"api"&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
&lt;span class="nx"&gt;name&lt;/span&gt;     &lt;span class="p"&gt;=&lt;/span&gt; &lt;span class="s2"&gt;"api"&lt;/span&gt;
&lt;span class="nx"&gt;location&lt;/span&gt; &lt;span class="p"&gt;=&lt;/span&gt; &lt;span class="s2"&gt;"us-central1"&lt;/span&gt;

&lt;span class="nx"&gt;template&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
&lt;span class="nx"&gt;containers&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
&lt;span class="nx"&gt;image&lt;/span&gt; &lt;span class="p"&gt;=&lt;/span&gt; &lt;span class="s2"&gt;"gcr.io/my-project/api:latest"&lt;/span&gt;
&lt;span class="nx"&gt;env&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
&lt;span class="nx"&gt;name&lt;/span&gt;  &lt;span class="p"&gt;=&lt;/span&gt; &lt;span class="s2"&gt;"DB_CONN"&lt;/span&gt;
&lt;span class="nx"&gt;value&lt;/span&gt; &lt;span class="p"&gt;=&lt;/span&gt; &lt;span class="nx"&gt;google_sql_database_instance&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;main&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;connection_name&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;

&lt;span class="k"&gt;resource&lt;/span&gt; &lt;span class="s2"&gt;"google_sql_database_instance"&lt;/span&gt; &lt;span class="s2"&gt;"main"&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
&lt;span class="nx"&gt;name&lt;/span&gt;             &lt;span class="p"&gt;=&lt;/span&gt; &lt;span class="s2"&gt;"app-db"&lt;/span&gt;
&lt;span class="nx"&gt;database_version&lt;/span&gt; &lt;span class="p"&gt;=&lt;/span&gt; &lt;span class="s2"&gt;"POSTGRES_15"&lt;/span&gt;
&lt;span class="nx"&gt;region&lt;/span&gt;           &lt;span class="p"&gt;=&lt;/span&gt; &lt;span class="s2"&gt;"us-central1"&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;

&lt;span class="k"&gt;resource&lt;/span&gt; &lt;span class="s2"&gt;"google_pubsub_topic"&lt;/span&gt; &lt;span class="s2"&gt;"events"&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
&lt;span class="nx"&gt;name&lt;/span&gt; &lt;span class="p"&gt;=&lt;/span&gt; &lt;span class="s2"&gt;"app-events"&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;

&lt;span class="k"&gt;resource&lt;/span&gt; &lt;span class="s2"&gt;"google_storage_bucket"&lt;/span&gt; &lt;span class="s2"&gt;"assets"&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
&lt;span class="nx"&gt;name&lt;/span&gt;     &lt;span class="p"&gt;=&lt;/span&gt; &lt;span class="s2"&gt;"my-project-assets"&lt;/span&gt;
&lt;span class="nx"&gt;location&lt;/span&gt; &lt;span class="p"&gt;=&lt;/span&gt; &lt;span class="s2"&gt;"US"&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  Supported resource types
&lt;/h2&gt;

&lt;p&gt;InfraSketch maps 85+ resource types across all three major providers:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;AWS networking:&lt;/strong&gt; VPC, Subnet, ALB/NLB, Route 53, CloudFront, API Gateway, Transit Gateway, NAT Gateway&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;AWS compute:&lt;/strong&gt; EC2, ECS, EKS, Lambda, Elastic Beanstalk, Auto Scaling Groups&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;AWS data:&lt;/strong&gt; RDS, Aurora, DynamoDB, ElastiCache, Redshift, S3, Glacier&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;AWS messaging:&lt;/strong&gt; SQS, SNS, EventBridge, Kinesis, MSK (Kafka)&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;AWS security:&lt;/strong&gt; IAM, Security Groups, WAF, Shield, Secrets Manager, KMS&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;AWS observability:&lt;/strong&gt; CloudWatch, X-Ray&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;GCP compute:&lt;/strong&gt; GCE, GKE, Cloud Run, Cloud Functions, App Engine&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;GCP data:&lt;/strong&gt; Cloud SQL, Bigtable, Firestore, Spanner, BigQuery, Cloud Storage&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;GCP networking:&lt;/strong&gt; VPC, Load Balancer, Cloud DNS, Cloud CDN&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;GCP messaging:&lt;/strong&gt; Pub/Sub, Dataflow&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Azure:&lt;/strong&gt; AKS, App Service, Functions, SQL, Cosmos DB, Service Bus, Key Vault, VNet, and 20+ more&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Unrecognized resource types are silently skipped — they don't cause errors. The diagram shows what it knows and omits the rest.&lt;/p&gt;

&lt;h2&gt;
  
  
  How Terraform references become diagram connections
&lt;/h2&gt;

&lt;p&gt;InfraSketch parses HCL attribute values for resource references in the pattern &lt;code&gt;resource_type.resource_name.attribute&lt;/code&gt;. When it finds &lt;code&gt;aws_subnet.private.id&lt;/code&gt; inside an &lt;code&gt;aws_eks_cluster&lt;/code&gt; block, it draws an arrow from the EKS node to the subnet node. This covers the most common connection patterns:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;code&gt;vpc_id = aws_vpc.main.id&lt;/code&gt; → containment inside VPC boundary&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;subnet_ids = [aws_subnet.private.id]&lt;/code&gt; → placement in subnet lane&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;security_group_ids = [aws_security_group.app.id]&lt;/code&gt; → connection to security group node&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;db_subnet_group_name = aws_db_subnet_group.main.name&lt;/code&gt; → RDS in database tier&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;event_source_arn = aws_sqs_queue.jobs.arn&lt;/code&gt; → Lambda triggered by SQS&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Module references like &lt;code&gt;module.vpc.vpc_id&lt;/code&gt; also parse — the module name is shown as a dashed group boundary when module blocks are present in the input.&lt;/p&gt;

&lt;h2&gt;
  
  
  Export and share
&lt;/h2&gt;

&lt;p&gt;Once your diagram is generated, export it in three formats:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;PNG&lt;/strong&gt; — paste into Confluence, Notion, Slack, or any wiki&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;SVG&lt;/strong&gt; — scalable for presentations and design files&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;draw.io XML&lt;/strong&gt; — import into draw.io or diagrams.net for manual editing and annotation&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;The &lt;strong&gt;Share&lt;/strong&gt; button generates a URL with your diagram state encoded in the hash — shareable without any server, since InfraSketch is 100% client-side.&lt;/p&gt;

&lt;h2&gt;
  
  
  Terraform diagram generator use cases
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;PR reviews&lt;/strong&gt; — paste a PR's &lt;code&gt;.tf&lt;/code&gt; changes to see what new resources appear before merging&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Onboarding&lt;/strong&gt; — generate a diagram of your Terraform codebase and share it with new engineers instead of asking them to read HCL&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Architecture review boards&lt;/strong&gt; — export PNG for design review submissions without touching Visio or Lucidchart&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Documentation&lt;/strong&gt; — embed diagrams in README files, runbooks, and ADRs that stay in sync with your IaC&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Incident response&lt;/strong&gt; — quickly diagram the affected infrastructure during an outage to understand blast radius&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Multi-cloud audits&lt;/strong&gt; — diagram AWS + GCP or AWS + Azure resources from the same Terraform workspace&lt;/li&gt;
&lt;/ul&gt;

&lt;blockquote&gt;
&lt;h3&gt;
  
  
  Generate your Terraform diagram now Paste any &lt;code&gt;.tf&lt;/code&gt; file and see your infrastructure topology in seconds. Free, no signup, nothing leaves your browser. &lt;a href="https://infrasketch.cloud" rel="noopener noreferrer"&gt;Open InfraSketch →&lt;/a&gt;
&lt;/h3&gt;
&lt;/blockquote&gt;

&lt;h2&gt;
  
  
  Frequently asked questions
&lt;/h2&gt;

&lt;h3&gt;
  
  
  Does InfraSketch run terraform plan or access my AWS account?
&lt;/h3&gt;

&lt;p&gt;No. InfraSketch does static analysis of your HCL source code only. It never runs Terraform, never contacts AWS/GCP/Azure APIs, and never reads your state file. Your code is parsed locally in the browser and nothing is sent to any server.&lt;/p&gt;

&lt;h3&gt;
  
  
  Does it support Terraform modules?
&lt;/h3&gt;

&lt;p&gt;InfraSketch parses &lt;code&gt;module&lt;/code&gt; blocks and shows them as grouped boundaries in the diagram. Resources defined inside modules appear when you paste the module's &lt;code&gt;.tf&lt;/code&gt; files into the input along with the root module — just concatenate the files together before pasting.&lt;/p&gt;

&lt;h3&gt;
  
  
  What about count and for_each resources?
&lt;/h3&gt;

&lt;p&gt;Resources using &lt;code&gt;count&lt;/code&gt; or &lt;code&gt;for_each&lt;/code&gt; are shown as single nodes — InfraSketch doesn't expand them into multiple instances since it doesn't evaluate variable values. The diagram shows the intended architecture pattern rather than the exact instance count.&lt;/p&gt;

&lt;h3&gt;
  
  
  Can I use it with Terragrunt?
&lt;/h3&gt;

&lt;p&gt;Yes — InfraSketch has a dedicated Terragrunt tab. Paste your &lt;code&gt;terragrunt.hcl&lt;/code&gt; files to diagram the dependency graph between Terragrunt units. See the &lt;a href="https://dev.to/blog/"&gt;blog&lt;/a&gt; for a full Terragrunt walkthrough.&lt;/p&gt;

&lt;h3&gt;
  
  
  How is this different from terraform graph?
&lt;/h3&gt;

&lt;p&gt;&lt;code&gt;terraform graph&lt;/code&gt; outputs a raw dependency graph of every internal Terraform object — providers, variables, locals, outputs, and resources — which renders as an unreadable tangle for any real codebase. InfraSketch produces an architecture diagram grouped by logical layer, using only the resources you care about, with official cloud icons. It's intended for human communication, not debugging execution order.&lt;/p&gt;

&lt;h3&gt;
  
  
  Is it free?
&lt;/h3&gt;

&lt;p&gt;Yes, InfraSketch is completely free with no usage limits. The source code is open on &lt;a href="https://github.com/pandey-raghvendra/infrasketch" rel="noopener noreferrer"&gt;GitHub&lt;/a&gt;. There's no paid tier, no API key required, and no account to create.&lt;/p&gt;

&lt;h2&gt;
  
  
  Related articles
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;&lt;a href="///blog/terraform-visualization-best-practices.html"&gt;Terraform Visualization: 5 Ways to See What Your Code Actually Builds&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="///blog/bicep-diagram-generator.html"&gt;Bicep Diagram Generator — Visualize Azure Bicep &amp;amp; ARM Templates Instantly&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="///blog/cdk-architecture-diagram-generator.html"&gt;CDK Architecture Diagram Generator — Visualize AWS CDK Stacks Instantly&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="///blog/free-vs-paid-diagram-tools.html"&gt;Free vs Paid Cloud Architecture Diagram Tools — Honest Comparison 2026&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;

</description>
      <category>terraformdiagramgenerator</category>
      <category>terraformarchitecturediagram</category>
      <category>terraformvisualizer</category>
      <category>terraformhcldiagram</category>
    </item>
    <item>
      <title>Bicep Diagram Generator — Visualize Azure Bicep &amp; ARM Templates Instantly</title>
      <dc:creator>Raghvendra Pandey</dc:creator>
      <pubDate>Tue, 12 May 2026 00:16:39 +0000</pubDate>
      <link>https://forem.com/pandey-raghvendra/bicep-diagram-generator-visualize-azure-bicep-arm-templates-instantly-1f1m</link>
      <guid>https://forem.com/pandey-raghvendra/bicep-diagram-generator-visualize-azure-bicep-arm-templates-instantly-1f1m</guid>
      <description>&lt;p&gt;InfraSketch supports Azure Bicep and ARM JSON templates. Paste your &lt;code&gt;.bicep&lt;/code&gt; file or ARM &lt;code&gt;azuredeploy.json&lt;/code&gt; into the &lt;strong&gt;Bicep / ARM&lt;/strong&gt; tab and get a full architecture diagram in seconds — VNet containment, subnet placement, resource connections, and official Azure icons. No login, no credentials, everything runs in your browser.&lt;/p&gt;

&lt;blockquote&gt;
&lt;h3&gt;
  
  
  Try it now Paste your Bicep or ARM JSON template and see the diagram instantly. &lt;a href="https://infrasketch.cloud" rel="noopener noreferrer"&gt;Open InfraSketch →&lt;/a&gt;
&lt;/h3&gt;
&lt;/blockquote&gt;

&lt;h2&gt;
  
  
  Why Azure Bicep needs a diagram tool
&lt;/h2&gt;

&lt;p&gt;Bicep is Microsoft's domain-specific language for Azure infrastructure. It compiles to ARM JSON and deploys via Azure Resource Manager. A production Bicep template can define dozens of resources — virtual networks, subnets, AKS clusters, API Management gateways, SQL servers, Key Vaults, Service Bus namespaces, and more. Reading that code to understand the topology is slow and error-prone.&lt;/p&gt;

&lt;p&gt;ARM JSON is even harder. A 1,000-line &lt;code&gt;azuredeploy.json&lt;/code&gt; with nested &lt;code&gt;dependsOn&lt;/code&gt; arrays and &lt;code&gt;resourceId()&lt;/code&gt; references takes real effort to parse mentally. The Azure portal shows deployed resources but not their relationships. Visio and draw.io require manual box-drawing. There's no free tool that takes your Bicep or ARM code and generates a diagram automatically — until now.&lt;/p&gt;

&lt;p&gt;InfraSketch parses Bicep and ARM JSON directly in the browser. No Azure subscription required. No CLI. No compile step. Paste and generate.&lt;/p&gt;

&lt;h2&gt;
  
  
  How to use it
&lt;/h2&gt;

&lt;p&gt;Open &lt;a href="https://infrasketch.cloud" rel="noopener noreferrer"&gt;infrasketch.cloud&lt;/a&gt;, click the &lt;strong&gt;Bicep / ARM&lt;/strong&gt; tab, paste your template, and click &lt;strong&gt;Generate Diagram&lt;/strong&gt;. InfraSketch auto-detects whether the input is Bicep syntax or ARM JSON — you don't need to switch modes.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;// Bicep example — paste this into the Bicep / ARM tab
param location string = 'eastus'

resource vnet 'Microsoft.Network/virtualNetworks@2023-04-01' = {
name: 'prod-vnet'
location: location
properties: {
addressSpace: { addressPrefixes: ['10.0.0.0/16'] }
}
}

resource appSubnet 'Microsoft.Network/virtualNetworks/subnets@2023-04-01' = {
parent: vnet
name: 'app'
properties: { addressPrefix: '10.0.1.0/24' }
}

resource aks 'Microsoft.ContainerService/managedClusters@2024-01-01' = {
name: 'prod-aks'
location: location
properties: {
agentPoolProfiles: [{ name: 'nodepool1', vnetSubnetID: appSubnet.id }]
}
}
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;Tip:&lt;/strong&gt; InfraSketch handles both Bicep and ARM JSON automatically. Paste either format — the tool detects it from the syntax.&lt;/p&gt;

&lt;h2&gt;
  
  
  What gets visualized
&lt;/h2&gt;

&lt;h4&gt;
  
  
  VNet containment
&lt;/h4&gt;

&lt;p&gt;Resources referencing a VNet via &lt;code&gt;virtualNetworkId&lt;/code&gt; or &lt;code&gt;parent: vnet&lt;/code&gt; are drawn inside the VNet boundary.&lt;/p&gt;

&lt;h4&gt;
  
  
  Subnet placement
&lt;/h4&gt;

&lt;p&gt;Resources with &lt;code&gt;vnetSubnetID&lt;/code&gt; or &lt;code&gt;subnetId&lt;/code&gt; references are placed inside the correct subnet lane.&lt;/p&gt;

&lt;h4&gt;
  
  
  Connection arrows
&lt;/h4&gt;

&lt;p&gt;ARM &lt;code&gt;dependsOn&lt;/code&gt; and Bicep &lt;code&gt;.id&lt;/code&gt; references between resources become directed arrows on the diagram.&lt;/p&gt;

&lt;h4&gt;
  
  
  Inline subnets
&lt;/h4&gt;

&lt;p&gt;Subnets defined inside a VNet's &lt;code&gt;properties.subnets&lt;/code&gt; array are automatically extracted and rendered.&lt;/p&gt;

&lt;h2&gt;
  
  
  Supported Azure resource types
&lt;/h2&gt;

&lt;p&gt;InfraSketch maps 40+ Azure resource types from Bicep and ARM templates into diagram nodes with official Microsoft icons:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Networking:&lt;/strong&gt; Virtual Networks, Subnets, Application Gateway, Load Balancer, Front Door, Traffic Manager, VPN Gateway, Azure Firewall, Bastion, NSG, DNS Zones&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Compute:&lt;/strong&gt; Virtual Machines, VM Scale Sets, AKS (Managed Clusters), Container Instances, App Service, Function Apps, Static Web Apps&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Containers:&lt;/strong&gt; Container Registry (ACR), AKS node pools&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Data:&lt;/strong&gt; SQL Server, SQL Database, Cosmos DB, PostgreSQL, MySQL, Redis Cache, Storage Accounts&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Integration:&lt;/strong&gt; Service Bus, Event Hub, API Management, SignalR, Web PubSub&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;AI &amp;amp; Analytics:&lt;/strong&gt; Cognitive Services, Azure AI, Data Factory, AI Search&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Security:&lt;/strong&gt; Key Vault, NSG&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Observability:&lt;/strong&gt; Log Analytics Workspace, Application Insights&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Resource types not yet in the mapping still parse — they're just omitted from the diagram rather than causing an error. Supported types grow with each release.&lt;/p&gt;

&lt;h2&gt;
  
  
  Bicep vs ARM JSON — both work
&lt;/h2&gt;

&lt;p&gt;Bicep is the recommended authoring format for new Azure projects. ARM JSON is what Bicep compiles to, and what older templates use. InfraSketch supports both:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Bicep:&lt;/strong&gt; Parses &lt;code&gt;resource varName 'Type@version' = { ... }&lt;/code&gt; syntax. Resolves &lt;code&gt;parent&lt;/code&gt; references for containment. Follows &lt;code&gt;varName.id&lt;/code&gt; and &lt;code&gt;varName.name&lt;/code&gt; references for connections.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;ARM JSON:&lt;/strong&gt; Parses the &lt;code&gt;resources&lt;/code&gt; array in &lt;code&gt;azuredeploy.json&lt;/code&gt;. Resolves &lt;code&gt;dependsOn&lt;/code&gt; with &lt;code&gt;resourceId()&lt;/code&gt; expressions. Reads &lt;code&gt;properties.subnet.id&lt;/code&gt; and &lt;code&gt;properties.virtualNetwork.id&lt;/code&gt; for containment.
&lt;/li&gt;
&lt;/ul&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight json"&gt;&lt;code&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="w"&gt;
&lt;/span&gt;&lt;span class="nl"&gt;"$schema"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"https://schema.management.azure.com/schemas/2019-04-01/deploymentTemplate.json#"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
&lt;/span&gt;&lt;span class="nl"&gt;"contentVersion"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"1.0.0.0"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
&lt;/span&gt;&lt;span class="nl"&gt;"resources"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="w"&gt;
&lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="w"&gt;
&lt;/span&gt;&lt;span class="nl"&gt;"type"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"Microsoft.Network/virtualNetworks"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
&lt;/span&gt;&lt;span class="nl"&gt;"name"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"prod-vnet"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
&lt;/span&gt;&lt;span class="nl"&gt;"apiVersion"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"2023-04-01"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
&lt;/span&gt;&lt;span class="nl"&gt;"location"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"[resourceGroup().location]"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
&lt;/span&gt;&lt;span class="nl"&gt;"properties"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="w"&gt;
&lt;/span&gt;&lt;span class="nl"&gt;"addressSpace"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="nl"&gt;"addressPrefixes"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="s2"&gt;"10.0.0.0/16"&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="p"&gt;},&lt;/span&gt;&lt;span class="w"&gt;
&lt;/span&gt;&lt;span class="nl"&gt;"subnets"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="p"&gt;[{&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="nl"&gt;"name"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"app"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="nl"&gt;"properties"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="nl"&gt;"addressPrefix"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"10.0.1.0/24"&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="p"&gt;}]&lt;/span&gt;&lt;span class="w"&gt;
&lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="w"&gt;
&lt;/span&gt;&lt;span class="p"&gt;},&lt;/span&gt;&lt;span class="w"&gt;
&lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="w"&gt;
&lt;/span&gt;&lt;span class="nl"&gt;"type"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"Microsoft.ContainerService/managedClusters"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
&lt;/span&gt;&lt;span class="nl"&gt;"name"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"prod-aks"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
&lt;/span&gt;&lt;span class="nl"&gt;"apiVersion"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"2024-01-01"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
&lt;/span&gt;&lt;span class="nl"&gt;"location"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"[resourceGroup().location]"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
&lt;/span&gt;&lt;span class="nl"&gt;"dependsOn"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="s2"&gt;"[resourceId('Microsoft.Network/virtualNetworks', 'prod-vnet')]"&lt;/span&gt;&lt;span class="p"&gt;],&lt;/span&gt;&lt;span class="w"&gt;
&lt;/span&gt;&lt;span class="nl"&gt;"properties"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="p"&gt;{}&lt;/span&gt;&lt;span class="w"&gt;
&lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="w"&gt;
&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt;&lt;span class="w"&gt;
&lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="w"&gt;
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  Use cases
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Azure landing zone reviews&lt;/strong&gt; — visualize your hub-and-spoke VNet topology before deploying&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;PR reviews&lt;/strong&gt; — paste a PR's Bicep changes and see what new resources get created&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Onboarding&lt;/strong&gt; — share a diagram with new engineers instead of asking them to read raw ARM JSON&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Documentation&lt;/strong&gt; — export as PNG, SVG, or draw.io XML and embed in Azure DevOps wikis or Confluence&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Migration planning&lt;/strong&gt; — diagram existing ARM templates before converting them to Bicep modules&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Architecture reviews&lt;/strong&gt; — generate a diagram for an ARB submission without opening Visio&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  Bicep vs Terraform diagrams
&lt;/h2&gt;

&lt;p&gt;If your team uses both Terraform (for AWS/GCP) and Bicep (for Azure), InfraSketch handles both in the same tool. Switch between the &lt;strong&gt;Terraform&lt;/strong&gt; and &lt;strong&gt;Bicep / ARM&lt;/strong&gt; tabs to diagram each side of a multi-cloud deployment. The layout zones — Internet, Ingress, Compute, Data, Messaging, Security — are consistent across providers, so diagrams from both tools are comparable at a glance.&lt;/p&gt;

&lt;blockquote&gt;
&lt;h3&gt;
  
  
  Generate your Bicep diagram now Paste your &lt;code&gt;.bicep&lt;/code&gt; file or &lt;code&gt;azuredeploy.json&lt;/code&gt; into the Bicep / ARM tab. Free, no login, nothing leaves your browser. &lt;a href="https://infrasketch.cloud" rel="noopener noreferrer"&gt;Open InfraSketch →&lt;/a&gt;
&lt;/h3&gt;
&lt;/blockquote&gt;

</description>
      <category>bicepdiagramgenerator</category>
      <category>azurebicepdiagram</category>
      <category>bicepvisualizer</category>
      <category>armtemplatediagram</category>
    </item>
    <item>
      <title>What's New in InfraSketch — May 2026: Pulumi &amp; Kubernetes Support</title>
      <dc:creator>Raghvendra Pandey</dc:creator>
      <pubDate>Thu, 30 Apr 2026 21:12:57 +0000</pubDate>
      <link>https://forem.com/pandey-raghvendra/whats-new-in-infrasketch-may-2026-pulumi-kubernetes-support-ce2</link>
      <guid>https://forem.com/pandey-raghvendra/whats-new-in-infrasketch-may-2026-pulumi-kubernetes-support-ce2</guid>
      <description>&lt;p&gt;Two major new input formats land in InfraSketch this month: &lt;strong&gt;Pulumi&lt;/strong&gt; TypeScript and Python, and &lt;strong&gt;Kubernetes YAML&lt;/strong&gt;. Together they bring InfraSketch support to every major infrastructure-as-code tool in active use today.&lt;/p&gt;

&lt;blockquote&gt;
&lt;h3&gt;
  
  
  Try the new formats now Click the Pulumi or Kubernetes tab and paste your code. &lt;a href="https://infrasketch.cloud" rel="noopener noreferrer"&gt;Open InfraSketch →&lt;/a&gt;
&lt;/h3&gt;
&lt;/blockquote&gt;

&lt;h2&gt;
  
  
  Pulumi support — TypeScript &amp;amp; Python
&lt;/h2&gt;

&lt;h3&gt;
  
  
  New Pulumi tab
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;Parse Pulumi TypeScript (&lt;code&gt;index.ts&lt;/code&gt;) and Python (&lt;code&gt;__main__.py&lt;/code&gt;) directly — no compile step&lt;/li&gt;
&lt;li&gt;95+ resource types across AWS, GCP, and Azure&lt;/li&gt;
&lt;li&gt;VPC containment from &lt;code&gt;vpcId: vpc.id&lt;/code&gt; / &lt;code&gt;vpc_id=vpc.id&lt;/code&gt; references&lt;/li&gt;
&lt;li&gt;Subnet placement from &lt;code&gt;subnetId&lt;/code&gt;, &lt;code&gt;subnets&lt;/code&gt;, &lt;code&gt;subnetIds&lt;/code&gt; arguments&lt;/li&gt;
&lt;li&gt;Connection arrows from variable references between resources&lt;/li&gt;
&lt;li&gt;Auto-detects TypeScript vs Python from syntax&lt;/li&gt;
&lt;li&gt;3 built-in examples: AWS production stack (TS), AWS serverless (Python), GCP Cloud Run (TS)&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;AWS resources covered:&lt;/strong&gt; VPC, subnets, EC2, EKS, ECS, Lambda, RDS, DynamoDB, ElastiCache, S3, ALB, Route53, CloudFront, SQS, SNS, IAM, KMS, WAF, ECR, Auto Scaling, CloudWatch.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;GCP resources covered:&lt;/strong&gt; Compute Engine, GKE, Cloud Run, Cloud Functions, Cloud SQL, BigQuery, Spanner, Bigtable, Firestore, Redis, Pub/Sub, Cloud Storage, Secret Manager, KMS, IAM, DNS, Monitoring.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Azure resources covered:&lt;/strong&gt; Virtual Networks, AKS, App Service, Functions, SQL, Cosmos DB, Key Vault, Container Groups, CDN Frontdoor, Redis, Service Bus, Event Hub.&lt;/p&gt;

&lt;p&gt;Read the full guide: &lt;a href="///blog/pulumi-diagram-generator.html"&gt;Pulumi Diagram Generator — Visualize Pulumi Infrastructure Instantly&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  Kubernetes YAML support
&lt;/h2&gt;

&lt;h3&gt;
  
  
  New Kubernetes tab
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;Parse multi-document YAML (documents separated by &lt;code&gt;---&lt;/code&gt;)&lt;/li&gt;
&lt;li&gt;16 resource kinds: Deployment, StatefulSet, DaemonSet, Job, CronJob, Pod, ReplicaSet, Service, Ingress, NetworkPolicy, ConfigMap, Secret, PersistentVolumeClaim, PersistentVolume, ServiceAccount, HorizontalPodAutoscaler&lt;/li&gt;
&lt;li&gt;Namespace grouping — resources grouped into labelled namespace boundaries from &lt;code&gt;metadata.namespace&lt;/code&gt;
&lt;/li&gt;
&lt;li&gt;Selector-based connections — Service &lt;code&gt;spec.selector&lt;/code&gt; matched to workload &lt;code&gt;spec.selector.matchLabels&lt;/code&gt;
&lt;/li&gt;
&lt;li&gt;Ingress routing — &lt;code&gt;spec.rules[].http.paths[].backend.service.name&lt;/code&gt; becomes Ingress→Service arrows&lt;/li&gt;
&lt;li&gt;Volume/envFrom references — Deployment→ConfigMap and Deployment→Secret arrows from volume mounts and &lt;code&gt;envFrom&lt;/code&gt;
&lt;/li&gt;
&lt;li&gt;HPA target links — &lt;code&gt;spec.scaleTargetRef&lt;/code&gt; connects HPA to its scale target&lt;/li&gt;
&lt;li&gt;1 built-in example: full-stack web app with Ingress, Service, Deployment, ConfigMap, Secret, HPA&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Works with raw manifests, &lt;code&gt;kubectl get all -o yaml&lt;/code&gt; output, Helm template output (&lt;code&gt;helm template&lt;/code&gt;), and Kustomize builds (&lt;code&gt;kustomize build&lt;/code&gt;).&lt;/p&gt;

&lt;p&gt;Read the full guide: &lt;a href="///blog/kubernetes-diagram-generator.html"&gt;Kubernetes Diagram Generator — Visualize K8s YAML Instantly&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  Bug fixes
&lt;/h2&gt;

&lt;h3&gt;
  
  
  Fix Diagram display
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;Diagram panel no longer shows half the diagram when output is taller than the panel height&lt;/li&gt;
&lt;li&gt;SVG height set to &lt;code&gt;auto&lt;/code&gt; — aspect ratio preserved via &lt;code&gt;viewBox&lt;/code&gt;
&lt;/li&gt;
&lt;li&gt;Diagram canvas scrolls from top rather than clipping vertically centered content&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  What's next
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Auto-detect format&lt;/strong&gt; — paste any IaC code and InfraSketch detects the format automatically&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Keyboard shortcuts&lt;/strong&gt; — generate, zoom, export without reaching for the mouse&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;More Kubernetes samples&lt;/strong&gt; — microservices, ingress controller, monitoring stack&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Bicep / ARM&lt;/strong&gt; — Azure-native template formats&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Feature requests and bug reports welcome on &lt;a href="https://github.com/pandey-raghvendra/infrasketch" rel="noopener noreferrer"&gt;GitHub&lt;/a&gt;.&lt;/p&gt;

&lt;blockquote&gt;
&lt;h3&gt;
  
  
  Try Pulumi and Kubernetes diagrams now Free, no login, nothing leaves your browser. &lt;a href="https://infrasketch.cloud" rel="noopener noreferrer"&gt;Open InfraSketch →&lt;/a&gt;
&lt;/h3&gt;
&lt;/blockquote&gt;

</description>
      <category>infrasketchupdate</category>
      <category>pulumidiagram</category>
      <category>kubernetesdiagram</category>
      <category>k8svisualizer</category>
    </item>
    <item>
      <title>Pulumi Diagram Generator — Visualize Pulumi Infrastructure Instantly</title>
      <dc:creator>Raghvendra Pandey</dc:creator>
      <pubDate>Thu, 30 Apr 2026 21:12:25 +0000</pubDate>
      <link>https://forem.com/pandey-raghvendra/pulumi-diagram-generator-visualize-pulumi-infrastructure-instantly-1gk4</link>
      <guid>https://forem.com/pandey-raghvendra/pulumi-diagram-generator-visualize-pulumi-infrastructure-instantly-1gk4</guid>
      <description>&lt;p&gt;InfraSketch now supports Pulumi. Paste your Pulumi TypeScript or Python code into the Pulumi tab and get a full architecture diagram in seconds — VPC containment, subnet grouping, resource connections, official AWS, GCP, and Azure icons. No login, no credentials, everything runs in your browser.&lt;/p&gt;

&lt;blockquote&gt;
&lt;h3&gt;
  
  
  Try it now Paste your Pulumi TypeScript or Python code and see the diagram instantly. &lt;a href="https://infrasketch.cloud" rel="noopener noreferrer"&gt;Open InfraSketch →&lt;/a&gt;
&lt;/h3&gt;
&lt;/blockquote&gt;

&lt;h2&gt;
  
  
  Why Pulumi needs a diagram tool
&lt;/h2&gt;

&lt;p&gt;Pulumi lets you write infrastructure in real programming languages — TypeScript, Python, Go, C#. That's great for developer productivity, but it creates the same visibility problem every IaC tool has: your infrastructure lives in code, not in a picture. When a new engineer joins the team, or when you're reviewing a PR that adds a VPC and six new resources, reading TypeScript is not the fastest way to understand what gets built.&lt;/p&gt;

&lt;p&gt;Unlike Terraform's HCL, Pulumi code doesn't have a declarative format that's easy to inspect at a glance. A function might conditionally create resources. Loops might generate dozens of similar components. The Pulumi console shows state, not topology. There's no built-in way to go from code to architecture diagram.&lt;/p&gt;

&lt;p&gt;InfraSketch parses Pulumi TypeScript and Python directly — no compile step, no export, just paste and generate.&lt;/p&gt;

&lt;h2&gt;
  
  
  How to use it
&lt;/h2&gt;

&lt;p&gt;Open &lt;a href="https://infrasketch.cloud" rel="noopener noreferrer"&gt;infrasketch.cloud&lt;/a&gt;, click the &lt;strong&gt;Pulumi&lt;/strong&gt; tab, paste your &lt;code&gt;index.ts&lt;/code&gt; or &lt;code&gt;__main__.py&lt;/code&gt; file, and click &lt;strong&gt;Generate Diagram&lt;/strong&gt;. You can paste a partial file — InfraSketch handles incomplete code gracefully.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight typescript"&gt;&lt;code&gt;&lt;span class="c1"&gt;// Example: paste this into the Pulumi tab&lt;/span&gt;
&lt;span class="k"&gt;import&lt;/span&gt; &lt;span class="o"&gt;*&lt;/span&gt; &lt;span class="k"&gt;as&lt;/span&gt; &lt;span class="nx"&gt;aws&lt;/span&gt; &lt;span class="k"&gt;from&lt;/span&gt; &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;@pulumi/aws&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;

&lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;vpc&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="k"&gt;new&lt;/span&gt; &lt;span class="nx"&gt;aws&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;ec2&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nc"&gt;Vpc&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;main&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="na"&gt;cidrBlock&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;10.0.0.0/16&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt; &lt;span class="p"&gt;});&lt;/span&gt;
&lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;subnet&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="k"&gt;new&lt;/span&gt; &lt;span class="nx"&gt;aws&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;ec2&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nc"&gt;Subnet&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;public&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
&lt;span class="na"&gt;vpcId&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nx"&gt;vpc&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;id&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
&lt;span class="na"&gt;cidrBlock&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;10.0.1.0/24&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
&lt;span class="p"&gt;});&lt;/span&gt;
&lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;igw&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="k"&gt;new&lt;/span&gt; &lt;span class="nx"&gt;aws&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;ec2&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nc"&gt;InternetGateway&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;igw&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="na"&gt;vpcId&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nx"&gt;vpc&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;id&lt;/span&gt; &lt;span class="p"&gt;});&lt;/span&gt;
&lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;lb&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="k"&gt;new&lt;/span&gt; &lt;span class="nx"&gt;aws&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;lb&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nc"&gt;LoadBalancer&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;alb&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="na"&gt;subnets&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="nx"&gt;subnet&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;id&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt; &lt;span class="p"&gt;});&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;Tip:&lt;/strong&gt; Pulumi Python uses the same resource types with underscores — &lt;code&gt;aws.ec2.Vpc&lt;/code&gt; in TypeScript is &lt;code&gt;aws.ec2.Vpc&lt;/code&gt; in Python too. Both work with InfraSketch.&lt;/p&gt;

&lt;h2&gt;
  
  
  What gets visualized
&lt;/h2&gt;

&lt;h4&gt;
  
  
  VPC containment
&lt;/h4&gt;

&lt;p&gt;Resources referencing a VPC via &lt;code&gt;vpcId: vpc.id&lt;/code&gt; are drawn inside the VPC boundary automatically.&lt;/p&gt;

&lt;h4&gt;
  
  
  Subnet placement
&lt;/h4&gt;

&lt;p&gt;Resources with &lt;code&gt;subnetId&lt;/code&gt; or &lt;code&gt;subnets&lt;/code&gt; arguments are placed in public or private subnet lanes.&lt;/p&gt;

&lt;h4&gt;
  
  
  Connection arrows
&lt;/h4&gt;

&lt;p&gt;Variable references between resources — &lt;code&gt;vpc.id&lt;/code&gt;, &lt;code&gt;cluster.endpoint&lt;/code&gt; — become directed arrows on the diagram.&lt;/p&gt;

&lt;h4&gt;
  
  
  Multi-cloud
&lt;/h4&gt;

&lt;p&gt;AWS, GCP, and Azure resources in the same stack all render on one diagram with their respective provider icons.&lt;/p&gt;

&lt;h2&gt;
  
  
  Supported Pulumi resource types
&lt;/h2&gt;

&lt;p&gt;InfraSketch supports 95+ Pulumi resource types across AWS, GCP, and Azure. Key AWS resources include:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Networking:&lt;/strong&gt; &lt;code&gt;aws.ec2.Vpc&lt;/code&gt;, &lt;code&gt;aws.ec2.Subnet&lt;/code&gt;, &lt;code&gt;aws.ec2.InternetGateway&lt;/code&gt;, &lt;code&gt;aws.ec2.NatGateway&lt;/code&gt;, &lt;code&gt;aws.ec2.SecurityGroup&lt;/code&gt;, &lt;code&gt;aws.ec2.TransitGateway&lt;/code&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Compute:&lt;/strong&gt; &lt;code&gt;aws.ec2.Instance&lt;/code&gt;, &lt;code&gt;aws.ec2.LaunchTemplate&lt;/code&gt;, &lt;code&gt;aws.autoscaling.Group&lt;/code&gt;, &lt;code&gt;aws.ecs.Cluster&lt;/code&gt;, &lt;code&gt;aws.ecs.Service&lt;/code&gt;, &lt;code&gt;aws.lambda_.Function&lt;/code&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Containers:&lt;/strong&gt; &lt;code&gt;aws.eks.Cluster&lt;/code&gt;, &lt;code&gt;aws.eks.NodeGroup&lt;/code&gt;, &lt;code&gt;aws.ecr.Repository&lt;/code&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Load balancing:&lt;/strong&gt; &lt;code&gt;aws.lb.LoadBalancer&lt;/code&gt;, &lt;code&gt;aws.lb.TargetGroup&lt;/code&gt;, &lt;code&gt;aws.alb.LoadBalancer&lt;/code&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Data:&lt;/strong&gt; &lt;code&gt;aws.rds.Instance&lt;/code&gt;, &lt;code&gt;aws.rds.Cluster&lt;/code&gt;, &lt;code&gt;aws.dynamodb.Table&lt;/code&gt;, &lt;code&gt;aws.elasticache.Cluster&lt;/code&gt;, &lt;code&gt;aws.s3.Bucket&lt;/code&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Messaging:&lt;/strong&gt; &lt;code&gt;aws.sqs.Queue&lt;/code&gt;, &lt;code&gt;aws.sns.Topic&lt;/code&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;DNS &amp;amp; CDN:&lt;/strong&gt; &lt;code&gt;aws.route53.Zone&lt;/code&gt;, &lt;code&gt;aws.cloudfront.Distribution&lt;/code&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Security:&lt;/strong&gt; &lt;code&gt;aws.iam.Role&lt;/code&gt;, &lt;code&gt;aws.kms.Key&lt;/code&gt;, &lt;code&gt;aws.wafv2.WebAcl&lt;/code&gt;
&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;GCP resources cover Compute Engine, GKE, Cloud Run, Cloud Functions, Cloud SQL, BigQuery, Spanner, Bigtable, Pub/Sub, Cloud Storage, Secret Manager, and more. Azure covers Virtual Networks, AKS, App Service, Functions, SQL, Cosmos DB, and Key Vault.&lt;/p&gt;

&lt;h2&gt;
  
  
  TypeScript vs Python
&lt;/h2&gt;

&lt;p&gt;InfraSketch detects the language automatically. TypeScript uses camelCase arguments (&lt;code&gt;cidrBlock&lt;/code&gt;, &lt;code&gt;vpcId&lt;/code&gt;). Python uses snake_case (&lt;code&gt;cidr_block&lt;/code&gt;, &lt;code&gt;vpc_id&lt;/code&gt;). Both parse correctly — no pre-processing needed.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight python"&gt;&lt;code&gt;&lt;span class="c1"&gt;# Python example — works the same way
&lt;/span&gt;&lt;span class="kn"&gt;import&lt;/span&gt; &lt;span class="n"&gt;pulumi_aws&lt;/span&gt; &lt;span class="k"&gt;as&lt;/span&gt; &lt;span class="n"&gt;aws&lt;/span&gt;

&lt;span class="n"&gt;vpc&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;aws&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;ec2&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nc"&gt;Vpc&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;main&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;cidr_block&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;10.0.0.0/16&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;span class="n"&gt;subnet&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;aws&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;ec2&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nc"&gt;Subnet&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;public&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
&lt;span class="n"&gt;vpc_id&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="n"&gt;vpc&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nb"&gt;id&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
&lt;span class="n"&gt;cidr_block&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;10.0.1.0/24&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;
&lt;span class="p"&gt;)&lt;/span&gt;
&lt;span class="n"&gt;cluster&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;aws&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;eks&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nc"&gt;Cluster&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;eks&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;vpc_config&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="n"&gt;aws&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;eks&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nc"&gt;ClusterVpcConfigArgs&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;
&lt;span class="n"&gt;subnet_ids&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;subnet&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nb"&gt;id&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt;
&lt;span class="p"&gt;))&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  Use cases
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Code reviews&lt;/strong&gt; — paste a PR's Pulumi code and see the topology change visually before approving&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Onboarding&lt;/strong&gt; — share a diagram link instead of asking new engineers to read TypeScript they've never seen&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Documentation&lt;/strong&gt; — export as PNG or SVG and embed in Confluence, Notion, or your wiki&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Architecture reviews&lt;/strong&gt; — export as draw.io XML for a fully editable diagram in your design doc&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Multi-stack visibility&lt;/strong&gt; — paste each stack separately and compare their architectures side by side&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  GCP resources with Pulumi
&lt;/h2&gt;

&lt;p&gt;InfraSketch maps Pulumi GCP resources using the &lt;code&gt;@pulumi/gcp&lt;/code&gt; (TypeScript) and &lt;code&gt;pulumi_gcp&lt;/code&gt; (Python) providers. Supported GCP types include:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Networking:&lt;/strong&gt; &lt;code&gt;gcp.compute.Network&lt;/code&gt;, &lt;code&gt;gcp.compute.Subnetwork&lt;/code&gt;, &lt;code&gt;gcp.compute.Router&lt;/code&gt;, &lt;code&gt;gcp.compute.GlobalAddress&lt;/code&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Compute:&lt;/strong&gt; &lt;code&gt;gcp.compute.Instance&lt;/code&gt;, &lt;code&gt;gcp.container.Cluster&lt;/code&gt; (GKE), &lt;code&gt;gcp.cloudrun.Service&lt;/code&gt;, &lt;code&gt;gcp.cloudfunctions.Function&lt;/code&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Data:&lt;/strong&gt; &lt;code&gt;gcp.sql.DatabaseInstance&lt;/code&gt;, &lt;code&gt;gcp.bigquery.Dataset&lt;/code&gt;, &lt;code&gt;gcp.spanner.Instance&lt;/code&gt;, &lt;code&gt;gcp.bigtable.Instance&lt;/code&gt;, &lt;code&gt;gcp.storage.Bucket&lt;/code&gt;, &lt;code&gt;gcp.firestore.Database&lt;/code&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Messaging:&lt;/strong&gt; &lt;code&gt;gcp.pubsub.Topic&lt;/code&gt;, &lt;code&gt;gcp.pubsub.Subscription&lt;/code&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Security:&lt;/strong&gt; &lt;code&gt;gcp.kms.KeyRing&lt;/code&gt;, &lt;code&gt;gcp.secretmanager.Secret&lt;/code&gt;, &lt;code&gt;gcp.serviceaccount.Account&lt;/code&gt;
&lt;/li&gt;
&lt;/ul&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight typescript"&gt;&lt;code&gt;&lt;span class="c1"&gt;// GCP Pulumi example&lt;/span&gt;
&lt;span class="k"&gt;import&lt;/span&gt; &lt;span class="o"&gt;*&lt;/span&gt; &lt;span class="k"&gt;as&lt;/span&gt; &lt;span class="nx"&gt;gcp&lt;/span&gt; &lt;span class="k"&gt;from&lt;/span&gt; &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;@pulumi/gcp&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;

&lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;network&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="k"&gt;new&lt;/span&gt; &lt;span class="nx"&gt;gcp&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;compute&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nc"&gt;Network&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;vpc&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="na"&gt;autoCreateSubnetworks&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="kc"&gt;false&lt;/span&gt; &lt;span class="p"&gt;});&lt;/span&gt;
&lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;subnet&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="k"&gt;new&lt;/span&gt; &lt;span class="nx"&gt;gcp&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;compute&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nc"&gt;Subnetwork&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;subnet&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
&lt;span class="na"&gt;network&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nx"&gt;network&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;id&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
&lt;span class="na"&gt;ipCidrRange&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;10.0.0.0/24&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
&lt;span class="p"&gt;});&lt;/span&gt;
&lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;cluster&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="k"&gt;new&lt;/span&gt; &lt;span class="nx"&gt;gcp&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;container&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nc"&gt;Cluster&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;gke&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
&lt;span class="na"&gt;network&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nx"&gt;network&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;name&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
&lt;span class="na"&gt;subnetwork&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nx"&gt;subnet&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;name&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
&lt;span class="p"&gt;});&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  Azure resources with Pulumi
&lt;/h2&gt;

&lt;p&gt;Pulumi supports Azure via two providers: the classic &lt;code&gt;@pulumi/azure&lt;/code&gt; (wraps Terraform AzureRM) and the native &lt;code&gt;@pulumi/azure-native&lt;/code&gt; (generated directly from the ARM API). InfraSketch supports the classic provider's &lt;code&gt;azurerm_*&lt;/code&gt; resource types through Pulumi's wrapping — pass Azure Classic Pulumi code and VNets, AKS clusters, App Services, SQL servers, and Key Vaults all render correctly.&lt;/p&gt;

&lt;h2&gt;
  
  
  Pulumi ComponentResource and abstractions
&lt;/h2&gt;

&lt;p&gt;ComponentResource is Pulumi's way of grouping resources into reusable abstractions — similar to CDK Constructs. A &lt;code&gt;ComponentResource&lt;/code&gt; might wrap a VPC, security groups, and route tables into a single "Network" abstraction. InfraSketch parses the resources at the leaf level (the actual &lt;code&gt;aws.ec2.Vpc&lt;/code&gt;, &lt;code&gt;aws.ec2.SecurityGroup&lt;/code&gt; calls inside the component), not at the component level, so you see the underlying resources on the diagram even if they're created inside a ComponentResource.&lt;/p&gt;

&lt;h2&gt;
  
  
  Pulumi vs CDK diagrams
&lt;/h2&gt;

&lt;p&gt;Both Pulumi and CDK let you write infrastructure in TypeScript. The key difference for diagramming:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Pulumi:&lt;/strong&gt; Paste source code directly — InfraSketch parses the TypeScript or Python text. No compilation step needed. Works best with files under ~500 lines; very large stacks may have resources that fall outside the parsed window.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;CDK:&lt;/strong&gt; Requires a &lt;code&gt;cdk synth&lt;/code&gt; step first. The synthesized JSON is more complete and deterministic — every resource CDK creates, including automatically-generated IAM roles and security groups, appears in the output. CDK diagrams tend to show more nodes than Pulumi diagrams for equivalent infrastructure.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;If you need the most accurate diagram, CDK wins because synthesis resolves all abstractions. If you want to paste and go without running any commands, Pulumi wins.&lt;/p&gt;

&lt;h2&gt;
  
  
  Frequently asked questions
&lt;/h2&gt;

&lt;h3&gt;
  
  
  Does InfraSketch support Pulumi Go or C#?
&lt;/h3&gt;

&lt;p&gt;Not yet. The parser targets TypeScript (&lt;code&gt;.ts&lt;/code&gt;) and Python (&lt;code&gt;.py&lt;/code&gt;) syntax specifically. Go and C# support is on the roadmap. TypeScript is the most widely used Pulumi language, and Python is second.&lt;/p&gt;

&lt;h3&gt;
  
  
  What if my Pulumi code uses variables and loops?
&lt;/h3&gt;

&lt;p&gt;InfraSketch uses regex-based parsing rather than evaluating the code. Resources created inside &lt;code&gt;for&lt;/code&gt; loops will be detected but may appear as a single node (only the first loop iteration's resource constructor is matched). Static resource declarations work fully. Conditional resources (&lt;code&gt;if (isProd) new aws.rds.Instance(...&lt;/code&gt;) appear in the diagram regardless of the condition value.&lt;/p&gt;

&lt;h3&gt;
  
  
  Can I paste multiple Pulumi files?
&lt;/h3&gt;

&lt;p&gt;Yes — paste the contents of multiple files concatenated together. InfraSketch scans the entire input for resource constructors. If two files reference the same variable name for different resources, connections may link incorrectly, so it's best to paste one file at a time for large stacks.&lt;/p&gt;

&lt;h2&gt;
  
  
  Pulumi vs Terraform diagrams
&lt;/h2&gt;

&lt;p&gt;If you're migrating from Terraform to Pulumi (or evaluating it), InfraSketch lets you diagram both. Paste your Terraform HCL in the Terraform tab and your equivalent Pulumi code in the Pulumi tab — the diagrams should look identical if the migration is complete. Differences become immediately visible.&lt;/p&gt;

&lt;blockquote&gt;
&lt;h3&gt;
  
  
  Generate your Pulumi diagram now Paste your &lt;code&gt;index.ts&lt;/code&gt; or &lt;code&gt;__main__.py&lt;/code&gt; into the Pulumi tab. Free, no login, nothing leaves your browser. &lt;a href="https://infrasketch.cloud" rel="noopener noreferrer"&gt;Open InfraSketch →&lt;/a&gt;
&lt;/h3&gt;
&lt;/blockquote&gt;

</description>
      <category>pulumidiagram</category>
      <category>pulumivisualizer</category>
      <category>pulumiarchitecturediagram</category>
      <category>pulumiawsdiagram</category>
    </item>
    <item>
      <title>Kubernetes Diagram Generator — Visualize K8s YAML Instantly</title>
      <dc:creator>Raghvendra Pandey</dc:creator>
      <pubDate>Thu, 30 Apr 2026 21:12:22 +0000</pubDate>
      <link>https://forem.com/pandey-raghvendra/kubernetes-diagram-generator-visualize-k8s-yaml-instantly-27f3</link>
      <guid>https://forem.com/pandey-raghvendra/kubernetes-diagram-generator-visualize-k8s-yaml-instantly-27f3</guid>
      <description>&lt;p&gt;InfraSketch now supports Kubernetes YAML. Paste one or more manifest files into the Kubernetes tab and get a full architecture diagram in seconds — namespace grouping, Ingress-to-Service connections, selector-based Service-to-Deployment wiring, ConfigMap and Secret references, and HPA targets. No login, no cluster access, everything runs in your browser.&lt;/p&gt;

&lt;blockquote&gt;
&lt;h3&gt;
  
  
  Try it now Paste your Kubernetes YAML manifests and see the diagram instantly. &lt;a href="https://infrasketch.cloud" rel="noopener noreferrer"&gt;Open InfraSketch →&lt;/a&gt;
&lt;/h3&gt;
&lt;/blockquote&gt;

&lt;h2&gt;
  
  
  Why Kubernetes needs a diagram tool
&lt;/h2&gt;

&lt;p&gt;A production Kubernetes application typically spans dozens of YAML files — Deployments, Services, Ingresses, ConfigMaps, Secrets, PVCs, HPAs, NetworkPolicies. When something breaks, or when you're onboarding a new engineer, the mental model of "how does this all connect" is not obvious from reading YAML alone.&lt;/p&gt;

&lt;p&gt;Tools like &lt;code&gt;kubectl&lt;/code&gt; show you state, not topology. &lt;code&gt;k9s&lt;/code&gt; gives you resource lists. Lens visualizes the cluster but requires actual cluster access. There's no fast, offline way to go from a set of YAML manifests to a clear connection diagram — until now.&lt;/p&gt;

&lt;p&gt;InfraSketch reads your YAML, infers the topology from label selectors and resource references, and renders it as a navigable diagram. No cluster access needed.&lt;/p&gt;

&lt;h2&gt;
  
  
  How to use it
&lt;/h2&gt;

&lt;p&gt;Open &lt;a href="https://infrasketch.cloud" rel="noopener noreferrer"&gt;infrasketch.cloud&lt;/a&gt;, click the &lt;strong&gt;Kubernetes&lt;/strong&gt; tab, paste your manifests (multiple documents separated by &lt;code&gt;---&lt;/code&gt;), and click &lt;strong&gt;Generate Diagram&lt;/strong&gt;.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;kubectl get all &lt;span class="nt"&gt;-n&lt;/span&gt; my-namespace &lt;span class="nt"&gt;-o&lt;/span&gt; yaml | pbcopy   &lt;span class="c"&gt;# macOS&lt;/span&gt;
kubectl get all &lt;span class="nt"&gt;-n&lt;/span&gt; my-namespace &lt;span class="nt"&gt;-o&lt;/span&gt; yaml | xclip      &lt;span class="c"&gt;# Linux&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;Tip:&lt;/strong&gt; Paste manifests from multiple namespaces at once — InfraSketch groups resources by namespace automatically using &lt;code&gt;metadata.namespace&lt;/code&gt;.&lt;/p&gt;

&lt;h2&gt;
  
  
  How connections are inferred
&lt;/h2&gt;

&lt;p&gt;InfraSketch doesn't need a running cluster to understand topology. It infers connections from the YAML itself:&lt;/p&gt;

&lt;h4&gt;
  
  
  Ingress → Service
&lt;/h4&gt;

&lt;p&gt;Every &lt;code&gt;spec.rules[].http.paths[].backend.service.name&lt;/code&gt; becomes a directed arrow from the Ingress to the target Service.&lt;/p&gt;

&lt;h4&gt;
  
  
  Service → Deployment
&lt;/h4&gt;

&lt;p&gt;Service &lt;code&gt;spec.selector&lt;/code&gt; is matched against Deployment/StatefulSet/DaemonSet &lt;code&gt;spec.selector.matchLabels&lt;/code&gt;. Matching labels = connection arrow.&lt;/p&gt;

&lt;h4&gt;
  
  
  Deployment → ConfigMap/Secret
&lt;/h4&gt;

&lt;p&gt;Volume mounts (&lt;code&gt;configMap.name&lt;/code&gt;, &lt;code&gt;secret.secretName&lt;/code&gt;) and &lt;code&gt;envFrom&lt;/code&gt; references become arrows from the workload to the config resource.&lt;/p&gt;

&lt;h4&gt;
  
  
  HPA → target
&lt;/h4&gt;

&lt;p&gt;&lt;code&gt;spec.scaleTargetRef.name&lt;/code&gt; and &lt;code&gt;kind&lt;/code&gt; links the HorizontalPodAutoscaler to its Deployment, StatefulSet, or ReplicaSet.&lt;/p&gt;

&lt;h2&gt;
  
  
  Supported Kubernetes resource kinds
&lt;/h2&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Kind&lt;/th&gt;
&lt;th&gt;Category&lt;/th&gt;
&lt;th&gt;Notes&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;Deployment&lt;/td&gt;
&lt;td&gt;Workload&lt;/td&gt;
&lt;td&gt;Main compute unit; selector matching for Service connections&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;StatefulSet&lt;/td&gt;
&lt;td&gt;Workload&lt;/td&gt;
&lt;td&gt;Persistent workloads; selector matching&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;DaemonSet&lt;/td&gt;
&lt;td&gt;Workload&lt;/td&gt;
&lt;td&gt;Node-level agents; selector matching&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Job&lt;/td&gt;
&lt;td&gt;Workload&lt;/td&gt;
&lt;td&gt;Batch tasks&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;CronJob&lt;/td&gt;
&lt;td&gt;Workload&lt;/td&gt;
&lt;td&gt;Scheduled batch tasks&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Pod&lt;/td&gt;
&lt;td&gt;Workload&lt;/td&gt;
&lt;td&gt;Standalone pods&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;ReplicaSet&lt;/td&gt;
&lt;td&gt;Workload&lt;/td&gt;
&lt;td&gt;HPA scale target&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Service&lt;/td&gt;
&lt;td&gt;Networking&lt;/td&gt;
&lt;td&gt;ClusterIP, NodePort, LoadBalancer — selector → Deployment arrows&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Ingress&lt;/td&gt;
&lt;td&gt;Networking&lt;/td&gt;
&lt;td&gt;HTTP routing rules → Service arrows&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;NetworkPolicy&lt;/td&gt;
&lt;td&gt;Networking&lt;/td&gt;
&lt;td&gt;Pod-level network rules&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;ConfigMap&lt;/td&gt;
&lt;td&gt;Config&lt;/td&gt;
&lt;td&gt;Referenced via volume mounts and envFrom&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Secret&lt;/td&gt;
&lt;td&gt;Config&lt;/td&gt;
&lt;td&gt;Referenced via volume mounts and envFrom&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;PersistentVolumeClaim&lt;/td&gt;
&lt;td&gt;Storage&lt;/td&gt;
&lt;td&gt;Volume mount references from workloads&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;PersistentVolume&lt;/td&gt;
&lt;td&gt;Storage&lt;/td&gt;
&lt;td&gt;Cluster-wide storage resources&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;ServiceAccount&lt;/td&gt;
&lt;td&gt;Security&lt;/td&gt;
&lt;td&gt;Pod identity&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;HorizontalPodAutoscaler&lt;/td&gt;
&lt;td&gt;Autoscaling&lt;/td&gt;
&lt;td&gt;Linked to scale target via scaleTargetRef&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;h2&gt;
  
  
  Namespace grouping
&lt;/h2&gt;

&lt;p&gt;Every resource is placed inside a namespace boundary drawn on the diagram. Resources with the same &lt;code&gt;metadata.namespace&lt;/code&gt; value are grouped together in a labelled box. Resources without a namespace go into the &lt;code&gt;default&lt;/code&gt; namespace group.&lt;/p&gt;

&lt;p&gt;When you paste manifests from multiple namespaces — say &lt;code&gt;production&lt;/code&gt;, &lt;code&gt;staging&lt;/code&gt;, and &lt;code&gt;monitoring&lt;/code&gt; — each namespace gets its own group and resources stay organized. Cross-namespace connections (e.g., an Ingress controller in &lt;code&gt;ingress-nginx&lt;/code&gt; routing to a Service in &lt;code&gt;production&lt;/code&gt;) are drawn as arrows between the groups.&lt;/p&gt;

&lt;h2&gt;
  
  
  Example: a typical web application
&lt;/h2&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight yaml"&gt;&lt;code&gt;&lt;span class="na"&gt;apiVersion&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;networking.k8s.io/v1&lt;/span&gt;
&lt;span class="na"&gt;kind&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;Ingress&lt;/span&gt;
&lt;span class="na"&gt;metadata&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;
&lt;span class="na"&gt;name&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;web-ingress&lt;/span&gt;
&lt;span class="na"&gt;namespace&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;production&lt;/span&gt;
&lt;span class="na"&gt;spec&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;
&lt;span class="na"&gt;rules&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;
&lt;span class="pi"&gt;-&lt;/span&gt; &lt;span class="na"&gt;http&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;
&lt;span class="na"&gt;paths&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;
&lt;span class="pi"&gt;-&lt;/span&gt; &lt;span class="na"&gt;path&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;/&lt;/span&gt;
&lt;span class="na"&gt;backend&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;
&lt;span class="na"&gt;service&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;
&lt;span class="na"&gt;name&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;web-service&lt;/span&gt;
&lt;span class="na"&gt;port&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;
&lt;span class="na"&gt;number&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="m"&gt;80&lt;/span&gt;
&lt;span class="nn"&gt;---&lt;/span&gt;
&lt;span class="na"&gt;apiVersion&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;v1&lt;/span&gt;
&lt;span class="na"&gt;kind&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;Service&lt;/span&gt;
&lt;span class="na"&gt;metadata&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;
&lt;span class="na"&gt;name&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;web-service&lt;/span&gt;
&lt;span class="na"&gt;namespace&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;production&lt;/span&gt;
&lt;span class="na"&gt;spec&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;
&lt;span class="na"&gt;selector&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;
&lt;span class="na"&gt;app&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;web&lt;/span&gt;
&lt;span class="nn"&gt;---&lt;/span&gt;
&lt;span class="na"&gt;apiVersion&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;apps/v1&lt;/span&gt;
&lt;span class="na"&gt;kind&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;Deployment&lt;/span&gt;
&lt;span class="na"&gt;metadata&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;
&lt;span class="na"&gt;name&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;web-deployment&lt;/span&gt;
&lt;span class="na"&gt;namespace&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;production&lt;/span&gt;
&lt;span class="na"&gt;spec&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;
&lt;span class="na"&gt;selector&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;
&lt;span class="na"&gt;matchLabels&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;
&lt;span class="na"&gt;app&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;web&lt;/span&gt;
&lt;span class="na"&gt;template&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;
&lt;span class="na"&gt;spec&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;
&lt;span class="na"&gt;containers&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;
&lt;span class="pi"&gt;-&lt;/span&gt; &lt;span class="na"&gt;name&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;web&lt;/span&gt;
&lt;span class="na"&gt;envFrom&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;
&lt;span class="pi"&gt;-&lt;/span&gt; &lt;span class="na"&gt;configMapRef&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;
&lt;span class="na"&gt;name&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;web-config&lt;/span&gt;
&lt;span class="pi"&gt;-&lt;/span&gt; &lt;span class="na"&gt;secretRef&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;
&lt;span class="na"&gt;name&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;web-secrets&lt;/span&gt;
&lt;span class="nn"&gt;---&lt;/span&gt;
&lt;span class="na"&gt;apiVersion&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;v1&lt;/span&gt;
&lt;span class="na"&gt;kind&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;ConfigMap&lt;/span&gt;
&lt;span class="na"&gt;metadata&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;
&lt;span class="na"&gt;name&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;web-config&lt;/span&gt;
&lt;span class="na"&gt;namespace&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;production&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Paste this and InfraSketch draws: &lt;strong&gt;Ingress → web-service → web-deployment → web-config&lt;/strong&gt; with &lt;strong&gt;web-secrets&lt;/strong&gt; also connected to the deployment. All resources inside a &lt;code&gt;production&lt;/code&gt; namespace box.&lt;/p&gt;

&lt;h2&gt;
  
  
  Use cases
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Onboarding&lt;/strong&gt; — new engineers understand the application topology in minutes instead of reading dozens of YAML files&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Code reviews&lt;/strong&gt; — visualize the topology change when a PR adds a new Service or reconfigures selectors&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Incident response&lt;/strong&gt; — quickly see which Services connect to a misbehaving Deployment&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Documentation&lt;/strong&gt; — export as PNG or SVG and embed in runbooks, Confluence, or Notion&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Architecture reviews&lt;/strong&gt; — export as draw.io XML for a fully editable diagram in design docs&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  Works with Helm and Kustomize output too
&lt;/h2&gt;

&lt;p&gt;InfraSketch reads rendered YAML — it doesn't need the original Helm chart or Kustomize overlay files. Render first, then paste:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;helm template my-release ./my-chart | pbcopy          &lt;span class="c"&gt;# macOS&lt;/span&gt;
kustomize build overlays/production | pbcopy            &lt;span class="c"&gt;# macOS&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;This works especially well for understanding what a third-party Helm chart actually deploys before you install it in your cluster. Paste the rendered output for NGINX Ingress Controller, cert-manager, or Prometheus Operator and see exactly which resources they create before running &lt;code&gt;helm install&lt;/code&gt;.&lt;/p&gt;

&lt;h2&gt;
  
  
  Common Kubernetes application patterns
&lt;/h2&gt;

&lt;h3&gt;
  
  
  Microservices with shared ingress
&lt;/h3&gt;

&lt;p&gt;Multiple Deployments each with their own Service, all routed through a single Ingress with path-based rules, produce a fan-out diagram: one Ingress node with arrows to each Service, each Service connected to its backing Deployment. InfraSketch draws each Deployment-Service pair as a group and fans the Ingress connections out clearly.&lt;/p&gt;

&lt;h3&gt;
  
  
  Worker with queue
&lt;/h3&gt;

&lt;p&gt;A pattern common in data pipelines: a Deployment that reads from an external queue has no Service (no inbound traffic) but does reference a Secret (for queue credentials) and a ConfigMap (for configuration). InfraSketch draws it as an isolated Deployment node with arrows to the Secret and ConfigMap — the asymmetry in the diagram immediately signals "this is a consumer, not a server."&lt;/p&gt;

&lt;h3&gt;
  
  
  StatefulSet with PVC
&lt;/h3&gt;

&lt;p&gt;Databases deployed as StatefulSets typically have a PersistentVolumeClaim per replica. InfraSketch draws the StatefulSet connected to its PVC(s) in the storage zone, and any Service that selects the StatefulSet connected from the networking zone. This pattern clearly separates the compute layer from the storage layer in the diagram.&lt;/p&gt;

&lt;h3&gt;
  
  
  Multi-namespace monitoring stack
&lt;/h3&gt;

&lt;p&gt;Paste Prometheus, Alertmanager, and Grafana manifests from a &lt;code&gt;monitoring&lt;/code&gt; namespace alongside your application manifests from &lt;code&gt;production&lt;/code&gt;. InfraSketch draws both namespace boxes side by side with the monitoring stack's ServiceMonitor references shown as cross-namespace connections.&lt;/p&gt;

&lt;h2&gt;
  
  
  Getting YAML from a live cluster
&lt;/h2&gt;

&lt;p&gt;Several &lt;code&gt;kubectl&lt;/code&gt; commands produce paste-ready YAML for InfraSketch:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="c"&gt;# All resources in a namespace&lt;/span&gt;
kubectl get all &lt;span class="nt"&gt;-n&lt;/span&gt; production &lt;span class="nt"&gt;-o&lt;/span&gt; yaml

&lt;span class="c"&gt;# Specific resource kinds&lt;/span&gt;
kubectl get deployments,services,ingresses &lt;span class="nt"&gt;-n&lt;/span&gt; production &lt;span class="nt"&gt;-o&lt;/span&gt; yaml

&lt;span class="c"&gt;# A single Helm release's resources&lt;/span&gt;
helm get manifest my-release &lt;span class="nt"&gt;-n&lt;/span&gt; production

&lt;span class="c"&gt;# All namespaces at once&lt;/span&gt;
kubectl get all &lt;span class="nt"&gt;--all-namespaces&lt;/span&gt; &lt;span class="nt"&gt;-o&lt;/span&gt; yaml
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;For large clusters, target specific namespaces or resource kinds to keep the diagram readable. Pasting ten namespaces of manifests will produce a technically accurate but visually dense diagram.&lt;/p&gt;

&lt;h2&gt;
  
  
  Frequently asked questions
&lt;/h2&gt;

&lt;h3&gt;
  
  
  Does InfraSketch need access to my cluster?
&lt;/h3&gt;

&lt;p&gt;No. Everything runs in your browser. InfraSketch reads the YAML you paste — it never makes network requests to your cluster, cloud provider, or any external API. Your manifests never leave your browser tab.&lt;/p&gt;

&lt;h3&gt;
  
  
  My Service selector doesn't match any Deployment — why?
&lt;/h3&gt;

&lt;p&gt;Selector matching requires the Service's &lt;code&gt;spec.selector&lt;/code&gt; labels to be a subset of the Deployment's &lt;code&gt;spec.selector.matchLabels&lt;/code&gt;. If the manifest is a Deployment template without &lt;code&gt;matchLabels&lt;/code&gt; defined (e.g., only &lt;code&gt;spec.template.metadata.labels&lt;/code&gt;), InfraSketch falls back to name-based matching. Paste both the Service and its target Deployment together for best results.&lt;/p&gt;

&lt;h3&gt;
  
  
  What about Custom Resource Definitions (CRDs)?
&lt;/h3&gt;

&lt;p&gt;CRDs with unknown &lt;code&gt;kind&lt;/code&gt; values are not mapped to diagram nodes — InfraSketch only renders the 16 built-in Kubernetes kinds listed above. Common operator resources (Certificates from cert-manager, VirtualServices from Istio) are skipped. Support for additional kinds will expand in future releases.&lt;/p&gt;

&lt;h3&gt;
  
  
  Can I diagram a single Pod's YAML?
&lt;/h3&gt;

&lt;p&gt;Yes — paste any valid Kubernetes YAML, including standalone Pod specs. A single Pod with &lt;code&gt;envFrom&lt;/code&gt; referencing a ConfigMap and a volume mounting a Secret will show the Pod connected to both config resources. It works best when you paste related manifests together so InfraSketch can draw the full connection graph.&lt;/p&gt;

&lt;blockquote&gt;
&lt;h3&gt;
  
  
  Generate your Kubernetes diagram now Paste your K8s manifests — or run &lt;code&gt;kubectl get all -o yaml&lt;/code&gt; and paste. Free, no login, no cluster access needed. &lt;a href="https://infrasketch.cloud" rel="noopener noreferrer"&gt;Open InfraSketch →&lt;/a&gt;
&lt;/h3&gt;
&lt;/blockquote&gt;

</description>
      <category>kubernetesdiagram</category>
      <category>k8sdiagramgenerator</category>
      <category>kubernetesarchitecturediagram</category>
      <category>kubernetesyamlvisualizer</category>
    </item>
    <item>
      <title>CDK Architecture Diagram Generator — Visualize AWS CDK Apps Instantly</title>
      <dc:creator>Raghvendra Pandey</dc:creator>
      <pubDate>Fri, 24 Apr 2026 22:12:26 +0000</pubDate>
      <link>https://forem.com/pandey-raghvendra/cdk-architecture-diagram-generator-visualize-aws-cdk-apps-instantly-4nl</link>
      <guid>https://forem.com/pandey-raghvendra/cdk-architecture-diagram-generator-visualize-aws-cdk-apps-instantly-4nl</guid>
      <description>&lt;p&gt;InfraSketch now supports AWS CDK. Run &lt;code&gt;cdk synth&lt;/code&gt;, paste the JSON output into the CDK tab, and get a full architecture diagram in seconds — VPC containment, subnet lanes, resource connections, official AWS icons. No login, no credentials, everything in your browser.&lt;/p&gt;

&lt;blockquote&gt;
&lt;h3&gt;
  
  
  Try it now Paste your &lt;code&gt;cdk synth&lt;/code&gt; output and see the diagram instantly. &lt;a href="https://infrasketch.cloud" rel="noopener noreferrer"&gt;Open InfraSketch →&lt;/a&gt;
&lt;/h3&gt;
&lt;/blockquote&gt;

&lt;h2&gt;
  
  
  Why CDK needs a diagram tool
&lt;/h2&gt;

&lt;p&gt;CDK is increasingly the default way teams write AWS infrastructure — TypeScript, Python, or Go code that compiles down to CloudFormation. The abstractions are great for development velocity, but they create a visibility problem: when something goes wrong, or when you need to explain the architecture to someone outside your team, the source code is not the right artifact to share.&lt;/p&gt;

&lt;p&gt;The CloudFormation console shows you a stack but won't visualize containment. The CDK tree view shows construct hierarchy, not network topology. There's no built-in way to go from a CDK app to a clean architecture diagram without manually drawing one.&lt;/p&gt;

&lt;p&gt;InfraSketch fills that gap. One command, paste, done.&lt;/p&gt;

&lt;h2&gt;
  
  
  How to get your CDK synth output
&lt;/h2&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;cdk synth | pbcopy          &lt;span class="c"&gt;# macOS — copies to clipboard&lt;/span&gt;
cdk synth &lt;span class="o"&gt;&amp;gt;&lt;/span&gt; template.json  &lt;span class="c"&gt;# save to file&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Then open &lt;a href="https://infrasketch.cloud" rel="noopener noreferrer"&gt;infrasketch.cloud&lt;/a&gt;, click the &lt;strong&gt;CDK&lt;/strong&gt; tab, paste, and click &lt;strong&gt;Generate Diagram&lt;/strong&gt;.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Tip:&lt;/strong&gt; If your app has multiple stacks, use &lt;code&gt;cdk synth MyStack&lt;/code&gt; to synthesize a specific stack, or paste each stack's output separately to diagram them individually.&lt;/p&gt;

&lt;h2&gt;
  
  
  How it works under the hood
&lt;/h2&gt;

&lt;p&gt;CDK compiles to CloudFormation JSON. InfraSketch's CDK tab runs the same parser as the CloudFormation tab — it reads the &lt;code&gt;Resources&lt;/code&gt; object, maps each &lt;code&gt;Type&lt;/code&gt; to a visual category, and infers topology from &lt;code&gt;Ref&lt;/code&gt; and &lt;code&gt;Fn::GetAtt&lt;/code&gt; references between resources.&lt;/p&gt;

&lt;p&gt;CDK logical IDs look different from hand-written CloudFormation — CDK generates names like &lt;code&gt;VPCB9E5F0B4&lt;/code&gt; and &lt;code&gt;EKSCluster9EE0221C&lt;/code&gt; — but the diagram labels use the resource type and truncated logical ID, making it easy to identify resources without needing the CDK source code in front of you.&lt;/p&gt;

&lt;h2&gt;
  
  
  What gets visualized
&lt;/h2&gt;

&lt;h4&gt;
  
  
  VPC containment
&lt;/h4&gt;

&lt;p&gt;Resources with &lt;code&gt;VpcId: { Ref: VPC }&lt;/code&gt; are drawn inside the VPC box. CDK's &lt;code&gt;ec2.Vpc&lt;/code&gt; construct generates this automatically.&lt;/p&gt;

&lt;h4&gt;
  
  
  Subnet placement
&lt;/h4&gt;

&lt;p&gt;Public and private subnet lanes from CDK's &lt;code&gt;SubnetSelection&lt;/code&gt; — &lt;code&gt;SubnetIds&lt;/code&gt; in the synthesized JSON places resources in the right lane.&lt;/p&gt;

&lt;h4&gt;
  
  
  Connection arrows
&lt;/h4&gt;

&lt;p&gt;Every &lt;code&gt;Fn::GetAtt&lt;/code&gt; between supported resources becomes a directed arrow — Lambda → IAM Role, ECS Service → ALB Target Group, etc.&lt;/p&gt;

&lt;h4&gt;
  
  
  Zone grouping
&lt;/h4&gt;

&lt;p&gt;Internet zone (IGW, CloudFront), messaging zone (SQS, SNS), data zone (RDS, ElastiCache, S3) — all inferred automatically from resource type.&lt;/p&gt;

&lt;h2&gt;
  
  
  Supported CDK constructs (L1 / Cfn*)
&lt;/h2&gt;

&lt;p&gt;Any CDK L1 construct (prefixed &lt;code&gt;Cfn&lt;/code&gt;) maps directly to a CloudFormation resource type and is fully supported. Common L2 constructs synthesize to the same underlying types:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;code&gt;ec2.Vpc&lt;/code&gt; → &lt;code&gt;AWS::EC2::VPC&lt;/code&gt; + subnets + IGW + NAT gateways&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;eks.Cluster&lt;/code&gt; → &lt;code&gt;AWS::EKS::Cluster&lt;/code&gt; + node groups + IAM roles&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;ecs.FargateService&lt;/code&gt; → &lt;code&gt;AWS::ECS::Service&lt;/code&gt; + task definition&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;lambda.Function&lt;/code&gt; → &lt;code&gt;AWS::Lambda::Function&lt;/code&gt; + IAM role&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;rds.DatabaseInstance&lt;/code&gt; → &lt;code&gt;AWS::RDS::DBInstance&lt;/code&gt; + subnet group&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;elasticache.CfnReplicationGroup&lt;/code&gt; → &lt;code&gt;AWS::ElastiCache::ReplicationGroup&lt;/code&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;s3.Bucket&lt;/code&gt; → &lt;code&gt;AWS::S3::Bucket&lt;/code&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;sqs.Queue&lt;/code&gt; → &lt;code&gt;AWS::SQS::Queue&lt;/code&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;sns.Topic&lt;/code&gt; → &lt;code&gt;AWS::SNS::Topic&lt;/code&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;elbv2.ApplicationLoadBalancer&lt;/code&gt; → &lt;code&gt;AWS::ElasticLoadBalancingV2::LoadBalancer&lt;/code&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;cloudfront.Distribution&lt;/code&gt; → &lt;code&gt;AWS::CloudFront::Distribution&lt;/code&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;kms.Key&lt;/code&gt; → &lt;code&gt;AWS::KMS::Key&lt;/code&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;iam.Role&lt;/code&gt; → &lt;code&gt;AWS::IAM::Role&lt;/code&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;wafv2.CfnWebACL&lt;/code&gt; → &lt;code&gt;AWS::WAFv2::WebACL&lt;/code&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;route53.HostedZone&lt;/code&gt; → &lt;code&gt;AWS::Route53::HostedZone&lt;/code&gt;
&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  Use cases
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Code reviews&lt;/strong&gt; — run &lt;code&gt;cdk synth&lt;/code&gt; on a PR branch and paste the output to see what the architecture change looks like visually&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Onboarding&lt;/strong&gt; — share a diagram link with new team members instead of asking them to read CDK TypeScript they've never seen&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Documentation&lt;/strong&gt; — export as PNG or SVG and embed in Confluence, Notion, or your wiki&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Architecture reviews&lt;/strong&gt; — export as draw.io XML to get a fully editable diagram for your design doc&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Drift detection&lt;/strong&gt; — synthesize before and after a change and compare diagrams side by side&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  Works with CDK for Terraform too
&lt;/h2&gt;

&lt;p&gt;CDK for Terraform (CDKTF) can synthesize Terraform JSON. If you're using CDKTF, use the &lt;strong&gt;Terraform&lt;/strong&gt; tab and paste the synthesized JSON — InfraSketch's plan JSON parser handles it directly.&lt;/p&gt;

&lt;h2&gt;
  
  
  Common CDK patterns and how they diagram
&lt;/h2&gt;

&lt;h3&gt;
  
  
  VPC with public and private subnets
&lt;/h3&gt;

&lt;p&gt;CDK's &lt;code&gt;ec2.Vpc&lt;/code&gt; construct with &lt;code&gt;maxAzs: 2&lt;/code&gt; synthesizes to one VPC, two public subnets, two private subnets, an Internet Gateway, two NAT Gateways, and four route tables — all in a single CloudFormation stack. InfraSketch renders the VPC container with public and private subnet lanes, places the NAT Gateways in the public lane, and draws the IGW in the Internet zone above.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight typescript"&gt;&lt;code&gt;&lt;span class="c1"&gt;// CDK TypeScript — synthesizes to ~30 CloudFormation resources&lt;/span&gt;
&lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;vpc&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="k"&gt;new&lt;/span&gt; &lt;span class="nx"&gt;ec2&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nc"&gt;Vpc&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="k"&gt;this&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;Vpc&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
&lt;span class="na"&gt;maxAzs&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="mi"&gt;2&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
&lt;span class="na"&gt;natGateways&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
&lt;span class="na"&gt;subnetConfiguration&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="p"&gt;[&lt;/span&gt;
&lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="na"&gt;name&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;Public&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="na"&gt;subnetType&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nx"&gt;ec2&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;SubnetType&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;PUBLIC&lt;/span&gt; &lt;span class="p"&gt;},&lt;/span&gt;
&lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="na"&gt;name&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;Private&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="na"&gt;subnetType&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nx"&gt;ec2&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;SubnetType&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;PRIVATE_WITH_EGRESS&lt;/span&gt; &lt;span class="p"&gt;},&lt;/span&gt;
&lt;span class="p"&gt;],&lt;/span&gt;
&lt;span class="p"&gt;});&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  ECS Fargate service with ALB
&lt;/h3&gt;

&lt;p&gt;The &lt;code&gt;ecs_patterns.ApplicationLoadBalancedFargateService&lt;/code&gt; L3 construct synthesizes to an ECS Cluster, Fargate Task Definition, ECS Service, ALB, Target Group, Security Groups, and IAM Roles. InfraSketch places the ALB in the ingress zone, the ECS service in a private subnet, and draws connections from ALB → Target Group → Service.&lt;/p&gt;

&lt;h3&gt;
  
  
  Lambda with SQS trigger
&lt;/h3&gt;

&lt;p&gt;When &lt;code&gt;lambda.Function&lt;/code&gt; uses an &lt;code&gt;SqsEventSource&lt;/code&gt;, CDK synthesizes an event source mapping resource alongside the Lambda and SQS Queue. InfraSketch draws the SQS Queue in the messaging zone with an arrow to the Lambda, matching the actual invocation direction.&lt;/p&gt;

&lt;h2&gt;
  
  
  Reading CDK-generated logical IDs
&lt;/h2&gt;

&lt;p&gt;CDK generates stable but opaque logical IDs like &lt;code&gt;VpcPublicSubnet1Subnet5C2D37C4&lt;/code&gt; and &lt;code&gt;ECSClusterA592C0A4&lt;/code&gt;. These IDs are hashes of the construct path, not human-friendly names. On InfraSketch diagrams, resources are labelled with their resource type and a truncated version of the logical ID, so you can cross-reference the diagram with your CDK source using the construct ID you gave the resource (e.g., &lt;code&gt;Vpc&lt;/code&gt;, &lt;code&gt;ECSCluster&lt;/code&gt;).&lt;/p&gt;

&lt;p&gt;To make diagrams easier to read, use descriptive IDs in your CDK code — &lt;code&gt;new eks.Cluster(this, 'ProdEksCluster', ...)&lt;/code&gt; produces a more readable diagram label than &lt;code&gt;new eks.Cluster(this, 'Cluster', ...)&lt;/code&gt;.&lt;/p&gt;

&lt;h2&gt;
  
  
  Frequently asked questions
&lt;/h2&gt;

&lt;h3&gt;
  
  
  Can I paste a CDK app with multiple stacks?
&lt;/h3&gt;

&lt;p&gt;Run &lt;code&gt;cdk synth MyStack&lt;/code&gt; to target one stack, or diagram each stack separately. Pasting output from &lt;code&gt;cdk synth&lt;/code&gt; with multiple stacks concatenated may produce unexpected results since the output is multiple JSON documents.&lt;/p&gt;

&lt;h3&gt;
  
  
  Does InfraSketch support CDK Aspects?
&lt;/h3&gt;

&lt;p&gt;Aspects modify the CDK tree before synthesis — by the time you run &lt;code&gt;cdk synth&lt;/code&gt; and paste the JSON, Aspects have already been applied. Any resources or properties added by an Aspect appear in the synthesized output and are diagrammed correctly.&lt;/p&gt;

&lt;h3&gt;
  
  
  What if my synth output is very large?
&lt;/h3&gt;

&lt;p&gt;InfraSketch runs entirely in-browser with no size limits. A typical VPC + EKS + RDS stack synthesizes to 150–300 CloudFormation resources; InfraSketch renders whichever resource types it recognises and omits lower-level resources like route table associations and security group egress rules that would clutter the diagram.&lt;/p&gt;

&lt;h3&gt;
  
  
  Can I diagram a CDK Stage or Environment?
&lt;/h3&gt;

&lt;p&gt;Yes — &lt;code&gt;cdk synth&lt;/code&gt; on a Stage produces one CloudFormation template per stack in the Stage. Diagram each stack's JSON separately to compare environments.&lt;/p&gt;

&lt;h2&gt;
  
  
  CDK vs CloudFormation diagrams
&lt;/h2&gt;

&lt;p&gt;The CDK and CloudFormation tabs in InfraSketch use the same underlying parser — CDK synthesizes to CloudFormation, so the input format is identical. The practical difference is how you get the input: CDK requires a &lt;code&gt;cdk synth&lt;/code&gt; step; CloudFormation templates are static files you already have. If you write CDK, always diagram from synthesized output (not hand-written CloudFormation) to make sure you're seeing exactly what gets deployed.&lt;/p&gt;

&lt;blockquote&gt;
&lt;h3&gt;
  
  
  Generate your CDK diagram now Run &lt;code&gt;cdk synth | pbcopy&lt;/code&gt;, paste into the CDK tab, click Generate. Free, no login, nothing leaves your browser. &lt;a href="https://infrasketch.cloud" rel="noopener noreferrer"&gt;Open InfraSketch →&lt;/a&gt;
&lt;/h3&gt;
&lt;/blockquote&gt;

</description>
      <category>cdk</category>
      <category>awscdk</category>
      <category>devops</category>
      <category>aws</category>
    </item>
  </channel>
</rss>
