Update (2026): this walkthrough and its screenshots are from March 2022. The RDS console has changed since then, so treat the steps as a historical walkthrough and check the current AWS documentation while following along.
Update (2026): AWS retired the Amazon Linux 2 platform branch used in this post (Corretto 8 running on 64bit Amazon Linux 2) in August 2026. Choose an Amazon Linux 2023 branch instead, and follow the current Elastic Beanstalk documentation - the console and steps shown here are from 2022 and may have changed.
AWS RDS [Relational Database Service] -
It is a web service running "in the AWS cloud", designed to simplify the setup, operation, and scaling of a relational database for use in applications.
Advantages
No need to worry about:
- Replication
- Auto backups
- Auto recovery
- Caching
I hope you have an account on AWS cloud! If not, you can create one (it's not rocket science, it's very simple).
Amazon RDS is pay as you go.
Storage is billed per gigabyte per month, and I/O is billed per million requests.
Search and open the RDS service in AWS, as shown in the snapshot below.
Steps to follow to create a database in RDS
Click Create database
Choose Standard create as the database creation method
Select Engine Type as MySQL.
Amazon Aurora (an optimized combined version of PostgreSQL and MySQL), MariaDB, PostgreSQL, Oracle, and Microsoft SQL Server are the different engines available in the RDS service.Select the version that matches the one you used in your Spring Boot app.
Choose Free tier (use the RDS Free Tier to develop new applications, test existing applications, or gain hands-on experience with Amazon RDS).
Give a name to your DB instance.
Set up the DB credentials (username and password for the DB).
Make the RDS instance publicly accessible, as shown in the snapshot below.
Caution: these steps open the database to any internet address (0.0.0.0/0 on port 3306). Restrict the inbound rule to your own IP for direct developer access - even in a demo - and give applications access through appropriate security-group or private-network configuration. Review the current AWS RDS security recommendations before following along.
- Keep the other settings as default and click Create Database.
TADAAAH!!! DB CREATED Successfully
Click the demo-db identifier and you can see that an endpoint and the port number 3306 are shown under the Connectivity & Security area.
Before testing the connection in MySQL Workbench, you should open port 3306 for this demo-db.
If you scroll down, you can see two security groups listed as default under the Security Groups section.
Select the security group that has CIDR/IP - Inbound as its Type. A security group acts like a firewall for RDS [restricting access], so we have to open port 3306 [allowing access only to requests coming to port 3306].
Integrate demo-db [RDS] with our Spring Boot app
Use this configuration in the application.properties file:
spring.datasource.url=jdbc:mysql://<give the endpoint as the hostname>:3306/schema_name
spring.datasource.username=<username given during the initial RDS setup>
spring.datasource.password=<password given during the initial RDS setup>
Test the connection using MySQL Workbench: configure a connection with the hostname set to the endpoint generated after the DB creation in RDS, and use the credentials given during the DB setup.
Yay!!! Now you've successfully configured Spring Boot with RDS.
Your data will now be stored in the cloud!!!
In the next part, we will discuss how to deploy the fat jar in Elastic Beanstalk.







Top comments (0)