Back to work // case study

PetCare

Pet-health platform.

status: live in production

My role: I designed and built the AWS infrastructure, CI/CD and deployments. The application code was written by the dev teams.

ECS Fargate GitHub Actions Amazon ECR Sidekiq Secrets Manager Amazon SES CloudWatch TLS

Context

PetCare is a pet-health platform. It runs as a containerized web application backed by a separate background-worker service that handles asynchronous jobs such as outbound email.

The problem

The platform needed somewhere reliable to run two separate workloads — the web app and its background worker — from the same image pattern, with credentials kept out of the image. Transactional email had to actually reach inboxes rather than spam folders, and when a send failed the team needed to see it without SSH-ing into a host. It also needed a staging environment that mirrored production so changes could be validated before they went live.

Architecture

RUNTIME EMAIL OBSERVE staging mirrors prod · petcare-staging / petcare-sidekiq-staging Users petcare · app ECS Fargate service petcare-sidekiq ECS Fargate worker Secrets Manager credentials TLS injected into task defs Amazon SES SPF · DKIM · DMARC delivery sends mail authenticated CloudWatch Logs app + worker + failed sends failed sends surfaced DEPLOY GitHub Actions builds image Amazon ECR ECS Fargate rolling update pushes updates service
live traffic / email secrets / logs failed sends
Web app and Sidekiq worker run as separate ECS Fargate services; SES handles deliverable mail; CloudWatch makes logs and failed sends visible; GitHub Actions builds to ECR and updates the ECS service.

What I built

Compute

  • The web application runs as an ECS service (petcare) on AWS Fargate.
  • The Sidekiq background worker runs as a separate ECS Fargate service (petcare-sidekiq), built from the same image pattern.
  • A staging environment mirrors production — petcare-staging and petcare-sidekiq-staging.

CI/CD

  • GitHub Actions builds the Docker image on each push and pushes it to Amazon ECR.
  • The same workflow then updates the ECS service to the new task definition, and ECS rolls the new task in with minimal downtime.

Security

  • Secrets Manager holds credentials, injected into the task definitions at runtime rather than baked into the image.
  • TLS configured for the application.

Email

  • Transactional email sent through Amazon SES.
  • SPF, DKIM and DMARC set up for deliverability so mail authenticates correctly.

Observability

  • Application and worker logs stream to CloudWatch Logs.
  • Failed email sends are made visible in CloudWatch, so issues can be found without SSH-ing into any host.

Deploy flow

  1. Push to GitHub on the application repository.
  2. GitHub Actions builds the Docker image for the web app and Sidekiq worker.
  3. The workflow pushes the image to Amazon ECR.
  4. It then updates the ECS (Fargate) service with the new task definition.
  5. ECS rolls the new task in with minimal downtime, keeping staging (petcare-staging / petcare-sidekiq-staging) ahead of production.

Security decisions

Secrets in Secrets Manager, not the image

Credentials are injected into the task definitions at runtime. The image stays free of secrets, and credentials can rotate without rebuilding it.

TLS for the application

Traffic to the app is served over TLS.

Authenticated email with SPF, DKIM and DMARC

Email sent through SES is signed and aligned so receiving servers can verify it — protecting deliverability and the sending domain's reputation.

Staging mirrors production

A separate staging environment (petcare-staging, petcare-sidekiq-staging) lets changes be validated before they reach production.

Challenges & fixes

Email landing reliably

Set up SPF, DKIM and DMARC and aligned them so SES mail authenticates against the sending domain, keeping transactional email out of spam folders.

Seeing failed sends without SSH

Surfaced failed email sends in CloudWatch Logs, so delivery problems can be diagnosed from the logs instead of connecting into a running host.

What's next

  • Stand up a dedicated production environment alongside the existing staging environment, so the two no longer share footprint.
  • Add CloudWatch alarms on failed email sends, turning the existing log visibility into proactive alerting.
  • Move SES out of the sandbox so sending is no longer limited to verified recipients.
  • Autoscale the ECS Fargate services on CPU and memory so capacity follows demand.

Stack

Docker ECS Fargate GitHub Actions Amazon ECR Sidekiq AWS Secrets Manager Amazon SES SPF / DKIM / DMARC CloudWatch Logs TLS

Hiring for DevOps / Cloud roles? Get in touch.

Get in touch