2 min read Jul 25, 2020 How to deploy Hasura GraphQL Engine to AWS with ECS and Aurora Serverless
Anaica Grouver

2 min read

2020-07-25

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

hasura_aws_architecture.png

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.

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.

cloudformation-launch-stack.png

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.

cloudformation-launch-stack.png

References

  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.

Topics

Share this blog

Create Zip Using AWS Lambda with Files Streamed from S3

Oct 15, 2020

A walkthrough on how to zip files from S3 bucket & store the zipped-file back into S3 bucket.

3 min read

3 min read

Oct 15, 2020

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

Jul 25, 2020

Cloudformation Template for deploying Hasura GraphQL Engine into auto scalable ECS cluster along with Aurora Serverless

2 min read

2 min read

Jul 25, 2020

This website stores cookies on your computer.

These cookies are used to collect information about how you interact with this website and allow us to remember you. We use this information in order to improve and customize your browsing experience and for analytics and metrics about our visitors on this website.

If you decline, your information won’t be tracked when you visit this website. A single cookie will be used in your browser to remember your preference not to be tracked.