Skip to main content

On This Page

InfraSketch: Automating AWS Architecture Diagrams from Terraform HCL

2 min read
Share

These articles are AI-generated summaries. Please check the original sources for full details.

I built a free tool to generate AWS architecture diagrams from Terraform — no signup, no credentials needed

Raghvendra Pandey launched InfraSketch, a browser-based tool designed to eliminate the manual overhead of drawing infrastructure diagrams. The tool performs static analysis on Terraform HCL or docker-compose.yml to visualize over 25 AWS resource types instantly.

Why This Matters

Manual architectural documentation often lags behind real-world infrastructure changes, leading to ‘documentation rot’ where diagrams become obsolete minutes after creation. While automated tools like Cloudcraft exist, their $49/month price point and requirement for AWS read access create significant security and financial barriers for small teams and individual contributors.

Key Insights

  • Static analysis of HCL code via a custom JavaScript parser extracts resource types and cross-references (InfraSketch, 2026).
  • Client-side processing ensures zero data egress, maintaining security by keeping HCL code within the local browser environment.
  • Automated grouping organizes resources into categories such as Networking, Compute, and Messaging using official AWS icons.
  • The tool supports draw.io export, allowing engineers to refine generated base structures for presentations or official documentation.

Working Examples

Example Terraform HCL showing VPC, Subnet, EKS, and SQS resources for visualization.

resource "aws_vpc" "main" {
cidr_block = "10.0.0.0/16"
}
resource "aws_subnet" "public" {
vpc_id = aws_vpc.main.id
cidr_block = "10.0.1.0/24"
}
resource "aws_internet_gateway" "gw" {
vpc_id = aws_vpc.main.id
}
resource "aws_lb" "app" {
name = "app-alb"
load_balancer_type = "application"
subnets = [aws_subnet.public.id]
}
resource "aws_eks_cluster" "main" {
name = "production"
role_arn = aws_iam_role.eks.arn
vpc_config {
subnet_ids = [aws_subnet.public.id]
}
}
resource "aws_iam_role" "eks" {
name = "eks-role"
assume_role_policy = jsonencode({})
}
resource "aws_db_instance" "db" {
identifier = "prod-db"
engine = "postgres"
instance_class = "db.t3.medium"
}
resource "aws_s3_bucket" "assets" {
bucket = "my-app-assets"
}
resource "aws_sqs_queue" "events" {
name = "event-queue"
}

Practical Applications

  • Use Case: Rapidly generating baseline architecture diagrams for DevOps documentation during sprint reviews. Pitfall: Attempting to use the tool for non-AWS providers like Azure or GCP before full support is implemented.
  • Use Case: Visualizing complex resource relationships in existing Terraform projects without granting third-party cloud access. Pitfall: Relying on static analysis for dynamic resource deployments that aren’t explicitly defined in the provided HCL.

References:

Continue reading

Next article

How to Migrate from Auth0 to kavachOS: A $427/Month Cost Optimization Study

Related Content