Day 44: Relational Database Service in AWS
Relational Database Service in AWS Create database Page.

Day 44: Relational Database Service in AWS

Dear Learners, In Today's article we will explain Amazon Relational Database Service (Amazon RDS) that how RDS work,definitions & Tasks. So now let's start without wasting the time.

RDS:-

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

No alt text provided for this image
Relational Database in AWS Types flow Diagram

I will Explain with the help of Tasks:

Prerequisites:-

Task-01

Login to your Amazon Account with username and Passoword.

Go to the Amazon EC2 console.

Click on "Launch Instance" on the right side of page. Highlight in orange colour.

Choose a "Linux AMI", give a name to your Ec2 instance.

Choose an instance type according to your need, I have select the t2.micro.

Configure the Security group rules to allow inbound traffic on the Appropriate port for the type of database you are using (e.g port 3306 used for the MySQL).

No alt text provided for this image
Choose an instance type according to your need, I have select the t2.micro Diagram
No alt text provided for this image
In Our Security Group, I will allow the port 3306 used for the MySQL

Launch the instance.

No alt text provided for this image
Launch the instance mention a tag on your isntance Diagram

2 Create a Free tier RDS instance of MYSQL.

Go to the Amazon RDS console. Click on "Create Database option" highlight in orange colour.

No alt text provided for this image
Click on "Create Database option" highlight in orange colour Diagram

In the Database creation method choose the Standard Create.

In Engine option:- I will select the MySQL, you can select according to your need like:- MariaDB, Oracle & PostgreSQL etc.

No alt text provided for this image
choose the Standard Create select the MySQL Diagram.

Choose the "Free tier" template for "DB instance class" no charges for the "free tier"

No alt text provided for this image
Choose the "Free tier" template for "DB instance Diagram.

Next Step:- Enter a unique name for the "DB instance identifier".

Set the "Master username" & "Master Password" for the database, It will used while login the database from the terminal, I will explain in it in Today Task.

No alt text provided for this image
Enter a uniqu e name for the "DB instance Set the "Master username" & "Master Password" Diagram.

Set the "Virtual Private Cloud" and "Subnet group" to create the instance in.

Leave the other settings at their default values.

No alt text provided for this image
"Virtual Private Cloud" and "Subnet group" Diagram.
No alt text provided for this image
Select the Storafe Type Diagram.

Select EC2 instance.

No alt text provided for this image
Select EC2 instance Diagram.

Choose VPC Security Group:-

No alt text provided for this image
Choose VPC Security Group Diagram.

Click on the "Create database" to start the instance creation.

No alt text provided for this image
Click on the "Create database" Diagram.
No alt text provided for this image
Click on the "Create database" Diagram.

Database is created.

No alt text provided for this image
Database is created Diagram.

After completing the Point 1 & Point 2, Move forward to Point to no 3:-

3. Create an IAM role for with RDS access.

Go to the IAM console in AWS. Click on "Roles". click on "Create Role" show in blue colour right side.

No alt text provided for this image
Create an IAM role for with RDS access Diagram.

Choose the "AWS Service"

Choose "Allows Ec2 instance to call AWS Services on your behalf".

No alt text provided for this image
Choose the "AWS Service" Diagram.

Need to be attached the "AmazonRDSFullAccess" policy.

No alt text provided for this image
Need to be attached the "AmazonRDSFullAccess" policy. Diagram

Enter a Unique name for the role.

No alt text provided for this image
Enter a Unique name for the role Diagram.

Click on "Create role"

No alt text provided for this image
Click on "Create role" Diagram

IAM Role is Successfully created, I will highlight in Blu Tick.

No alt text provided for this image

Point No 4 is very Important:-

4 Assign the role to EC2 so that your EC2 instance can connect with RDS.

Go to the Ec2 console.

Select the instance you just created.

Click on "Actions" option then "Instance Settings", then "Attach/Replace IAM Role".

No alt text provided for this image
Click on "Actions" option then "Instance Settings", then "Attach/Replace IAM Role" Diagram

Choose the IAM role you just created.

Click on the "Updated IAM role"

No alt text provided for this image
Choose the IAM role you just created Click on the "Updated IAM role" Diagram.

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

Go to RDS console in AWS.

Select the Instance you just created.

Click "Configuration" and note the endpoint address.

No alt text provided for this image
Click "Configuration" and note the endpoint address Diagram.

Click "Security" and note the username and Password.

No alt text provided for this image
Click "Security" and note the username and Password Diagram.

SSH into your EC2 instance using a Terminal or remote access tool.

No alt text provided for this image
SSH into your EC2 instance Diagram.
No alt text provided for this image
Successfully login in account with SSH Key Diagram.

Need to be install the MySQL Client, such as "mysql".I will share the commands it will helpful for you for the installtion.

Syntax:-

sudo apt install mysql-client-core-8.0

mysql --version

No alt text provided for this image
install the MySQL Client, such as "mysql" & Version check Diagram.

Connect to the RDS instance using the MySql client and the endpoint address username, and Password.

mysql -h <endpoint address> -P <port.no> -u <username> -p        

Enter the password when prompter and press enter:-

you should now be connected to the MySQL database on the RDS instance.

Syntax:-

sudo mysql -h database-1.c4mwnlabtvwh.ap-south-1.rds.amazonaws.com -P 3306 -u admin -p

Enter the Password:- <>

you are enter in the mysql:-

mysql>

show databases;

No alt text provided for this image
sudo mysql -h database-1.c4mwnlabtvwh.ap-south-1.rds.amazonaws.com -P 3306 -u admin -p Diagram

(Note) if your RDS are not access please check the Endpoint address in RDS. It will take one or 2 min for access.


In this blog, I have discussed RDS Definition, create a database,attach with the IAM Role . If you have any questions or would like to share your experiences, feel free to leave a comment below. Don't forget to read my blogs and connect with me on LinkedIn and let's have a conversation.

Thank you for reading !! I hope you find this article helpful!!

Happy Learning!!


Next Topic:

Day 45: Deploy Wordpress Website on AWS


Aakib Khan

Cloud computing | AWS | GCP | Azure | DevOps | 31k+ LinkedIn |Kubernetes | Docker| Terraform | Jenkins | 5 million+ impressions

1y

Well written

To view or add a comment, sign in

More articles by Maninder Singh

  • Artificial Intelligence for DevOps Engineer

    Artificial Intelligence for DevOps Engineer

    Dear learners, In today article we will explain the Artificial Intelligence for the DevOps Engineers. Important Aspects…

    12 Comments
  • Bash Shell Scripting:- Lesson 7,8 &9 for DevOps Engineers.

    Bash Shell Scripting:- Lesson 7,8 &9 for DevOps Engineers.

    Dear Learners, In Today Topic, We will learn the Shell Scripting form Basics to Advanced for DevOps Engineers. Course…

    3 Comments
  • Bash Shell Scripting:- Lesson 4,5 &6 for DevOps Engineers.

    Bash Shell Scripting:- Lesson 4,5 &6 for DevOps Engineers.

    Dear Learners, In Today Topic, We will learn the Shell Scripting form Basics to Advanced for DevOps Engineers. Course…

    3 Comments
  • Bash Shell Scripting:- Lesson 1,2 &3 for DevOps Engineers.

    Bash Shell Scripting:- Lesson 1,2 &3 for DevOps Engineers.

    Dear Learners, In Today Topic, We will learn the Shell Scripting form Basics to Advanced for DevOps Engineers. Course…

    3 Comments
  • EP 2 DevOps:- 2 Tier Application Deployment

    EP 2 DevOps:- 2 Tier Application Deployment

    2-Tier Application Deployment Diagram (Architecture) Dear Learners in today topic we will deploy a 2 Tier Application…

    8 Comments
  • DevOps Engineers:- Docker Cheat Sheet

    DevOps Engineers:- Docker Cheat Sheet

    Dear learner, presented below is a concise yet comprehensive Docker cheat sheet, complete with detailed commands and…

    7 Comments
  • DevOps (Day-90): Ending the challengs

    DevOps (Day-90): Ending the challengs

    Table of Contents: Flashback Self-Impact of Learning Today, We have completed the 90days of DevOps challenge where we…

    16 Comments
  • DevOps (Day-88): Kubernetes Architecture

    DevOps (Day-88): Kubernetes Architecture

    Dear Learner's in today topic we will discuss the Kubernetes Architecture in detail. Table of Contents Kubernetes…

    1 Comment
  • DevOps (Day-87): Argo CD

    DevOps (Day-87): Argo CD

    Dear Learners in today topic we will the discuss the Argo CD in Kubernetes. Table of Contents Challenges with CD into…

    13 Comments
  • DevOps (Day-86): Project-7 Portfolio App

    DevOps (Day-86): Project-7 Portfolio App

    Dear Learners in Today's article we will deploying a Portfolio app on AWS S3 Bucket using GitHub. Table of Contents:…

    10 Comments

Insights from the community

Others also viewed

Explore topics