Relational Database Service in AWS

Table of contents

No heading

No headings in the article.

Day 44 - Relational Database Service in AWS

Amazon Relational Database Service (Amazon RDS) is a collection of managed services that makes it simple to set up, operate, and scale databases in the cloud

Create an EC2 instance

Create a Free tier RDS instance of MySQL

  • In the RDS dashboard, click on "Create database". Select "Standard Create" to use the standard creation process and select "MySQL" as the database engine.

  • Select the "Free tier" template,

  • Set the username and password for the master user.

  • Configure other options, such as DB instance size and storage.

  • Select the EC2 Instance which we created earlier.

  • Configure any additional advanced settings, such as VPC, database name, port, and backup options.

  • Review the configuration details for your RDS instance and click on "Create database".

Create an IAM role with RDS access

  • In the IAM dashboard, click on "Roles" and then click on the "Create role" button.

  • Choose the service that will use this role and select use case.

  • Select the "AmazonRDSFullAccess" policy to grant full access to RDS.

  • Enter name and description and click on the "Create role" button

  • Once the role is created, you will see a confirmation page with the role details.

Assign the role to EC2 so that your EC2 Instance can connect with RDS

  • In the instance dashboard select the instance and click on Actions then Security and then 'Modify IAM role'

  • Select the IAM role that you want to assign to the EC2 instance and Click on the "Update IAM role" button to attach the IAM role to the instance.

Once the RDS instance is up and running, get the credentials and connect your EC2 instance using a MySQL client.

  • Go to the RDS console and see database is created.

  • Click on the database name and copy the endpoint from the connectivity & security section.

  • Connect the instance using ssh.

  • Install mysql and check the version to verify the installation.

  • Use the mysql -h <Endpoint> -P <portno.> -u <Username> -p command to connect to the RDS. You can see SQL is connected.

Thank you for reading!!
~Irfan