This repository contains the source code and configuration for a simple web application and a Continuous Integration / Continuous Deployment (CI/CD) pipeline using AWS services, including AWS CodePipeline, AWS CodeBuild, and AWS Elastic Beanstalk.
🔗 GitHub
Table of Contents
- Overview
- Requirements
- Getting Started
- Pipeline Stages
- Automated Testing
- Deployment
- Contributing
- License
- Output
Overview
The primary goal of this project is to set up a CI/CD pipeline that automates the build, test, and deployment of a simple web application to AWS Elastic Beanstalk whenever changes are pushed to the repository. Below are the key components of the project:
-
Web Application: A simple web application that is hosted on AWS Elastic Beanstalk.
-
CI/CD Pipeline: The CI/CD pipeline is defined using AWS CodePipeline and includes the following stages:
- Source: Pulls the code from the repository.
- Build: Builds the application using AWS CodeBuild.
- Deploy: Deploy the application to Elastic Beanstalk using CodePipeline to Elastic Beanstalk integration.
Requirements
To set up and use this CI/CD pipeline, you need the following requirements:
- An AWS account with the necessary permissions.
- An AWS Elastic Beanstalk environment for hosting the web application.
- A GitHub repository to host the source code.
- An AWS CodeBuild project for building the application.
Getting Started
Prerequisites
Before you start, ensure you have the following prerequisites:
- AWS account credentials configured on your local machine.
- AWS CLI and AWS Elastic Beanstalk CLI (EB CLI) installed.
- GitHub repository with your web application code.
Setup
-
Create a GitHub Repository: Create a new repository for your web application on GitHub.
-
Configure AWS Services:
- Set up an AWS Elastic Beanstalk environment to host your application.
- Create an AWS CodeBuild project for building your application.
-
Create AWS CodePipeline:
- Set up an AWS CodePipeline that defines the source, build, and deploy stages.
-
Configure Automatic Trigger:
- Configure the pipeline to be triggered automatically whenever there is a change to the code in your GitHub repository.
-
Deploy the Pipeline:
- Deploy the configured pipeline in AWS.
Pipeline Stages
The CI/CD pipeline is composed of the following stages:
-
Source Stage:
- This stage pulls the code from your GitHub repository whenever changes are pushed.
-
Build Stage:
- This stage builds the application using AWS CodeBuild, ensuring that your application is ready for deployment.
-
Deploy Stage:
- This stage deploys the application to the Elastic Beanstalk environment using CodePipeline’s integration.
Automated Testing
You can add automated tests to your application and configure the pipeline to run these tests before deploying the application.
Deployment
Your web application will be automatically built, tested (if configured), and deployed to AWS Elastic Beanstalk whenever changes are pushed to your GitHub repository.
Contributing
We welcome contributions to this project. Please feel free to submit issues, feature requests, or pull requests.
License
This project is licensed under the MIT License.
Output(For Reference)
Configure the Environment for Elastic Beanstalk
Choose the platform and platform Branch based on your requirements, This project is based on Nodejs
Set up the Networking and Database
Configure Pipeline for CI/CD
Choose the pipeline Settings
Most importantly add source providers like(Github , BitBucket, Codecommit etc)
Create a Build stage in the Codebuild Service console
Add Build Stage
Add deploy Stage
Finally Review the Changes and click Create
Logs
Complete Flowchart
ElaticBeanStalk Console
Click the Domain link to access the web application
Final output of the Web Application
Happy coding and automating your deployments with AWS! 😊