- 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.
- Jenkins server up and running.
- Basic knowledge of Elastic Beanstalk.
- Jenkins Installation on Amazon-Linux-2. https://gist.github.com/sampathshivakumar/54449ea95540ad0fd0f0cf44beb54ff9
- GitHub Repo https://github.com/sampathshivakumar/Java-Web-Apps.git
-
Amazon Elastic Beanstalk has two types of environment tiers to support different types of web applications.
-
I have selected Platform type as Tomcat as i want to deploy war file to Amazon Elastic Beanstalk
- 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.
- Select appropriate Service role and EC2 instance profile
- For more info you can go through this link https://docs.aws.amazon.com/elasticbeanstalk/latest/dg/AWSHowTo.iam.html
-
As i am deploying a simple stateless application, there is no need of Database so click on Skip to review.
- Review and click submit
- It will take few minutes
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.
- Install a plugin AWSEB Deployment
- Add your AWS Credentials in Jenkins Global credentials
- Configure Java and Maven inside Jenkins.
- Build Steps
- Invoke top-level Maven targets
You can get Bucket name from here
Now update index.jsp in your GitHub Project Repo, GitHub Webhook will push new code to Jenkins and start the job.
- New Code is successfuly deployed
we can see the previous output of Sample Application is replaced by our Application.
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!