This is the source code for the blog post
https://exampledriven.wordpress.com/2017/01/09/spring-boot-aws-elastic-beanstalk-example/
- Install eb CLI http://docs.aws.amazon.com/elasticbeanstalk/latest/dg/eb-cli3-install.html
- Change application to listen on port 5000
- eb init
- To make EB deploy artifact instead of source code add the following to .elasticbeanstalk/config.yml
deploy:
artifact: target/spring-boot-aws-example-0.0.1-SNAPSHOT.jar
- mvn clean install (this is needed so the environment can be created and artifacts deployed immediately)
- eb create or eb create -s to create without loadbalancer
- mvn clean install
- eb deploy
Create environment
mvn beanstalk:upload-source-bundle beanstalk:create-application-version beanstalk:create-environment
Update application
mvn beanstalk:upload-source-bundle beanstalk:create-application-version beanstalk:update-environment
To avoid being charged, stop or delete all infrastructure components created, including :
- EC2 instances
- Load balancers
The easiest and safest way to do it is to use the command line
# list all eb environments
eb list
# terminate an environment
eb terminate <<env name>>