High Level Design (HLD) for IAC Devops Project using AWS Code Pipeline.
High Level Design
Objective:
HLD :
Automate the deployment of Infrastructure using terraform - IAC Devops using Code Pipeline
Code Pipeline 1
Architecture
Overview:
GitHub Link: https://github.com/LokeshJavvaji/Devops_Project_with_Automation
The project aims to automate the deployment of infrastructure using Terraform, implement a CI/CD pipeline with AWS Code Pipeline and Code Build, and introduce a manual approval step for deploying to the staging environment.
1.Source Code
Management:
·
Tool: GitHub (Version Control System)
·
Purpose:
§
Centralized version control for Terraform code .
§
Supports collaboration and versioning.
2.Continuous
Integration and Deployment:
·
AWS Code Pipeline:
§
Stages:
v Source Stage
(GitHub):
·
Monitors the GitHub repository for changes.
·
Triggers the pipeline upon detecting changes.
v
Build and Dev Deployment Stage (CodeBuild):
·
AWS CodeBuild compiles Terraform code and
deploys to the development environment.
·
Automated process triggered by source changes.
3.Manual Approval
(Staging):
·
Manual Approval Stage (Email Notification):
§
Sends email notification for manual approval.
§
Approval required before proceeding to the
staging environment.
4.Staging
Environment Deployment:
·
Staging Deployment Stage (CodeBuild):
§
Similar to the development deployment stage but
targets the staging environment.
§
Executes Terraform apply to provision or update
infrastructure.
5.Infrastructure as
Code (Terraform):
·
Purpose:
§
Defines and provisions infrastructure on AWS.
§
Supports environment-specific configurations
(dev, staging, prod).
6.Continuous
Monitoring:
·
CloudWatch Metrics and Logs:
§
Captures logs and metrics for Code Pipeline,
CodeBuild, and Terraform executions.
§
Sets up CloudWatch Alarms for critical metrics.
Workflow:
1.Developer
Workflow:
§
Developers push code changes to the GitHub
repository.
2.Continuous
Integration and Deployment Workflow (AWS CodePipeline):
§
Automated build and deployment to the
development environment on source code changes.
3.Manual Approval
Workflow (Email Notification):
§
Notification sent for manual approval before
deploying to staging.
4.Staging
Environment Deployment Workflow (AWS CodeBuild):
§
If approved, the pipeline triggers deployment to
the staging environment using Terraform.
5.Infrastructure as
Code Workflow (Terraform):
§
Terraform scripts define and manage AWS
infrastructure components.
§ Version-controlled and organized into modules.
2.Architecture for CI/CD pipeline web App triggering:
GitHub Link: https://github.com/LokeshJavvaji/webapp
The deployment architecture aims to automate the deployment process of the web application using AWS services. The primary components include AWS CodePipeline for orchestrating the workflow, AWS CodeBuild for building and linting PHP code, AWS CodeDeploy for deploying changes, and Auto Scaling for managing instances.
2.Components:
§
AWS CodePipeline:
§ Role: Orchestrates the entire
deployment process.
§ Stages:
o
Source:
Monitors the source code repository for changes.
o
Build:
Utilizes AWS CodeBuild to compile and lint PHP code.
o
Deploy:
Triggers AWS CodeDeploy to deploy the application.
§
AWS CodeBuild:
§ Environment:
o
Ubuntu-based environment with PHP pre-installed.
§ Build Steps:
o
Clone source code from the repository.
o
Install PHP dependencies.
o
Run linting checks on PHP code.
o
Generate artifacts for deployment.
§
AWS CodeDeploy:
§ Deployment Strategy:
o
Blue/Green deployment to minimize downtime.
§ AppSpec.yml:
o
Specifies deployment lifecycle events.
o
Includes hooks for pre and post deployment actions.
§
Auto Scaling:
§ Configuration:
o
Manages instances based on demand.
o
Auto Scaling group configured with desired capacity and scaling
policies.
3. Workflow:
·
Code changes trigger CodePipeline.
·
CodePipeline fetches the latest code from the source repository.
·
CodeBuild compiles the code, installs dependencies, and performs
linting.
·
If the build is successful, CodeDeploy deploys the changes using
the defined deployment strategy.
·
Auto Scaling ensures the appropriate number of instances are
running.
Comments
Post a Comment