
Building an AI-Powered AWS Architecture Generator with Amazon Bedrock
Generate production-ready AWS architecture diagrams from simple natural language using Amazon Bedrock, FastAPI, React Flow, and ELK.js.
📖 Introduction
Designing AWS architectures requires cloud expertise. Beginners often know what they want to build but don't know which AWS services to use or how to connect them.
For example, someone might ask:
"Build a scalable e-commerce application."
An experienced AWS architect immediately thinks about CloudFront, WAF, Application Load Balancer, ECS/Fargate, Auto Scaling, RDS, S3, CloudWatch, IAM, and networking.
A beginner usually thinks only about "EC2 and a database."
I wanted to bridge this gap by building an AI-powered AWS Architecture Generator that understands business requirements, infers the missing cloud components, and produces professional AWS architecture diagrams automatically.
🎯 The Problem
Creating cloud architectures is difficult because:
- AWS has 200+ services.
- Beginners don't know which services fit their use case.
- Most diagram tools are manual drag-and-drop editors.
- Existing AI tools often return disconnected services rather than a coherent architecture.
I wanted a system that could think like an AWS Solutions Architect rather than a keyword matcher.
🧠 The Solution
The application accepts simple natural language prompts, uses Amazon Bedrock to infer the most appropriate architecture, and renders an interactive AWS diagram.
Example prompt:
"Create a full-stack application deployment architecture."
Instead of returning only:
EC2 ↓RDSThe AI infers a complete production-ready architecture with routing, compute, storage, monitoring, and security.
🏗️ High-Level Architecture

🔧 Tech Stack

⚙️ How It Works

💡 Prompt Engineering
This was the most important part of the project.
Instead of asking the model to translate text into AWS services, I instructed it to behave like an AWS Principal Solutions Architect.
The model:
- infers missing requirements
- chooses the architecture pattern
- applies AWS Well-Architected principles
- avoids unnecessary services
- generates high-level diagrams
This dramatically improved diagram quality.
🧩 Challenges I Faced
Talk about the real engineering work:
- Prompt Engineering
Initial prompts generated disconnected services.
Solution:
Redesigned the system prompt so the model reasons like an AWS architect.
- Automatic Layout
Simple graph layouts produced overlapping nodes.
Solution:
Integrated ELK.js for hierarchical layouts.
- AI Output Validation
LLMs occasionally returned invalid JSON.
Solution:
Added schema validation and normalization before rendering.
- AWS Icon Mapping
The model sometimes produced unsupported service names.
Solution:
Maintained a whitelist of supported AWS services and mapped them to official AWS Architecture Icons.
🚀 Key Learnings
Examples:
- Prompt engineering is as important as model choice.
- Structured JSON makes AI output predictable.
- Auto-layout significantly improves usability.
- Restricting AI output increases reliability.
- High-level diagrams are more useful than overly detailed infrastructure diagrams.
📈 Future Improvements
Ideas:
- Cost Estimation
- Terraform generation
- AWS CDK generation
- CloudFormation export
- Architecture validation
- AWS Well-Architected recommendations
- Multi-cloud support
- Architecture comparison
- Collaborative editing
- Diagram versioning
🎬 Demo


📚 GitHub Repository
🎉 Conclusion
Conclude by reflecting on how the project demonstrates the combination of generative AI and cloud architecture:
This project shows how generative AI can lower the barrier to cloud architecture design. By combining Amazon Bedrock with a structured architecture pipeline, users can describe applications in plain English and receive professional AWS diagrams that are easier to understand, discuss, and iterate on. It highlights how AI can assist architects and learners alike without replacing the need for sound engineering judgment.
This structure follows the style of the AWS Builder Center article you referenced while being tailored to your project and emphasizing the architectural and AI aspects.
Enjoyed reading this content? Let the author know!
Your likes, comments, shares, and saves help creators reach more builders.
Loading recommendations
Loading article