|
2 | 2 |
|
3 | 3 | ## Overview |
4 | 4 |
|
5 | | -Easy Deploy Backend is a robust and scalable backend system designed to automate the deployment of applications using AWS services. It leverages Amazon ECS, ECR, CodeBuild, and other AWS components to provide a seamless CI/CD pipeline for containerized applications. |
6 | | -This project aims to simplify the deployment process by providing a pre-configured infrastructure that can be easily customized and extended. It supports both Fargate and EC2 launch types, allowing for flexible resource management based on workload requirements. |
| 5 | +Easy Deploy is a SaaS (Software as a Service) platform that simplifies application deployment on AWS, designed for developers who want to focus on building great applications without worrying about DevOps or cloud infrastructure. Our platform handles all the complex AWS setup, containerization, and deployment processes automatically. |
| 6 | + |
| 7 | +Key benefits: |
| 8 | +- **Zero DevOps Knowledge Required**: Deploy your applications without understanding AWS, containers, or infrastructure |
| 9 | +- **Automated Infrastructure**: We handle all AWS resource provisioning and management |
| 10 | +- **Secure by Default**: Built-in security best practices for your applications |
| 11 | +- **Scalable Architecture**: Applications automatically scale based on demand |
| 12 | +- **Cost-Effective**: Pay only for the resources your application actually uses |
| 13 | + |
| 14 | +## How It Works |
| 15 | + |
| 16 | +### Our CI/CD Pipeline vs Your Application Pipeline |
| 17 | + |
| 18 | +Easy Deploy uses two distinct CI/CD pipelines: |
| 19 | + |
| 20 | +1. **Platform CI/CD Pipeline** (GitHub Actions): |
| 21 | + - Manages the Easy Deploy platform itself |
| 22 | + - Builds and deploys platform updates |
| 23 | + - Handles infrastructure changes |
| 24 | + - Ensures platform reliability and security |
| 25 | + |
| 26 | + |
| 27 | + |
| 28 | +2. **Application CI/CD Pipeline** (AWS CodeBuild): |
| 29 | + - Manages your application deployments |
| 30 | + - Builds your application container |
| 31 | + - Pushes to Amazon ECR |
| 32 | + - Deploys to ECS |
| 33 | + - Handles application updates |
| 34 | + |
| 35 | + |
| 36 | + |
| 37 | +### Deployment Process |
| 38 | + |
| 39 | +When you deploy an application through Easy Deploy, the following process occurs: |
| 40 | + |
| 41 | +1. **AWS User Setup**: |
| 42 | + - System checks if you have an AWS user account |
| 43 | + - If not, creates a new IAM user with necessary permissions |
| 44 | + - Sets up secure access credentials |
| 45 | + - Configures user-specific AWS resources |
| 46 | + |
| 47 | + |
| 48 | + |
| 49 | +2. **Repository Setup**: |
| 50 | + - Clones your GitHub repository |
| 51 | + - Stores it in a secure EFS (Elastic File System) location |
| 52 | + - Copies pre-configured pipeline templates |
| 53 | + - Sets up build and deployment configurations |
| 54 | + |
| 55 | + |
| 56 | + |
| 57 | +3. **Application Deployment**: |
| 58 | + - CodeBuild accesses your code from EFS |
| 59 | + - Builds your application container |
| 60 | + - Pushes the image to ECR |
| 61 | + - Deploys the container to ECS |
| 62 | + - Configures load balancing and auto-scaling |
| 63 | + - Stores build artifacts in S3 |
| 64 | + |
| 65 | + |
7 | 66 |
|
8 | 67 | ## Architecture |
9 | 68 |
|
@@ -155,63 +214,43 @@ Benefits: |
155 | 214 | - Regional service with automatic scaling |
156 | 215 |  |
157 | 216 |
|
158 | | - |
159 | 217 | ## Deployment Process |
160 | 218 |
|
161 | | -### 1. Infrastructure Setup |
162 | | - |
163 | | -1. Navigate to the Terraform directory: |
164 | | - ```bash |
165 | | - cd Backend/terraform |
166 | | - ``` |
167 | | - |
168 | | -2. Initialize Terraform: |
169 | | -Initialize the remote backend by running setup_backend.sh script which: |
170 | | -- Creates an S3 bucket for storing Terraform state |
171 | | -- Creates a DynamoDB table for state locking |
172 | | -- Configures backend.tf with the created resources |
173 | | -- Ensures proper state management across team members |
174 | | - ```bash |
175 | | - terraform init |
176 | | - ``` |
177 | | - |
178 | | -3. Apply the infrastructure: |
179 | | - Apply the Terraform configuration to create all infrastructure resources: |
180 | | - - Creates VPC and networking components |
181 | | - - Sets up ECS cluster and services |
182 | | - - Configures load balancer and target groups |
183 | | - - Creates ECR repository |
184 | | - - Sets up CodeBuild project and IAM roles |
185 | | - - Establishes security groups and access controls |
186 | | - - Provisions NAT Gateway and VPC endpoints |
187 | | - - Creates EC2 Instance Connect Endpoint |
188 | | - |
189 | | - The --auto-approve flag skips the interactive approval step |
190 | | - The --lock=false flag allows concurrent Terraform operations |
191 | | - |
192 | | - ```bash |
193 | | - terraform apply --auto-approve --lock=false |
194 | | - ``` |
| 219 | +### 1. User Onboarding |
| 220 | + |
| 221 | +1. **AWS Account Setup**: |
| 222 | + - System automatically creates an IAM user if needed |
| 223 | + - Configures necessary permissions and policies |
| 224 | + - Sets up secure access credentials |
| 225 | + - Stores user information securely |
| 226 | + |
| 227 | +2. **Repository Integration**: |
| 228 | + - Connect your GitHub repository |
| 229 | + - System clones and stores your code in EFS |
| 230 | + - Sets up build and deployment pipelines |
| 231 | + - Configures environment variables |
195 | 232 |
|
196 | 233 | ### 2. Application Deployment |
197 | 234 |
|
198 | | -1. Build and push your Docker image: |
199 | | - ```bash |
200 | | - docker build -t your-app:latest . |
201 | | - docker tag your-app:latest $ECR_REPO_URL:latest |
202 | | - docker push $ECR_REPO_URL:latest |
203 | | - ``` |
204 | | - |
205 | | -2. The CodeBuild pipeline will automatically execute the following steps: |
206 | | - - Access the source code from the EFS mount point where repositories are stored |
207 | | - - Install dependencies and run tests based on buildspec.yml configuration |
208 | | - - Build the application using the specified entry point and port |
209 | | - - Create an optimized Docker image with the application |
210 | | - - Tag and push the image to Amazon ECR with a unique deployment tag |
211 | | - - Update the ECS task definition with the new image |
212 | | - - Deploy the updated container to ECS and configure load balancer routing |
213 | | - - Monitor deployment health and roll back if needed |
214 | | - - Log all build and deployment steps to CloudWatch |
| 235 | +1. **Build Process**: |
| 236 | + - CodeBuild accesses your code from EFS |
| 237 | + - Installs dependencies |
| 238 | + - Builds your application |
| 239 | + - Creates optimized Docker image |
| 240 | + - Pushes to ECR with unique tags |
| 241 | + |
| 242 | +2. **Deployment Process**: |
| 243 | + - Updates ECS task definition |
| 244 | + - Deploys new container version |
| 245 | + - Configures load balancer |
| 246 | + - Sets up auto-scaling |
| 247 | + - Monitors deployment health |
| 248 | + |
| 249 | +3. **Post-Deployment**: |
| 250 | + - Stores build artifacts in S3 |
| 251 | + - Updates deployment status |
| 252 | + - Provides deployment URL |
| 253 | + - Sets up monitoring and logging |
215 | 254 |
|
216 | 255 | ## CI/CD Pipeline |
217 | 256 |
|
@@ -272,7 +311,6 @@ You can connect to running containers using AWS Systems Manager Session Manager: |
272 | 311 | 4. Push to the branch |
273 | 312 | 5. Create a Pull Request |
274 | 313 |
|
275 | | - |
276 | 314 | ## Contributors |
277 | 315 | - [Mohamed Gomaa](https://github.com/mo7amedgom3a) |
278 | 316 | - [Adel Kazzaz](https://github.com/Adelkazzaz) |
|
0 commit comments