Skip to content

Two SaaS platforms on AWS, built from scratch

AWS infrastructure from an empty account for a B2B SaaS platform, and since 2026 a second, smaller platform built the same way. On the first, deploys take 5–6 minutes instead of 45, the bill is 30% lower than on the original infrastructure on ready-made AWS services such as Amplify, and availability over a year is 99.99%.

Industry
B2B SaaS
Period
since 2023, second platform since 2026
Stack
AWS Organizations, ECS, Aurora PostgreSQL, RDS PostgreSQL, Terraform, GitHub Actions
AWS bill compared with the original infrastructure
–30%
availability over a year
99.99%
environments from one Terraform codebase
3
saas-platforms.diffChange: 6 lines added, 2 removed

infrastructure

  • Before: AWS services clicked together by hand (e.g. Amplify), no environments in code
  • After: AWS Organizations with separate accounts
  • After: 3 environments from one Terraform codebase
  • After: ECS with autoscaling
  • After: Aurora PostgreSQL, RDS PostgreSQL on the second platform

result

  • Before: deploy: 45 min
  • After: deploy: 5–6 min, no interruption
  • After: AWS bill: –30% compared with the original infrastructure
  • availability over a year: 99.99%

Before

A SaaS platform for businesses ran on infrastructure its developers had clicked together by hand in the console on ready-made AWS services such as Amplify: no infrastructure code and no separate environments. A deploy through GitHub Actions took 45 minutes on the old infrastructure. I built the new infrastructure from an empty AWS account.

Infrastructure
clicked together by hand (e.g. Amplify)
Environments in code
0
Deploy time
45 min

What I did

  • AWS Organizations with separate accounts.
  • Three identical environments (staging, pre-production, production), entirely in Terraform.
  • ECS for the backend and workers, with autoscaling from a few to a dozen or so nodes. CloudFront, ACM and Route 53 in front of the application.
  • CI/CD in GitHub Actions: deploys cut from 45 to 5–6 minutes, zero-downtime releases and fast rollback.
  • Aurora PostgreSQL with read replicas and Multi-AZ, query tuning, ElastiCache. RDS PostgreSQL with replicas on the second platform.
  • Costs: Savings Plans, rightsizing, a move to Graviton, budgets and cost alerts. The bill is 30% lower than on the original infrastructure the developers had clicked together by hand on ready-made AWS services such as Amplify.
  • Monitoring in CloudWatch and Grafana. Incident response during business hours, driven by alerts.
  • Regular updates, and backups with restore tests.
  • Security following AWS best practice: least privilege and single sign-on, secrets kept out of the code, encryption, threat detection, private networks.
  • Support for the development team, and infrastructure documentation.
  • Since 2026 I have built and run a second, smaller platform the same way. Thanks to Savings Plans, rightsizing and Graviton, its costs are below the original budget.

After

Both platforms run on AWS with the same layout. Staging, pre-production and production come from one Terraform codebase, so what passed the tests reaches production in the same configuration. The second platform, running since 2026, is smaller.

Environments
3 per platform
ECS nodes
a few to a dozen or so, autoscaled
Deploy time
5–6 min
AWS bill compared with the original infrastructure
–30%
Availability over a year
99.99%

Got a similar problem? Describe it in two sentences.