It is been a while since I last caught up in this COVID-19 pandemic. 😫 This time I am bringing how to automate your spring boot app deployment on AWS. In this article I am deriving how to configure AWS CodePipeline to deploy a spring boot application from GitHub to an AWS Elastic Beanstalk instance πŸ’ͺ In order to continue this article, you will have to follow my previous articles i.e.

  1. Create your first Web App using Spring Boot with IntelliJ
  2. Deploy Spring Boot application into the AWS infrastructure.

I will be continuing from those articles and if you are not familiar with either spring boot or AWS Elastic BeanStalk, I do recommend you to follow them.

First of all, let’s get to know what is the automation of code deployment. It is simply called as CI / CD i.e. Continuous Integration and Continuous Delivery and Deployment. As nowadays the Agile approach is used, features have to be delivered in every 2 to 3 weeks. That will make the client happy as well as everything would get sorted 😌 In those instances you will have to deploy your code to the server every now and then. It is a difficult task. Then it comes the advantage of using ci/cd ❀. You simply have to commit your changes and the ci/cd configuration will automatically test your code and deploy it to the server πŸ’ͺ

Image for post

Now let’s move on to the example I am going to describe. In this example, source code is in GitHub and once we commit a change, it will trigger a hook to AWS infrastructure. Then the build is going to be done using AWS CodeBuild. Build is defined using _buildspec.yml _which I will show later. After source code is built, artifacts are uploaded to an S3 bucket. There is a feature called AWS CodeDeploy which deploys the artifacts in the S3 bucket to the Elastic BeanStalk instance. This whole process is controlled using a service called AWS CodePipelines.

Now I am going to use my initial project, which I mentioned earlier. In addition to that, I am going to create a GitHub repository and commit and push my code into it.

Image for post

Create new repo in GitHub

#ci-cd-pipeline #spring-boot #github #java #aws

Automate Spring Boot app deployment on AWS infrastructure using Github
10.55 GEEK