AWS Logo
Menu

Creating Diagrams with Amazon Q Developer

Creating Diagrams with Amazon Q Developer

aidin
Amazon Employee
Published Apr 24, 2025
As software developers and architects, we often need to create diagrams to visualize our systems, explain complex architectures, or document our designs. Creating these diagrams has traditionally been time-consuming and required specialized tools or skills.
Amazon Q Developer can generate diagrams directly in your IDE. In this post, I'll show you how to leverage Amazon Q to create various types of diagrams, from simple flowcharts to complex architecture diagrams based on your existing code.
AWS Architecture Visualization: Infrastructure Diagram Auto-Generated by Amazon Q Developer from Clo
AWS Architecture Visualization: Infrastructure Diagram Auto-Generated by Amazon Q Developer from Clo

Getting Started

Before diving in, make sure you have:
  • Amazon Q Developer plugin installed in your IDE
  • An AWS account with appropriate permissions
  • Basic understanding of the system you want to diagram
If you haven't installed Amazon Q Developer yet, follow the official installation guide.

Creating Your First Diagram

Let's start with something simple. Open the Amazon Q chat panel in your IDE and try one of these approaches:

Method 1: Direct Diagram Creation

Simply ask Amazon Q to create a diagram by describing what you need:
Amazon Q Developer chat
Amazon Q Developer chat
Amazon Q will generate a draw.io compatible file that you can save with a `.drawio` extension or you can ask Amazon Q Developer to create a file with specific name you like for you.

Method 2: Using Markdown with Mermaid

For simpler diagrams that you want to include in markdown documentation:

Method 3: Creating draw.io Style Diagrams

Amazon Q Developer can help you create draw.io diagrams for your architecture and system designs.

Step-by-Step Process

  1. Start with a clear request for a draw.io diagram:
  1. Describe the components and relationships you want to include:
  1. Save the generated file with a .drawio extension or ask Amazon Q Developer to create a new file for you.
  2. Open the file using: - draw.io website

Example Prompts for draw.io Diagrams

Here are some effective prompts for creating draw.io diagrams:
  1. Basic AWS Architecture:
  1. Network Diagram:
  1. Microservices Architecture:
4. Security-Focused Diagram:

Generating Diagrams from Code

Amazon Q Developer can analyze your code and configuration files to generate accurate diagrams that visualize your system architecture. This is particularly valuable for understanding complex systems defined in code.

From Infrastructure as Code

  1. Reference your IaC files using the `@file` or `@folder` command:

Terraform Example

CloudFormation Example

Microservices Example

From Database Schemas

Best Practices

  1. Be specific in your requests:
    • Include all components you want in the diagram
    • Specify relationships between components
    • Mention any color schemes or styling preferences
  2. Iterate on your diagrams:
    • Start with a basic diagram and refine it
    • Ask Amazon Q to add more details or make specific changes or services
  3. Use appropriate diagram types:
    • Flowcharts for processes
    • Sequence diagrams for interactions
    • Architecture diagrams for system design
    • Entity-relationship diagrams for data models
  4. Combine with documentation:
    • Ask Amazon Q to create explanatory text to accompany diagrams
    • Use diagrams as part of larger documentation efforts

Real-World Examples

Here are practical examples showing how Amazon Q Developer can help you create and improve diagrams for your projects.

Example 1: Generating a Diagram from Terraform Files

Example 2: Creating a Microservices Architecture Diagram

Example 3: Improving an Existing AWS Architecture Diagram

Conclusion

These examples demonstrate how Amazon Q Developer can help you create professional diagrams for different scenarios, from infrastructure visualization to application architecture and diagram improvements.
By following this guide, you can leverage Amazon Q Developer to create diagrams that visualize your systems, architectures, and processes. These diagrams will enhance your documentation, improve team communication, and provide clear visual representations of complex technical concepts.
 

Any opinions in this post are those of the individual author and may not reflect the opinions of AWS.

Comments