Skip to main content

Command Palette

Search for a command to run...

Beginner's Guide: Setting Up MySQL RDS on AWS Cloud

Updated
4 min read
Beginner's Guide: Setting Up MySQL RDS on AWS Cloud

Today I want to share how to setup MySQL RDS in AWS Infra step by step. In this scenario you can see how to configure and setup RDS with best practice ways and connect RDS from DBeaver via using bastion host. Let’s check it out guys.

Here is the step by step procedure.

PhasesSteps
Phase 1Define Security group for bastion host and RDS
Phase 2Create database subnet and parameter group
Phase 3Setup RDS
Phase 4Connect from DBeaver via using bastion host
Pahse 5Delete RDS and other resources

Phase 1 ( Define Security group for bastion host and RDS )

I create two security group one for database and last for bastion host. can see I allow db connection from anywhere. In real world use case you don’t need to define inbound rule like that. For production or uat environment you should define db inbound rule is coming from specific backend look like EKS cluster security group, ECS security group, EC2 security group or etc. Don’t define anywhere ipv4.

Create Bastion host security group. Allow SSH connection from anywhere. But in real world you should define specific ip for who are allow to connect bastion host.

I edit db inbound rule form anywhere to allow only from bastion host.

Phase 2 ( Create database subnet and parameter group )

In default setting there is no subnet groups and prameter groups. You want to define RDS subnet is exactly locate in private subent you can create and define subnet in this place. I create parameter group because I want to customize database parameter group value in feature. At that time if you don’t create parameter group system will automatically define parameter group base upon your db engine but this system create parameter group is can’t edit prarmeter value. So I would like to suggest you should use customized parameter group.

Phase 3 ( Setup RDS )

I only use free tier RDS and engine is MySQL Community edition with private access.

In this place you can see enable storage autoscaling feature is on. If you don’t care about storage you can unchek this setting. If you need to care about storage you can define storage ammount.

I define db parameter group with my own db parameter group which are already created.

You should turn on enable deletion protection. This function is helpful and svae you in one day. Think you accidentally delete the database but your database is not delete because of this function.

After database is created system is automatically snapshoot your database.

Phase 4 ( Connect from DBeaver via using bastion host )

SSH into my bastion host and I test using telenet command for my bastion can connect to database. You can see my bastion can connect to RDS. Thanks god my security groups are working properly and well define.

telnet [ your database endpoint ] 3306

I put username and password. I already define in RDS setting. And then click SSH for bastion host.

I define my bastion host public ip and username. I use private key authentication method.

Phase 5 ( Delete RDS and other resources )

I hope you will perfectly know how to setup and configure about AWS RDS. If you have any issue or doubt please let me know. Don’t forget to delete resources after you tested. Happy learning and see you at the next articale. If my article is helpful for you please like and share. I would really appreciate your support.