Member-only story
Diagram as Code; creating AWS architecture diagrams.
I have been using draw.io for a long time, no complains, but we always want to save time, right? with the explosion of AI tools this side of the software development cycle is not an exception.
So for this exercise we can use a Python library called Diagrams and my best friend, Copilot.
We can start a creating a Python virtual environment, is a good practice to manage dependencies for your project. Here’s how you can do it on your Mac:
python3 -m venv venv
Activate the virtual environment:
source venv/bin/activate
Install the required dependencies:
pip install -r requirements.txt
Let´s startt with a simple example, for this purpose we can create a aws_diagram.py file.
from diagrams import Diagram
from diagrams.aws.compute import EC2
from diagrams.aws.database import RDS
from diagrams.aws.network import ELB
from diagrams.aws.network import VPC
from diagrams.aws.storage import S3
with Diagram("AWS…