Skip to content

[AWS] Story 2: Data Layer (Aurora + Redis) #177

@mfittko

Description

@mfittko

Summary

Implement the data layer: Aurora PostgreSQL Serverless v2 for persistent storage and ElastiCache Redis for caching and event bus.

Epic: #174
Architecture: docs/architecture/planned/aws-ecs-cdk.md


Tasks

Aurora PostgreSQL Serverless v2

  • Create Aurora cluster with Serverless v2 capacity
  • Configure min/max ACU (default: 0.5-4)
  • Enable encryption at rest (KMS)
  • Configure automatic backups (7 days retention)
  • Store credentials in Secrets Manager (auto-generated)
  • Create database security group (ECS access only)

ElastiCache Redis

  • Create Redis cluster (single node, t4g.micro default)
  • Enable encryption in transit (TLS)
  • Enable encryption at rest
  • Configure auth token in Secrets Manager
  • Create Redis security group (ECS access only)

Application Prerequisites

  • Verify LLM Proxy supports rediss:// URL scheme (TLS Redis)
  • Document connection string format for Aurora

Configuration Props

// Aurora
auroraMinCapacity?: number;  // default: 0.5 ACU
auroraMaxCapacity?: number;  // default: 4 ACU
auroraBackupRetention?: number; // default: 7 days

// Redis  
redisNodeType?: string;      // default: cache.t4g.micro
redisNumNodes?: number;      // default: 1

Acceptance Criteria

  • Aurora cluster deploys with Serverless v2
  • Redis cluster deploys with TLS enabled
  • Credentials stored in Secrets Manager
  • Security groups restrict access to ECS only
  • cdk deploy completes successfully

Note: Migration testing moves to Story 3 (Compute) since we need ECS to connect to the private database.


Dependencies

  • Story 1: CDK Foundation (VPC, security groups)

Estimated Effort

Medium - 2 days


Notes

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions