Aws architecture diagram

From NVlabs/Skill2Env · View interactive version

Aws architecture diagram is an AI agent skill from the GitHub repository NVlabs/Skill2Env. Generate AWS architecture diagrams in draw.io format. Activates when the user asks to create, generate, or build an architecture diagram, system diagram, or draw.io diagram for AWS services.

How to use this skill

Skill file

Instructions

Generate a draw.io (.drawio) XML file representing an AWS architecture diagram.

Layout

Canvas

<mxCell value="&lt;b&gt;Diagram Title&lt;/b&gt;&lt;br&gt;Author | Date | Version" style="text;html=1;align=left;verticalAlign=top;whiteSpace=wrap;rounded=0;fontSize=14;spacing=8;" vertex="1" parent="1">
  <mxGeometry x="40" y="30" width="420" height="60" as="geometry" />
</mxCell>

Icon Style

Edge Style — CRITICAL FOR CLEAN DIAGRAMS

Base edge style (all edges):

edgeStyle=orthogonalEdgeStyle;rounded=1;orthogonalLoop=1;jettySize=auto;html=1;strokeWidth=2;exitX=1;exitY=0.5;exitDx=0;exitDy=0;entryX=0;entryY=0.5;entryDx=0;entryDy=0;

Rules for edge labels:

Edge label positioning (prevents overlap with icons):

<mxCell value="Label" style="edgeStyle=orthogonalEdgeStyle;rounded=1;orthogonalLoop=1;jettySize=auto;html=1;strokeWidth=2;labelBackgroundColor=#F5F5F5;fontSize=11;" edge="1" source="a" target="b" parent="1">
  <mxGeometry relative="1" as="geometry" />
</mxCell>

For edges that go to services ABOVE or BELOW the main flow:

Edge types:

When NOT to label edges:

Two Icon Patterns — CRITICAL

Pattern 1: Service-level (resourceIcon frame)

Pattern 2: Resource-level (standalone shape)

Confusing these patterns guarantees broken icons.

Icon Reference Files (load by category as needed)

Always look up icons from reference files. Never guess icon names.

Group Boundaries

PNG Export Background Fix

Place a full-canvas rectangle as the FIRST element (lowest z-order):

<mxCell value="" style="rounded=0;whiteSpace=wrap;html=1;fillColor=#F5F5F5;strokeColor=none;" vertex="1" parent="1">
  <mxGeometry x="0" y="0" width="2400" height="1400" as="geometry" />
</mxCell>

This prevents black background on PNG export. Use strokeColor=none (not E0E0E0).

Multi-page Diagrams

For complex architectures, use multiple pages (tabs) in one .drawio file:

<mxfile>
  <diagram id="overview" name="Overview">...</diagram>
  <diagram id="networking" name="Networking Detail">...</diagram>
  <diagram id="data-flow" name="Data Flow">...</diagram>
</mxfile>

Edge Legend (optional, for complex diagrams)

Place below the title block if the diagram has multiple edge types:

File Splitting

Since draw.io XML can be large, split creation across multiple tool calls:

  1. Header + left side (frontend, delivery layer)
  2. Middle (processing lambdas, database)
  3. Right side (ingest, messaging, data sources)
  4. Bottom (optional/outbound flows) + close XML

Audience Mode

Before generating, assess the target audience:

If unclear, ask: "Technical audience or executive/non-technical?"

Numbered Flow Edges (for non-technical mode)

Instead of technical labels, show flow order with circled numbers:

Use edge labels: value="①" with fontSize=14;fontStyle=1;labelBackgroundColor=#ffffff;

Companion Guide

After generating the .drawio file, also generate a markdown guide:

Two-Step Edit Approach

After generating the initial .drawio file:

  1. Export to PNG using the draw.io CLI (see Output section)
  2. Review the PNG visually — check for empty/broken icons, overlapping edges, misaligned labels
  3. Fix issues in the .drawio XML and re-export

This catches rendering problems (wrong stencil names, broken styles) that are invisible in raw XML.

Icon Name Gotchas — CRITICAL

draw.io stencil names do NOT always match current AWS service names. Services that were renamed keep their legacy stencil names:

| AWS Service Name | draw.io resIcon name | Why |

|---|---|---|

| Amazon OpenSearch Service | elasticsearch_service | Renamed from Elasticsearch in 2021 |

| Amazon EventBridge | eventbridge | Was CloudWatch Events |

| AWS Fargate | fargate | Correct |

Rule: Always verify icon names from the reference files. If a service icon renders as an empty box, the stencil name is wrong. Check the draw.io source at src/main/webapp/js/diagramly/sidebar/Sidebar-AWS4.js for the canonical name.

Validation Step

After generating XML, mentally verify:

  1. Every resIcon= value exists in the reference files
  2. Service-level icons have strokeColor=#ffffff
  3. Resource-level icons have strokeColor=none
  4. No XML comments present
  5. All cell IDs are unique
  6. Every edge has <mxGeometry relative="1" as="geometry" />
  7. No icon uses a guessed stencil name — all verified against reference files

Output

Flags: -x export, -f format, -e embed diagram XML, -b 10 border

XML Well-formedness (CRITICAL)

Official Reference

Use this skill with your AI agent: Open on Skill Issue to copy, download, or add to your library. Works with Claude, ChatGPT, Gemini, Cursor, Windsurf and more.