AWS Tutorial

Setup an AWS database for FREE

Setup free tier PostgreSQL database on AWS RDS

Foo Cheechuan
Geek Culture

--

Template from Canva Photo by Jan Antonin Kolar on Unsplash

Introduction

For a student or beginner data scientist, you need to equip yourself with skills like Python, R, and SQL for the minimum to land your first data scientist job. However, it’s not common for a student to own a database so they can practice SQL and loading data from the database and do their analysis. With AWS RDS students have a viable option to practice their skills for FREE.

Create an AWS Account

Go to the AWS website

Create an AWS Account
Sign up for AWS

Then follow the steps to register for an account. (You will need a credit or debit card to register)

Select the Basic support plan

Upon completing sign-up, go to AWS Management Console.

Search for RDS services

Create a Database

Click on Create database button

Choose a database creation method — Standard create

Choose your preferred Engine type

Be sure to choose the Free tier to automatically limits your usage to the free tier.

Note that Amazon RDS is free only for 12 months according to AWS documentation.

AWS Free Tier

https://docs.aws.amazon.com/whitepapers/latest/how-aws-pricing-works/get-started-with-the-aws-free-tier.html
https://docs.aws.amazon.com/whitepapers/latest/how-aws-pricing-works/get-started-with-the-aws-free-tier.html

Since we’re using Amazon RDS, make sure you delete the database before it charges you upon free tier expiration.

Connectivity

Under Connectivity, we need to allow public access so that AWS can assign a public IP address to the database.

Under the Connectivity section when registering an account

We’ll leave the other configuration as it is and click on the “Create Database” button.

Creating database

We’ll wait for the Status to turn to Available before it’s available to be used.

Setup PostgreSQL server

For an experienced user, you can already connect to the DB instance and do whatever you want. For a beginner, you probably want to connect to download a GUI so you can import or visualize your data (query a table) in PostgreSQL GUI.

pgAdmin 4

Inside pgAdmin4, right-click on Servers, click on Register > Server…

Register a Server

Database Details

Insert your database information

Insert General Information
Connection Details
Copy the Endpoint to the hostname tab in PostgreSQL

Click on Save to establish a connection.

If you couldn’t connect to the server, check if you have added your IP address to the security group.

Edit the security rule

Go to security group rules
Edit the inbound rule
Add IP into security group

Type: PostgreSQL (This will add 5432 to the port which is the default for PostgreSQL)

Source: My IP (This will automatically search for your IP and add /32 at the back)

Now I’ve added my prepare-db into the PostgreSQL database

Pgadmin4 server

With this, you can import your data into the PostgreSQL database and host it in AWS RDS for free.

Precaution

Remember that AWS RDS is not always free. You’ll have to delete your instance before that to avoid payment. For a student especially you do not want to be charged when you’re experimenting in AWS.

To be continued

In the upcoming articles, I will show you how to create a table in PostgreSQL using python so you don’t have to create the table manually, and for a more experienced developer how you can load your data into AWS RDS without downloading pgadmin4.

Conclusion

To set up a free tier database in AWS you need to:

  1. Register for an AWS account on the AWS website
  2. Create a DB instance
  3. (Optional) Download and setup pgadmin4
  4. Add MYIP to the security group
  5. Connect to AWS RDS

Thank you for reading this article. See you again at the next one! Bye.

--

--