2.4 KiB
2.4 KiB
nvhi-atsila-microservice
AWS ECS CI/CD Pipeline with Terraform, Ansible & Jenkins
A complete CI/CD pipeline for deploying microservices to AWS ECS using infrastructure as code and configuration management.
🚀 Overview
This project implements an end-to-end CI/CD pipeline that automates the build, test, and deployment of microservices to AWS ECS. The pipeline leverages DevOps best practices to create a reproducible, scalable deployment solution optimized for AWS Free Tier.
🛠️ Technology Stack
- Terraform - Provisions all AWS infrastructure
- Ansible - Configures EC2 instances with Docker and ECS agent
- Jenkins - Orchestrates the entire CI/CD workflow
- Artifactory - Hosts Docker images
- SonarQube - Enforces code quality gates
- Gitea - Git repository hosting
- AWS ECS - Container orchestration (EC2-backed)
📋 Pipeline Workflow
- Developer pushes code to Gitea
- Jenkins webhook triggers the pipeline
- SonarQube scans code for quality compliance
- Docker image is built from approved code
- Image is pushed to Artifactory registry
- Terraform provisions/updates AWS infrastructure
- Ansible configures EC2 instances for ECS
- Microservice is deployed to ECS cluster
🏗️ Infrastructure Components
AWS Resources (Managed by Terraform)
- VPC with public/private subnets
- ECS cluster with EC2 container instances
- Application Load Balancer (ALB)
- Security groups and IAM roles
- Auto-scaling capabilities
DevOps Tools (Self-hosted)
All DevOps tools run on a dedicated Linux server:
- Jenkins for CI/CD automation
- Gitea for version control
- SonarQube for code analysis
- Artifactory for artifact management
📁 Project Structure
├── terraform/ # Infrastructure as Code
├── ansible/ # Configuration management
├── jenkins/ # CI/CD pipeline definitions
├── microservice/ # Sample application
├── scripts/ # Setup and utility scripts
└── docs/ # Documentation
🔒 Key Features
- Fully Automated - Push code and deploy automatically
- Quality Gates - SonarQube ensures code standards
- Infrastructure as Code - All resources defined in Terraform
- Configuration Management - Ansible ensures consistent server setup
- AWS Free Tier - Optimized for minimal AWS costs
- Modular Design - Easy to extend and customize