{"id":28454225,"url":"https://github.com/prajwalchapke055/amazon-prime-clone-devsecops-project","last_synced_at":"2026-04-07T07:42:34.902Z","repository":{"id":296003576,"uuid":"991995696","full_name":"prajwalchapke055/Amazon-Prime-Clone-DevSecOps-Project","owner":"prajwalchapke055","description":"This project automates the deployment of an Amazon Prime Clone using GitHub, Jenkins, SonarQube, Trivy, and Docker. Terraform provisions AWS infrastructure, Helm and ArgoCD handle deployments to AWS EKS, and Prometheus with Grafana enables monitoring. It demonstrates a complete CI/CD pipeline with security, scalability, and real-time monitoring.","archived":false,"fork":false,"pushed_at":"2025-06-05T12:08:19.000Z","size":9649,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"main","last_synced_at":"2025-08-01T17:17:57.259Z","etag":null,"topics":["argocd","aws","docker","dockerhub","git","github","grafana","helm","jenkins","npm","owasp","prometheus","sonarqube","terraform","trivy","vscode"],"latest_commit_sha":null,"homepage":"https://prime-clone-2fcfe.web.app/","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/prajwalchapke055.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null}},"created_at":"2025-05-28T13:09:53.000Z","updated_at":"2025-06-05T12:08:21.000Z","dependencies_parsed_at":"2025-06-28T05:41:52.386Z","dependency_job_id":null,"html_url":"https://github.com/prajwalchapke055/Amazon-Prime-Clone-DevSecOps-Project","commit_stats":null,"previous_names":["prajwalchapke055/amazon-prime-clone-devsecops-project"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/prajwalchapke055/Amazon-Prime-Clone-DevSecOps-Project","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/prajwalchapke055%2FAmazon-Prime-Clone-DevSecOps-Project","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/prajwalchapke055%2FAmazon-Prime-Clone-DevSecOps-Project/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/prajwalchapke055%2FAmazon-Prime-Clone-DevSecOps-Project/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/prajwalchapke055%2FAmazon-Prime-Clone-DevSecOps-Project/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/prajwalchapke055","download_url":"https://codeload.github.com/prajwalchapke055/Amazon-Prime-Clone-DevSecOps-Project/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/prajwalchapke055%2FAmazon-Prime-Clone-DevSecOps-Project/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":274609465,"owners_count":25316621,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","status":"online","status_checked_at":"2025-09-11T02:00:13.660Z","response_time":74,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["argocd","aws","docker","dockerhub","git","github","grafana","helm","jenkins","npm","owasp","prometheus","sonarqube","terraform","trivy","vscode"],"created_at":"2025-06-06T19:00:35.535Z","updated_at":"2025-10-12T06:19:55.572Z","avatar_url":"https://github.com/prajwalchapke055.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Amazon Prime Clone Deployment Project\n![Pipeline Overview](https://github.com/user-attachments/assets/23463138-c112-4997-8631-63218dbf6e53)\n\n---\n\n## Project Overview\nThis project demonstrates deploying an Amazon Prime clone using a set of DevOps tools and practices. The primary tools include:\n\n| Tool                       | Purpose                                                                        |\n| -------------------------- | ------------------------------------------------------------------------------ |\n| **Git**                    | Version control system to manage source code.                                  |\n| **GitHub**                 | Source code hosting and collaboration platform.                                |\n| **Visual Studio Code**     | Lightweight and powerful code editor for development.                          |\n| **AWS IAM**                | Identity and Access Management for AWS services and user roles.                |\n| **Terraform**              | Infrastructure as Code (IaC) tool to provision AWS resources like EC2 and EKS. |\n| **Jenkins**                | CI/CD automation tool for building, testing, and deploying applications.       |\n| **SonarQube**              | Code quality analysis and static code inspection with quality gates.           |\n| **NPM**                    | Node.js package manager used for building and managing dependencies.           |\n| **OWASP Dependency-Check** | Detect known vulnerabilities in project dependencies.                          |\n| **Aqua Trivy**             | Security scanner for vulnerabilities in Docker images and Kubernetes.          |\n| **Docker**                 | Containerization tool for creating and managing container images.              |\n| **Docker Hub**             | Cloud-based Docker registry for storing and sharing container images.          |\n| **AWS ECR**                | Private container registry on AWS for Docker images.                           |\n| **AWS EKS**                | Kubernetes-based container orchestration service by AWS.                       |\n| **Helm**                   | Kubernetes package manager for deploying applications (charts).                |\n| **ArgoCD**                 | GitOps-based continuous delivery tool for Kubernetes.                          |\n| **Prometheus**             | Monitoring system and time-series database for metrics.                        |\n| **Grafana**                | Visualization and alerting dashboard for Prometheus metrics.                   |\n| **Blackbox Exporter**      | Probes endpoints (HTTP, TCP, etc.) and exposes metrics for Prometheus.         |\n\n---\n\n## Pre-requisites\n1. **AWS Account**: Ensure you have an AWS account. [Create an AWS Account](https://docs.aws.amazon.com/accounts/latest/reference/manage-acct-creating.html)\n2. **AWS CLI**: Install AWS CLI on your local machine. [AWS CLI Installation Guide](https://docs.aws.amazon.com/cli/latest/userguide/getting-started-install.html)\n3. **VS Code (Optional)**: Download and install VS Code as a code editor. [VS Code Download](https://code.visualstudio.com/download)\n4. **Install Terraform in Windows**: Download and install Terraform in Windows [Terraform in Windows](https://learn.microsoft.com/en-us/azure/developer/terraform/get-started-windows-bash)\n\n---\n\n## Note For Developers\n\n- This project is a Amazon Prime Clone. You can run the below commands to see the project on your local system.\n- Hosted on Firebase at - https://prime-clone-2fcfe.web.app/ (Desktop View Only). For getting Data I have used TMDB API.\n\n- For running the App locally you will have to generate your own API_Key and substitute in all requests files and App.js files.\n- You can check out other ReactJs projects as well in other repositories deployed on firebase.\n\n- Icons from Material UI library have been used. Link is - https://material-ui.com/components/material-icons/\n\n### Technologies Used:\n- ReactJS\n- NodeJS\n- MaterialUI for icons\n\n### Note: Don't use it for any commercial purposes.\n\n---\n\n## Configuration\n### AWS Setup\n1. **IAM User**: Create an IAM user and generate the access and secret keys to configure your machine with AWS.\n2. **Key Pair**: Create a key pair named `key` for accessing your EC2 instances.\n\n---\n\n## Infrastructure Setup Using Terraform\n1. **Clone the Repository** (Open Command Prompt \u0026 run below):\n   ```bash\n   git clone https://github.com/prajwalchapke055/Amazon-Prime-Clone-DevSecOps-Project.git\n   cd Amazon-Prime-Clone-DevSecOps-Project\n   code .   # this command will open VS code in backend\n   ```\n2. **Initialize and Apply Terraform**:\n   - Run the below commands to reduce the path displayed in VS Code terminal (Optional)\n     ```bash\n     code $PROFILE\n     function prompt {\"$PWD \u003e \"}\n     function prompt {$(Get-Location -Leaf) + \" \u003e \"}\n     ```\n   - Open `terraform_code/ec2_server/main.tf` in VS Code.\n   - Run the following commands:\n     ```bash\n     aws configure\n     terraform init\n     terraform apply --auto-approve\n     ```\n\nThis will create the EC2 instance, security groups, and install necessary tools like Jenkins, Docker, SonarQube, etc.\n\n---\n\n## SonarQube Configuration\n1. **Login Credentials**: Use `admin` for both username and password.\n2. **Generate SonarQube Token**:\n   - Create a token under `Administration → Security → Users → Tokens`.\n   - Save the token for integration with Jenkins.\n\n---\n\n## Jenkins Configuration\n1. **Add Jenkins Credentials**:\n   - Add the SonarQube token, AWS access key, and secret key in `Manage Jenkins → Credentials → System → Global credentials`.\n\n2. **Install Required Plugins**:\n   - Install plugins such as SonarQube Scanner, NodeJS, Docker, and Prometheus metrics under `Manage Jenkins → Plugins`.\n\n3. **Global Tool Configuration**:\n   - Set up tools like JDK 17, SonarQube Scanner, NodeJS, and Docker under `Manage Jenkins → Global Tool Configuration`.\n\n---\n\n## Pipeline Overview\n\n### Pipeline Stages\n\n1. **Clean Workspace** – Clears previous build artifacts and resets the Jenkins workspace.\n2. **Git Checkout** – Clones the latest source code from the GitHub repository.\n3. **SonarQube Code Analysis** – Performs static code analysis for bugs, vulnerabilities, and code smells.\n4. **Quality Gate Validation** – Verifies that the SonarQube quality gate status is acceptable before proceeding.\n5. **Install NPM Dependencies** – Installs Node.js dependencies with `npm install`.\n6. **OWASP Dependency-Check** – Scans project dependencies for known security vulnerabilities using OWASP (if enabled).\n7. **Trivy Security Scan** – Runs Trivy to detect file-system-level vulnerabilities and outputs an HTML report.\n8. **Docker Image Build \u0026 Local Run** – Builds the Docker image and runs it locally to verify functionality.\n9. **Create AWS ECR Repository** – Creates the specified ECR repository if it doesn’t already exist.\n10. **Authenticate with AWS ECR** – Logs in to AWS ECR using AWS credentials for pushing images.\n11. **Push Docker Image to AWS ECR** – Pushes Docker images with versioned and latest tags to ECR.\n12. **Cleanup Local Docker Images** – Removes local Docker containers and images to save disk space.\n13. **Post-Build Email Notification** – Sends an HTML email with build result, reports, and pipeline summary.\n\n---\n\n### Running Jenkins Pipeline\nCreate and run the build pipeline in Jenkins. The pipeline will build, analyze, and push the project Docker image to ECR.\nCreate a Jenkins pipeline by adding the following script:\n\n---\n\n### Build Pipeline\n\n```groovy\npipeline {\n    agent any\n\n    parameters {\n        string(name: 'ECR_REPO_NAME', defaultValue: 'amazon-prime', description: 'Enter repository name')\n        string(name: 'AWS_ACCOUNT_ID', defaultValue: '123456789012', description: 'Enter AWS Account ID')\n    }\n\n    tools {\n        jdk 'JDK17'\n        nodejs 'NodeJS'\n    }\n\n    environment {\n        SCANNER_HOME = tool 'SonarQube Scanner'\n        AWS_REGION = \"us-east-1\"\n        IMAGE_NAME = \"${params.ECR_REPO_NAME}\"\n        ECR_URI = \"${AWS_ACCOUNT_ID}.dkr.ecr.${AWS_REGION}.amazonaws.com/${params.ECR_REPO_NAME}\"\n    }\n\n    stages {\n\n        stage ('1. Clean Workspace') {\n            steps {\n                cleanWs()\n            }\n        }\n\n        stage('2. Git Checkout') {\n            steps {\n                git branch: 'main', url: 'https://github.com/prajwalchapke055/Amazon-Prime-Clone-DevSecOps-Project.git'\n            }\n        }\n\n        stage('3. SonarQube Analysis') {\n            steps {\n                withSonarQubeEnv('sonar-server') {\n                    sh \"\"\"\n                    ${SCANNER_HOME}/bin/sonar-scanner \\\n                    -Dsonar.projectName=amazon-prime \\\n                    -Dsonar.projectKey=amazon-prime\n                    \"\"\"\n                }\n            }\n        }\n\n        // stage('4. Quality Gate') {\n        //   steps {\n        //        waitForQualityGate abortPipeline: true\n        //    }\n        // }\n\n        stage(\"4. Quality Gate\") {\n            steps {\n                script {\n                    def qualityGate = waitForQualityGate(abortPipeline: false, credentialsId: 'sonar-token')\n                    if (qualityGate.status != 'OK') {\n                        error \"Quality Gate failed: ${qualityGate.status}\"\n                        }\n                    }\n                }\n        }\n\n\n        stage('5. Install NPM Dependencies') {\n            steps {\n                sh '''\n                rm -rf node_modules package-lock.json\n                npm install --legacy-peer-deps\n                '''\n            }\n        }\n\n// stage('6. OWASP Dependency-Check') {\n//     steps {\n//         withCredentials([string(credentialsId: 'nvd-api-key', variable: 'NVD_API_KEY')]) {\n//             sh 'mkdir -p dependency-check-report'  // Ensure output directory exists\n//             dependencyCheck(\n//                 additionalArguments: '--scan ./ ' +\n//                                      '--format XML ' +\n//                                      '--format HTML ' +\n//                                      '--out dependency-check-report ' +\n//                                      '--disableYarnAudit ' +\n//                                      '--disableNodeAudit ' +\n//                                      '--nvdApiKey=' + NVD_API_KEY,\n//                 odcInstallation: 'dc'\n//             )\n//         }\n//         dependencyCheckPublisher pattern: '**/dependency-check-report.xml'\n//     }\n// }\n\n\n        stage('6. Trivy Scan \u0026 Report') {\n            steps {\n                script {\n                    sh \"trivy fs --format table -o trivy-fs-report.html . \"\n                }\n            }\n        }\n        \nstage('7. Build Docker Image') {\n            steps {\n                script {\n                    sh \"\"\"\n                        echo \"Cleaning up any existing containers...\"\n\n                        # Stop and remove running container\n                        if docker ps -a --format '{{.Names}}' | grep -w amazon-prime; then\n                            docker stop amazon-prime || true\n                            docker rm -f amazon-prime || true\n                        fi\n\n                        # Remove image if exists\n                        if docker images -q ${IMAGE_NAME}:latest \u003e /dev/null; then\n                            docker rmi -f ${IMAGE_NAME}:latest || true\n                        fi\n\n                        echo \"Building new Docker image...\"\n                        docker build -t ${IMAGE_NAME}:latest .\n\n                        echo \"Tagging image for ECR...\"\n                        docker tag ${IMAGE_NAME}:latest ${ECR_URI}:${BUILD_NUMBER}\n                        docker tag ${IMAGE_NAME}:latest ${ECR_URI}:latest\n\n                        echo \"Running container on port 5000...\"\n                        docker run -d --name amazon-prime -p 5000:5000 ${IMAGE_NAME}:latest\n                    \"\"\"\n                }\n            }\n        }\n\n        stage('8. Create ECR Repo') {\n            steps {\n                withCredentials([\n                    string(credentialsId: 'access-key', variable: 'AWS_ACCESS_KEY'),\n                    string(credentialsId: 'secret-key', variable: 'AWS_SECRET_KEY')\n                ]) {\n                    sh \"\"\"\n                        aws configure set aws_access_key_id $AWS_ACCESS_KEY\n                        aws configure set aws_secret_access_key $AWS_SECRET_KEY\n                        aws ecr describe-repositories --repository-names ${IMAGE_NAME} --region ${AWS_REGION} || \\\n                        aws ecr create-repository --repository-name ${IMAGE_NAME} --region ${AWS_REGION}\n                    \"\"\"\n                }\n            }\n        }\n\n        stage('9. Login to ECR') {\n            steps {\n                withCredentials([\n                    string(credentialsId: 'access-key', variable: 'AWS_ACCESS_KEY'),\n                    string(credentialsId: 'secret-key', variable: 'AWS_SECRET_KEY')\n                ]) {\n                    sh \"\"\"\n                        aws configure set aws_access_key_id $AWS_ACCESS_KEY\n                        aws configure set aws_secret_access_key $AWS_SECRET_KEY\n                        aws ecr get-login-password --region ${AWS_REGION} | docker login --username AWS --password-stdin ${ECR_URI}\n                    \"\"\"\n                }\n            }\n        }\n\n        stage('10. Push Image to ECR') {\n            steps {\n                sh \"\"\"\n                    docker push ${ECR_URI}:${BUILD_NUMBER}\n                    docker push ${ECR_URI}:latest\n                \"\"\"\n            }\n        }\n\n        stage('11. Cleanup Old Images') {\n            steps {\n                sh \"\"\"\n                    docker rmi -f ${ECR_URI}:${BUILD_NUMBER} || true\n                    docker rmi -f ${ECR_URI}:latest || true\n                    docker rmi -f ${IMAGE_NAME}:latest || true\n                    docker image prune -f\n                \"\"\"\n            }\n        }\n    }\n    \n    \npost {\n    always {\n        // archiveArtifacts artifacts: 'dependency-check-report/*', fingerprint: true\n\n        script {\n            def jobName = env.JOB_NAME\n            def buildNumber = env.BUILD_NUMBER\n            def buildStatus = currentBuild.currentResult ?: 'UNKNOWN'\n\n            def userCause = currentBuild.getBuildCauses('hudson.model.Cause$UserIdCause')\n            def buildUser = userCause ? userCause[0]?.userId : 'GitHub or Timer Triggered'\n\n            def bannerColor = buildStatus.toUpperCase() == 'SUCCESS' ? 'green' : 'red'\n\n            def body = \"\"\"\u003chtml\u003e\n                            \u003cbody\u003e\n                                \u003cdiv style=\"border: 4px solid ${bannerColor}; padding: 10px;\"\u003e\n                                    \u003ch2\u003e${jobName} - Build #${buildNumber}\u003c/h2\u003e\n                                    \u003cdiv style=\"background-color: ${bannerColor}; padding: 10px;\"\u003e\n                                        \u003ch3 style=\"color: white;\"\u003ePipeline Status: ${buildStatus.toUpperCase()}\u003c/h3\u003e\n                                    \u003c/div\u003e\n                                    \u003cp\u003e\u003cstrong\u003eStarted by:\u003c/strong\u003e ${buildUser}\u003c/p\u003e\n                                    \u003cp\u003eCheck the \u003ca href=\"${env.BUILD_URL}\"\u003econsole output\u003c/a\u003e.\u003c/p\u003e\n                                \u003c/div\u003e\n                            \u003c/body\u003e\n                          \u003c/html\u003e\"\"\"\n\n            emailext(\n                subject: \"Pipeline ${buildStatus}: ${jobName} #${buildNumber}\",\n                body: body,\n                to: 'prajwalchapke742@gmail.com',\n                from: 'prajwalchapke742@gmail.com',\n                replyTo: 'prajwalchapke742@gmail.com',\n                mimeType: 'text/html',\n                attachmentsPattern: 'trivy-fs-report.html,dependency-check-report.xml,**/*.html,**/*txt,**/*.xml'\n            \t)\n        \t}\n\t}\n}\n}\n```\n---\n\n## Continuous Deployment with ArgoCD\n1. **Create EKS Cluster**: Use Terraform to create an EKS cluster and related resources.\n2. **Deploy Amazon Prime Clone**: Use ArgoCD to deploy the application using Kubernetes YAML files.\n3. **Monitoring Setup**: Install Prometheus and Grafana using Helm charts for monitoring the Kubernetes cluster.\n\n### Deployment Pipeline\n```groovy\npipeline {\n    agent any\n\n    environment {\n        KUBECTL = '/usr/local/bin/kubectl'\n    }\n\n    parameters {\n        string(name: 'AWS_REGION', defaultValue: 'us-east-1', description: 'Enter your AWS region')\n        string(name: 'AWS_ACCOUNT_ID', defaultValue: '123456789000', description: 'Enter your AWS account ID')\n        string(name: 'ECR_REPO_NAME', defaultValue: 'amazon-prime', description: 'Enter ECR repository name')\n        string(name: 'VERSION', defaultValue: 'latest', description: 'Enter image version tag')\n        string(name: 'CLUSTER_NAME', defaultValue: 'amazon-prime-cluster', description: 'Enter your EKS cluster name')\n    }\n\n    stages {\n\n        stage(\"1. Clone GitHub Repository\") {\n            steps {\n                git branch: 'main', url: 'https://github.com/prajwalchapke055/Amazon-Prime-Clone-DevSecOps-Project.git'\n            }\n        }\n\n        stage(\"2. Login to EKS\") {\n            steps {\n                script {\n                    withCredentials([\n                        string(credentialsId: 'access-key', variable: 'AWS_ACCESS_KEY'),\n                        string(credentialsId: 'secret-key', variable: 'AWS_SECRET_KEY')\n                    ]) {\n                        sh \"\"\"\n                        aws configure set aws_access_key_id $AWS_ACCESS_KEY\n                        aws configure set aws_secret_access_key $AWS_SECRET_KEY\n                        aws configure set region ${params.AWS_REGION}\n                        aws eks --region ${params.AWS_REGION} update-kubeconfig --name ${params.CLUSTER_NAME}\n                        \"\"\"\n                    }\n                }\n            }\n        }\n\n        stage(\"3. Configure Prometheus \u0026 Grafana\") {\n            steps {\n                script {\n                    sh \"\"\"\n                    helm repo add stable https://charts.helm.sh/stable || true\n                    helm repo add prometheus-community https://prometheus-community.github.io/helm-charts || true\n\n                    if kubectl get namespace prometheus \u003e /dev/null 2\u003e\u00261; then\n                        helm upgrade stable prometheus-community/kube-prometheus-stack -n prometheus\n                    else\n                        kubectl create namespace prometheus\n                        helm install stable prometheus-community/kube-prometheus-stack -n prometheus\n                    fi\n\n                    kubectl patch svc stable-kube-prometheus-sta-prometheus -n prometheus -p '{\"spec\": {\"type\": \"LoadBalancer\"}}'\n                    kubectl patch svc stable-grafana -n prometheus -p '{\"spec\": {\"type\": \"LoadBalancer\"}}'\n                    \"\"\"\n                }\n            }\n        }\n\n        stage(\"4. Configure ArgoCD\") {\n            steps {\n                script {\n                    sh \"\"\"\n                    kubectl create namespace argocd || true\n                    kubectl apply -n argocd -f https://raw.githubusercontent.com/argoproj/argo-cd/stable/manifests/install.yaml\n                    kubectl patch svc argocd-server -n argocd -p '{\"spec\": {\"type\": \"LoadBalancer\"}}'\n                    \"\"\"\n                }\n            }\n        }\n\n        stage(\"5. Update Image in manifest.yml\") {\n            steps {\n                script {\n                    def IMAGE = \"${params.AWS_ACCOUNT_ID}.dkr.ecr.${params.AWS_REGION}.amazonaws.com/${params.ECR_REPO_NAME}:${params.VERSION}\"\n                    sh \"sed -i 's|image: .*|image: ${IMAGE}|' k8s_files/manifest.yml\"\n                }\n            }\n        }\n\n        stage(\"6. Deploy Application to EKS\") {\n            steps {\n                script {\n                    // Apply single manifest\n                    sh \"kubectl apply -f k8s_files/manifest.yml\"\n                }\n            }\n        }\n    }\n}\n```\n\n---\n\n## Screenshots of Website\n\n![Screenshot (288)](https://github.com/user-attachments/assets/934be741-4a8a-4ddd-936e-d7899fd33496)\n\n![Screenshot (289)](https://github.com/user-attachments/assets/f9da10e6-04ad-45d8-81d2-d85df3141c1f)\n\n---\n\n## Cleanup\n- Run cleanup pipelines to delete the resources such as load balancers, services, and deployment files.\n- Use `terraform destroy` to remove the EKS cluster and other infrastructure.\n\n### Cleanup Pipeline\n```groovy\npipeline {\n    agent any\n\n    environment {\n        KUBECTL = '/usr/local/bin/kubectl'\n    }\n\n    parameters {\n        string(name: 'CLUSTER_NAME', defaultValue: 'amazon-prime-cluster', description: 'Enter your EKS cluster name')\n    }\n\n    stages {\n\n        stage(\"1. Login to EKS\") {\n            steps {\n                script {\n                    withCredentials([string(credentialsId: 'access-key', variable: 'AWS_ACCESS_KEY'),\n                                     string(credentialsId: 'secret-key', variable: 'AWS_SECRET_KEY')]) {\n                        sh \"aws eks --region us-east-1 update-kubeconfig --name ${params.CLUSTER_NAME}\"\n                    }\n                }\n            }\n        }\n        \n        stage('2. Cleanup K8s Resources') {\n            steps {\n                script {\n                    // Step 1: Delete services and deployments\n                    sh 'kubectl delete svc kubernetes || true'\n                    sh 'kubectl delete deploy pandacloud-app || true'\n                    sh 'kubectl delete svc pandacloud-app || true'\n\n                    // Step 2: Delete ArgoCD installation and namespace\n                    sh 'kubectl delete -n argocd -f https://raw.githubusercontent.com/argoproj/argo-cd/stable/manifests/install.yaml || true'\n                    sh 'kubectl delete namespace argocd || true'\n\n                    // Step 3: List and uninstall Helm releases in prometheus namespace\n                    sh 'helm list -n prometheus || true'\n                    sh 'helm uninstall kube-stack -n prometheus || true'\n                    \n                    // Step 4: Delete prometheus namespace\n                    sh 'kubectl delete namespace prometheus || true'\n\n                    // Step 5: Remove Helm repositories\n                    sh 'helm repo remove stable || true'\n                    sh 'helm repo remove prometheus-community || true'\n                }\n            }\n        }\n\t\t\n        stage('3. Delete ECR Repository and KMS Keys') {\n            steps {\n                script {\n                    // Step 1: Delete ECR Repository\n                    sh '''\n                    aws ecr delete-repository --repository-name amazon-prime --region us-east-1 --force\n                    '''\n\n                    // Step 2: Delete KMS Keys\n                    sh '''\n                    for key in $(aws kms list-keys --region us-east-1 --query \"Keys[*].KeyId\" --output text); do\n                        aws kms disable-key --key-id $key --region us-east-1\n                        aws kms schedule-key-deletion --key-id $key --pending-window-in-days 7 --region us-east-1\n                    done\n                    '''\n                }\n            }\n        }\t\t\n\t\t\n    }\n}\n```\n\n---\n\n## Additional Information\nFor further details, refer to the word document containing a complete write-up of the project.\n\n- Contact Details: Email id =\u003e prajwalchapke055@gmail.com\n- Hosted on Firebase at =\u003e https://prime-clone-2fcfe.web.app/\n\n### Available Scripts\nIn this project directory, you can run:\n\n```bash\nnpm install\n```\nThis command installs all the required dependencies for running the App.\n\n```bash\nnpm start\n```\nRuns the app in the development mode.\n\n```bash \nOpen http://localhost:5000 to view it in the browser. \n```\n\nThe page will reload if you make edits.\nYou will also see any lint errors in the console.\n\n---\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fprajwalchapke055%2Famazon-prime-clone-devsecops-project","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fprajwalchapke055%2Famazon-prime-clone-devsecops-project","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fprajwalchapke055%2Famazon-prime-clone-devsecops-project/lists"}