We will be building a horizontally scalable GraphQL API that runs over a PostgreSQL database powered by AWS’s serverless Aurora product. We will be using Hasura for the GraphQL API, AWS ECR and ECS to run the docker image and AWS Cloudformation to deploy resources.

First, huge shout out to the team at Hasura. Their product allows any professional to feel like they are part of the GraphQL buzz and provides incredible value to any project.

To accomplish the article’s title, we will need to assume some AWS resources are already in place.

  1. You should own a domain name and have a hosted zone for it on Route 53.
  2. You should have an SSL cert on AWS Certificate manager that covers the domain or subdomain that you want to serve the API over. The cert has to be in the same region your will deploy ECS.

We also need to assume you have some things configured on your local machine.

  1. Docker is installed
  2. You have the AWS CLI set up correctly
  3. You have IAM permissions to use all required resources

We will accomplish our goal in 3 steps. First, push the Hasura image to an Elastic Container Registry (ECR). Second, gather Cloudformation template parameters and walk through what it does. Third, deploy the Cloudformation template using the AWS CLI.

All resources for this article can be found at this git hub repo.

#graphql #serverless #hasura #aws

Serverless GraphQL with Hasura on AWS ECS over Aurora PostgreSQL
21.55 GEEK