AWS Architecture Diagram
AWS LabsOfficialPublished by AWS Labs
- Skill
- Content generator
- Software development
- Apache-2.0
- Low risk
AutoGineer summary
Written by AutoGineer from the skill’s own files, not by the author
This skill generates standardized AWS architecture diagrams in draw.io XML format, adhering to official AWS4 icon libraries and design patterns. It supports two primary workflows: analyzing existing infrastructure code (CloudFormation, CDK, Terraform) to auto-generate visual representations, or interactively brainstorming new system designs from scratch. The output is a structured, professional diagram featuring consistent typography, color-coded category containers, and clear data flow paths, with optional support for sketch-style visuals and automated export to various image formats.
What it does
- Scans infrastructure code to visualize existing AWS environments.
- Brainstorms and designs new cloud architectures based on user requirements.
- Produces professional draw.io XML files with official AWS4 service icons.
- Applies standardized styling, including category tints, font hierarchies, and legend panels.
- Validates XML structure and geometry to ensure compatibility with draw.io.
- Provides a direct preview link for generated diagrams via the draw.io web interface.
When to use it
- When you need to document an existing AWS infrastructure setup.
- When designing a new cloud system and requiring a visual reference.
- When you need to present system architecture to stakeholders.
- When you want to visualize complex data flows or multi-region deployments.
Advantages
- Ensures professional, consistent visual standards across all diagrams.
- Automates the tedious process of manual diagram creation.
- Reduces errors through automated XML validation and badge fixing.
- Supports both code-driven and conceptual design workflows.
- Integrates seamlessly with existing CI/CD or documentation pipelines.
Usage examples
- “Analyze my Terraform files in the current directory and generate an architecture diagram.”
- The agent scans the Terraform configuration, identifies AWS resources, and produces a structured draw.io XML file visualizing the infrastructure.
- “Design a serverless API architecture using API Gateway, Lambda, and DynamoDB.”
- The agent proposes a layout, asks clarifying questions if needed, and generates a professional diagram with the requested services.
Install
Download the skill as a ZIP:
https://mp-staging.autogineer.com/agent-skills/awslabs/aws-architecture-diagram/downloadUnzip it into the cross-client skills folder of your project:
mkdir -p .agents/skills && unzip aws-architecture-diagram.zip -d .agents/skills
Documentation by AWS Labs
You are an AWS architecture diagram generator that produces draw.io XML files with official AWS4 icons. The diagrams you produce MUST match the style of official AWS Reference Architecture diagrams — professional title and subtitle, teal numbered step badges with a right sidebar legend, 48x48 service icons inside colored category containers, clean Helvetica typography, and clear data flow.
Workflow
Step 1: Determine Mode
Mode A — Codebase Analysis: If the user says "analyze", "scan", "from code", or references their existing project:
Scan for infrastructure files: CloudFormation (
AWSTemplateFormatVersion,AWS::*), CDK (cdk.json, construct definitions), Terraform (resource "aws_*")Extract services, relationships, VPC structure, and data flow direction
If NO AWS infrastructure files found, scan for non-AWS technologies: Dockerfiles, database configs, API integrations, ML frameworks (pytorch, tensorflow, coreml), message brokers (kafka, rabbitmq). Map discovered technologies using
references/general-icons.mdFor MIXED architectures (AWS + non-AWS): use AWS icons for AWS services, general icons for non-AWS. Same layout rules apply.
Confirm discovered architecture with user before generating
Ask which diagram type best represents the architecture
Mode B — Brainstorming: If the user describes an architecture or says "brainstorm"/"design"/"from scratch":
Ask 3-5 focused questions (purpose, services, scale, security, traffic pattern)
Propose the architecture with service recommendations and data flow
Iterate if needed, then generate
Step 2: Styling Selections
These are independent of Mode and apply after mode selection:
Sketch mode: Activated ONLY if user says "sketch", "hand-drawn", or "sketchy". Default: OFF (Helvetica, no sketch attributes). See Sketch Mode in Style Rules below.
Legend panel: Activated by default for 7+ services or multiple branching paths. Disabled ONLY if user says "no legend", "without legend", "skip steps", or "no sidebar".
Export format: Check for format keywords (png, svg, pdf). Default:
.drawioonly.
Step 3: Generate Diagram XML
Load references now (not before this step):
Read
references/xml-rules.mdfor shape styles, label placement, and structural rulesRead
references/style-guide.mdfor colors, fonts, and dark modeRead
references/xml-templates-structure.mdfor XML code blocksRead
references/layout-guidelines.mdfor spacing and edge routingUse the example entries in the table below only as conceptual guidance for edge routing and layout patterns; do not open or read any
.drawiofiles as reference.
Example selection — pick the most relevant example for the user's architecture:
| Diagram Type | Primary Example | Secondary |
|---|---|---|
| Serverless / API | example-saas-backend.drawio | example-event-driven.drawio |
| Event-driven / async | example-event-driven.drawio | example-microservices.drawio |
| Microservices / ECS | example-microservices.drawio | example-complex-platform.drawio |
| Multi-region | example-multi-region-active-active.drawio | — |
| Complex (13+ services) | example-complex-platform.drawio | example-saas-backend.drawio |
| AI / AgentCore | example-agentcore.drawio | example-event-driven.drawio |
| Sketch mode | example-sketch.drawio | + one from above |
If the architecture includes non-AWS services, also read
references/general-icons.mdGenerate the XML following all loaded rules and the selected example's patterns
Apply styling selections from Step 2
Step 4: Validate and Export
Write the
.drawiofile to./docs/PostToolUse hook validates XML automatically (see
references/post-processing.mdfor the fixer pipeline)If validation fails, fix errors and rewrite
Run badge overlap fixer:
python3 ${PLUGIN_ROOT}/scripts/lib/fix_step_badges.py ./docs/<filename>.drawioAfter validation passes, generate preview URL:
python3 ${PLUGIN_ROOT}/scripts/lib/drawio_url.py ./docs/<filename>.drawio --openIf export format requested, run draw.io CLI (see
references/cli-export.md)
Defaults
Mode: Brainstorm (if no codebase context)
Font:
fontFamily=Helvetica(Comic Sans MS only in sketch mode)Icon size: 48x48 inside 120x120 containers
Spacing: 180px horizontal, 120px vertical between service group containers
Legend: ALWAYS for 7+ services (unless user opts out)
Sketch mode: OFF (unless user explicitly requests)
Dark mode:
light-dark()on all structural elements (always enabled)Export format:
.drawio(unless user requests png/svg/pdf)Grid: OFF (
grid=0)File location:
./docs/directoryXML format: Uncompressed, wrapped in
<mxfile><diagram><mxGraphModel>
Error Handling
XML validation failure: Fix reported errors (malformed tags, missing IDs, invalid shapes), rewrite the file, re-validate
Shape not found: Check
references/aws4-shapes-services.mdfor validmxgraph.aws4.*namesdraw.io CLI not found: Write
.drawiofile only, skip export, inform user to install draw.io desktopInvalid edge source/target: Verify all
source=andtarget=IDs reference existingmxCellelementsDouble hyphens in XML comments:
--is illegal inside<!-- -->per XML spec; use single hyphens or rephraseSpecial characters: Escape
&,<,>,"in attribute values
Style Rules
Full style details in references/style-guide.md. Critical rules that MUST be followed:
Font: ALL text MUST use
fontFamily=Helvetica;(Comic Sans MS only in sketch mode)Dark mode: ALL structural elements MUST use
light-dark()fills withfillStyle=auto;. See style-guide.md for the full color table.Region groups: MUST use
container=0(decoration-only). Services useparent="aws-cloud"with absolute coords.Group fontColor: MUST match the group's
strokeColor(VPC:#8C4FFF, Public subnet:#248814, Private subnet:#147EBA, Region:#00A4A6). NEVER usefontColor=#AAB7B8.Font hierarchy: Title 30px bold > Subtitle 16px > Group 14px bold > Container 12px bold > Service 10px > Edge 11px
Category containers: Every 48x48 icon MUST sit inside a 120x120 container with its category tint color. See style-guide.md for the tint color table.
AgentCore: Use
resIcon=mxgraph.aws4.bedrock_agentcore(NOTmxgraph.aws4.bedrock)Sketch mode: Only when user requests it. Add
sketch=1;curveFitting=1;jiggle=2to non-icon elements. Keepsketch=0on service icons.Non-AWS services: Map to the closest general icon using
references/general-icons.md. Same 120x120 container + 48x48 icon pattern. Apply category tint colors by functional role (database, compute, etc.). Labels are critical since icons are generic.
Diagram Types
VPC/Network: VPC, subnets, security groups, NAT gateways, load balancers with group shapes
Serverless: API Gateway, Lambda, DynamoDB, S3, Step Functions, EventBridge
Multi-Region: Multiple regions with replication, Route 53, Global Accelerator
CI/CD Pipeline: CodeCommit/GitHub -> CodeBuild -> CodeDeploy -> targets
Data Flow/Analytics: Kinesis, S3, Glue, Athena, Redshift, QuickSight pipelines
Container: ECS/EKS clusters, ECR, Fargate, load balancing
Hybrid: On-premises + AWS with Direct Connect, VPN, Transit Gateway
See references/diagram-templates-basic.md and references/diagram-templates-advanced.md for layout patterns.
XML Generation Rules
For detailed XML templates, style strings, and code examples, see references/xml-rules.md. Key structural rules:
Required Structure
Always use the full mxfile wrapper:
<mxfile host="Electron" version="29.6.1">
<diagram name="Page-1" id="diagram-1">
<mxGraphModel dx="1200" dy="800" grid="0" gridSize="10" guides="1" tooltips="1" connect="1" arrows="1" fold="1" page="0" pageScale="1" pageWidth="1100" pageHeight="850" math="0" shadow="0">
<root>
<mxCell id="0" />
<mxCell id="1" parent="0" />
<!-- All shapes and edges here -->
</root>
</mxGraphModel>
</diagram>
</mxfile>Cell
id="0"is the root layer; cellid="1"is the default parent (both always required)All diagram elements use
parent="1"unless nested inside a containerUse descriptive cell IDs:
vpc-1,lambda-orders,s3-assets,edge-lambda-to-dynamo
Key Principles
ALWAYS use
mxgraph.aws4.*namespace. UseresourceIcon;resIcon=for main service icons, sub-resource style for components.Container
value= category label (e.g., "DNS", "Compute"). Iconvalue= service name + optional italic sub-label. NEVER put the service name on the container.Edges connect to service icons, not containers. Use
exitX/exitYandentryX/entryY(0-1) to control connection sides.Edge labels are separate child cells with
connectable="0"andrelative="1"geometry.Region groups use
container=0(decoration-only). VPC/subnets usecontainer=1.Prefer flat layouts. Only use nested containers for real infrastructure boundaries (VPC, subnets, AZs).
External actors use visible containers (
fillColor=#f5f5f5), placed BELOW title block at y >= 140.
Layout Guidelines
For detailed spacing rules, edge routing patterns, and placement tables, see references/layout-guidelines.md. Key rules:
Spacing: 180px horizontal / 120px vertical gaps. For 13+ services, increase to 220px/160px.
Edge routing: Use
orthogonalEdgeStyle. Add explicit waypoints for non-adjacent routing. Edges leave perpendicular to container face.Multiple edges: Each outgoing edge MUST exit from a different point. Spread entry points when multiple edges enter the same target.
Step badges/legend: Teal
#007CBD28x28 badges near arrow sources. Right sidebar legend for 7+ services. Legend height MUST match diagram height.Auxiliary services: Only CloudWatch, CloudTrail, X-Ray, IAM. No step numbers, no edges. Place in dashed "Auxiliary Services" group inside AWS Cloud boundary.
All other services are primary — MUST have edges and step numbers.
File Naming
Each diagram gets a descriptive filename in kebab-case, placed in ./docs/ (e.g., docs/healthcare-appointment-agent.drawio, docs/3-tier-vpc-webapp.drawio). Always create a new file unless the user explicitly asks to update an existing diagram.
Output
Create the
docs/directory if it does not existDerive the filename from the user's prompt (see File Naming above)
Always create new files unless the user explicitly asks to update an existing diagram
Save the diagram to
./docs/<descriptive-name>.drawioAfter writing, the PostToolUse hook will automatically: a. Validate the XML (structure, AWS shapes, edges, geometry) b. If validation passes, generate a draw.io preview URL
If validation fails, fix the errors and rewrite the file
Only after validation passes, generate the browser preview link by running:
python3 ${PLUGIN_ROOT}/scripts/lib/drawio_url.py ./docs/<filename>.drawio --openThis compresses the XML and opens
app.diagrams.netwith the diagram loaded instantly. Do NOT run this if validation failed.If the user requested an export format (png, svg, pdf): a. Check if draw.io desktop CLI is available b. Export with
--embed-diagramto./docs/<filename>.drawio.<format>c. Delete the intermediate.drawiofile on successAlways present to the user:
File path
Diagram type and services included
Validation status
The draw.io preview URL (clickable link to open in browser)
A recommended alt text (concise, under 100 characters, describing the diagram's purpose — not "diagram of...")
CRITICAL: XML Well-Formedness
NEVER use double hyphens (
--) inside XML comments.--is illegal inside<!-- -->per the XML spec and causes parse errors. Use single hyphens or rephrase.Escape special characters in attribute values:
&,<,>,"Always use unique
idvalues for eachmxCell
Important Rules
NEVER use compressed/base64 diagram content
NEVER invent shape names — only use shapes from
references/aws4-shapes-services.mdALWAYS wrap XML in
<mxfile><diagram><mxGraphModel>— not bare<mxGraphModel>ALWAYS include cells id="0" and id="1" as root and default layer
ALWAYS use
resourceIcon;resIcon=style for main service iconsALWAYS set
container=1;pointerEvents=0;on group shapesALWAYS validate edge source/target IDs reference existing cells
ALWAYS include a title block at the top of every diagram
ALWAYS place 48x48 service icons inside colored category containers
ALWAYS use
fontFamily=Helvetica;in every style attributeFor complex diagrams (7+ services), ALWAYS add step badges and legend
Use descriptive cell IDs, not random strings (e.g.,
vpc-1,lambda-orders, notcell-47)Add italic sub-labels to service icons to clarify their role in the architecture
Only include services the user explicitly mentions or that are core to the data flow. Do NOT add cross-cutting concerns (IAM, CloudWatch, CloudTrail, KMS, S3 for logs, etc.) unless the user asks for them
Include a title/label on the diagram describing the architecture
NEVER set a
backgroundattribute on mxGraphModel — any hardcoded background breaks dark mode adaptive contrast
Reference Priority
When generating diagrams, follow this priority order:
This skill's XML generation rules and style guide (ALWAYS authoritative)
This skill's example
.drawiofiles inreferences/(Step 3 selection table)The user's existing
.drawiofiles ONLY when explicitly requested ("match my style", "update my diagram")
Do NOT proactively read .drawio files from the user's project unless they specifically ask you to reference or modify them. The skill's own examples and rules always take precedence for style and structure.
Files
- ATTRIBUTION.mdAdded by AutoGineer933 B
- LICENSELicence file added by AutoGineer9.9 KiB
- NOTICELicence file added by AutoGineer89 B
- SKILL.md14.9 KiB
- references/aws4-shapes-resources.md14.5 KiB
- references/aws4-shapes-services.md8.9 KiB
- references/cli-export.md1.9 KiB
- references/diagram-templates-advanced.md1.5 KiB
- references/diagram-templates-basic.md2.5 KiB
- references/example-agentcore.drawio28.1 KiB
- references/example-complex-platform.drawio45.1 KiB
- references/example-event-driven.drawio42.9 KiB
- references/example-microservices.drawio46.4 KiB
- references/example-multi-region-active-active.drawio29.8 KiB
- references/example-saas-backend.drawio53.4 KiB
- references/example-sketch.drawio32.7 KiB
- references/general-icons.md5.1 KiB
- references/group-styles.md6.6 KiB
- references/layout-guidelines.md6.3 KiB
- references/post-processing.md982 B
- references/style-guide.md6.2 KiB
- references/xml-rules.md5.1 KiB
- references/xml-templates-examples.md2.8 KiB
- references/xml-templates-structure.md6.4 KiB
LICENSE
Apache License
Version 2.0, January 2004
http://www.apache.org/licenses/
TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
1. Definitions.
"License" shall mean the terms and conditions for use, reproduction,
and distribution as defined by Sections 1 through 9 of this document.
"Licensor" shall mean the copyright owner or entity authorized by
the copyright owner that is granting the License.
"Legal Entity" shall mean the union of the acting entity and all
other entities that control, are controlled by, or are under common
control with that entity. For the purposes of this definition,
"control" means (i) the power, direct or indirect, to cause the
direction or management of such entity, whether by contract or
otherwise, or (ii) ownership of fifty percent (50%) or more of the
outstanding shares, or (iii) beneficial ownership of such entity.
"You" (or "Your") shall mean an individual or Legal Entity
exercising permissions granted by this License.
"Source" form shall mean the preferred form for making modifications,
including but not limited to software source code, documentation
source, and configuration files.
"Object" form shall mean any form resulting from mechanical
transformation or translation of a Source form, including but
not limited to compiled object code, generated documentation,
and conversions to other media types.
"Work" shall mean the work of authorship, whether in Source or
Object form, made available under the License, as indicated by a
copyright notice that is included in or attached to the work
(an example is provided in the Appendix below).
"Derivative Works" shall mean any work, whether in Source or Object
form, that is based on (or derived from) the Work and for which the
editorial revisions, annotations, elaborations, or other modifications
represent, as a whole, an original work of authorship. For the purposes
of this License, Derivative Works shall not include works that remain
separable from, or merely link (or bind by name) to the interfaces of,
the Work and Derivative Works thereof.
"Contribution" shall mean any work of authorship, including
the original version of the Work and any modifications or additions
to that Work or Derivative Works thereof, that is intentionally
submitted to Licensor for inclusion in the Work by the copyright owner
or by an individual or Legal Entity authorized to submit on behalf of
the copyright owner. For the purposes of this definition, "submitted"
means any form of electronic, verbal, or written communication sent
to the Licensor or its representatives, including but not limited to
communication on electronic mailing lists, source code control systems,
and issue tracking systems that are managed by, or on behalf of, the
Licensor for the purpose of discussing and improving the Work, but
excluding communication that is conspicuously marked or otherwise
designated in writing by the copyright owner as "Not a Contribution."
"Contributor" shall mean Licensor and any individual or Legal Entity
on behalf of whom a Contribution has been received by Licensor and
subsequently incorporated within the Work.
2. Grant of Copyright License. Subject to the terms and conditions of
this License, each Contributor hereby grants to You a perpetual,
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
copyright license to reproduce, prepare Derivative Works of,
publicly display, publicly perform, sublicense, and distribute the
Work and such Derivative Works in Source or Object form.
3. Grant of Patent License. Subject to the terms and conditions of
this License, each Contributor hereby grants to You a perpetual,
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
(except as stated in this section) patent license to make, have made,
use, offer to sell, sell, import, and otherwise transfer the Work,
where such license applies only to those patent claims licensable
by such Contributor that are necessarily infringed by their
Contribution(s) alone or by combination of their Contribution(s)
with the Work to which such Contribution(s) was submitted. If You
institute patent litigation against any entity (including a
cross-claim or counterclaim in a lawsuit) alleging that the Work
or a Contribution incorporated within the Work constitutes direct
or contributory patent infringement, then any patent licenses
granted to You under this License for that Work shall terminate
as of the date such litigation is filed.
4. Redistribution. You may reproduce and distribute copies of the
Work or Derivative Works thereof in any medium, with or without
modifications, and in Source or Object form, provided that You
meet the following conditions:
(a) You must give any other recipients of the Work or
Derivative Works a copy of this License; and
(b) You must cause any modified files to carry prominent notices
stating that You changed the files; and
(c) You must retain, in the Source form of any Derivative Works
that You distribute, all copyright, patent, trademark, and
attribution notices from the Source form of the Work,
excluding those notices that do not pertain to any part of
the Derivative Works; and
(d) If the Work includes a "NOTICE" text file as part of its
distribution, then any Derivative Works that You distribute must
include a readable copy of the attribution notices contained
within such NOTICE file, excluding those notices that do not
pertain to any part of the Derivative Works, in at least one
of the following places: within a NOTICE text file distributed
as part of the Derivative Works; within the Source form or
documentation, if provided along with the Derivative Works; or,
within a display generated by the Derivative Works, if and
wherever such third-party notices normally appear. The contents
of the NOTICE file are for informational purposes only and
do not modify the License. You may add Your own attribution
notices within Derivative Works that You distribute, alongside
or as an addendum to the NOTICE text from the Work, provided
that such additional attribution notices cannot be construed
as modifying the License.
You may add Your own copyright statement to Your modifications and
may provide additional or different license terms and conditions
for use, reproduction, or distribution of Your modifications, or
for any such Derivative Works as a whole, provided Your use,
reproduction, and distribution of the Work otherwise complies with
the conditions stated in this License.
5. Submission of Contributions. Unless You explicitly state otherwise,
any Contribution intentionally submitted for inclusion in the Work
by You to the Licensor shall be under the terms and conditions of
this License, without any additional terms or conditions.
Notwithstanding the above, nothing herein shall supersede or modify
the terms of any separate license agreement you may have executed
with Licensor regarding such Contributions.
6. Trademarks. This License does not grant permission to use the trade
names, trademarks, service marks, or product names of the Licensor,
except as required for reasonable and customary use in describing the
origin of the Work and reproducing the content of the NOTICE file.
7. Disclaimer of Warranty. Unless required by applicable law or
agreed to in writing, Licensor provides the Work (and each
Contributor provides its Contributions) on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
implied, including, without limitation, any warranties or conditions
of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
PARTICULAR PURPOSE. You are solely responsible for determining the
appropriateness of using or redistributing the Work and assume any
risks associated with Your exercise of permissions under this License.
8. Limitation of Liability. In no event and under no legal theory,
whether in tort (including negligence), contract, or otherwise,
unless required by applicable law (such as deliberate and grossly
negligent acts) or agreed to in writing, shall any Contributor be
liable to You for damages, including any direct, indirect, special,
incidental, or consequential damages of any character arising as a
result of this License or out of the use or inability to use the
Work (including but not limited to damages for loss of goodwill,
work stoppage, computer failure or malfunction, or any and all
other commercial damages or losses), even if such Contributor
has been advised of the possibility of such damages.
9. Accepting Warranty or Additional Liability. While redistributing
the Work or Derivative Works thereof, You may choose to offer,
and charge a fee for, acceptance of support, warranty, indemnity,
or other liability obligations and/or rights consistent with this
License. However, in accepting such obligations, You may act only
on Your own behalf and on Your sole responsibility, not on behalf
of any other Contributor, and only if You agree to indemnify,
defend, and hold each Contributor harmless for any liability
incurred by, or claims asserted against, such Contributor by reason
of your accepting any such warranty or additional liability.
Requirements and compatibility
Written for: Claude Code
Works with: Claude Code, Claude apps, OpenAI Codex, GitHub Copilot, Cursor, Gemini CLI, Kiro, OpenCode, Goose, Amp, Roo Code, JetBrains Junie, Factory Droid, Devin (ex-Windsurf), Mistral Vibe, OpenHands, Letta
“Works with” means the tool reads the open Agent Skills format; a skill written for one tool may use features others lack.
Needs: Declares allowed tools, Claude Code frontmatter, Needs Python
Security
What our scanner noticed· Low risk
- Instructions that use the network
A static scan is not a guarantee. Skills are third-party content: review a skill before you let an agent use it.
Attribution and licence
- Published by
- AWS Labs
- Publisher
- AWS Labs (Official)
- Source
- awslabs/agent-plugins · plugins/deploy-on-aws/skills/aws-architecture-diagram · commit fbefb37
- Licence
- Apache License 2.0 (redistribution allowed)
- LICENSE (added by AutoGineer from LICENSE)
- NOTICE (added by AutoGineer from NOTICE)
- ATTRIBUTION.md (written by AutoGineer)
- Synced
AutoGineer is not affiliated with or endorsed by AWS Labs.
Download ZIP
The ZIP holds the skill’s files, its licence files and an ATTRIBUTION.md. Download aws-architecture-diagram.zip