DevOps

AWS for a Health-AI App (Terraform)

Context

A Terraform-based AWS setup built for the engineering team of a health-AI startup. It is built on Terraform, AWS ECS Fargate, Docker, and GitHub Actions, with 9 modules, dev and prod environments, auto-scaling services, CI/CD pipelines, and handover documentation.

The Hard Part

The client had a medical-AI application but no production cloud environment and no way to operate it independently. The work covered a cloud environment, containers, a database, networking and security, monitoring, CI/CD, and handover documents, and the client's team needed to deploy and run the app without ongoing dependency.

What I Built

  • 9 Terraform modules for networking, security, IAM, secrets, database, cache, storage, compute, and monitoring, wired in dependency order for dev and prod environments
  • ECS Fargate setup for 4 services (frontend, clinical, image, and worker) with CPU and memory limits, service discovery, and per-service log groups with 7-day retention
  • Application load balancer with path-based routing to the clinical, image, and frontend services, plus CPU and memory auto-scaling for each service
  • Sizing for each environment: dev with a small single-AZ database and no deletion protection, prod with a medium multi-AZ database and deletion protection
  • 2 GitHub Actions pipelines: one for Terraform format, validate, plan, and apply through a production GitHub environment, and one that builds 4 Docker images, pushes them to ECR, and deploys to ECS, with AWS login through OIDC and no stored keys
  • Security and monitoring modules for IAM, security groups, secrets, CloudTrail, CloudWatch, SNS, and budgets
  • 4 Dockerfiles with multi-stage builds, non-root users, and health checks

The Build

A health-AI startup had a medical application but no production cloud environment and no way to run it independently.

I built AWS infrastructure as code with Terraform: 9 modules, dev and prod environments, ECS Fargate for 4 services with auto-scaling, and CI/CD pipelines that deploy with AWS login through OIDC and no stored keys. Production has a multi-AZ database with deletion protection.

A bootstrap script sets up an encrypted, versioned S3 state bucket with locking, and 4 container configs come with placeholder health-check apps. 6 handover documents with 4,874 lines let the client's team deploy and run the app on its own.

Measured Results

9

Terraform modules, wired in dependency order for dev and prod

4

ECS Fargate services with auto-scaling, deployed by 2 CI/CD pipelines

0

stored AWS keys: the pipelines log in through OIDC

6

handover documents so the client’s team can deploy and run it on its own

Tech Stack

Terraform 1.14AWS provider 6ECS FargateECRALBRDS PostgreSQLElastiCache RedisS3Secrets ManagerCloudWatchSNSCloudTrailIAMVPCGitHub ActionsOIDCDockerPython 3.11Bash
AWS for a Health-AI App (Terraform) — interface screenshot

More Case Studies

Have a similar project?

I would love to help you build something great. Let's discuss your requirements.