Teaching an AI Agent to Roast My AWS Architecture (So Production Doesn't)

Teaching an AI Agent to Roast My AWS Architecture (So Production Doesn't)

Why wait for a 3 AM pager alert to discover your cloud setup is held together by hope and duct tape? Learn how to build a brutally honest, rubber-duck-debugging AI architecture reviewer using Amazon Bedrock.

Every cloud engineer has that one architecture diagram they’re quietly proud of—and terrified to show during a Well-Architect Review. Mine involved three AWS Lambda functions playing hot potato with an Amazon SQS queue, an Amazon DynamoDB table with a partition key that aged like milk, and IAM permissions generously set to  "Resource": "*"  "just for testing."
Instead of waiting for my AWS bill (or my tech lead) to humble me, I decided to build an AI agent on Amazon Bedrock whose sole purpose is to roast my architecture before it hits production.



The Premise: Rubber Duck Debugging, But the Duck Talks Back

Traditional rubber duck debugging relies on you explaining your code to an inanimate object until you spot your own mistake. The problem? Rubber ducks are far too polite.
By pairing a multi modal foundation model (like Anthropic Claude or Amazon Nova) with a cheeky system prompt, you can turn an architecture diagram—or a Cloud Formation/Terraform template—into a ruthless code review session.



How the "Cloud Gordon Ramsay" Architecture Works

  1. Input Ingestion: Drop an architecture screenshot or IaC template ( template.yaml ) into an Amazon S3 bucket.
  1. Trigger: An S3 Event Notification invokes an AWS Lambda function.
  1. The Roast Engine: Lambda passes the diagram image and template to Amazon Bedrock ( Converse  API) with structured output enabled.
  1. Actionable Fix: Alongside the jokes, the model outputs a serious JSON checklist mapped to the AWS Well-Architected Framework pillars (Security, Reliability, Cost Optimization).



The Secret Sauce: System Prompting for Humor + Utility

If you just ask an LLM to "be funny," you’ll get cheesy dad jokes. To get sharp, genuinely useful feedback, constrain the persona and force structured remediation:
import boto3
import json
bedrock = boto3.client("bedrock-runtime", region_name="us-east-1")
SYSTEM_PROMPT = """
You are a cynical, battle-hardened Principal Cloud Architect who has survived
too many Friday afternoon deployments.
Your job:
1. Roast the user's AWS architecture in 3-4 punchy, hilarious sentences.
2. Immediately follow up with 3 concrete, production-grade fixes mapped to
AWS Well-Architected best practices (Cost, Security, Reliability).
Be witty, never mean-spirited, and ruthlessly accurate.
"""
def roast_architecture(iac_snippet: str) -> str:
response = bedrock.converse(
modelId="us.anthropic.claude-3-7-sonnet-20250219-v1:0",
system=[{"text": SYSTEM_PROMPT}],
messages=[
{
"role": "user",
"content": [{"text": f"Here is my template:\n\n{iac_snippet}"}]
}
],
inferenceConfig={"temperature": 0.8, "maxTokens": 800}
)
return response["output"]["message"]["content"][0]["text"]
Any opinions in this article are those of the individual author and may not reflect the opinions of AWS.
Enjoyed reading this content? Let the author know!

Your likes, comments, shares, and saves help creators reach more builders.

Loading recommendations

Loading article