A Hubot script for invoking AWS Lambda functions
- Separate invocation privileges from execution privileges.
- New languages will almost certainly be added to AWS Lambda, in this case hubot-lambda would enable easy cross language Hubot integrations. (Amazon recently announced that support for Java Lambda functions are coming soon. https://aws.amazon.com/blogs/aws/aws-lambda-update-production-status-and-a-focus-on-mobile-apps/)
- Potentially a robust mechanism for enabling ad-hoc hubot script additions/modifications without recycling the hubot process. (I'd like some feedback on this one)
Add hubot-lambda to your package.json, run npm install and add hubot-lambda to external-scripts.json.
Add hubot-lambda to your package.json dependencies.
"dependencies": {
"hubot-lambda": "0.0.0"
}
Add hubot-lambda to external-scripts.json.
> cat external-scripts.json
> ["hubot-lambda"]
> export HUBOT_LAMBDA_AWS_ACCESS_KEY_ID="XXXX"
> export HUBOT_LAMBDA_AWS_SECRET_ACCESS_KEY="XXXX"
{
"Version": "2012-10-17",
"Statement": [
{
"Effect": "Allow",
"Action": [
"lambda:InvokeFunction"
],
"Resource": "*"
}
]
}
hubot lambda <functionName> <arg1>
hubot lambda helloWorld Yo
vagrant up
vagrant ssh
cd hubot
./bin/hubot
HUBOT_LOG_LEVEL=debug ./bin/hubot
