Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save sampathshivakumar/1304a03fec0f7cd2db2a60910cff62e8 to your computer and use it in GitHub Desktop.
Save sampathshivakumar/1304a03fec0f7cd2db2a60910cff62e8 to your computer and use it in GitHub Desktop.

Continuous Deployment on AWS Elastic Beanstalk with Jenkins

AWS Elastic Beanstalk

what is AWS Elastic Beanstalk?

  • AWS Elastic Beanstalk is a fully managed platform as a service (PaaS) offered by AWS for deploying and managing applications.
  • It simplifies the process of deploying applications by abstracting away the underlying infrastructure details and providing an easy-to-use interface.
  • With Elastic Beanstalk, developers can focus on writing their application code while AWS takes care of the deployment, capacity provisioning, load balancing, and automatic scaling.
  • It supports a variety of programming languages and frameworks, including Java, .NET, PHP, Node.js, Python, Ruby, and Go.

Prerequisites

  • Jenkins server up and running.
  • Basic knowledge of Elastic Beanstalk.

Reference

Open Amazon Elastic Beanstalk in AWS console.

1

Create application

  • Amazon Elastic Beanstalk has two types of environment tiers to support different types of web applications.

  • For now we are going with Web server environment 2

  • I have selected Platform type as Tomcat as i want to deploy war file to Amazon Elastic Beanstalk

3

  • For now we will go with Sample application, later we will deploy our code using jenkins.
  • Lets go with High availability, and click on save.

4

5

  • EC2 instance profile 6

  • Service role 7

  • As i am deploying a simple stateless application, there is no need of Database so click on Skip to review.

8

  • Review and click submit

9

  • It will take few minutes

10

AWS Elastic Beanstalk in back groud will Create Environment,S3 Bucket, security group, target groups, Auto Scaling group, launch EC2 instances, CloudWatch alarm, load balancer, once done also checks health of application.

Environment successfully launched, you can check by clicking on the Domain link.

11

12

Now lets setup jenkins Pipeline to deploy our code using AWS Elastic Beanstalk.

13

  • Install a plugin AWSEB Deployment

14

  • Add your AWS Credentials in Jenkins Global credentials

15

  • Configure Java and Maven inside Jenkins.

16

Create a Freestyle Project.

17

Make the following configurations.

  • Source Code Management 18

  • Build Triggers 19

21

  • Build Steps
  • Invoke top-level Maven targets

22

  • AWS Elastic Beanstalk 23

24

You can get Bucket name from here 25

Now update index.jsp in your GitHub Project Repo, GitHub Webhook will push new code to Jenkins and start the job.

26

  • New Code is successfuly deployed

27

Lets see the output

28

we can see the previous output of Sample Application is replaced by our Application.

Hence we have Achived Continuous Deployment on AWS Elastic Beanstalk with Jenkins successfully.

Thank you for reading this post! I hope you found it helpful. If you have any feedback or questions,Please connect with me on LinkedIn at https://www.linkedin.com/in/sampathsivakumar-boddeti/. Your feedback is valuable to me. Thank you!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment