AWS · Open source · No account required
AWS architecture diagrams as code.
Describe your AWS architecture in a few lines of text. ArchLex validates placement and connections against its 194-service AWS catalog, then renders a clean SVG with official AWS Architecture Icons.
A three-tier web app on AWS.
An Application Load Balancer in a public subnet, two EC2 web servers in a private subnet, and an RDS database in its own subnet, all inside one VPC.
provider aws
direction LR
validation normal
account prod {
region us-east-1 {
vpc main {
subnet public {
alb: alb["Web Load Balancer"]
}
subnet private-app {
web1: ec2["Web Server 1"]
web2: ec2["Web Server 2"]
}
subnet private-db {
db: rds["PostgreSQL Database"]
}
}
}
}
alb -[routes]-> web1
alb -[routes]-> web2
web1 -[reads]-> db
web1 -[writes]-> db
web2 -[reads]-> db
web2 -[writes]-> dbWhy write AWS diagrams as code?
- It knows AWS structure. Accounts, regions, VPCs, and subnets are real scopes, so every resource is drawn in the same place it lives in your account.
- It catches mistakes. Rules cover subnet containment, network placement, security groups, event targets, IAM attachment, and relationship kinds, and each problem comes back with a diagnostic code.
- It reviews like code. The source is plain text, so architecture changes show up as small, readable diffs in pull requests, and the same source always renders the same SVG.
- It uses official icons. Services render with the official AWS Architecture Icons instead of generic boxes.
Let your AI agent draw it.
Install the ArchLex skill or connect the MCP server, then ask Claude, Cursor, or Codex to diagram your AWS setup. The agent writes the source, ArchLex validates it, and you get back an SVG.
npx skills add baires/archlexPrefer MCP? Follow the MCP server guide.
Render from the command line.
Save the source as a .arch file and render it with the CLI, or call @archlex/core from Node.js or the browser.
npx @archlex/cli render three-tier.arch --direction LR --output three-tier.svgOpen source · MIT licensed