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.