Create a Lambda service that returns a list of colours
User serverless.com video and reference material, and for this initial task prefer the Node.js option.
MVP will be a tested deployment to an AWS Gateway API for demo consumption
##Later Consider
- deployment within org's AWS infra, IAMs, etc.
- Correlation ID passthrough
- Logging integration
$ brew install node $ node -v v7.2.1 $ npm install serverless -g /usr/local/Cellar/node/7.2.1/bin/serverless -> /usr/local/Cellar/node/7.2.1/lib/node_modules/serverless/bin/serverless /usr/local/Cellar/node/7.2.1/bin/slss -> /usr/local/Cellar/node/7.2.1/lib/node_modules/serverless/bin/serverless /usr/local/Cellar/node/7.2.1/bin/sls -> /usr/local/Cellar/node/7.2.1/lib/node_modules/serverless/bin/serverless [email protected] /usr/local/Cellar/node/7.2.1/lib/node_modules/serverless ��� [email protected] ��� [email protected] ... scads of deps
Adjust $PATH in ~/.bash_profile
$ serverless create -t aws-nodejs
make a few small changes to the serverless.yml file
$ serverless deploy -r eu-west-1 -s dev
go to AWS Lamba console to see the function, and execute it with a boilerplate Json snippet.
In the console, add a Trigger
Select API gateway
Edit the JS
$ serverless deploy -r eu-west-1 -s dev