

Tutorial : How to deploy your Java app to the web with AWS Elastic Beanstalk in...
source link: https://marco.dev/2017/03/01/how-to-deploy-your-java-app-in-the-web-with-aws-elastic-beanstalk-in-5-minutes/
Go to the source link to view the article. You can view the picture content, updated content and better typesetting reading experience. If the link is broken, please click the button below to view the snapshot at that time.

To deploy your Spring Boot app in the web it really takes only 5 minutes thanks to AWS Elastic Beanstalk.
For the deploy we can choose multiple sources: code, docker image or deployable jar/war. In this example we shows the deploy through a war.
IngredientsF2017-03-19-easy-and-effective
- a Spring bootable web application (Web Server embedded). For this tutorial I use the demo app : https://github.com/marco76/SpringAngular2TypeScript
- configure the server.port of your Spring application to 5000. BeanStalk install ngix that redirect the public port 80 of the server to the internal port 5000. You can change application.properties or set a system variable in AWS.
- an account with AWS (the deployment of application in AWS is not free).
Step by step procedure
- In the AWS services select ‘Elastic Bean’.
<img class="alignnone size-full wp-image-971" src="/assets/img/uploads/2017/03/1.png?resize=355%2C200" data-recalc-dims="1" /> 2. Click on ‘Create new application’.
<img class="alignnone wp-image-957" src="/assets/img/uploads/2017/03/2.png?resize=209%2C67" data-recalc-dims="1" /> 3. Choose a name and write a description to your application.
<img class="alignnone wp-image-958" src="/assets/img/uploads/2017/03/3.png?resize=310%2C191" data-recalc-dims="1" /> 4. This will create your environment, you need to generate a new application. Click on ‘create one now’.
<img class="alignnone wp-image-966" src="/assets/img/uploads/2017/03/4.png?resize=428%2C77" data-recalc-dims="1" /> 5. Choose ‘Web server environment’.
<img class="alignnone wp-image-969" src="/assets/img/uploads/2017/03/5.png?resize=330%2C216" data-recalc-dims="1" /> 6. Select Java in the ‘Preconfigured platform’.
<img class="alignnone wp-image-975" src="/assets/img/uploads/2017/03/6.png?resize=355%2C213" data-recalc-dims="1" /> 7. Don’t change the option in ‘Application code’. AWS will install a default application.
<img class="alignnone wp-image-961" src="/assets/img/uploads/2017/03/7.png?resize=345%2C170" data-recalc-dims="1" /> 8. At this point you can ‘Create environment’ to create your server instance.
<img class="alignnone wp-image-967" src="/assets/img/uploads/2017/03/10.png?resize=355%2C46" data-recalc-dims="1" /> 9. (Optional) You can choose to customize the options of the server configuration (an EC2 instance is created). In our example we don’t change anything, the configuration suggested by Amazon is enough).
<img class="alignnone wp-image-962" src="/assets/img/uploads/2017/03/8.png?resize=333%2C268" data-recalc-dims="1" /> 10. After the confirmation the server instance is created and the demo application deployed.
<img class="alignnone wp-image-964" src="/assets/img/uploads/2017/03/9.png?resize=372%2C71" data-recalc-dims="1" /><img class="alignnone wp-image-968" src="/assets/img/uploads/2017/03/11.png?resize=382%2C200" data-recalc-dims="1" /><img class="alignnone size-full wp-image-970" src="/assets/img/uploads/2017/03/12.png?resize=400%2C132" data-recalc-dims="1" /> 11. Near the name of your application there is the clickable URL that allows you to open the app.
<img class="alignnone size-full wp-image-965" src="/assets/img/uploads/2017/03/13.png?resize=955%2C43" data-recalc-dims="1" /> 12. Here the sample application installed by AWS.
<img class="alignnone size-full wp-image-972" src="/assets/img/uploads/2017/03/14.png?resize=400%2C250" data-recalc-dims="1" /> 13. To deploy your application you have to click on ‘Upload and Deploy’ in your dashboard.
<img class="alignnone size-full wp-image-963" src="/assets/img/uploads/2017/03/15.png?resize=220%2C121" data-recalc-dims="1" /> 14. Upload the war that you want to deploy and give a version name to this deploy, e.g. : ‘My First app version 1.0’. All the deployments are archived in S3 and you can easily redeploy a previous version.
<img class="alignnone size-full wp-image-959" src="/assets/img/uploads/2017/03/19.png?resize=350%2C188" data-recalc-dims="1" /> 15. When the deployment is terminated you can click on the URL link and see your application deployed!
<img class="alignnone size-full wp-image-960" src="/assets/img/uploads/2017/03/17.png?resize=500%2C297" data-recalc-dims="1" />
Congratulations! 🙂

How to delete your environment
At this point you have many interesting options, p.e. you can copy your environment, save the configuration or, my choice, to delete the servers.
This server has been created only for this tutorial, now I can delete it choosing ‘Terminate environment’, after confirmation AWS will destroy the instance created and all the related objects.

Recommend
-
175
Elastic Beanstalk provides pre-configured platforms for programming languages (Java, PHP, Python, Ruby, Go), web containers (Tomcat, Passenger, Puma), and Docker containers, with multiple configurations of each.
-
48
There is no doubt that AWS is still a hot topic in 2019 so I felt that I should write something useful to get started with exploring it’s capabilities. In this tutorial I’ll show you how to deploy a simple Spring Boot app...
-
24
AWS Elastic Beanstalk 增加了对 PHP 7.3 和 .NET Core 3.0 的支持 发布于: Oct 29, 2019 您现在可以使用 PHP 7.3 和 .NET Core 3.0 开...
-
8
Getting Started with AWS - Up and Running with Elastic Beanstalk in Minutes📅 June 28, 2018 – Kyle GalbraithLearning Amazon Web Services can be very tricky nowadays with over 100+ services that can satisfy thousands if not hund...
-
12
In this post, we are going to explore how we can deploy a simple Spring Boot application to AWS Elastic Beanstalk. We will explain how to setup an AWS account and provide a step-by-step guide how to deploy to AWS. 1. Introducti...
-
7
Yet another guide to deploy Plotly Dash on AWS Elastic Beanstalk In August, I got interested in Amazon Web Service (AWS) and spent some time to get an AWS Cloud Practitioner...
-
13
Moving Flask serverless application from Elastic Beanstalk to AWS Lambda A Cloud Guru News Mar 30, 2021 18 Minute...
-
8
Share on facebook Share on twitter Share on linkedin Elastic Beanstalk, CloudWatch Appl...
-
7
Intro This article is a step-by-step guide on setting up and deploying a sample Node JS application on AWS using Elastic Beanstalk. I completed this project as part of the Cloud D...
-
7
How to Deploy a NestJS Application with AWS Elastic Beanstalk and CodePipeline
About Joyk
Aggregate valuable and interesting links.
Joyk means Joy of geeK