We are committed to provide service 24 X 7

Deals, Shopping, Training, Tools

How to Setup RDS and connect with EC2 in AWS

How to Setup RDS and connect with EC2 in AWS. In this guide you will learn how to create an RDS (Relational Database Service) in AWS and configure it to allow connections from your AWS Instance.

With this method you can have a split website setup by having your programming files on EC2 instance and database on RDS.

Prerequisites

Important: Make sure you have your RDS and EC2 Instance in the same region. Otherwise you will get latency issues.

Create RDS Database in AWS

Go to your AWS console and navigate to Services >> Database >> RDS.

In the dashboard click Create Database.

Create RDS Database in AWS

Now you can define all your details…

Select your database engine.

Select Database Engine

Now select template, if you need to get benefited from free tier you can choose Free tier.

Select Template

Enter a name to identify your RDS instance.

In the Configuration settings enter the master username and password. You can login using this username and password to manage the instance.

Configure Master settings

Leave everything to default and scroll down to Additional configuration and open that tab.

RDS Additional Configuration

Here you can create your first database by entering your database name in the Initial database name.

Proceed to configure the automatic backups and retention period as you wish.

Create RDS Instance

Click Create database to create your RDS Instance.

Now your RDS Database Instance will get created.

RDS Database Instance

Now you have created your first RDS Instance.

Configure RDS to allow connections from EC2 Instance

Go to your RDS instance and click the security group in the Connectivity & Security tab.

Edit Security Group for RDS

This will take you to the configure the security group assigned to your RDS instance.

Click the Inbound tab, then click the Edit button to change the rules for your security group.

Authorize access to RDS

Change the Type property to MYSQL/Aurora, which will update the Protocol and Port Range to the proper values.

In the value group enter the security group that is used for your EC2 instance.

Click Save.

This rule will allow MySQL access to any EC2 instance with that security group configured.

Become a Certified AWS Professional with this easy to learn course now.

Conclusion

Now you have learned how to setup RDS database instance and allow connections from EC2 instance in AWS.

Thanks for your time. If you face any problem or any feedback, please leave a comment below.

Cart

Your Cart is Empty

Back To Shop