Select your cookie preferences

We use essential cookies and similar tools that are necessary to provide our site and services. We use performance cookies to collect anonymous statistics, so we can understand how customers use our site and make improvements. Essential cookies cannot be deactivated, but you can choose “Customize” or “Decline” to decline performance cookies.

If you agree, AWS and approved third parties will also use cookies to provide useful site features, remember your preferences, and display relevant content, including relevant advertising. To accept or decline all non-essential cookies, choose “Accept” or “Decline.” To make more detailed choices, choose “Customize.”

AWS Logo
Menu
Build Serverless GenAI Apps Faster with Amazon Q Developer CLI Agent

Build Serverless GenAI Apps Faster with Amazon Q Developer CLI Agent

Discover how Amazon Q Developer CLI Agent revolutionizes cloud development by building a complete serverless GenAI application in minutes instead of days. With just a single prompt, Amazon Q Developer CLI Agent generated all necessary infrastructure code in TypeScript, created a Python Lambda function, and seamlessly integrated with Claude 3 Haiku on Amazon Bedrock. This step-by-step walkthrough demonstrates the entire process from concept to deployment, showcasing how developers can now focus on innovation

Published Mar 19, 2025
Last Modified Apr 11, 2025
In this blog post, I demonstrate how Amazon Q Developer CLI Agent helps developers accelerate their work by generating a complete, functional serverless application. While AI cannot and should not replace human developers, it can significantly speed up the initial development process and help us build faster. Every line of code was generated by Amazon Q, compiled perfectly, and deployed with complete accuracy, allowing developers to focus on customization and business logic rather than boilerplate setup.
I completed in nearly 10 minutes with a few simple prompts what would typically take days of reading documentation, writing code, troubleshooting, and manual work. Amazon Q Developer CLI Agent transforms how developers build cloud applications by dramatically accelerating the development process from concept to deployment.
Starting with just a high-level description of what I wanted to build, Amazon Q Developer CLI Agent guided me through the entire process - generating all necessary code, deploying the infrastructure, troubleshooting issues, and creating comprehensive documentation.
I found most impressive how Amazon Q Developer CLI Agent handled the entire development lifecycle with minimal input from me. This level of assistance makes complex AWS architectures accessible to developers of all skill levels, allowing me to focus on innovation rather than implementation details.

The Initial Prompt to Amazon Q Developer CLI Agent

I began my journey with this single prompt to Amazon Q Developer CLI Agent:
That's it. From this conceptual description, Amazon Q CLI Agent:
  1. Understood the architecture I wanted to create
  2. Generated all the necessary code files
  3. Structured the project appropriately
  4. Implemented the integration with AWS Bedrock
  5. Created the CDK infrastructure in TypeScript
  6. Wrote the Lambda function in Python
  7. Guided me through deployment
  8. Created comprehensive documentation

The Amazon Q Developer CLI Agent Conversation

Here's how the actual conversation flowed with the Amazon Q Developer CLI Agent:

Project Structure

Amazon Q Developer CLI Agent organized the project with the following essential structure, automatically creating all necessary files and directories:
This structure follows AWS best practices with clear separation of:
  • Infrastructure code (CDK TypeScript in /lib)
  • Lambda function code (Python in /lambda)
  • Client application (HTML/JS in /client)
  • Documentation (diagrams and README)

Deployment and Testing with Amazon Q Developer CLI Agent

After setting up the infrastructure code and Lambda function, it was time to deploy the application. Let's walk through the deployment process and testing of the serverless GenAI application.
When it came time to deploy, I simply told Amazon Q:
Amazon Q immediately recognized the next steps and guided me through the deployment process:

Building the Application

Amazon Q knew to build the TypeScript code first:

AWS Profile Configuration

When it detected an issue with AWS credentials, Amazon Q prompted me for the correct profile. I only needed to provide:

Successful Deployment

With the build complete and AWS profile configured, Amazon Q executed the deployment:
The deployment created all necessary AWS resources, and Amazon Q captured the important output:

Configuring the Client

Amazon Q automatically updated the client HTML file with the actual API Gateway URL:

Testing the Deployment

Amazon Q then tested the deployment in two ways:
Direct Lambda invocation:
API endpoint testing with curl:
Both tests were successful, confirming that the application was properly deployed and functioning.

Troubleshooting Deployment Issues

When attempting to deploy with CDK, Q CLI Agent encountered a Docker-related error. It immediately:
  1. Identified the issue (Docker not running needed for bundling)
  2. Proposed a solution (modify the CDK stack to use a simpler deployment approach)
  3. Made the necessary code changes
Amazon Q made a precise and targeted code change:

Documentation Generation

When I asked for an architecture diagram, Amazon Q went above and beyond:
  1. Created a detailed draw.io diagram file
  2. Generated ASCII art representations for text-based documentation
  3. Updated the README.md with the architecture diagram
  4. Created an HTML viewer for the architecture when I exported the diagram as a JPEG
It created all this documentation with minimal prompting - I simply asked for

Architecture Diagram

The architecture diagram Amazon Q created shows the flow of data through the application:
To my surprise, I rendered the architecture diagram on drawio and it was perfect as you see in the following screenshot:
Serverless Bedrock Application Architecture
Serverless Bedrock Application Architecture
Later I asked Q Developer CLI agent to "render this diagram as ASCII representation"
and it responded as follows:

The Final Result

Starting from just a conceptual description, I used Amazon Q Developer CLI Agent to:
  1. Create a complete serverless GenAI application with AWS CDK
  2. Integrate with Amazon Bedrock's Claude 3 Haiku model
  3. Successfully deploy all resources to AWS
  4. Test the functionality
  5. Create comprehensive architecture documentation
The application now allows users to send prompts through an API and receive AI-generated responses from Claude 3 Haiku, all running in a serverless architecture on AWS.

Conclusion: The Power of Amazon Q Developer CLI Agent

Amazon Q Developer CLI Agent demonstrated remarkable capabilities in this project:
  1. Understanding Requirements: It translated my high-level description into a complete application architecture
  2. Full-Stack Development: It generated both infrastructure code and application code
  3. Problem Solving: It identified and resolved deployment issues
  4. AWS Knowledge: It executed exactly the right AWS commands for deployment and testing
  5. Documentation Skills: It created comprehensive architecture diagrams and documentation
I completed the entire process - from initial concept to a fully deployed, working application - with just a handful of simple prompts. This represents a fundamental shift in how developers can work with cloud technologies, making complex architectures accessible and dramatically reducing the time from idea to implementation.
Amazon Q Developer CLI Agent truly transforms the developer experience by handling complex tasks with minimal guidance, allowing me to focus on innovation rather than implementation details.
 

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

Comments