/coffee-button

An Amazon Lambda function that publishes messages to a Slack channel when an Amazon IoT button is pressed.

Primary LanguagePythonApache License 2.0Apache-2.0

coffee-button

Build Status Apache V2 License

An Amazon Lambda function that publishes messages to a configured Slack channel when an Amazon IoT button is pressed.

Table of Contents

Configuration

The following environment variables can be used to dictate which Slack webhook URL and channel are used:

  • COFFEE_BUTTON_SLACK_WEBHOOK_URL: Slack webhook URL
  • COFFEE_BUTTON_SLACK_CHANNEL: Slack channel to send messages to
  • COFFEE_BUTTON_FUNCTION_ALIAS: When deploying, the alias associated with the Lambda function

Testing

Function testing occurs within a Docker container and is driven by make:

$ make test

Deployment

Function deployment occurs automatically via Travis CI. If you choose to execute deployments manually, run through the following steps:

$ export COFFEE_BUTTON_SLACK_WEBHOOK_URL="https://hooks.slack.com/..."
$ export COFFEE_BUTTON_SLACK_CHANNEL="#general"
$ export COFFEE_BUTTON_FUNCTION_ALIAS="staging"
$ export AWS_SECRET_ACCESS_KEY="..."
$ export AWS_ACCESS_KEY_ID="..."
$ make deploy

This deployment process makes use of make and Apex to publish the function to Amazon Lambda.