Amazon Web Services

This document outlines the AWS services used in the SAMLA system and their specific roles in supporting the infrastructure.

Services Used

AWS Lambda

  • Serverless compute service that runs code in response to events
  • Used for:
    • Processing document uploads
    • Handling search queries
    • Managing index operations
    • Executing background tasks
  • Benefits:
    • Automatic scaling
    • Pay-per-use pricing
    • No server management required
    • Built-in high availability

Elastic Container Registry (ECR)

  • Fully managed Docker container registry
  • Used for:
    • Storing container images
    • Versioning container deployments
    • Managing image lifecycle
    • Securing container artifacts
  • Features:
    • Private container repositories
    • Image scanning for vulnerabilities
    • Integration with ECS
    • Cross-region replication

Elastic Container Service (ECS)

  • Highly scalable container orchestration service, used for publishing our Agents in the cloud
  • Used for:
    • Running containerized applications
    • Managing service deployments
    • Scaling container workloads
    • Load balancing container traffic
  • Capabilities:
    • Serverless Fargate option
    • Task definitions
    • Service discovery
    • Auto-scaling

Amazon API Gateway

  • Fully managed service for creating, publishing, and maintaining APIs
  • Used for:
    • Exposing RAG system endpoints
    • Managing API versions
    • Implementing rate limiting
    • Handling authentication
  • Benefits:
    • REST and WebSocket support
    • Automatic scaling
    • Caching capabilities
    • Request/response transformation

Infrastructure Architecture

The SAMLA system leverages these AWS services in a modern containerized architecture:

  1. API Gateway receives incoming requests
  2. Lambda functions handle serverless workloads
  3. ECR stores container images
  4. ECS orchestrates container deployments
  5. Services communicate through API Gateway endpoints

Best Practices

  • Use AWS Lambda layers for shared code
  • Implement proper error handling and retries
  • Set up appropriate monitoring and logging
  • Follow container security best practices
  • Enable encryption at rest and in transit
  • Implement proper backup strategies
  • Use AWS CloudFormation for infrastructure as code