- Implement a resilient, multi-AZ three‑tier architecture.
- Keep the web tier public and stateless.
- Place the application tier in private subnets.
- Harden and isolate the database tier with the strictest controls.
- Automate and validate each stage using agent features (stateful conversations, sub-agents, skills, MCP).

- Public subnets: Application Load Balancer (ALB) + stateless web or edge containers.
- Private subnets: Application servers (ECS/Fargate tasks or EC2) and PostgreSQL RDS instances.
- NAT gateways (one per AZ) allow outbound internet access for private resources without exposing them.
- Internet Gateway provides inbound/outbound for public subnets.
- Multi‑AZ RDS with a primary and standby for high availability.
Before you begin, ensure you have an AWS account with permissions to create VPCs, subnets, NAT gateways, RDS, ECS (Fargate), ALBs, and CloudFormation stacks. Use least-privilege credentials and avoid embedding long-lived secrets in code or prompts.
Task 1 — Planning (stateful client + web search)
- Objective: Use a stateful conversation plus web search to research best practices, produce a concrete architecture design with CIDRs and security groups, then estimate monthly cost.
- Why stateful? Memory preserves earlier answers across multiple turns so the planning agent can refine a design and then price it without losing context.
- Example flow: three conversational turns (research, design, price) carried out by a stateful agent with web search enabled.
- Objective: Delegate network and security responsibilities to focused sub-agents so each specialist can own a well-defined part of deployment.
- Example sub-agents:
- Network configurator: creates VPC, subnets, route tables, NAT gateways, and route propagation.
- Security specialist: defines security groups, network ACLs, and least-privilege rules. Mark this agent
use_proactivelyso it can be invoked automatically when needed.
- Benefit: Mirrors a real-world DevOps team separation of duties and limits tool access by role (e.g., only
BashandReadfor some specialists).
- Objective: Produce a reusable skill file (e.g.,
skills/SKILL.md) that encapsulates RDS operational knowledge so the agent applies best practices consistently. - What goes in the skill:
- The exact
aws rds create-db-instancecommand (templated with placeholders). - Recommended instance class (e.g.,
db.t3.smallfor low-cost test/proof-of-concept; choose production classes as needed). - Backup retention policy (e.g., 7 days) and enable automated backups.
- Encryption at rest (KMS) and Multi‑AZ configuration.
- A deployment checklist: parameter groups, maintenance window, monitoring, and snapshots.
- The exact
- Reusability: The
skills/folder lets the agent discover and apply the RDS skill on any run without bloating the main prompt.
- Objective: Use an MCP (Model Context Protocol) CloudFormation server to produce, validate, and deploy an ECS (Fargate) stack without embedding CloudFormation tooling inside the agent.
- How it works:
- The SDK launches a separate
cfn-mcpprocess that exposes tools likecreate_stack,validate_template, anddescribe_stack. - The agent asks the MCP server to author a CloudFormation template for the ECS web tier: cluster, Fargate task (NGINX, 256 CPU units, 512 MB memory, port 80), desired count 2, and an ALB with health checks.
- Agent validates the template via MCP, then deploys the stack.
- The SDK launches a separate
- Benefit: Keeps CloudFormation logic out of the agent and makes deployment reproducible and auditable.
- Objective: Run the full deployment pipeline: monitoring, deployment, verification, and a final report using the combined capabilities of the SDK.
- Configuration: Enable a stateful client with web search, the
skills/folder, a monitoring specialist sub-agent, and the MCP CloudFormation server. - Three ordered turns the orchestrator executes:
- Research CloudWatch best practices (web search + memory).
- Build the monitoring layer: CloudWatch alarms (CPU, memory, storage), a dashboard, SNS/notifications, and Container Insights. The agent uses the monitoring sub-agent and MCP to author and deploy CloudFormation for observability.
- Verify the full stack end-to-end: confirm VPC resources, check RDS status, verify ECS service health, test ALB target health, and confirm alarms are firing. Generate a deployment report with findings and remediation steps.
- VPC and route tables configured for two AZs
- Subnets public/private and NAT gateways per AZ
- RDS status: available and Multi‑AZ active
- ECS service: desired and running counts match
- ALB: all registered targets healthy
- CloudWatch: alarms active, dashboard present

- Planning uses memory and search to produce a viable design and cost estimate.
- Sub-agents isolate responsibilities for safe delegation.
- Skills encapsulate and reuse operational knowledge (e.g., RDS best practices).
- MCP servers let agents interact with toolchains (CloudFormation) in a controlled way.
- The orchestrator coordinates everything and validates the final system.
This demonstration is intended for learning. For production use, review IAM policies, rotate credentials, use parameter stores or secrets managers for sensitive values, and perform security audits and penetration testing before exposing workloads to the internet.
- AWS VPC: https://aws.amazon.com/vpc/
- Application Load Balancer: https://aws.amazon.com/elasticloadbalancing/application-load-balancer/
- NAT Gateway: https://docs.aws.amazon.com/vpc/latest/userguide/vpc-nat-gateway.html
- AWS RDS: https://aws.amazon.com/rds/
- AWS ECS / Fargate: https://aws.amazon.com/ecs/ and https://aws.amazon.com/fargate/
- CloudFormation: https://aws.amazon.com/cloudformation/
- CloudWatch best practices: https://docs.aws.amazon.com/AmazonCloudWatch/latest/monitoring/monitoring_best_practices.html
- CloudWatch Container Insights: https://docs.aws.amazon.com/AmazonCloudWatch/latest/monitoring/Container-Insights.html