Deploy NodeJS APP on Elastic Beanstalk Using CodePipeline(CI/CD)

“Developer Friendly Deployment Doc’s”

This article is focused on the deployment of NodeJs Application in AWS Elastic Beanstalk using NodeJs Environment in simple developer-friendly configurations.

Prerequisites to Proceed Further

  1. Basic in NodeJs
  2. Basic in Linux Commands
  3. Basic in AWS Console

Deploy the NodeJs APP to Elastic Beanstalk

Login to the AWS console and search or Navigate to the Elastic Beanstalk console below shown image and click on the Create Application for creating a server.

Then you will redirect to this page here you have to input certain details like Application Name for the Project then you have to Choose the Platform that you want to run, Since it’s a NodeJS project we have to choose the Nodejs and select the latest platform branch and platform version then make the radio button to be select for sample application and click on the create button

Wait until the application is created and you will redirect to this page here you can get the environment URL for our sample application you can copy paste the URL and See the Sample Application Page provided by the NodeJS

Sample Application Page Loaded in Webbrowser

AWS CODE COMMIT

AWS Code commit is same as the Git operation here we can create repository and we can push the code in to it

Note: You Have to create the Access Key ID and Secret Access Key for using the Code Commit

Click the Link and do the steps to Generate the Password for git

https://docs.aws.amazon.com/codecommit/latest/userguide/setting-up-gc.html?icmpid=docs_acc_console_connect_np

once the steps completed you will get a console like this, download the credentials and keep it as safe

Git Keys

Click Create a repository for creating the repository

Type the repository name and click on “Create Button”

Then you will redirect to the page shown in below image

Next go to your project and initialise the git (Install git in you system before doing this)

git add .

Then next you have to commit the code with initial commit

git commit -m "Initial Commit"

Then got the AWS code commit repo page and copy the URL and paste it in your project

git remote set-url origin <copied URL to Here>

Then next you have to push the code to your newly created git repo using the username and password

then the code in the repo will be look like this and the you have successfully configured the AWS Code commit

AWS CODE PIPELINES

Got AWS Code Pipeline console and Click to Create a AWS Code Pipeline

Type the Pipeline name as you project name and click on the Next

Next You have to Choose the Source stage for that you have to Choose the AWS Code Commit, since am using AWS Code Commit here if you are using GitHub you can choose the GitHub Version 1, GitHub Version 2 and Click on the Next Button

then Next step you have to choose the Repository Name and the Branch which you want to deploy and Choose the AWS CodePipeline and Output artifcat format as CodePipeline default then click on the Next button as the below image shown

Next Step is to Choose the Build Stage, since here am not using any build so am skipping the build stage section as like the below image shows

Then Next You have to setup the Deploy Stage for this Choose the Deploy Service of AWS, Since we are using the AWS Elastic Beanstalk we have to choose that and click on the Next Button,

Next Section you can choose the region where the server want to be deployed (Always choose the Server Region Near to the Application is Implementing), then Type the Application Name and Environment name as like the below images shows and click on the Next Button

Next is the Final step that is we have to Review all the information and details we have inputted and click on the Create Pipeline button

--

--

--

DevOps Engineer / Solution Architect- Calicut

Love podcasts or audiobooks? Learn on the go with our new app.

Recommended from Medium

Dependency Injection in Spring

A Guide to Scala Collections: Exploring Monads in Scala Collections

Basic Electronic Components

File Base Access Control for Trino/PrestoSQL

ID auto Generate from Laravel Helper

Exploring HTML Emails

HEROKU — AGORA — FLUTTER: Generate an RTC token — Golang.

WeBlock and Japanese BlockChain Company Connectome.Inc

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store
Akshay Krison

Akshay Krison

DevOps Engineer / Solution Architect- Calicut

More from Medium

Deploy NodeJS APP Using Docker in EC2

How To Create Node.js Express Server With Socket.io Using Typescript

Elastic Search integration in Laravel 9

Deploy MERN App on Heroku