🧠 Building an Event-Driven Facial Analysis App with AWS Rekognition

Abdul RaheemAbdul Raheem
2 min read

🔍 Project Overview

Project Name: Event-Driven Facial Analysis
Core Services: S3, Lambda, Rekognition, DynamoDB, IAM
Architecture Style: Event-driven, serverless
Difficulty: Easy/Medium
Cost: Free-tier friendly


💡 Problem Statement

Facial analysis is being widely used today in areas like:

  • Identity verification

  • Security & surveillance

  • User behavior analytics

Most facial detection tools are either costly or complex to integrate. My goal was to build a simple but scalable cloud-native solution to process user-submitted images in real-time.


🏗️ Architecture Diagram

Here’s a breakdown of the flow:

  1. User uploads a photo to an S3 bucket

  2. S3 triggers a Lambda function

  3. Lambda calls Amazon Rekognition to analyze the face

  4. Extracted metadata (age, emotions, etc.) is saved in DynamoDB


🔧 Services Used

ServiceRole
S3Stores the uploaded images
LambdaServerless compute to trigger facial analysis
RekognitionDetects facial attributes (eyes open, emotions, age range, etc.)
DynamoDBStores structured metadata for later use
IAMManages permissions for S3 triggers, Rekognition, and DynamoDB access

💥 Key Challenges

  1. IAM Permissions Hell 😵

    • Rekognition couldn’t read the S3 object: Fixed by allowing s3:GetObject to Rekognition

    • Lambda couldn’t write to DynamoDB: Solved using a custom inline policy

  2. Understanding Event Payloads

    • Learning how the S3 event JSON is structured was crucial for parsing image names
  3. Dealing with S3 Key Encoding

    • Filenames with spaces caused issues → replaced + with space or used urllib.parse.unquote

✅ Final Result

  • Upload an image to S3, and boom 💥

  • Face metadata (like AgeRange, Emotions, EyesOpen) appears in DynamoDB instantly!

  • All 100% serverless with minimal cost and maximum scalability.


📂 GitHub Repository

🔗 Event-Driven Facial Analysis on GitHub

Feel free to clone it, improve it, or use it in your own cloud portfolio!


🔥 Lessons Learned

  • IAM is tricky but mastering it is non-negotiable

  • Rekognition is insanely powerful and simple to use

  • Serverless event-driven apps are a game-changer for real-time use cases


🚀 What’s Next?

I'm building a complete AWS Projects Portfolio — real-world apps using real AWS services — not just "hello world" stuff.
Next stop: AI Customer Service Bot using Bedrock/SageMaker!

Follow my journey at 👉 abdulraheem.hashnode.dev
Or connect on GitHub 👉 github.com/abdulraheem381


💬 Have Questions?

Let me know in the comments
Happy building, and see you in the cloud ☁️


0
Subscribe to my newsletter

Read articles from Abdul Raheem directly inside your inbox. Subscribe to the newsletter, and don't miss out.

Written by

Abdul Raheem
Abdul Raheem

Cloud DevOps | AWS | Terraform | CI/CD | Obsessed with clean infrastructure. Cloud DevOps Engineer 🚀 | Automating Infrastructure & Securing Pipelines | Bridging Gaps Between Code and Cloud ☁️ I’m on a mission to master DevOps from the ground up—building scalable systems, automating workflows, and integrating security into every phase of the SDLC. Currently working with AWS, Terraform, Docker, CI/CD, and learning the art of cloud-native development.