Relational Database Service in AWS

Hello thereπ, I'm Akash Zade and I'm passionate about the world of DevOps. As a curious and dedicated learnerπ, I'm constantly exploring new ways to improve software development and make the process more efficient. With a keen interest π in cloud computing, containerization, and automation, I'm excited to share my insights and experiences as I navigate the ever-evolving world of DevOps. Join me π€ on this awesome journey where technology meets efficiency!
Let's begin!!
What is Amazon RDS?
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.
Task
Create a Free tier RDS instance of MySQL.
Go to the
RDSservice in the AWS console, create a database and then selectMySQLfrom the engine options.
Select the
free tieroption and provide a name for the database instance identifier.
Enter the
master username& themaster passwordhere.
We can adjust these storage details as per our needs and choose the
default VPC.
Public access is assumed to be granted and you can either select an existing security group or create a new one.

MySQL port number is
3306and it is seen here.
Note: Make sure the
initial database nameshould be given otherwise database won't be created.
Click on "create database" and wait a few minutes for the new database to be created. Finally, it is done.

Create an EC2 instance.
Launch an EC2 instance and add the port number
3306to the inbound security rules.

Create an IAM role with RDS access.
Now it's time to create an IAM role having RDS access & follow these steps:



Here we get the IAM role ready.

Assign the role to EC2 so that your EC2 Instance can connect with RDS.
So, let's assign the previously prepared IAM role to the EC2 instance using the following method.


After updating the IAM role, let us now connect to the RDS database in this way.
Select the EC2 instance, go to actions & then click on '
Connect RDS database' underNetworking.
Select the instance, check for the database name which we created & Click on Connect.


Once the RDS instance is up and running, get the credentials and connect your EC2 instance using a MySQL client.
Connecting the EC2 instance using a MySQL client:
First, install mysql-client in your instance by using the command
sudo apt update sudo apt install mysql-client -y
Copy the "db-instance endpoint".

Check the version of MySQL and then use the command
$ mysql -h <paste here db-instance endpoint> -P 3306 -u admin -p where the options denotes 'h' for host 'P' for port of database 'u' for master username 'p' for master passwordEnter the password so that the EC2 instance will connect with the MySQL client successfully.


That's all guys, thanks for your valuable time.
Reference
Thanks for reading my articles.
Keep reading, learning and upskilling.
Peace out!!





