apod-slack-lambda

The Astronomy Picture of the Day via Slack, with a little help from AWS Lambda

Usage no npm install needed!

<script type="module">
  import apodSlackLambda from 'https://cdn.skypack.dev/apod-slack-lambda';
</script>

README

apod-slack-lambda

Send yourself the Astronomy Picture of the Day via Slack, with a little help from AWS Lambda.

I created this to learn how to use Lambda to schedule a simple task. I wanted the configuration to live in version control, and the whole thing to be deployed automatically, so I decided to use ThoughtWorks Studios' nice library node-aws-lambda.

I added functionality to automatically configure Lambda functions with scheduled events, which I later moved into its own package, node-aws-lambda-scheduler.

Deployment

  1. Clone this repository.
  2. Set up your AWS credentials in ~/.aws/credentials, if you haven't already.
  3. If necessary, create an IAM role for Lambda execution.
  4. Configure your Lambda execution IAM role in config/default.yml.
  5. Optional: Adjust the ScheduleExpression in config.default.yml.
  6. Configure an incoming webhook integration in Slack. Copy ./config/local.template.yml to ./config/local.yml, which is gitignored, and fill it in.
  7. Optional: To avoid rate limits with NASA's demo key, obtain your own NASA API key and configure it in ./config/local.yml.
  8. Deploy: node_modules/.bin/gulp deploy

Contribute

Pull requests welcome!

Support

If you are having issues, please let me know.

License

The project is licensed under the MIT license.