Day 44: Relational Database Service in AWS - 90DaysOfDevOps

Day 44: Relational Database Service in AWS - 90DaysOfDevOps

Task-01

  • Create a Free tier RDS instance of MySQL

  • Create an EC2 instance

  • Create an IAM role with RDS access

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

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

Steps:

  1. Launch one EC2 instance with the open 3306 port.

  2. Go to RDS and create a new database.

  1. Select the free tier template.

  1. Add credentials to the database.

  1. Add EC2 server in connectivity.

  1. Select default VPC group.

  1. Create database.

  1. The database is created.

  1. Now we need to add RDS roles to our EC2 instance. Go to IAM and create a new role.

  1. Add AmazonRDSFullAccess permission.

  1. Go to EC2 instance Actions > Security > Modify IAM role.

  1. Add the role, which we have created with RDS access.

  1. Go to the database once it's created and copy the endpoint.

  1. SSH to EC2 instance and install mysql-client using the below command.

  2. Login to MySQL using the endpoint that we copied from the RDS console.

sudo apt update
sudo apt install mysql-client
mysql -h <endpoint-name> -P <port-name> -u <username> -p

  1. Run a few commands like show databases; to check if everything is working fine.

Thank you :)