Setup a Hasura Cloud Project with Amazon RDS

Jason Brown
InstructorJason Brown
Share this video with your friends

Social Share Links

Send Tweet
Published 4 years ago
Updated 3 years ago

We'll start by creating a new Hasura Cloud project. Then setup a new Security Group in AWS for a secure connection from Hasura Cloud to our RDS PostgreSQL database. Then we'll create our RDS PostgreSQL database, and setup the connection string in our Hasura Cloud project.

Jason Brown: [0:00] When you create your project in Hasura, you're prompted with an IP address. This address is going to be used to secure the access to your database. Click copy, and we'll head over to AWS to set up our security group.

[0:16] We need to create a security group inside of EC2 and down here under Security Groups. We then click Create security group, and we're prompted with a form to fill up. We'll give it a name and a description.

[0:40] Then, we'll add an inbound rule. Click Add rule. We'll be configuring for Postgres, so let's find Postgres. Then, Custom, input the IP address that Hasura gave you. That's it. Click Create security group. Now we're prepared to create our database.

[1:07] Go to RDS, or search in the services for RDS. Click Create database. We'll do a Standard Create with a Postgres database engine. We'll select free tier. The database name does not matter. We'll just leave it as is for now. Then, we need to create a password. You do need to know this password so that Hasura Cloud can connect to your database.

[1:51] I'm creating a super-secure password called hasurapassword. We have our DB instance size, selected as micro. Select whatever you need for your instances, but I'm on the free tier just for demo purposes.

[2:07] We'll also need to configure our Security group, so we'll say publicly accessible as well because this needs to be able to be connected to or from the outside world aka Hasura Cloud. Then, we'll delete the default security group and select our hasura cloud security group. That's it. Click Create database.

[2:29] Once your database has been created, go ahead and select it. You have your database endpoint. This is what we'll use to connect to Hasura Cloud. We'll swap over to Hasura Cloud, and we'll type in our connection string.

[2:45] Type in postgres. Then the user, that is just postgres, as well as our super-secret hasurapassword. We'll give it the connection string. Finally, we'll define the database that Hasura should connect to.

[3:03] The default database when creating a Postgres database is just postgres. If you have a different one, you would define that here. You would define that before and then input that here. Put that postgres, and then we'll click Create project.

[3:20] Once Hasura has finalized its initialization, you can click Launch Console. There you go. You have the Hasura Console app. You can start creating tables that will be created inside of your Amazon database that you just created.

[3:40] Finally, don't forget to add a secret so that your admin console is not available to the world. First off, go into your project again. Click on Env vars. Click on New Env Var. Select Admin_Secret, and then give it a secret. Your project will then re-initialize, and your project on Hasura Cloud will be secure.

egghead
egghead
~ an hour ago

Member comments are a way for members to communicate, interact, and ask questions about a lesson.

The instructor or someone from the community might respond to your question Here are a few basic guidelines to commenting on egghead.io

Be on-Topic

Comments are for discussing a lesson. If you're having a general issue with the website functionality, please contact us at support@egghead.io.

Avoid meta-discussion

  • This was great!
  • This was horrible!
  • I didn't like this because it didn't match my skill level.
  • +1 It will likely be deleted as spam.

Code Problems?

Should be accompanied by code! Codesandbox or Stackblitz provide a way to share code and discuss it in context

Details and Context

Vague question? Vague answer. Any details and context you can provide will lure more interesting answers!

Markdown supported.
Become a member to join the discussionEnroll Today