DEV Community

Deploying Hasura on AWS with Fargate, RDS and Terraform

Gordon Johnston on January 15, 2019

Hasura is a awesome GraphQL gateway for Postgres. You can get going really simply on Heroku but if you're looking to deploy onto AWS with a fully a...
Collapse
 
adron profile image
Adron Hall

Hey Gordon, Adron here at Hasura, I'm going to whip together a Terraform + AWS for 2021 over the next few days. Will give you a shout out for the work you've posted here. 👍🏻

If you've got a minute to chat, could you ping me adron @ hasura? Would love to discuss any lessons learned, if you're still running Hasura on AWS, and all this.

Cheers!

Collapse
 
mattsears18 profile image
Matt Sears

@adron have you finished this? I used the stack at the link below to deploy hasura + fargate + aurora postgres, but I would prefer to have everything in terraform. Would be interested to see what you've put together.

antstack.io/blog/how-to-deploy-has...

Collapse
 
adron profile image
Adron Hall

Cool page you've put together for that!

I unfortunately got a bit sidetracked and headed down the path of some other efforts (for now). However I do intend to get this done but it'll just be in a few more weeks/month or so. What's the best way to ping you when I get these things going again? I've got you Twitter and Email via Github @ mattsears18 if that works.

Cheers!

Collapse
 
next2you profile image
Christian v.d.Leeden

Very interesting, one of the next tasks on my todo list! With or without EKS/ECS, that is the big question for me right now

Collapse
 
tae profile image
Tae Kim • Edited

Hi Gordon, thanks for posting this. I noticed you used an ALB. Were you able to secure the Hasura endpoint using Cognito with ALBs? I started down this path and realized that the ID Token's issued via ALB's have a "ES256" algorithm, which Hasura does not support. Were you able to find any workarounds for this scenario?

Collapse
 
tae profile image
Tae Kim • Edited

Answering my own question - I managed to get this working via an Auth Webhook. I created a custom endpoint that validates the JWT (using the jwt library) and tells Hasura whether that user is authenticated.

hasura.io/docs/latest/graphql/core...

Collapse
 
pulidovpe profile image
Pulido V. P. E. • Edited

Hi. I've using your "method" as a guide with python, flask and postgres. I did not use Route53, Hasura or GraphQL. However, I used a NAT gateway with an Elastic IP for each private subnet.
Now, I'm having this error when the service start, any idea? can you help me on this?
pastebin.com/Dx55pr8P

Collapse
 
konsumer profile image
David Konsumer

In your diagram, it seems like there are 2 RDS & Hasura nodes, but in the code it seems like it only describes 1 of each. Is this correct?

Collapse
 
webchi profile image
Vasiliy

Hi, why did you delete "provider" aws section?
github.com/Rayraegah/terraform-aws...