Skip to content

Commit 12d23a3

Browse files
committed
Merge pull request #48156 from vpavic
* pr/48156: Polish contribution Revise AWS section of "Deploying to the Cloud" in reference manual Closes gh-48156
2 parents 9f39b5e + 1d4551e commit 12d23a3

File tree

2 files changed

+18
-57
lines changed
  • spring-boot-project/spring-boot-docs/src/docs/antora/modules

2 files changed

+18
-57
lines changed

spring-boot-project/spring-boot-docs/src/docs/antora/modules/ROOT/pages/redirect.adoc

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -478,8 +478,6 @@
478478
* xref:how-to:deployment/cloud.adoc#howto.deployment.cloud.aws.beanstalk.tomcat-platform[#deployment.cloud.aws.beanstalk.tomcat-platform]
479479
* xref:how-to:deployment/cloud.adoc#howto.deployment.cloud.aws.beanstalk[#cloud-deployment-aws-beanstalk]
480480
* xref:how-to:deployment/cloud.adoc#howto.deployment.cloud.aws.beanstalk[#deployment.cloud.aws.beanstalk]
481-
* xref:how-to:deployment/cloud.adoc#howto.deployment.cloud.aws.summary[#cloud-deployment-aws-summary]
482-
* xref:how-to:deployment/cloud.adoc#howto.deployment.cloud.aws.summary[#deployment.cloud.aws.summary]
483481
* xref:how-to:deployment/cloud.adoc#howto.deployment.cloud.aws[#cloud-deployment-aws]
484482
* xref:how-to:deployment/cloud.adoc#howto.deployment.cloud.aws[#deployment.cloud.aws]
485483
* xref:how-to:deployment/cloud.adoc#howto.deployment.cloud.azure[#deployment.cloud.azure]

spring-boot-project/spring-boot-docs/src/docs/antora/modules/how-to/pages/deployment/cloud.adoc

Lines changed: 18 additions & 55 deletions
Original file line numberDiff line numberDiff line change
@@ -252,17 +252,22 @@ https://www.openshift.com/[OpenShift] has many resources describing how to deplo
252252
[[howto.deployment.cloud.aws]]
253253
== Amazon Web Services (AWS)
254254

255-
Amazon Web Services offers multiple ways to install Spring Boot-based applications, either as traditional web applications (war) or as executable jar files with an embedded web server.
256-
The options include:
255+
Amazon Web Services provides several options that are suitable for running Spring Boot-based applications, either as containers, traditional web applications (war), or self-contained executable jar files.
256+
Popular options are:
257257

258+
* Amazon Elastic Container Service (ECS)
258259
* AWS Elastic Beanstalk
259-
* AWS Code Deploy
260-
* AWS OPS Works
261-
* AWS Cloud Formation
262-
* AWS Container Registry
263260

264-
Each has different features and pricing models.
265-
In this document, we describe to approach using AWS Elastic Beanstalk.
261+
262+
263+
[[howto.deployment.cloud.aws.ecs]]
264+
=== Amazon Elastic Container Service (ECS)
265+
266+
Official https://docs.aws.amazon.com/AmazonECS/latest/developerguide/Welcome.html[Amazon ECS developer guide] provides comprehensive overview of platform's features and includes https://docs.aws.amazon.com/AmazonECS/latest/developerguide/getting-started.html[getting started guide] that walks you through the steps needed to get your containers up and running.
267+
268+
NOTE: Spring Boot applications can be packaged in Docker containers using techniques described in xref:reference:packaging/container-images/index.adoc[].
269+
270+
In addition to the developer guide, AWS also provides a https://docs.aws.amazon.com/AmazonECS/latest/developerguide/create-container-image.html[topical guide] for deploying containerized Java services on Amazon ECS using AWS Fargate.
266271

267272

268273

@@ -278,60 +283,18 @@ You can either use the "`Tomcat Platform`" or the "`Java SE platform`".
278283
==== Using the Tomcat Platform
279284

280285
This option applies to Spring Boot projects that produce a war file.
281-
No special configuration is required.
282-
You need only follow the official guide.
286+
Follow the official guide and https://docs.aws.amazon.com/elasticbeanstalk/latest/dg/tomcat-quickstart.html[Java on Tomcat tutorial].
287+
288+
NOTE: Creating deployable war for a Spring Boot application is described in xref:deployment/traditional-deployment.adoc[].
283289

284290

285291

286292
[[howto.deployment.cloud.aws.beanstalk.java-se-platform]]
287293
==== Using the Java SE Platform
288294

289295
This option applies to Spring Boot projects that produce a jar file and run an embedded web container.
290-
Elastic Beanstalk environments run an nginx instance on port 80 to proxy the actual application, running on port 5000.
291-
To configure it, add the following line to your `application.properties` file:
292-
293-
[configprops,yaml]
294-
----
295-
server:
296-
port: 5000
297-
----
298-
299-
300-
[TIP]
301-
.Upload binaries instead of sources
302-
====
303-
By default, Elastic Beanstalk uploads sources and compiles them in AWS.
304-
However, it is best to upload the binaries instead.
305-
To do so, add lines similar to the following to your `.elasticbeanstalk/config.yml` file:
306-
307-
[source,xml]
308-
----
309-
deploy:
310-
artifact: target/demo-0.0.1-SNAPSHOT.jar
311-
----
312-
====
313-
314-
[TIP]
315-
.Reduce costs by setting the environment type
316-
====
317-
By default an Elastic Beanstalk environment is load balanced.
318-
The load balancer has a significant cost.
319-
To avoid that cost, set the environment type to "`Single instance`", as described in https://docs.aws.amazon.com/elasticbeanstalk/latest/dg/environments-create-wizard.html#environments-create-wizard-capacity[the Amazon documentation].
320-
You can also create single instance environments by using the CLI and the following command:
321-
322-
[source]
323-
----
324-
eb create -s
325-
----
326-
====
327-
328-
329-
330-
[[howto.deployment.cloud.aws.summary]]
331-
=== Summary
332-
333-
This is one of the easiest ways to get to AWS, but there are more things to cover, such as how to integrate Elastic Beanstalk into any CI / CD tool, use the Elastic Beanstalk Maven plugin instead of the CLI, and others.
334-
There is a https://exampledriven.wordpress.com/2017/01/09/spring-boot-aws-elastic-beanstalk-example/[blog post] covering these topics more in detail.
296+
Follow the official guide and https://docs.aws.amazon.com/elasticbeanstalk/latest/dg/java-quickstart.html[Java tutorial].
297+
There are also community provided tutorials such as https://www.baeldung.com/spring-boot-deploy-aws-beanstalk[this one].
335298

336299

337300

0 commit comments

Comments
 (0)