This project demonstrates a powerful AWS Cloud Engineer Agent built with the Strands Agents SDK, showcasing how easily you can create sophisticated AI agents with a model-first approach. The agent can perform various cloud engineering tasks on AWS accounts, such as resource monitoring, security analysis, cost optimization, and more.
- AWS Resource Management: Monitor, analyze, and manage AWS resources across multiple services
- Security Analysis: Identify security vulnerabilities and recommend best practices
- Cost Optimization: Find cost-saving opportunities and recommend resource optimizations
- Infrastructure Diagramming: Generate AWS architecture diagrams from text descriptions
- AWS Documentation Search: Find relevant AWS documentation for any service or feature
- Direct AWS API Access: Execute AWS CLI commands through the agent interface
- EC2 instance status monitoring
- S3 bucket analysis and management
- CloudWatch alarm status checking
- IAM user activity tracking
- Security group vulnerability analysis
- Cost optimization recommendations
- Lambda function management
- RDS instance monitoring
- VPC configuration analysis
- EBS volume optimization
- AWS architecture diagram generation
- Strands Agents SDK Integration: Leverages the Strands framework for agent capabilities with its model-first approach
- AWS Bedrock Integration: Uses Amazon Nova Premier model (
us.amazon.nova-premier-v1
) for AI capabilities - MCP Tools Integration: Incorporates AWS Documentation and AWS Diagram MCP tools
- AWS CLI Integration: Direct access to AWS API through the
use_aws
tool - Streamlit UI: User-friendly interface for interacting with the agent
- Containerized Deployment: Docker-based deployment for portability
- CDK Infrastructure: Infrastructure as Code using AWS CDK TypeScript
The solution consists of:
- Strands Agent: Built using the Strands Agents SDK with AWS Bedrock Amazon Nova Premier model (
us.amazon.nova-premier-v1
), implementing the agentic loop architecture - Streamlit UI: User-friendly interface for interacting with the agent
- AWS Infrastructure: Deployed using CDK with:
- ECR repository for the Docker image
- ECS Fargate service for running the agent
- Application Load Balancer for routing traffic
- Public subnet configuration (no NAT Gateway)
- Automated ECR deployment using cdk-ecr-deployment
- Python 3.11+
- AWS CLI configured with appropriate permissions
- Node.js and npm (for CDK)
- AWS Bedrock access with permissions for Amazon Nova Premier model
-
Install Python dependencies:
pip install -r requirements.txt
-
Run the Streamlit app locally:
streamlit run app.py
- AWS CDK installed and bootstrapped
- Docker installed locally
- AWS account with Bedrock access enabled
-
Navigate to the CDK directory:
cd cloud-engineer-agent-cdk
-
Install dependencies:
npm install
-
Build the TypeScript code:
npm run build
-
Deploy the stack:
cdk deploy
-
Access the agent using the URL provided in the CDK output.
The following environment variables are used:
AWS_REGION
: AWS region for API calls (must be a region where Amazon Nova Premier is available)AWS_ACCESS_KEY_ID
: AWS access key (for local development)AWS_SECRET_ACCESS_KEY
: AWS secret key (for local development)
- The agent uses IAM roles with least privilege
- Bedrock permissions are scoped to necessary model invocation actions
- All communications use HTTPS
- Sensitive information is not stored in the application
This project leverages the Strands Agents SDK, a powerful framework for building AI agents with a model-first approach. Key features include:
Strands Agents SDK uses a model-first approach where the LLM acts as the orchestrator, making decisions about which tools to use and when. This approach allows for more flexible and intelligent agents that can adapt to complex scenarios.
The SDK implements an agentic loop architecture where:
- The agent receives a user request
- The LLM analyzes the request and determines the best course of action
- The agent executes tools as directed by the LLM
- Results are fed back to the LLM for further analysis
- The process repeats until the task is complete
This architecture enables sophisticated reasoning and multi-step problem solving without hardcoded workflows.
This project utilizes two Model Context Protocol (MCP) servers:
- AWS Documentation MCP Server: Provides access to comprehensive AWS documentation, allowing the agent to retrieve accurate information about AWS services, features, and best practices.
- AWS Diagram MCP Server: Enables the agent to generate visual AWS architecture diagrams based on text descriptions.
- Simplified Development: Create powerful agents with minimal code
- Flexible Tool Integration: Easily add new tools and capabilities
- Intelligent Decision Making: Let the LLM decide the best approach to solving problems
- Transparent Reasoning: Follow the agent's thought process and tool usage
- Extensible Framework: Build on top of the core architecture for specialized use cases
- Built-in MCP: Native support for Model Context Protocol (MCP) servers, enabling access to thousands of pre-built tools
For more information about Strands Agents SDK, visit the official documentation.
This project is licensed under the MIT License - see the LICENSE file for details.