How to deploy Hasura GraphQL Engine to AWS with ECS and Aurora Serverless

How to deploy Hasura GraphQL Engine to AWS with ECS and Aurora Serverless

July 25, 2020


How to deploy Hasura GraphQL Engine to AWS with ECS and Aurora Serverless

Following are the steps to build a scalable GraphQL API over Serverless Aurora PostgreSQL with the help of ECS to run the docker image which will be deployed by AWS Cloudformation.

Architecture overview

How to deploy Hasura GraphQL to AWS with ECS and Aurora Serverless

The idea is to deploy the Hasura Docker Image as a Elastic Cluster Service. This gives us ability to add compute tasks to the cluster whenever current CPU is not sufficient for serving the user requests. This behavior can be modified by changing AutoScalingTargetValue, MinContainers and MaxContainers parameters in the CloudFormation Templates. Aurora Serverless PostgreSQL is a managed service from AWS which handles on-demand scaling, this supports our scalable Hasura Compute with the database layer needed.

One Click Launch CloudFormation Links

This launch URL, retrieves cloudformation template from AWS S3 and runs it to form the stack. On calling the URL, it calls the yaml file which consist of the instructions aws must use while creating the stack on cloudformation. You will have to fill in the details to name the database, set password and define the domain in case if you want to deploy Hasura with SSL and custom domain name.

Deploy Hasura with default DNS of Load Balancer

Deploy Hasura Engine with a auto generated DNS from Load Balancer. To access the deployed Hasura, go to EC2 dashboard on AWS and click on the created load balancer, now copy the DNS name and open it in a new tab.

Click to Deploy to Cloudformation

Deploy Hasura with custom domain and SSL

Deploy Hasura Engine with custom domain name and SSL. Pre-requisites for this step would be to have a hosted zone setup in Route53 and SSL certificate issued from Amazon Certificate Manager.

Click to Deploy to Cloudformation


  1. Serverless GraphQL with Hasura on AWS ECS over Aurora PostgreSQL
  2. Construct Your Own Launch Stack URL

For questions and suggestions, feel free to reach out to us on Twitter.

Antstack Blog Post
Antstack Blog Post

Are you planning to go to serverless? AntStack is a cloud computing service and consulting company primarily focusing on Serverless Computing. We help companies get up and running with serverless, and we’ll make sure that there are no limits.

Keep track of our socials and connect with us - LinkedIn

event bannerevent bannerevent banner