hubot-s3-brain
v0.2.0
Published
Stores the brain in Amazon S3
Downloads
153
Readme
hubot-s3-brain
Store the hubot brain in S3.
This is a lightly modified version of hubot-scripts/s3-brain.coffee by IrishStyle. It has been updated to use the AWS S3 SDK package.
Take care if using this brain storage with other brain storages. Others may set the auto-save interval to an undesireable value. Since S3 requests have an associated monetary value, this script uses a 30 minute auto-save timer by default to reduce cost.
Installation
In hubot project repo, run:
npm install hubot-s3-brain --save
Then add hubot-rules to your external-scripts.json:
[
"hubot-s3-brain"
]
Configuration
S3-brain can be configured with environment variables:
HUBOT_S3_BRAIN_ACCESS_KEY_ID
Optional AWS Access Key ID with S3 permissionsHUBOT_S3_BRAIN_SECRET_ACCESS_KEY
Optional AWS Secret Access Key for IDHUBOT_S3_BRAIN_BUCKET
Bucket to store brain inHUBOT_S3_BRAIN_FILE_PATH
Optional path/file in bucket to store brain atHUBOT_S3_BRAIN_SAVE_INTERVAL
Optional auto-save interval in secondsHUBOT_S3_BRAIN_ENDPOINT
Optional alternative S3 API endpoint
It's highly recommended to use an IAM account explicitly for this s3-brain. A sample S3 policy for a bucket named Hubot-Bucket would be:
{
"Statement": [
{
"Action": [
"s3:DeleteObject",
"s3:DeleteObjectVersion",
"s3:GetObject",
"s3:GetObjectAcl",
"s3:GetObjectVersion",
"s3:GetObjectVersionAcl",
"s3:PutObject",
"s3:PutObjectAcl",
"s3:PutObjectVersionAcl"
],
"Effect": "Allow",
"Resource": [
"arn:aws:s3:::Hubot-Bucket/brain-dump.json"
]
}
]
}