Download as pdf or txt
Download as pdf or txt
You are on page 1of 5

AWS DevOps

Md. Noor Alam


+8801726217566

DevOps is the practice of operations and development engineers participating together in the entire service
lifecycle from design through to the development process into production support.

Why DevOps (CI/CD)?

While deploying an application, first we create a JJAR/WAR


AR/WAR application and then deploy it elsewhere (i.e.,
Elastic Beanstalk).

The steps appear to be quite easy to follow. However, if we will need to alter the code in the future, to deploy,
we have to create a JAR/WAR and deploy the same JAR/WAR to the elastic beanstalk. Then, it seems repeated
job for a developer. Is not it?

Why don't we automate this process? This means that if we make any code changes, the elastic beanstalk will
automatically be updated. So, take make Developer’s job easier Amazon provide AWS CodeP Pipeline services
for continuous integration and continuous deployment.

This Article will explore how we can integrate CodePipeline into our application to automate this job.

Objectives

In this article, the below things are covered step by step.

1. Developing a Spring Boot application and publish the sources to GitHub.


2. Create an Elastic Beanstalk Environment.
3. Create CodePipeline application.
4. Veryfy whethr the application at GitHub was successfully deployed using CodePipeline to Elastic Beanstalk.
5. Do some sorce code changes and push to Github.
6. Check to see if the changes were applied automatically.

Developing a Spring Boot application and publish the sources to GitHub.

SourceCode:

return Stream.of(

new Book(17, "Why Nation Fails",, "Daron


Acemoglu"),

new Book(10, "Discourse on Method"


Method", "Rene
Descartes"),

new Book(5, "As A Man Thinketh",


Thinketh" "James
Allen"),

new Book(4, "Thinking Architecturally",


Architecturally"
"Nathaniel Schutta"),

new Book(1, "As We May Think", " Vannevar


Bush")).

collect(Collectors.toList());

There is only one endpoint in this application that delivers a list of books that are worthwhile reading. The book
names and author are shown in the screenshot up top, but there is no apparent sequence.
Add the source codes to the Github repository at this point. Once git is installed on the machine, all it takes is a
few commands to get started.

Create a new repository Go to the project Directory and execute the commands sequentially

These are the files that have successfully been published to Github.

As a result, the application is now complete and accessible on GitHub. The application now be deployed into
Elastic Beanstalk.

Create an Elastic Beanstalk Environment.

With AWS Elastic Beanstalk, a developer can deploy an application wi


without
thout provisioning the underlying
infrastructure while maintaining high availability.

Elastic Beanstalk Architecture

There is AWS Elastic Load balancer in forefront. This load


Balancer will send the traffic to a set of EC2 instances
(which is auto-scaled).

Each EC2 instance will send the have a NGINX web server
and a Tomcat application server. Request send by the Elastic
Load Balancer is first handled by the NGINX server. Then
NGINX server forwards the request to the tomcat server.

A brief explanation of how to set up an Elastic Beanstalk web server is included below.
Go to the AWS Console, login, and search for Elastic Beanstalk. Follow as instructed in the screenshot.

The environment would need to be set up, and additional tasks like running an EC2 instance would
take a while.

As seen in the diagram below, everything is ready except for the CoderPipeline.

What is AWS CodePipeline?


CodePipeline automates the software deployment process, allowing a developer to quickly model, visualize and
deliver code for new features and updates.

It provides a graphic user interface to model workflow configurations for the release process within the pipeline,
thereby development team can specify and run actions or a group of actions. The service can then run these
actions through the parallel execution process, in which multiple processors handle computing tasks
simultaneously to accelerate workflows.
The process of constructing this AWS Code Pipeline involves several steps. No -1: Defining Source Code’s
location (i.e. Github), No-2: The Details of Where to deploy (i.e.Elastic Beanstalk), and No-3:
No Deployment
instructions. However, for brevity, only the summary portion is presented here.

The progress status is indicated by the tik marks on the right side. All appears to be well.

Veryfy whethr the application at GitHub was successfully deployed using CodePipeline to Elastic Beanstalk.

This is the earlier created Elastic Beanstalk environment with the name aws-devops-testing.
aws No source code was
put during creation, but CodePipile has already integrated our program
progra into it.
CI/CD

The process of developing an application, posting it to Github, setting up an Elastic Beanstalk, and
configuring CodePipeline is now complete.
But, what if later at anytime someone asks to sort the book names alphabetically? Possibly changing
the code,
ode, producing a JAR or WAR, and deploying that JAR or WAR to the elastic beanstalk is a
solution. We don't need to do that right

CodePipeline is aware of our repository,y, and thereby following the earlier instructs it deploys the
applicatin accordingly.
We only need to complete the necessary coding and submit the change to Github. CodePipeline will
do the rest.

At http://localhost:8089/ At http://awsdevopstesting-env.eba-y5frp2dk.ap-northeast
northeast-
1.elasticbeanstalk.com/

To recapitulate, thesee are all we did.


A Spring Boot application and publish
ublished to GitHub. – Status: Done.
Created an Elastic Beanstalk Environment. – Status: Done.
Created CodePipeline application. – Status: Done.
Veryfy whethr the application at GitHub was successfully
deployed using CodePipeline to Elastic Beanstalk. – Status: Done.
Code changes and push to Github and Auto Deploy. – Status: Done.

The End.

You might also like