- Serverless framework
- AWS Account
- Mac, Windows, Linux
- Installing Node.js
check the link Node
You can install
nodejs
. Just run:
# Ubuntu
$ curl -sL https://deb.nodesource.com/setup_8.x | sudo -E bash -
$ sudo apt-get install -y nodejs
# Debian, as root
$ curl -sL https://deb.nodesource.com/setup_8.x | bash -
$ apt-get install -y nodejs
- Installing the Serverless Framework check the link Serverless framework
$ npm install -g serverless
$ serverless --version
- if you don't have yet an account on aws, you need an account to deploy lambda function check the link AWS Account
$ git clone https://github.com/zamirajaupaj/serverless-rekognition-polly.git
$ cd serverless-rekognition-polly
- Change the variables in params.yml
$ sls deploy
$ deactive
$ sls remove
{
"Records": [
{
"eventVersion": "2.0",
"eventTime": "1970-01-01T00:00:00.000Z",
"requestParameters": {
"sourceIPAddress": "127.0.0.1"
},
"s3": {
"configurationId": "testConfigRule",
"object": {
"eTag": "xxxxxxxxxxxxxxxxxx",
"sequencer": "xxxxxxxxxxxxx",
"key": "image.jpg",
"size": 1024
},
"bucket": {
"arn": bucketarn,
"name": "sourcebucket",
"ownerIdentity": {
"principalId": "EXAMPLE"
}
},
"s3SchemaVersion": "1.0"
},
"responseElements": {
"x-amz-id-2": "xxxxxxxxxxxxxxxxxxx",
"x-amz-request-id": "EXAMPLE123456789"
},
"awsRegion": "eu-west-1",
"eventName": "ObjectCreated:Put",
"userIdentity": {
"principalId": "EXAMPLE"
},
"eventSource": "aws:s3"
}
]
}
- Amazon Polly is a service that turns text into lifelike speech
- Text in images
Specifically built to work with real world images, Rekognition can detect and recognize text from images, such as street names, captions, product names, and license plates.
{
"Effect": "Allow",
"Action": [
"s3:GetBucketLocation",
"s3:DeleteObject",
"s3:GetObject",
"s3:GetObjectVersion",
"s3:ListBucket",
"s3:PutObject"
],
"Resource": [
"arn:aws:s3:::bucketname",
"arn:aws:s3:::bucketname/*"
]
}
{
"Effect": "Allow",
"Action": [
"dynamodb:PutItem",
"polly:SynthesizeSpeech",
"rekognition:DetectText"
],
"Resource": [
"*"
]
}