⬡ Hub
Skip to content

AWS GenAI Use Case 6: Infrastructure Developer Assistant

A unique GenAI architecture focused on Developer Productivity. Rather than building a customer-facing chatbot, we are integrating Amazon Q Developer into a standard DevOps workflow to automatically generate and validate Infrastructure as Code (CloudFormation / Terraform).

Architecture Overview

This is a local-to-cloud productivity pipeline rather than a hosted web service.

  1. Local IDE Integration (Amazon Q for VSCode): The developer uses the Amazon Q IDE plugin to request infrastructure code. e.g., "Write a CloudFormation template for an AutoScaling Group of EC2 instances with a Load Balancer."
  2. CLI Integration (Amazon Q CLI): After generating the code locally, the developer uses the Q CLI for AI-assisted terminal debugging. If aws cloudformation deploy fails, the developer types q to have the AI instantly read the terminal stack trace and suggest the fix.
  3. AWS CloudFormation (Execution): The target AWS service that parses the generated YAML/JSON and provisions the physical infrastructure.
  4. AWS CodeWhisperer/Q Security Scanning: Before deployment, the AI automatically scans the generated YAML for security vulnerabilities (e.g., "Warning: S3 bucket is exposed to the public").

Component Breakdown

1. src/ (The Generated Infrastructure)

  • auto_scaling_web_app.yaml: An example of a complex CloudFormation template generated entirely by Amazon Q based on a single prompt.
  • prompt_history.md: Documentation of the exact prompts used to generate the infrastructure.

2. .github/workflows/deploy.yml (CI/CD)

A pipeline that takes the AI-generated CloudFormation code, validates it using AWS tools, and automatically deploys the stack to AWS.

Prerequisites for Local Usage

  1. Install Amazon Q CLI.
  2. Authenticate using AWS Builder ID (Free) or IAM Identity Center (Enterprise).
  3. Try running a broken AWS CLI command (e.g., aws s3 ls fake-bucket-dfsdafhj), and when it fails, let Amazon Q auto-diagnose the error!