# charon-relay-fastly

If you are getting "Invalid parameter: Message too long" errors then you need to reduce the batch size.
Batch size can be found in src/aws/sns.ts on line 9. Rule of thumb is to reduce the batch size by half.

Build your project and deploy:
1) Grab nodenv if you dont already have it:
    https://github.com/nodenv/nodenv
    nodenv install 8.12.0

2) npm install -g yarn in the charon-relay-cloudwatch folder, 

3) yarn install

4) sls package. if you need to install npm install -g serverless

5) once you have the charon-relay-fastly.zip in the ./.serverless folder you can run the ./deploy.sh script in the root of the project. This will upload the zip to the lambda

Troubleshooting:

The biggest problem I had was getting my environment to the correct versions to build. 

Node version:
If you get an error similar to this during yarn install:
    error @twitch/arcana@1.1.3: The engine "node" is incompatible with this module. Expected version ">=8.12.0 <13.0.0". Got "13.11.0"

Means yarn is using the wrong node version. You can check what version you are using by doing node -v 
If you need to switch versions you can do nvm install 10.6.0 (this will satisfy all dependencies when building)

Serverkess Errors:
When packaging, serverless threw the following: 
    Error: npm install failed with code 1

I had found that I was not using the proper version of node, so switch to 10.6.0 (nvm use 10.6.0 OR if that doesnt work nvm install 10.6.0)
Then run a npm install then sls package
