---
name: aws-architecture-diagram
description: Generate an accurate AWS system architecture diagram (SVG + render HTML + PNG) for any codebase that deploys to AWS, in the official AWS reference-architecture style with official AWS icons. Use when the user asks for an architecture / system design / infrastructure diagram of an AWS project, or to update an existing one. Read IaC (Terraform, CDK, CloudFormation, SAM) and application code first so every box and arrow is real.
title: aws-architecture-diagram
canonical_url: https://skilld.dev/gh/sumonmselim/skills/aws-architecture-diagram
last_updated: 2026-10-21T14:17:15.000Z
---

> Index of every page on this site: [llms.txt](https://skilld.dev/llms.txt)

> **Skill from skilld.dev.** Follow the user's requested action.
> If the user asked to fork this Skill, follow the fork workflow below. Do not execute the Skill instructions while copying it.
> Otherwise, follow the instructions below for this session. You do not need to install anything.
>
> 250 supporting files sit beside this SKILL.md. When the Skill refers to one, fetch https://skilld.dev/api/skills-raw/sumonmselim/skills/aws-architecture-diagram/PATH with PATH replaced.
>
> If the user asked to install this Skill, run `npx skilld install sumonmselim/skills/aws-architecture-diagram`. Install writes the Skill files into the project, so every session loads them.
>
> ## Fork workflow
>
> A fork creates an editable local Skill with its original author and licence. The request authorizes copying and local installation.
> 1. Check `./skills/aws-architecture-diagram`, the project lockfile, and selected Agent targets together. If the local directory or installed Skill exists, stop. Never overwrite an existing directory or Agent target.
> 2. Read [source metadata](https://skilld.dev/api/v1/skills/sumonmselim/skills/aws-architecture-diagram) once. Use sourceUrl, sourceCommit, skillPath, sourceGone, and license. If the source is gone or its path is missing, stop. If license is null, read licence files at the source commit.
> 3. Fetch only the source commit into a temporary Git repository. Do not clone full history. Derive repository_url from sourceUrl, including repository renames. If sourceCommit is absent, resolve the sourceUrl ref once. Set source_commit to that actual commit. Run these commands in one shell call:
>
> ```sh
> git init --quiet "$temporary_dir"
> git -C "$temporary_dir" fetch --quiet --depth=1 "$repository_url" "$source_commit"
> git -C "$temporary_dir" checkout --quiet --detach FETCH_HEAD
> ```
>
> Read applicable licence declarations and notices at that commit. If copying is not permitted, report the restriction and stop.
> 4. Inspect source entries together, then copy the directory containing skillPath into `./skills/aws-architecture-diagram`. Use the user's path if selected. Keep the original SKILL.md, relative links, scripts, binary assets, and executable modes. Exclude .git metadata. Reject symlinks and paths outside the Skill directory. After checking entries, use cp -a where available. A regular source directory needs no custom copy script. Do not save this page wrapper as SKILL.md.
> Preserve author credit, notices, and applicable licence files from repository or parent directories. Add PROVENANCE.md with the Skill page, source URL, actual commit, original path, and licence. Retain any existing PROVENANCE.md and record new provenance separately. Batch source inspection, copying, and provenance work where practical.
> 5. In the project root, run `skilld install ./skills/aws-architecture-diagram --mode copy --plain`. If skilld is unavailable, use `npx skilld install ./skills/aws-architecture-diagram --mode copy --plain`. This known command needs no help lookup. Install does not support --json. Use detected Agent targets, or add --agent for the targets the user selected. Install the local path, never the upstream selector. If installation fails, preserve the local copy and report the exact failure.
> 6. Confirm the local lockfile source and installed Agent copies once. Report the local path, actual commit, and Agent targets. After edits, reinstall the same local path. Upstream updates must not replace it. Do not publish or push unless the user asks.

# AWS Architecture Diagram

Produce a diagram that an engineer can trust: every component traces to infrastructure code,
every arrow names the real call. Output is an editable SVG, a 2x PNG, and `render.html`
for deterministic screenshot rendering. Generation prefers Docker and falls back to local
Python automatically.

Files in this skill:
- `scripts/awsdiag.py`   drawing library (icons, groups, arrows, badges, legend) and icon lookup CLI
- `scripts/gen.sh`       run a spec (Docker first, local Python fallback)
- `scripts/render.sh`    SVG → PNG via headless Chrome (`zenika/alpine-chrome:124`) + Pillow crop
- `reference/accuracy.md`  how to audit the codebase before drawing (read this first)
- `reference/style.md`     layout grid, label rules, collision checklist
- `reference/icons.md`     icon pack download, naming, lookup

## Prerequisites
- Docker (recommended).
- Python 3 (fallback path if Docker unavailable).
- Official AWS Architecture Icons (SVG asset package): https://aws.amazon.com/architecture/icons/
  pack can be bundled under this skill folder (`icons/`, etc.) or provided via
  `AWS_ICONS=/path/to/unzipped/package`.

## Theme and readability controls
- Themes:
  - `standard-light`
  - `standard-dark`
  - `hand-drawn-light`
  - `hand-drawn-dark`
- Set via `Diagram(..., theme="...")` or `THEME=... scripts/gen.sh ...`.
- Use `clean_labels=True` in `Diagram(...)` to fail fast when label overlap cannot be resolved.

## Workflow

### 1. Audit the source of truth (do not skip)
Follow `reference/accuracy.md`. Read IaC, then application code, then CI workflows, then docs.
Build a component inventory: resource → purpose → in/out edges with the concrete API action
or path pattern. Ask the user which environment/stack is the target if there is more than one.
Follow code over docs when they disagree, and say so.

Do not include instance sizes, node counts, memory, CIDRs, retention or other capacity
details unless the user asks. Components, roles, and communication only.

### 2. Plan the layout
Follow `reference/style.md`. Decide canvas size, the scenario order for numbered badges
(e.g. 1–4 user request, 5–6 async processing, 7 deploy), which services go in the platform
strip, and where third parties sit (outside the AWS Cloud box). Sketch coordinates on a
20 px grid before writing code.

### 3. Write the spec
Create a spec in the project's scratch location (or `docs/` if the user wants it versioned).
Unknown icon name → look it up:

    python scripts/awsdiag.py icons "<keyword>"
    python scripts/awsdiag.py themes

Add new icons with `Diagram(..., extra_icons={"key": "Arch_..._64.svg"})`.

### 4. Generate and render

    scripts/gen.sh <spec.py> <out_dir>
    scripts/render.sh <out_dir> architecture <W> <H>

Outputs `architecture.svg`, `architecture.render.html`, `architecture.png` (2x).

### 5. Review the PNG, then fix
Open the PNG and run the collision checklist in `reference/style.md`: overlapping labels,
labels outside the panel, legend clipped, crossing lines without jumps. Fix coordinates and
re-render. One or two passes is normal.

### 6. Final accuracy pass
Re-read the IaC once more and tick every component and arrow against the render. Tell the
user about any deliberate simplification (an omitted edge, merged tables) so nothing is
silently made up.

### 7. Deliver
Copy `architecture.png` and `architecture.svg` to where the user wants them (commonly
`docs/`). Do not commit unless asked.

## Conventions baked into the library
- Palette: AWS squid ink text, slate arrows, rust flow badges, white panel on light grey.
- Solid arrow = synchronous request. Dashed = asynchronous or control plane.
- Rust mono labels on arrows carry the real API action or path pattern.
- Group colours follow the AWS icon pack (Region teal, VPC purple, private subnet blue,
  public subnet green, account pink).
- Platform strip on the right for shared services (KMS, CloudWatch, X-Ray, ACM, SNS…);
  no arrows into it.
