Go to the AWS Console and select DynamoDB
Click on create table and create a table called "agents". The Primary key should be "id" and type string, as in this picture:
Repeat the process for all the tables:
- agents
- domains
- entitys
- intents
- scenarios
- sessions
- settings
- trainings
When you finish you will have all the tables created like this:
Execute this in a folder where you want to work:
$ git clone https://github.com/axa-group/nlp.js-app.git
$ cd nlp.js-app
$ git checkout feature/serverless-lambda
$ npm install
This will download all the code and install the dependencies
You'll need to configure your AWS credentials. As this software is based on serverless, you can follow the documentation of serverless: https://serverless.com/framework/docs/providers/aws/guide/credentials/
Inside your source code folder, run this:
$ npx serverless deploy
This will deploy your backend at serverless and configure your API Gateway At the end of the process, it will returns in console the URL of your API If you go to your AWS console and there you select your lambda, you'll se something like this:
At the end of the process you'll get the URL for your training app! Note it.
Follow the instructions located at: https://aws.amazon.com/es/blogs/security/how-to-create-an-aws-iam-policy-to-grant-aws-lambda-access-to-an-amazon-dynamodb-table/
Or follow this instructions:
Open the IAM console and click on Policies, and then Create Policy
Click on "Choose a Service"
Select DynamoDB, and click on all DynamoDB actions
Select the specific resources that you want your lambda to have access in dynamoDB
Put a name for your policy and finally click on create policy.
Go back to your lambda and click on Permissions and the role name of the lambda
Click on Attach policies
Select your policy and click on Attach Policy
Now you can navigate to your training app, using the URL from 4 or retrieving it from your API Gateway information