How can I host a Spring application in AWS.
I know that a Spring boot app is deployes easily with Elastic Bean Stalk. What about a Spring app? Should i migrate first to Spring boot? Or I should just run it on a Tomcat installed on an EC2?
First, you can build your Spring APP using Maven:
mvn clean install -f /your/module/path
The result will be located inside the /your/module/path/target/ folder as a war package (and these packages can be read by Tomcat).
Install Tomcat on your EC2, regarding your JRE (Tomcat 8 works great until Java 10- and Tomcat 8.5+ for Java 11+).
If you are working with Java 8, you can easily install the EC2 instance by launching it with Ubuntu 16.04 (just for testing):
apt-get install default-jdk (will install JDK8)
apt-get install tomcat8 (will install Tomcat 8)
Once installation is done, you can upload your war packages to /var/lib/tomcat8/webapps/ folder and then fire the command service tomcat8 stop|start.
Hope it will help you.