Overview
This guide walks you through deploying CaseBender on AWS using pre-built Docker images with Amazon ECS (Elastic Container Service) and Fargate.Prerequisites
- AWS Account
- AWS CLI installed and configured
- 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 separatequarantine, 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
web, api, and worker task definitions.
Step 5: Create Task Definitions
Create task definition JSON files for each service: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
- Use Fargate Spot for non-critical workloads
- Implement auto-scaling based on metrics
- Choose appropriate instance sizes
- Use Reserved Instances for predictable workloads
Security Best Practices
- Use AWS Secrets Manager for sensitive data
- Implement WAF rules
- Enable VPC Flow Logs
- Regular security group audits
- Enable AWS GuardDuty
Next Steps
- Set up CI/CD pipeline with AWS CodePipeline
- Configure backup strategies
- Implement monitoring and alerting
- Review security best practices