Skip to content

About

A hands-on DevOps project demonstrating the development, packaging, and automated deployment of a web application using AWS cloud infrastructure and CI/CD services.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Latest commit

 

History

22 Commits

Folders and files

Repository files navigation

Java Web Application — AWS CI/CD Pipeline

Java Maven AWS EC2 CodeBuild CodeDeploy CodePipeline GitHub

A hands-on DevOps project demonstrating the development, packaging, and automated deployment of a Java web application using AWS cloud infrastructure and CI/CD services.

The project was built to gain practical experience designing a software delivery workflow that moves application code from source control through build and deployment stages into a cloud-hosted environment.


📌 Project Overview

This project demonstrates how a Java web application can be integrated with a cloud-based CI/CD workflow using AWS developer tools.

Instead of manually building and deploying the application, the project explores an automated delivery process where changes to the application source code can move through a repeatable build, test, and deployment workflow.

High-Level Workflow

Developer
    │
    │ Git Push
    ▼
GitHub Repository
    │
    ▼
AWS CI/CD Pipeline
    │
    ├── Source
    │
    ├── Build & Test
    │
    └── Deployment
    │
    ▼
Amazon EC2
    │
    ▼
Java Web Application

The project focuses on understanding the DevOps principles behind:

  • Continuous Integration
  • Continuous Delivery
  • Automated builds
  • Automated testing
  • Artifact management
  • Cloud deployment
  • Infrastructure configuration
  • Deployment automation
  • Source-control-driven workflows

🏗️ Architecture

flowchart LR

    Dev["👨‍💻 Developer"]

    GitHub["GitHub Repository"]

    Pipeline["AWS CodePipeline"]

    Source["Source Stage"]

    Build["AWS CodeBuild"]

    Artifact["Build Artifact"]

    Deploy["AWS CodeDeploy"]

    EC2["Amazon EC2"]

    App["Java Web Application"]

    Dev -->|"git push"| GitHub

    GitHub --> Source

    Source --> Pipeline

    Pipeline --> Build

    Build -->|"Build + Test"| Artifact

    Artifact --> Deploy

    Deploy --> EC2

    EC2 --> App
Loading

Architecture Components

Component Purpose
Git Source control and version history
GitHub Application source repository
AWS CodePipeline Orchestrates the CI/CD workflow
AWS CodeBuild Builds and tests the Java application
AWS CodeDeploy Automates application deployment
Amazon EC2 Hosts the deployed application
Maven Java dependency management and build automation
Java Application programming language
VS Code Development environment
AWS CodeArtifact Artifact/package management where configured

🎯 Project Objectives

The primary objective of this project was to gain practical experience building a cloud-based CI/CD workflow for a Java application.

Key learning objectives

  • Understand CI/CD architecture
  • Connect source control with automated delivery
  • Build Java applications using Maven
  • Understand build artifacts
  • Configure AWS CodeBuild
  • Understand AWS CodeDeploy
  • Configure AWS CodePipeline
  • Deploy applications to Amazon EC2
  • Work with Linux-based cloud servers
  • Understand deployment automation
  • Manage AWS services and permissions
  • Troubleshoot CI/CD failures
  • Understand the relationship between source, build, and deployment stages

🛠️ Technology Stack

Application

  • Java
  • Maven
  • Java Web Application

Development

  • Visual Studio Code
  • Git
  • GitHub

AWS

  • Amazon EC2
  • AWS CodeArtifact
  • AWS CodeBuild
  • AWS CodeDeploy
  • AWS CodePipeline
  • AWS IAM

Operating Environment

  • Linux
  • Amazon EC2

📁 Repository Structure

The project follows a Maven-based Java application structure.

Paul-web-project/
│
├── src/
│   ├── main/
│   │   └── ...
│   │
│   └── test/
│       └── ...
│
├── pom.xml
├── buildspec.yml
├── appspec.yml
├── scripts/
│   └── ...
│
└── README.md

The exact structure may vary depending on the current application implementation and deployment configuration.


🔄 CI/CD Workflow

The project is designed around the following delivery process:

Source Code
     │
     ▼
GitHub
     │
     ▼
CodePipeline
     │
     ▼
CodeBuild
     │
     ├── Install dependencies
     ├── Compile application
     ├── Run tests
     └── Generate artifact
     │
     ▼
CodeDeploy
     │
     ▼
Amazon EC2
     │
     ▼
Running Java Application

1. Source Control

The application source code is maintained in Git and hosted on GitHub.

Development changes are committed using Git:

git add .
git commit -m "Update application"
git push origin main

The source repository acts as the starting point for the delivery pipeline.


2. Build and Test

AWS CodeBuild is responsible for automating the application build process.

The build stage can perform tasks such as:

Install dependencies
       ↓
Compile Java source
       ↓
Run automated tests
       ↓
Package application
       ↓
Generate deployment artifact

For a Maven application, the build process can be initiated with:

mvn clean package

This provides a repeatable way to transform source code into a deployable application artifact.


3. Artifact Management

The application build produces artifacts that can be passed between CI/CD stages.

AWS CodeArtifact can also be used as a managed repository for software packages and dependencies.

This introduces an important DevOps concept:

Source Code ≠ Build Artifact

The source code is compiled and packaged into an artifact that can then be deployed independently.


4. Deployment

AWS CodeDeploy handles the application deployment process.

The deployment workflow can:

  1. Retrieve the build artifact.
  2. Prepare the target EC2 instance.
  3. Execute deployment scripts.
  4. Place application files in the required location.
  5. Start or restart the application.
  6. Complete the deployment.

The EC2 instance therefore acts as the application hosting environment.


☁️ Amazon EC2

The application is deployed to an Amazon EC2 instance running a Linux-based environment.

EC2 provides the compute environment required to host the Java application.

The deployment architecture can be summarized as:

AWS Cloud
│
└── EC2 Instance
     │
     ├── Linux
     │
     ├── Java Runtime
     │
     ├── Application Files
     │
     └── Running Web Application

This project provided practical experience working with:

  • EC2 instances
  • Linux servers
  • Application deployment
  • Server configuration
  • AWS networking
  • IAM permissions
  • Deployment automation

🔐 AWS IAM and Security

AWS IAM is an important part of the CI/CD architecture because AWS services need permission to interact with one another.

For example:

CodePipeline
      │
      │ permissions
      ▼
CodeBuild
      │
      │ permissions
      ▼
CodeDeploy
      │
      │ deployment
      ▼
EC2

The project therefore provides practical exposure to:

  • IAM roles
  • IAM policies
  • Service permissions
  • EC2 instance roles
  • Least-privilege concepts
  • Secure AWS service integration

IAM permissions should be restricted to only the resources and actions required by each component.


⚙️ Build Configuration

The project uses Maven for Java dependency management and application packaging.

A typical Maven build command is:

mvn clean package

This performs the major stages of the application build:

Clean
  ↓
Compile
  ↓
Test
  ↓
Package

The resulting artifact can then be passed to the deployment stage.


📦 Deployment Configuration

AWS CodeDeploy uses deployment configuration files and scripts to determine how the application should be installed and started on the EC2 instance.

A typical deployment process looks like:

Download artifact
       ↓
Run deployment hooks
       ↓
Copy application files
       ↓
Configure application
       ↓
Start application
       ↓
Verify deployment

This separates the application build process from the application deployment process, which is an important CI/CD principle.


🔁 Continuous Integration vs Continuous Delivery

One of the major concepts demonstrated by this project is the distinction between CI and CD.

Continuous Integration

Continuous Integration focuses on automatically validating changes.

Developer
   ↓
Git Push
   ↓
Build
   ↓
Test
   ↓
Package

Continuous Delivery

Continuous Delivery extends the process by making the application ready for deployment and automating delivery to the target environment.

Build
   ↓
Test
   ↓
Artifact
   ↓
Deploy
   ↓
EC2

Together, these practices create a repeatable software delivery pipeline.


🧪 Testing

Automated testing is incorporated into the build process.

The goal is to prevent broken application changes from progressing through the deployment pipeline.

Conceptually:

Code Change
     │
     ▼
Build
     │
     ▼
Tests
     │
 ┌───┴────┐
 │        │
Fail     Pass
 │        │
 ▼        ▼
Stop    Deploy

If the build or test stage fails, the deployment should not continue.


📊 DevOps Skills Demonstrated

This project demonstrates practical experience with:

Source Control

  • Git
  • GitHub
  • Git workflows
  • Branching and commits

CI/CD

  • Continuous Integration
  • Continuous Delivery
  • Pipeline orchestration
  • Automated builds
  • Automated deployments

AWS

  • Amazon EC2
  • AWS CodePipeline
  • AWS CodeBuild
  • AWS CodeDeploy
  • AWS CodeArtifact
  • AWS IAM

Linux

  • Linux server administration
  • Application deployment
  • Server configuration
  • Troubleshooting

Java

  • Java application development
  • Maven
  • Dependency management
  • Application packaging

DevOps

  • Build automation
  • Artifact management
  • Deployment automation
  • Cloud-based application delivery
  • CI/CD troubleshooting

🔍 Key DevOps Concepts Learned

The project helped reinforce several important DevOps concepts.

1. Automation

Manual deployment introduces repetitive work and opportunities for human error.

CI/CD automation allows the same deployment process to be executed consistently.

2. Repeatability

The same source code should produce a predictable build artifact.

Source
  ↓
Build
  ↓
Artifact
  ↓
Deployment

3. Separation of Responsibilities

Different AWS services perform different roles:

CodePipeline → Orchestration
CodeBuild    → Build & Test
CodeDeploy   → Deployment
EC2          → Application Hosting
CodeArtifact → Package Management

4. Infrastructure and Application Delivery

The project demonstrates how cloud infrastructure and application deployment work together.

A DevOps engineer needs to understand both sides of this relationship.


🚀 What I Built

This project represents a practical progression from application development toward DevOps engineering.

Rather than only writing application code, I worked through the complete delivery lifecycle:

Application Development
        ↓
Source Control
        ↓
Build Automation
        ↓
Testing
        ↓
Artifact Creation
        ↓
CI/CD Pipeline
        ↓
Cloud Deployment
        ↓
Application Hosting

This experience forms part of my broader DevOps portfolio, alongside containerization, GitHub Actions, Docker, AWS infrastructure, and cloud deployment projects.


🧠 Lessons Learned

Some of the most important lessons from this project include:

  • CI/CD is a workflow rather than a single tool.
  • Source control is the foundation of automated delivery.
  • Build and deployment should be separated into clear stages.
  • Build artifacts provide a consistent deployment unit.
  • AWS services can be combined to create complete delivery pipelines.
  • IAM permissions are critical to successful AWS automation.
  • Deployment failures often require investigation across multiple layers.
  • Linux server knowledge is essential for cloud-based DevOps work.
  • Automation improves consistency and reduces manual deployment effort.

🔒 Security Considerations

Security considerations for the project include:

  • Using IAM roles instead of hard-coded AWS credentials where possible.
  • Avoiding secrets in source code.
  • Restricting IAM permissions according to least-privilege principles.
  • Protecting EC2 instances with appropriate security-group rules.
  • Keeping deployment credentials out of Git repositories.
  • Separating development and production environments.
  • Monitoring deployed infrastructure and application activity.

For a production environment, additional controls could include:

  • HTTPS/TLS
  • Application Load Balancer
  • AWS Systems Manager
  • CloudWatch monitoring
  • Centralized logging
  • Automated vulnerability scanning
  • Deployment approvals
  • Immutable artifacts
  • Private subnets
  • More restrictive IAM policies

📈 Future Improvements

Potential improvements to this project include:

  • Infrastructure as Code with Terraform
  • Automated infrastructure provisioning
  • HTTPS with an Application Load Balancer
  • CloudWatch monitoring
  • Automated deployment rollback
  • Blue/green deployment
  • Deployment notifications
  • Automated security scanning
  • Containerize the Java application
  • Deploy the application using Amazon ECS
  • Implement environment-specific pipelines
  • Add automated integration testing
  • Implement centralized logging

🏆 Portfolio Value

This project demonstrates practical exposure to an AWS-based DevOps workflow rather than simply demonstrating individual AWS services.

The key portfolio outcome is the ability to explain how the following components work together:

GitHub
   ↓
CodePipeline
   ↓
CodeBuild
   ↓
Artifact
   ↓
CodeDeploy
   ↓
EC2
   ↓
Java Web Application

This architecture represents a foundational CI/CD workflow that can be extended toward more advanced DevOps architectures involving containers, Infrastructure as Code, monitoring, security automation, and Kubernetes.


📚 References


👨‍💻 Author

Paul Iyen

DevOps | Cloud | Cybersecurity

This project is part of my hands-on DevOps engineering portfolio, focused on building practical experience with cloud infrastructure, CI/CD automation, containerization, Linux, and AWS.


⭐ Project Status

Status: Completed / Learning Project

Focus: AWS DevOps & CI/CD

Primary Objective: Build practical experience designing and operating an automated Java application delivery pipeline.

About

A hands-on DevOps project demonstrating the development, packaging, and automated deployment of a web application using AWS cloud infrastructure and CI/CD services.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages