DevOps(Day-44): Relational Database Service in AWS

DevOps(Day-44): Relational Database Service in AWS

SPEED1X

TABLE OF CONTENTS

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 : Creating a Database

  • Create a Free tier RDS instance of MySQL

    1. Navigate to the RDS section in the AWS management console and click to Create a database.

    2. Select the Engine option which is the type of database to setup. We will select MySQL as per our task.

    3. Select free-tier as the template.

    4. Set up the DB credentials.

    5. select the db size.

    6. Select the EC2 Compute connect as we are going to access our database from EC2.

    7. Choose the VPC that you have created already while spinning EC2 instance.

    8. Use Password authentication to access the database.

    9. Now the new database is spun up.

  • Create an EC2 instance

    1. An instance is created and attached to the database in the above step.
  • Create an IAM role with RDS access

    1. Create a role in IAM.

    2. Select the EC2 option.

    3. Add RDS full access to the group.

    4. Provide the role name and create the role now.

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

    1. Navigate to your EC2 instance security settings and modify the IAM role.

    2. Choose your created role to assign to EC2

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

    1. Now navigate to your database and make note of Endpoint that is needed to connect RDS to EC2.

    2. Install MySQL client on EC2.

    3. Database will be using 3306 port which you can open in the inbound rule of Instance.

    4. Use the below command to connect to the RDS. You can see now SQL is connected.

Thanks for reading my article. Have a nice day.

WRITTEN BY Biswaraj Sahoo --AWS Community Builder | DevOps Engineer | Docker | Linux | Jenkins | AWS | Git | Terraform | Docker | kubernetes

Empowering communities via open source and education. Connect with me over linktree: linktr.ee/biswaraj333