AWS Containerized Deployment
Deploy agents to AWS ECS Fargate for consistent, low-latency execution.
Architecture
Prerequisites
- Docker installed
- AWS CLI configured
- ECR repository created
- Agent Kernel with AWS extras
Deployment
Refer to example ECS implementation which leverages Agent Kernel's terraform module for ECS deployment.
Advantages
- No cold starts - containers always warm
- Consistent performance - predictable latency
- Better for high traffic - efficient resource usage
- Full control - customize container, resources, etc.
Session Storage
Use ElastiCache Redis:
export AK_SESSION_STORAGE=redis
export AK_REDIS_URL=redis://elasticache-endpoint:6379
Monitoring
Use CloudWatch Container Insights:
- CPU/Memory utilization
- Task count
- Network metrics
- Application logs
Health Checks
Agent Kernel provides a health endpoint:
# Automatically available at /health
# Returns 200 OK if healthy
Best Practices
- Use at least 2 tasks for high availability
- Configure auto-scaling based on traffic
- Use Redis for session persistence
- Enable Container Insights for monitoring
- Set up log aggregation
- Use secrets manager for API keys