aws-diagram-png
Skill8 starsChanged 45 days agoApache-2.0View on GitHub
Generate AWS architecture diagrams as PNG images with real AWS icons using the awslabs/diagram-as-code (awsdac) CLI. Triggers when user wants a PNG diagram, architecture image, or visual export of AWS infrastructure. Produces publication-ready diagrams following AWS architecture guidelines.
- Installs packages
In this repository17 other files it gives its agents.
- AGENTSAGENTS.md
- amazon-bedrockSkill
- amazon-location-serviceSkill
- amazon-polly-generativeSkill
- aws-architecture-diagramSkill
- aws-diagram-htmlSkill
- aws-serverless-patternsSkill
- cdk-infrastructure-patternsSkill
- cognito-email-migrationSkill
- cognito-passkey-authSkill
- deploy-on-awsSkill
- email-template-renderingSkill
- mcp-tool-discoverySkill
- personal-rules-managementSkill
- react-frontend-patternsSkill
- reinvent-stack-toolkitSkill
- testing-patternsSkill
The file
Show its rules and text
We split this skill into the rules it gives an agent
13 rules. About 0 are common, 4 are distinctive, and 9 are very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈4
Distinctive · estimate
This author's own choices. Worth a look.
9
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Very specific: line 13
Use this skill (aws-diagram-png) when the user wants a PNG file directly, a ready-to-share image, or a diagram for a slide/doc
- Very specific: line 14
Use aws-architecture-diagram when the user wants editable draw.io XML that they can modify later in app.diagrams.net
- Very specific: line 15
Use aws-diagram-html when the user wants a polished HTML page with hand-routed connectors that never overlap (awsdac auto-layout can route …
- Distinctive: line 35
If the user says "analyze", "scan", "from code", or references their existing project:
- Very specific: line 40
Shortcut: If the user has a CloudFormation template, use awsdac -c template.yaml to auto-generate the diagram directly (beta feature)
- Distinctive: line 44
If the user describes an architecture or says "brainstorm" / "design" / "from scratch":
- Distinctive: line 46
Ask 3-5 focused questions (purpose, services, scale, security, traffic pattern)
- Very specific: line 52
Write the YAML file (see structure below) to a sensible path — typically docs/diagrams/<name>.yaml or architecture/<name>.yaml
- Distinctive: line 54
Verify the PNG was created: check that output file exists and is non-zero size
- Very specific: line 128
DefinitionFiles: Always use the official definition-for-aws-icons-light.yaml URL (has real AWS icons)
- Very specific: line 129
Canvas: Always the root. Set Direction: vertical or horizontal
- Very specific: line 131
VPC / Subnet: Use Preset: PublicSubnet or Preset: PrivateSubnet for color coding
- Very specific: line 132
Resource types: Use CloudFormation resource types (e.g., AWS::Lambda::Function, AWS::DynamoDB::Table, AWS::S3::Bucket)
≈ “Common” is an estimate: at least 1 in 5 of the 364,980 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
AWS Diagram PNG Generator (awsdac)
Generate production-ready PNG diagrams with official AWS architecture icons using the awsdac CLI tool. Use this skill when the user wants a PNG image (not draw.io XML).
When to Use This Skill vs. aws-architecture-diagram
- Use this skill (
aws-diagram-png) when the user wants a PNG file directly, a ready-to-share image, or a diagram for a slide/doc - Use
aws-architecture-diagramwhen the user wants editable draw.io XML that they can modify later in app.diagrams.net - Use
aws-diagram-htmlwhen the user wants a polished HTML page with hand-routed connectors that never overlap (awsdac auto-layout can route lines across each other)
Prerequisites
awsdac must be installed on the user's machine:
# macOS
brew install awsdac
# Go 1.21+
go install github.com/awslabs/diagram-as-code/cmd/awsdac@latestVerify with: awsdac --version
Workflow
Mode A — Codebase Analysis
If the user says "analyze", "scan", "from code", or references their existing project:
- Scan for infrastructure files: CloudFormation (
*.yaml,*.json), CDK (cdk.json,app.py), Terraform (*.tf) - Extract services, relationships, VPC structure, and data flow
- Confirm discovered architecture with the user before generating
- Shortcut: If the user has a CloudFormation template, use
awsdac -c template.yamlto auto-generate the diagram directly (beta feature)
Mode B — Brainstorming / From Scratch
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
Generation Steps
- Write the YAML file (see structure below) to a sensible path — typically
docs/diagrams/<name>.yamlorarchitecture/<name>.yaml - Run:
awsdac <name>.yaml -o <name>.png - Verify the PNG was created: check that output file exists and is non-zero size
- Tell the user the path to the generated PNG
YAML Structure
Diagram:
DefinitionFiles:
- Type: URL
Url: 'https://raw.githubusercontent.com/awslabs/diagram-as-code/main/definitions/definition-for-aws-icons-light.yaml'
Resources:
Canvas:
Type: AWS::Diagram::Canvas
Direction: vertical
Children:
- AWSCloud
- User
AWSCloud:
Type: AWS::Diagram::Cloud
Direction: vertical
Preset: AWSCloudNoLogo
Align: center
Children:
- VPC
VPC:
Type: AWS::EC2::VPC
Direction: vertical
Children:
- PublicSubnet
- ALB
BorderChildren:
- Position: S
Resource: IGW
PublicSubnet:
Type: AWS::EC2::Subnet
Preset: PublicSubnet
Children:
- WebServer
WebServer:
Type: AWS::EC2::Instance
ALB:
Type: AWS::ElasticLoadBalancingV2::LoadBalancer
Preset: Application Load Balancer
IGW:
Type: AWS::EC2::InternetGateway
User:
Type: AWS::Diagram::Resource
Preset: User
Links:
- Source: User
Target: IGW
TargetArrowHead:
Type: Open
- Source: IGW
Target: ALB
TargetArrowHead:
Type: Open
- Source: ALB
Target: WebServer
TargetArrowHead:
Type: OpenKey YAML Conventions
- DefinitionFiles: Always use the official
definition-for-aws-icons-light.yamlURL (has real AWS icons) - Canvas: Always the root. Set
Direction: verticalorhorizontal - AWSCloud: Wraps anything running inside AWS. Use
Preset: AWSCloudNoLogofor cleaner look - VPC / Subnet: Use
Preset: PublicSubnetorPreset: PrivateSubnetfor color coding - Resource types: Use CloudFormation resource types (e.g.,
AWS::Lambda::Function,AWS::DynamoDB::Table,AWS::S3::Bucket) - Links: Connect resources with arrows.
TargetArrowHead: Type: Openis standard
Common Resource Types
Note: Prefer the base service type (e.g.,
AWS::CloudFront) when a specific variant isn't defined in awsdac's icon file. Variants likeAWS::CloudFront::Distributionfall back to the base icon with a warning. The types below are all verified to render cleanly with zero warnings.
| Service | Type |
| Lambda | AWS::Lambda::Function |
| API Gateway | AWS::ApiGateway (REST) / AWS::ApiGatewayV2::Api (HTTP) |
| DynamoDB | AWS::DynamoDB::Table |
| S3 | AWS::S3::Bucket |
| CloudFront | AWS::CloudFront |
| Cognito | AWS::Cognito::UserPool |
| SQS | AWS::SQS::Queue |
| SNS | AWS::SNS::Topic |
| Step Functions | AWS::StepFunctions |
| EventBridge | AWS::Events |
| EC2 Instance | AWS::EC2::Instance |
| RDS | AWS::RDS::DBInstance |
| ECS | AWS::ECS::Service |
| ALB | AWS::ElasticLoadBalancingV2::LoadBalancer (with Preset: Application Load Balancer) |
| VPC | AWS::EC2::VPC |
| Subnet | AWS::EC2::Subnet (with Preset: PublicSubnet or PrivateSubnet) |
| CloudWatch | AWS::CloudWatch::Alarm |
| X-Ray | AWS::XRay |
| Secrets Mgr | AWS::SecretsManager::Secret |
| User / Client | AWS::Diagram::Resource with Preset: User |
See the full list at: https://github.com/awslabs/diagram-as-code/blob/main/doc/resource-types.md
CLI Options
# Basic usage - generates output.png by default
awsdac diagram.yaml
# Custom output path
awsdac diagram.yaml -o architecture.png
# Convert CloudFormation template directly (beta)
awsdac -c cloudformation.yaml -o diagram.png
# Generate YAML from CloudFormation for manual editing
awsdac -c cloudformation.yaml -d -o diagram.yaml
# Verbose logging for debugging
awsdac diagram.yaml -vBest Practices
- Keep diagrams focused — one diagram per concern (data flow, security, deployment) beats one giant diagram
- Add a User resource at the top or left edge for flows that start with users
- Group by VPC/Subnet to clearly show network boundaries
- Use consistent direction —
verticalfor top-to-bottom data flow,horizontalfor step-by-step - Save the YAML alongside the PNG so the diagram can be regenerated or tweaked later
Troubleshooting
- "command not found: awsdac" — Run
brew install awsdac(macOS) or usego install - "unknown resource type" — Check the resource-types.md doc; use the exact CloudFormation-style name
- Ugly layout — Reorganize the
Childrenlists; resources stack in the order listed. Try switchingDirectionbetweenverticalandhorizontal - Text is cut off — The tool auto-sizes; if specific labels are wrong, use
Title:field on the resource
Reference Links
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

