Run npm install
to install all the needed dependencies.
This project is developed from a react basis so it's javascript based. Because this script will run from a Lambda function, we have to transform it into a Node.js interpretable code. In order to do so, we use Babel
Run npm run build:preprocess
to transform the javascript project into a Node.js executable one.
The build artifacts will be stored in the dist-preprocess
directory.
You need to set up a lambda function but before then, you have to create an IAM role with the "LambdaExecute" role. For the lambda creation, choose the Node.js 8.10 runtime and the role you just created.
Then, you have to import the dist-preprocess folder you created thanks to babel. Don't forget to compress it !
Once it's done, you have to type in the Handler, it should be dist-preprocess/scripts/Preprocess.default
for this specific project.
Then, you can create a cron job in order to execute the function on a regular basis. You can get help here
- babel-cli
- babel-plugin-transform-async-functions
- babyparse
- jquery
To get more help on Babel go check out the Babel README.
If you have require issues when launching the lambda function, you need to run npm i into the dist-preprocess folder.