Read this in Türkçe.
This is the first part of our NLP with AWS series. We are going to develop a web application without using any server or container but only AWS Serverless services. We are going to use Polly, Lambda, API Gateway, S3 ve DynamoDB and Javascript ES7 as backend language.
Serverless-Polly is a "Text-to-Speech" application runs entirely under AWS Serverless tools. It gets a text from a static web UI and saves it to DynamoDB through a Lambda function (newpost). After record has been saved, it is sent to a new Lambda function (convertaudio) via DynamoDB Streams. This record then sent to Polly to get a speech audio stream and that stream saved to an S3 bucket for later use. 3rd lambda function (getpost) is used for getting these processed mp3 files to same static web UI.
For the deployment of serviecs and web application, we are going to follow "Infrastructure as Code" principles. Amazon CloudFormation and Serverless Framework will help to make sure all these services deployed correctly.
Before we get to the details, it is really easy to install and run the project. You just need to do:
- Create an AWS account and create a user that has AccessKey and Secret
- Node.js v8.11.1
- Open a terminal window and type
npm install serverless -g
npm install
serverless deploy
- Update API Gateway endpoint inside
static/scripts.js
- Upload
static/
folder to newly created S3 bucket viaaws s3 sync --acl public-read static/ s3://S3BUCKETNAME
Live application example:
All services that we have used in this project are AWS's as a service
solutions. All the infrastructure are handled by AWS but of course architecture and usage's of these services needs to be the responsibility of the developer. You can find the service diagram of application below: