This project demonstrates a complete end-to-end DevOps implementation for deploying a production-ready containerized application using modern DevOps tools and cloud-native technologies.
The objective of this project was to:
- Containerize a Python Flask application using Docker
- Provision AWS infrastructure using Terraform
- Deploy the application to AWS ECS Fargate
- Implement CI/CD automation using GitHub Actions
- Configure monitoring and logging using AWS CloudWatch
- Maintain a modular, reusable, and production-style deployment workflow
The deployment process is fully automated and follows Infrastructure as Code (IaC) and DevOps best practices.
The project was designed to achieve the following:
β Infrastructure automation using Terraform β Application containerization using Docker β Automated CI/CD pipeline using GitHub Actions β AWS ECS Fargate deployment β CloudWatch monitoring & logging β Repeatable and scalable deployment workflow β Production-style DevOps architecture
Developer
β
GitHub Repository
β
GitHub Actions CI/CD Pipeline
β
Docker Image Build
β
Docker Hub Registry
β
AWS ECS Fargate Deployment
β
CloudWatch Monitoring & Logging
| Component | Purpose |
|---|---|
| GitHub | Source code management |
| GitHub Actions | CI/CD automation |
| Docker | Application containerization |
| Docker Hub | Docker image registry |
| Terraform | Infrastructure provisioning |
| AWS ECS Fargate | Container orchestration |
| AWS CloudWatch | Monitoring and logging |
| IAM Roles | ECS execution permissions |
| VPC/Subnets | Network infrastructure |
- AWS (Amazon Web Services)
- Terraform
- Docker
- GitHub Actions
- AWS ECS Fargate
- AWS CloudWatch
- Python Flask
- Git & GitHub
devops-project/
β
βββ apps/
β βββ app.py
β βββ requirements.txt
β βββ Dockerfile
β
βββ terraform/
β βββ iam.tf
β βββ alb.tf
β βββ ecs.tf
β βββ network.tf
β βββ security.tf
β βββ variables.tf
β βββ provider.tf
β
βββ .github/
β βββ workflows/
β βββ deploy.yml
β
βββ README.md
βββ DevOps_Architecture2.png
βββ .gitignoreThe application was developed using Python Flask.
from flask import Flask
app = Flask(__name__)
@app.route("/")
def home():
return "Taiwo DevOps Challenge App Running Successfully!"
if __name__ == "__main__":
app.run(host="0.0.0.0", port=5000)The application interface was later upgraded with:
- Modern HTML/CSS UI
- Responsive layout
- Professional DevOps dashboard appearance
- Deployment status display
This improved the project presentation and production readiness.
Docker was used to containerize the Flask application.
FROM python:3.9-slim
WORKDIR /app
COPY requirements.txt .
RUN pip install -r requirements.txt
COPY . .
EXPOSE 5000
CMD ["python", "app.py"]docker build -t devops-app ./appsBuilds the Docker image from the application directory.
docker run -p 5000:5000 devops-appRuns the Docker container locally.
docker run -p 5001:5000 devops-appUsed when port 5000 was already occupied.
docker psDisplays active Docker containers.
docker stop <container_id>Stops a running Docker container.
AWS infrastructure was provisioned using Terraform.
- VPC
- Public Subnets
- Internet Gateway
- Route Tables
- Security Groups
- IAM Roles
- ECS Cluster
- ECS Service
- ECS Task Definition
- CloudWatch Log Groups
Terraform was used to provision AWS infrastructure in a modular and reusable way.
terraform initDownloads required providers and initializes Terraform.
terraform validateChecks Terraform syntax and configuration.
terraform planDisplays infrastructure changes before deployment.
terraform applyDeploys AWS infrastructure resources.
terraform destroyDeletes all provisioned infrastructure.
AWS CLI was configured locally for Terraform and ECS deployment.
aws configurePrompts:
- AWS Access Key
- AWS Secret Key
- Region
- Output format
aws sts get-caller-identityVerifies AWS authentication.
Amazon ECS Fargate was selected because:
- Fully managed container service
- No EC2 management required
- Production-ready scalability
- Simplified deployment workflow
- ECS Cluster
- ECS Task Definition
- ECS Service
- Fargate Launch Type
GitHub Actions was used to automate the complete deployment pipeline.
The workflow automatically triggers whenever code is pushed to the main branch.
uses: actions/checkout@v4Fetches latest repository code.
uses: aws-actions/configure-aws-credentials@v4Authenticates GitHub Actions with AWS.
docker loginAuthenticates Docker Hub access.
docker build -t devops-app ./appsBuilds updated application image.
docker push username/devops-app:latestPushes image to Docker Hub.
aws ecs update-service \
--cluster devops-cluster \
--service devops-service \
--force-new-deploymentForces ECS to deploy latest image.
name: DevOps CI/CD Pipeline
on:
push:
branches:
- main
jobs:
deploy:
runs-on: ubuntu-latest
steps:
- name: Checkout Code
uses: actions/checkout@v4
- name: Configure AWS Credentials
uses: aws-actions/configure-aws-credentials@v4
with:
aws-access-key-id: ${{ secrets.AWS_ACCESS_KEY }}
aws-secret-access-key: ${{ secrets.AWS_SECRET_KEY }}
aws-region: us-east-1
- name: Docker Hub Login
run: echo "${{ secrets.DOCKER_PASSWORD }}" | docker login -u "${{ secrets.DOCKER_USERNAME }}" --password-stdin
- name: Build Docker Image
run: docker build -t devops-app ./apps
- name: Tag Docker Image
run: docker tag devops-app ${{ secrets.DOCKER_USERNAME }}/devops-app:latest
- name: Push Docker Image
run: docker push ${{ secrets.DOCKER_USERNAME }}/devops-app:latest
- name: Deploy to ECS
run: |
aws ecs update-service \
--cluster devops-cluster \
--service devops-service \
--force-new-deploymentSensitive credentials were securely stored using GitHub Secrets.
| Secret Name | Purpose |
|---|---|
| AWS_ACCESS_KEY | AWS authentication |
| AWS_SECRET_KEY | AWS authentication |
| DOCKER_USERNAME | Docker Hub login |
| DOCKER_PASSWORD | Docker Hub access token |
AWS CloudWatch was implemented for:
- Container logs
- ECS monitoring
- Deployment troubleshooting
- Runtime visibility
- ECS task logs
- Container stdout/stderr logs
- Centralized logging
The following validations were performed:
β Terraform validation β Docker image build test β ECS deployment verification β CloudWatch log verification β GitHub Actions CI/CD testing β External IP accessibility testing
| Challenge | Solution |
|---|---|
| Duplicate Terraform provider | Removed duplicate provider block |
| Invalid AWS token | Reconfigured AWS CLI |
| Docker Hub authentication failure | Used Docker access token |
| GitHub push rejection | Pulled remote changes with rebase |
| Docker build path error | Corrected apps directory path |
| Port already allocated | Used alternative localhost port |
| Folder casing conflict | Fixed Git folder naming |
- Serverless container management
- Simplified operations
- Production-ready service
- Infrastructure as Code
- Repeatable deployments
- Reusable infrastructure
- Portable runtime environment
- Consistent deployments
- Simplified dependency management
- Native GitHub integration
- Easy CI/CD automation
- Fast deployment workflow
The following security best practices were implemented:
- IAM Roles for ECS execution
- GitHub Secrets for credentials
- No hardcoded secrets
- Security Group restrictions
- Infrastructure managed through Terraform
Current implementation limitations:
- No Auto Scaling
- Single environment deployment
- Basic monitoring only
Potential enhancements:
- Implement Auto Scaling
- Add HTTPS with ACM
- Use AWS ECR instead of Docker Hub
- Implement Blue/Green deployment
- Add Prometheus & Grafana monitoring
- Implement Kubernetes (EKS)
Code Development
β
Git Push to GitHub
β
GitHub Actions Trigger
β
Docker Build
β
Docker Hub Push
β
AWS ECS Deployment
β
CloudWatch Monitoring
Taiwo Peter Olatunji DevOps Engineer Practical Challenge Submission
GitHub Repository:
This project successfully demonstrates a production-style DevOps deployment pipeline using:
- Docker containerization
- Terraform infrastructure provisioning
- AWS ECS Fargate deployment
- Load Balancer
- GitHub Actions CI/CD automation
- CloudWatch monitoring
The implementation provides:
- Automated infrastructure deployment
- Automated application deployment
- Scalable container orchestration
- Production-style DevOps workflow
- End-to-end CI/CD automation