Spring Boot Web Application Deployment on AWS Elastic Beanstalk with AWS RDS
This post briefly documents the process of deploying a Spring Boot based web application on the AWS Elastic Beanstalk platform. This application will be connected to an AWS managed MySQL Relational Database system.
Introduction
AWS Elastic Beanstalk is an orchestration service offered by Amazon Web Services for deploying applications which orchestrates various AWS services, including EC2, S3, Simple Notification Service, CloudWatch, autoscaling, and Elastic Load Balancers.
Amazon Relational Database Service (RDS) is a distributed relational database service by Amazon Web Services. It is a web service running "in the cloud" designed to simplify the setup, operation, and scaling of a relational database for use in applications.
Goals
- Amazon Relational Database Service (MySQL) Creation and Configuration
- AWS Beanstalk - Creating Environment
2.1 Create a new environment
2.2 Select environment tier
2.3 Create a web server environment
2.4 Environment information
2.5 Platform
2.6 Application code
2.7 Log - Edit inbound rules for the web app deployed on Elastic Beanstalk to access the Database
- Environment Overview
4.1 Environment setup complete
4.2 Application
4.3 Configuration
4.4 Monitoring
4.5 Events - Output
5.1 Web Page
5.2 API Endpoint
5.3 API In Action - Cleanup
6.1 Terminate Environment
6.2 Confirm Environment Termination
Minimum Requirements
- Access to AWS Management Console
Sample Project
Spring Boot Minimal Web App is the sample Spring Boot web application i've used to deploy on the AWS Elastic Beanstalk platform.
Navigate to http://localhost:8080/ to discover the application URLs.
Find details on how to build an executable jar here.
In the application.properties file present in the resources folder, set the spring.profiles.active value to mysql-aws.
In the application-mysql-aws.properties file, set the server.port value to 5000. Also, set the aws.rds.database.endpoint value in the same file to the database endpoint generated after following the steps in the next section.
Noticed an issue with this Sample Project? Open an issue or a PR on GitHub!
Step 1 - AWS RDS MySQL Creation and Configuration
Refer the following post detailing the process of creating MySQL Database via the AWS RDS service. This is an essential part of the process since the sample application will be connected to a relational database.
https://anantharajuc.github.io/aws-relational-database-mysql/