Documentation

Create beautiful infrastructure diagrams from simple YAML

Getting Started

InfraSketch lets you create interactive, hierarchical cloud architecture diagrams using a simple YAML schema. Just describe your infrastructure and watch it come to life!

Basic Structure

name: "My Architecture"
direction: LR  # LR (left-right) or TB (top-bottom)

nodes:
  - id: unique_id
    type: aws.compute.EC2
    label: "My Server"

connections:
  - from: node_id_1
    to: node_id_2

Node Types

Nodes represent components in your architecture. Use the format provider.category.ClassName or just type the class name for autocomplete suggestions!

Available Providers

aws gcp azure k8s onprem programming generic saas

Common Node Types

Short Name Full Path Description
ec2 aws.compute.EC2 AWS EC2 Instance
lambda aws.compute.Lambda AWS Lambda Function
rds aws.database.RDS AWS RDS Database
s3 aws.storage.S3 AWS S3 Bucket
nginx onprem.network.Nginx Nginx Web Server
redis onprem.inmemory.Redis Redis Cache
pod k8s.compute.Pod Kubernetes Pod
Tip: Smart Autocomplete

Start typing a node name in the type: field and autocomplete will show suggestions with icons!

Clusters (Grouping)

Group related nodes together using clusters:

nodes:
  - id: vpc
    type: cluster
    label: "VPC"
    children:
      - id: web
        type: ec2
        label: "Web Server"
      - id: db
        type: rds
        label: "Database"

Cluster with Custom Background Color

You can customize the background color of clusters using the color property. A color picker will appear when you edit this field!

nodes:
  - id: production
    type: cluster
    label: "Production"
    color: "#E8F5E9"  # Light green background
    children:
      - id: web
        type: ec2
        label: "Web Server"

  - id: staging
    type: cluster
    label: "Staging"
    color: "#FFF3E0"  # Light orange background
    children:
      - id: staging_web
        type: ec2
        label: "Staging Web"
Tip: Color Picker

When you type in the color: field, a color picker will appear with preset colors and a native color selector!

Drill-Down Details

Add detailed sub-diagrams to any node. Click on the node to explore!

nodes:
  - id: web_server
    type: ec2
    label: "Web Server"
    details:
      name: "Web Server Details"
      direction: TB
      nodes:
        - id: nginx
          type: nginx
          label: "Nginx"
        - id: app
          type: onprem.compute.Server
          label: "App"
      connections:
        - from: nginx
          to: app

Connections

Define how nodes connect to each other:

connections:
  # Simple connection
  - from: client
    to: server

  # With label
  - from: server
    to: database
    label: "SQL"

  # With styling
  - from: app
    to: cache
    label: "Redis"
    color: "red"
    style: "dashed"

Connection Options

Property Description Example
from Source node ID from: web
to Target node ID to: database
label Connection label label: "HTTPS"
color Line color color: "red"
style Line style style: "dashed"

Keyboard Shortcuts

Shortcut Action
Ctrl + Enter Render diagram
Ctrl + S Download YAML
Tab Insert 2 spaces
Navigate autocomplete
Enter Select autocomplete item
Esc Close autocomplete

Examples

Web Application

Classic 3-tier architecture with users, web servers, and database.

Microservices

Event-driven microservices with message queues and API gateway.

Kubernetes

K8s cluster with pods, services, and ingress controller.

Serverless

AWS Lambda functions with API Gateway and DynamoDB.

Full Example

name: "E-Commerce Platform"
direction: LR

nodes:
  - id: users
    type: aws.general.Users
    label: "Customers"

  - id: cdn
    type: aws.network.CloudFront
    label: "CDN"

  - id: api_cluster
    type: cluster
    label: "API Layer"
    children:
      - id: api
        type: aws.compute.Lambda
        label: "API Gateway"
        details:
          name: "API Details"
          nodes:
            - id: auth
              type: aws.security.Cognito
              label: "Auth"
            - id: handler
              type: aws.compute.Lambda
              label: "Handler"
          connections:
            - from: auth
              to: handler

      - id: cache
        type: aws.database.ElastiCache
        label: "Redis Cache"

  - id: db
    type: aws.database.RDS
    label: "PostgreSQL"

  - id: storage
    type: aws.storage.S3
    label: "Assets"

connections:
  - from: users
    to: cdn
  - from: cdn
    to: api
  - from: api
    to: cache
    label: "Cache"
  - from: api
    to: db
    label: "Query"
  - from: cdn
    to: storage
    style: "dashed"