Collection of infrastructure diagrams built as code with Diagrams (Python). The idea is to keep visuals reproducible and aligned with what you define in tools like Terraform, so documentation stays clear and easy to refresh.
Diagrams.With.Python/
├── requirements.txt
├── examples/ # Shared PNG gallery (samples, CI/CD, diagram-terra)
├── samples/ # Small AWS topologies + JSON-driven diagram
│ ├── config.json
│ ├── json-read.py
│ ├── project-2.py … project-5.py
│ └── rds-ec2.py
├── ci-cd/ # Bitbucket → Azure DevOps → AWS (QA develop / Prod master)
│ └── ci-cd-bitbucket-azure-aws.py
├── multi-region-dr/ # Route 53 failover across two AWS regions
│ └── route53-failover.py
├── diagram-terra/ # Larger AWS / Azure DevOps style diagram
│ └── diagram-terra.py
├── big-diagram/ # Extended gateway topology (+ local config.json)
├── ec2-backup-with-s3/ # EC2 → S3 backup
├── ecs-fargate/ # ECS Fargate
└── with-docker/ # Docker-related diagram (+ local config.json)
| Folder | Script | Output |
|---|---|---|
samples/ |
project-4.py |
examples/project-4.png |
samples/ |
json-read.py |
examples/project-json.png |
ci-cd/ |
ci-cd-bitbucket-azure-aws.py |
examples/ci-cd-bitbucket-azure-aws.png |
multi-region-dr/ |
route53-failover.py |
examples/multi-region-dr.png |
diagram-terra/ |
diagram-terra.py |
examples/diagram-terra.png |
big-diagram/ |
with-gateway.py |
big-diagram/with-gateway-diagram.png |
ec2-backup-with-s3/ |
backup.py |
ec2-backup-with-s3/backup.png |
ecs-fargate/ |
fargate.py |
ecs-fargate/diagram.png |
with-docker/ |
with-dockers.py |
with-docker/with-dockers-diagram.png |
- Python 3.x
- Graphviz installed on the system (required by Diagrams). On Windows, the installer often leaves
dotoff yourPATH; addC:\Program Files\Graphviz\binto the user PATH and open a new terminal, or run once per session in PowerShell:$env:Path = "C:\Program Files\Graphviz\bin;" + $env:Path - Python dependencies (pinned in
requirements.txt):
python -m venv .venv
# Windows: .venv\Scripts\activate
# macOS / Linux: source .venv/bin/activate
pip install -r requirements.txtScripts resolve config and output paths from their own location, so you can run them from any working directory:
python samples/project-4.py
# Writes: examples/project-4.png
python ci-cd/ci-cd-bitbucket-azure-aws.py
# Writes: examples/ci-cd-bitbucket-azure-aws.pngBesides the PNG, Diagrams may leave a Graphviz source file next to it (same base name, often without a .dot extension). You can delete those files and regenerate them by running the script again.
- In
Diagram(...),show=Trueopens the image with the default viewer after generation; useshow=Falseto only write the file. - Getting started and layout options: Diagrams — Getting started. AWS node catalog: AWS nodes.
Version: 0.2.0
Released under the MIT License. Copyright (c) 2026 Agustina Fassina.
Conjunto de diagramas de infraestructura definidos como código con Diagrams en Python. El objetivo es que los gráficos sean reproducibles y coherentes con lo que definís en Terraform (u otras fuentes), para documentar de forma clara y actualizable.
Diagrams.With.Python/
├── requirements.txt
├── examples/ # Galería PNG compartida (samples, CI/CD, diagram-terra)
├── samples/ # Topologías AWS pequeñas + diagrama desde JSON
│ ├── config.json
│ ├── json-read.py
│ ├── project-2.py … project-5.py
│ └── rds-ec2.py
├── ci-cd/ # Bitbucket → Azure DevOps → AWS (QA develop / Prod master)
│ └── ci-cd-bitbucket-azure-aws.py
├── multi-region-dr/ # Failover Route 53 entre dos regiones AWS
│ └── route53-failover.py
├── diagram-terra/ # Diagrama amplio AWS / Azure DevOps
│ └── diagram-terra.py
├── big-diagram/ # Topología con gateway (+ config.json local)
├── ec2-backup-with-s3/ # Backup EC2 → S3
├── ecs-fargate/ # ECS Fargate
└── with-docker/ # Diagrama con Docker (+ config.json local)
| Carpeta | Script | Salida |
|---|---|---|
samples/ |
project-4.py |
examples/project-4.png |
samples/ |
json-read.py |
examples/project-json.png |
ci-cd/ |
ci-cd-bitbucket-azure-aws.py |
examples/ci-cd-bitbucket-azure-aws.png |
multi-region-dr/ |
route53-failover.py |
examples/multi-region-dr.png |
diagram-terra/ |
diagram-terra.py |
examples/diagram-terra.png |
big-diagram/ |
with-gateway.py |
big-diagram/with-gateway-diagram.png |
ec2-backup-with-s3/ |
backup.py |
ec2-backup-with-s3/backup.png |
ecs-fargate/ |
fargate.py |
ecs-fargate/diagram.png |
with-docker/ |
with-dockers.py |
with-docker/with-dockers-diagram.png |
- Python 3.x
- Graphviz instalado en el sistema (lo exige la librería Diagrams). En Windows, si aparece
ExecutableNotFound: failed to execute WindowsPath('dot'), agregáC:\Program Files\Graphviz\binal PATH del usuario y abrí una terminal nueva, o en PowerShell por sesión:$env:Path = "C:\Program Files\Graphviz\bin;" + $env:Path - Dependencias de Python (versiones fijadas en
requirements.txt):
python -m venv .venv
# Windows: .venv\Scripts\activate
# macOS / Linux: source .venv/bin/activate
pip install -r requirements.txtLos scripts resuelven config y salidas desde su propia ubicación, así que podés ejecutarlos desde cualquier directorio de trabajo:
python samples/project-4.py
# Genera: examples/project-4.png
python ci-cd/ci-cd-bitbucket-azure-aws.py
# Genera: examples/ci-cd-bitbucket-azure-aws.pngAdemás del PNG, Diagrams puede dejar el fuente Graphviz al lado (mismo nombre, a veces sin extensión .dot). Podés borrarlo y regenerarlo volviendo a ejecutar el script.
- En
Diagram(...),show=Trueabre la imagen con el visor predeterminado al terminar; conshow=Falsesolo se guarda el archivo. - Intro e instalación: Diagrams — Getting started. Catálogo de nodos AWS: AWS nodes.
Versión: 0.2.0


