{"id":26638151,"url":"https://github.com/dheyyu/text-to-speech-application","last_synced_at":"2026-02-15T02:01:45.256Z","repository":{"id":282587430,"uuid":"949058280","full_name":"Dheyyu/Text-to-Speech-Application","owner":"Dheyyu","description":"This project implements a serverless Text-to-Speech Narrator using AWS Lambda, Amazon Polly, and Amazon S3.  The entire infrastructure is provisioned using Terraform, making it easy to deploy, test, and tear down your environment. This solution provides a great learning experience in building and managing serverless architectures with Terraform.","archived":false,"fork":false,"pushed_at":"2025-03-26T00:37:19.000Z","size":39,"stargazers_count":2,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"main","last_synced_at":"2025-07-27T06:09:09.676Z","etag":null,"topics":["aws","aws-iam","aws-iam-roles","aws-lambda","aws-polly","aws-s3","cloudfront","cloudfront-distribution","css","html","javascript","terraform"],"latest_commit_sha":null,"homepage":"https://d8oqlnxgo22k4.cloudfront.net/","language":"HCL","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/Dheyyu.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-03-15T15:25:58.000Z","updated_at":"2025-04-27T08:41:24.000Z","dependencies_parsed_at":"2025-07-27T05:40:26.784Z","dependency_job_id":null,"html_url":"https://github.com/Dheyyu/Text-to-Speech-Application","commit_stats":null,"previous_names":["dheyyu/text-narrator","dheyyu/text-to-speech-application"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/Dheyyu/Text-to-Speech-Application","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Dheyyu%2FText-to-Speech-Application","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Dheyyu%2FText-to-Speech-Application/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Dheyyu%2FText-to-Speech-Application/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Dheyyu%2FText-to-Speech-Application/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Dheyyu","download_url":"https://codeload.github.com/Dheyyu/Text-to-Speech-Application/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Dheyyu%2FText-to-Speech-Application/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":29465397,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-02-15T01:01:38.065Z","status":"online","status_checked_at":"2026-02-15T02:00:07.449Z","response_time":118,"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":["aws","aws-iam","aws-iam-roles","aws-lambda","aws-polly","aws-s3","cloudfront","cloudfront-distribution","css","html","javascript","terraform"],"created_at":"2025-03-24T17:25:22.607Z","updated_at":"2026-02-15T02:01:45.236Z","avatar_url":"https://github.com/Dheyyu.png","language":"HCL","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Text-to-Speech Narrator with AWS and Terraform\n\nThis project implements a serverless Text-to-Speech Narrator using AWS Lambda, Amazon Polly, and Amazon S3.\n\nThe entire infrastructure is provisioned using Terraform, making it easy to deploy, test, and tear down your environment. This solution provides a great learning experience in building and managing serverless architectures with Terraform.\n\n## Table of Contents\n\n- [Overview](#overview)\n- [Architecture](#architecture)\n- [Project Structure](#project-structure)\n- [Prerequisites](#prerequisites)\n- [Setup and Deployment](#setup-and-deployment)\n- [Testing the Application](#testing-the-application)\n- [Cleanup](#cleanup)\n- [Troubleshooting](#troubleshooting)\n- [Notes and Future Enhancements](#notes-and-future-enhancements)\n- [License](#license)\n\n## Overview\n\nThe core functionality of this project is to convert any provided text into speech using Amazon Polly. The Lambda function accepts text (via a JSON payload), synthesizes speech, uploads the generated MP3 file to an S3 bucket (which is kept private), and returns a pre-signed URL for temporary access to the audio file.\n\n_Note_: Amazon Polly has input size limits (around 3000 characters for plain text). In production or experiments with longer texts, you might need to split the text into smaller chunks.\n\n## Architecture\n\nPICTURE\n\n## Project Structure\n\n. ├── terraform/ │ ├── main.tf # Main Terraform configuration │ ├── variables.tf # Variable definitions │ └── outputs.tf # Output variables (e.g., API endpoints) ├── lambda/ │ ├── lambda_function.py # Lambda function code (text-to-speech conversion) │ └── lambda.zip # Deployment package (generated from lambda_function.py) └── README.md # This file\n\n## Prerequisites\n\nBefore you begin, make sure you have the following installed and configured\n\n- [Terraform](https://www.terraform.io/) (v0.12 or later recommended)\n- [AWS CLI](https://aws.amazon.com/cli/) (configured with appropriate credentials)\n- Python 3.8+ (for developing the Lambda function)\n- Basic knowledge of AWS services (Lambda, S3, IAM, and Amazon Polly)\n\n## Setup and Deployment\n\n### 1. Configure AWS Credentials\n\nEnsure your AWS CLI is configured. For example, run:\n\n```bash\naws configure\n```\nThen provide your AWS credentials to connect your account.\n\n### 2. Provision Infrastructure with Terraform\n\nNavigate to the terraform/ directory and run:\n\n```bash\nterraform init\n```\n\nTo initialalize terraform on your local machine\n\nThen run:\n\n```bash\nterraform validate\n```\n\nTo validate your code is well structured\n\nThen run:\n\n```bash\nterraform plan\n```\n\nTo plan the way the resources would be created\n\nThen finally, run:\n\n```bash\nterraform apply\n```\n\nTo apply those changes and set up the resources.\n\nTerraform will provision the following:\n\n- An S3 bucket (for storing your synthesized audio)\n\n- An IAM Role with permissions for Lambda, S3, and Polly\n\n- A Lambda function that implements the text-to-speech conversion\n\nNote: The S3 bucket ACL is set to private by default, and pre-signed URLs control temporary access.\n\n### 3. Package and Deploy the Lambda Function\n\nIn the lambda/ directory, package your function code:\n\n```bash\ncd lambda\nzip lambda.zip lambda_function.py\ncd ..\n```\n\nEnsure your Terraform Lambda resource points to the correct ZIP file. Then, re-run terraform apply if necessary to update your Lambda deployment.\n\n## Testing the Application\n\nSince this project isn’t exposed via a public website, you can test the Lambda function below:\n\n### A. Via the AWS Console\n\n#### 1. Go to your Lambda function in the AWS Console.\n\n#### 2. Click \"Test\" and set up a new test event with the following JSON payload:\n\n```json\n{\n  \"body\": \"{\\\"text\\\": \\\"Hello, this is a sample text-to-speech conversion.\\\"}\"\n}\n```\n\n#### 3. Invoke the test and inspect the response. A successful response returns a pre-signed URL for the audio file.\n\n## Cleanup\n\nWhen you're finished experimenting and documenting, tear down all the resources by running:\n\n```bash\nterraform destroy\n```\n\nThis command removes all AWS resources that were created for this project.\n\nThen you have successfully created the Text-to-Speech Application.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdheyyu%2Ftext-to-speech-application","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdheyyu%2Ftext-to-speech-application","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdheyyu%2Ftext-to-speech-application/lists"}