Hato is programmable notification for esa.io and Slack using Lambda and API Gateway.
(illustlated by いらすとや)
Go to AWS Console and create a new IAM role that has AWSLambdaBasicExecutionRole
.
And wrote .env
:
AWS_ENVIRONMENT=development
AWS_PROFILE=
AWS_SESSION_TOKEN=
AWS_REGION=ap-northeast-1
AWS_FUNCTION_NAME=hato
AWS_HANDLER=index.handler
AWS_MEMORY_SIZE=128
AWS_TIMEOUT=60
AWS_DESCRIPTION=
AWS_RUNTIME=nodejs4.3
AWS_VPC_SUBNETS=
AWS_VPC_SECURITY_GROUPS=
EXCLUDE_GLOBS="event.json"
PACKAGE_DIRECTORY=build
AWS_ACCESS_KEY_ID=your_access_key
AWS_SECRET_ACCESS_KEY=your_secret_access_key
AWS_ROLE_ARN=aws_role
Go to Slack settings page and create "Incoming WebHooks".
And wrote deploy.env
:
SLACK_WEBHOOK=webhook_url
Write rule.js
:
smodule.exports = [
{ pattern: 'Users/mzp', channel: '#current_mzp' },
// fallback rule
{ pattern: '', channel: '#notification' }
]
docker-compose build
docker-compose up
Go to AWS Console and create API gateway related with hato-development lambda function.
Go to esa admin page, and setup generic webhook.
mzp