This repository provides a comprehensive guide to setting up a multi-account CI/CD pipeline using AWS CDK for deploying a serverless image recognition application. The project automates infrastructure deployments across development and production environments, ensuring consistency and scalability using AWS services such as Lambda, S3, Rekognition, DynamoDB, and CodePipeline.
The goal of this project is to showcase how to build a multi-account CI/CD pipeline using AWS CDK to manage and deploy resources for an image recognition application. The pipeline integrates with GitHub for source control and deploys Lambda functions, S3 buckets, and DynamoDB tables for processing images using AWS Rekognition.
- Fully automated CI/CD pipeline using AWS CodePipeline and CodeBuild.
- Serverless image recognition leveraging AWS Rekognition for detecting objects and labels in images.
- Multi-account setup with deployments to both development and production environments.
- Cross-account role management for secure deployments between accounts.
- GitHub integration for source control and continuous deployment.
The following AWS services are used in this project:
- AWS Lambda: Processes images by calling AWS Rekognition for label detection.
- Amazon S3: Stores the uploaded images and triggers Lambda functions on object creation.
- Amazon Rekognition: Performs image analysis and detects objects or labels in images.
- Amazon DynamoDB: Stores the results of the image analysis, such as detected labels.
- AWS CodePipeline: Manages the CI/CD pipeline for deploying infrastructure and Lambda code.
- AWS CodeBuild: Builds the application and synthesizes the CDK app for deployment.
- AWS account with sufficient privileges to create and manage resources.
- CDK toolkit installed (
npm install -g aws-cdk
). - AWS CLI configured on your machine.
- GitHub account for repository integration.
- Clone the repository to your local machine:
- Install dependencies for Lambda function (if needed):
- Install project dependencies:
- Configure AWS credentials:
- Deploy the resources in your development account:
git clone https://github.com/amitraikkr/AWS-CDK-Multi-Account-Pipeline-for-Serverless-Image-Recognition-App.git
cd lambda && npm install
npm install
aws configure
cdk deploy
- Upload an image to the S3 bucket created by the stack.
- Lambda function is triggered to process the image using Rekognition.
- Results are stored in DynamoDB, and you can query the detected labels and objects.
Contributions are welcome! Please fork this repository and submit a pull request with your improvements.
For more content like this, follow me on: