Deploy scalable, highly available and infra-as-code managed web application (Omaha) on AWS.

In this post, I’ll be showing you how to leverage AWS CloudFormation to deploy a scalable, highly available and manageable 3-tier web application on AWS.

I’ll use Crystalnix’s Omaha Server as an example web application but it should equally apply to other modern web app you wish to deploy onto AWS Cloud.

What is Omaha Server?

An open-source implementation of Google’s Omaha update protocol, which for example powers Chrome’s automatic update mechanism. Omaha server is used by organizations large and small for products that require sophisticated update logic and advanced usage statistics.

Technologies

  • AWS CloudFormation
  • Amazon VPC
  • AWS ALB
  • Amazon ElastiCache (redis)
  • Amazon RDS (postgres)
  • AWS S3
  • Amazon ECS with EC2 launch type
  • and Docker.

High-level Architecture Diagram

Image for post

Clone the repository from Github

$ git clone https://github.com/tuladhar/omaha-server-on-aws

Set the AWS profile and environment variables

$ export AWS_PROFILE=REPLACE_ME
$ export AWS_REGION=us-east-1
$ export ENV_LABEL=omaha
$ export ENV_TYPE=nonprod

Deploy stack: Virtual Private Cloud (VPC)

Image for post

Fig: VPC with private & public subnet on AZ1 & AZ2 with Internet and NAT gateway

$ make -C 01_NETWORK/01_VPC create-stack
Image for post

Fig: CloudFormation stack


Deploy stack: Multi-AZ Public Load-balancer

Image for post

Fig: Publicly reachable load-balancer deployed on public subnet AZ1 & AZ2

$ make -C 01_NETWORK/02_ALB create-stack
Image for post

Fig: CloudFormation stack


Deploy stack: Multi-AZ ElastiCache Redis Cluster

Image for post

Fig: Multi-AZ ElastiCache Redis Cluster

$ make -C 02_DATABASE/01_REDIS create-stack
Image for post

Fig: Redis CloudFormation stack


Deploy stack: Multi-AZ RDS (postgres) with read-replica

Image for post

Fig: Multi-AZ RDS (postgres) with read-replica

$ make -C 02_DATABASE/02_RDS create-stack

Deploy stack: S3 bucket

$ make -C 03_S3 create-stack
Image for post

Fig: S3 Bucket CloudFormation Stack


Deploy stack: ECS Cluster

Image for post

Fig: Deploy ECS cluster with EC2 launch type

Fig: Launch configuration — User data

$ make -C 04_COMPUTE/01_ECS/01_CLUSTER create-stack
Image for post

Fig: Cloudformation stack


Deploy stack: ECS service that runs Omaha Server (Django App) container

Image for post
$ make -C 04_COMPUTE/01_ECS/02_SERVICE create-stack
Image for post

Fig: CloudFormation stack


Demo: Omaha Server Dashboard

Image for post

Fig: Omaha Server Dashboard

Conclusion

Please following things in mind for production deployment

  • Store RDS credentials using SSM or Secrets Manager.
  • Use separate subnet for stateless and stateful resources. Learn more here