CloudLingo-A-Serverless-Language-Translator-with-AWS-Translate-and-Lambda

🌍 CloudLingo: A Serverless Language Translator with AWS Translate and Lambda

Author: Bernard Kwame Solodzi
Date: 2025-09-01


πŸ“Œ Features


Introduction

CloudLingo is an automated translation pipeline using AWS services. JSON files containing text are uploaded into an S3 Request Bucket, which triggers a Lambda function. The Lambda reads the file, uses Amazon Translate to convert the text into the target language, and stores the translated output in an S3 Response Bucket.

This project demonstrates event-driven architecture on AWS to solve real-world problems, eliminating manual translation and enabling automated, scalable, and cost-effective multilingual support.


πŸ—οΈ Architecture

Architecture Diagram

Flow:

  1. A JSON file is uploaded to the Input S3 Bucket.
  2. S3 Event Notification triggers the Lambda function.
  3. The Lambda function:
    • Reads the file.
    • Sends text to Amazon Translate.
    • Stores translated results in the Output S3 Bucket.
  4. The output file is saved as filename-output.json.

Table of Contents

  1. Introduction
  2. Architecture
  3. Prerequisites
  4. Objectives
  5. Step 1: Deploy Resources with CloudFormation
  6. Step 2: Review IAM Role and Policies
  7. Step 3: Lambda Function Configuration
  8. Step 4: Test the Translation Pipeline
  9. Monitoring
  10. Challenges and Lessons Learned
  11. Conclusion
  12. References

Prerequisites

Ensure the following are installed:

CLI Configurations


Objectives

  1. Automate S3-triggered Lambda-based translation using AWS Translate.
  2. Use CloudFormation to create:
    • S3 buckets with lifecycle policies
    • Lambda execution role with scoped IAM permissions
    • Lambda deployment from zip file
    • S3 event notification trigger for Lambda
  3. Package and deploy Python-based Lambda zip
  4. Log outputs to CloudWatch
  5. Save translated files into a different S3 bucket

Step-by-Step Guidelines


Step 1: Deploy Resources with CloudFormation

All scripts and templates used in this project are openly available in this repository, feel free to use all files to reproduce this project.

  1. Use the provided CloudFormation template (translation-setup-with-lambda.yaml) to provision all required AWS resources:
    • S3 Request Bucket (input)
    • S3 Response Bucket (output)
    • Lambda function
    • IAM roles and policies
    • S3 event notification trigger
  2. In the AWS Console, go to CloudFormation β†’ Create stack β†’ Upload a template file.

  3. Follow the prompts to deploy the stack.
    • You can review and customize parameters (bucket names, Lambda environment variables, etc.) as needed.

CloudFormation Created Stacked


Step 2a: Review IAM Role and Policies

IAM Role with Policies Attached

Step 2b: Review the Request S3 bucket to be sure the an s3 event notification event was properly configured as shouw below

IAM Role with Policies Attached


Step 3: Lambda Function Configuration

Lambda Function


Step 4: Test the Translation Pipeline

  1. Upload a JSON file in the format below into the Request Bucket:
{
  "source_language": "en",
  "target_language": "fr",
  "text": "Hello, this is my 2nd capstone project, this is from lambda!"
}

Request Bucket with files to be translated

  1. Check the Response Bucket for an output file (e.g., test-output.json):
{
    "source_language": "en", 
    "target_language": "fr", 
    "original_text": "Hello, this is my 2nd capstone project, this is from lambda!", 
    "translated_text": "Bonjour, c'est mon deuxième projet de synthèse, il vient de Lambda!"
}

Response Bucket with translated files


Translated Output Screenshot

Another Test

Translated Output Screenshot


Monitoring

Metrics on Lambda Function

CloudWatch Metrics on Lambda Function CloudWatch Metrics on Lambda Function

Metrics from AWS Translate Dashboard

AWS Translate Dashboard AWS Translate Dashboard

Challenges and Lessons Learned

Conclusion

This project demonstrates how AWS serverless services can work together to create an automated translation system. With S3 for storage, Lambda for processing, and Translate for language conversion, CloudLingo provides a scalable, cost-effective, and event-driven pipeline. It eliminates manual translation steps and makes it easy to support multilingual workflows in real time.

References