Skip to main content
Reference architecture only. This page is not a production-certified deployment procedure and predates the current activation, image-pinning, secret-management, and network-isolation baseline. Use the supported on-premises guide or complete an enterprise architecture review before deployment.

Overview

This guide walks you through deploying CaseBender on AWS using pre-built Docker images with Amazon ECS (Elastic Container Service) and Fargate.

Prerequisites

  1. AWS Account
  2. AWS CLI installed and configured
  3. Docker installed

Step 1: Initial Setup

Install and Configure AWS CLI

Step 2: Set Up AWS Infrastructure

Connect existing S3 buckets

CaseBender uses customer-owned object storage. It does not create, empty, or delete S3 buckets. Provision separate quarantine, records, and ephemeral buckets (or equivalently isolated prefixes) before this deployment, then attach an ECS task role or IRSA identity with scoped object permissions. Do not create an IAM user or long-lived access key for a new deployment. The canonical runtime variables are STORAGE_PROVIDER=s3, S3_BUCKET, and AWS_REGION. AWS_S3_BUCKET and AWS_S3_REGION are not valid storage variables. Prefer a mounted STORAGE_CONFIG_FILE when the three profiles use different buckets. See Enterprise Storage Overview and Storage Security Baseline.

Create a VPC

Create Subnets

Set Up RDS (PostgreSQL)

Set Up ElastiCache (Redis)

Step 3: Create ECR Repositories

Step 4: Create ECS Cluster

Create the audit-chain key once in AWS Secrets Manager. Preserve the existing secret on every subsequent deployment:
Grant the ECS task execution role permission to read this secret, and inject it into the web, api, and worker task definitions.

Step 5: Create Task Definitions

Create task definition JSON files for each service:
Register the task definitions:

Step 6: Create Application Load Balancer

Step 7: Create ECS Services

Step 8: Set Up Route 53 (Optional)

If you’re using a custom domain:

Monitoring and Maintenance

Set Up CloudWatch Alarms

View Logs

Update Services

Cost Optimization

  1. Use Fargate Spot for non-critical workloads
  2. Implement auto-scaling based on metrics
  3. Choose appropriate instance sizes
  4. Use Reserved Instances for predictable workloads

Security Best Practices

  1. Use AWS Secrets Manager for sensitive data
  2. Implement WAF rules
  3. Enable VPC Flow Logs
  4. Regular security group audits
  5. Enable AWS GuardDuty

Next Steps

  • Set up CI/CD pipeline with AWS CodePipeline
  • Configure backup strategies
  • Implement monitoring and alerting
  • Review security best practices