You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: documentation/spring-boot-docs/src/docs/antora/modules/how-to/pages/deployment/cloud.adoc
+18-55Lines changed: 18 additions & 55 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -252,17 +252,22 @@ https://www.openshift.com/[OpenShift] has many resources describing how to deplo
252
252
[[howto.deployment.cloud.aws]]
253
253
== Amazon Web Services (AWS)
254
254
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:
257
257
258
+
* Amazon Elastic Container Service (ECS)
258
259
* AWS Elastic Beanstalk
259
-
* AWS Code Deploy
260
-
* AWS OPS Works
261
-
* AWS Cloud Formation
262
-
* AWS Container Registry
263
260
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.
266
271
267
272
268
273
@@ -278,60 +283,18 @@ You can either use the "`Tomcat Platform`" or the "`Java SE platform`".
278
283
==== Using the Tomcat Platform
279
284
280
285
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[].
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].
0 commit comments