Skip to content
This repository has been archived by the owner on May 17, 2021. It is now read-only.

AWS Lambda function / Docker image to notify EC2 Scheduled Events to Slack

License

Notifications You must be signed in to change notification settings

dtan4/ec2-event-slack-notifier

Repository files navigation

EC2 Event Slack Notifier

Build Status

AWS Lambda function / Docker image to notify EC2 Scheduled Events to Slack

image

You can install this function as...

  • Serverless function
  • a part of Apex project
  • standalone function
  • Kubernetes CronJob

Usage

Environment variables

key description
AWS_ACCESS_KEY_ID AWS access key ID
AWS_SECRET_ACCESS_KEY AWS secret access key
AWS_REGION AWS region
WEBHOOK_URL Slack webhook URL
TZ timezone (tz database zone name) e.g., Asia/Tokyo

1. Serverless function

$ git clone https://github.com/dtan4/ec2-event-slack-notifier.git
$ cd ec2-event-slack-notifier
$ yarn
$ cp serverless.yml.example serverless.yml
$ vim serverless.yml
$ npm run deploy

2. Apex project

Add ec2-event-slack-notifier to your Apex project:

$ git submodule add https://github.com/dtan4/ec2-event-slack-notifier.git functions/ec2-event-slack-notifier

Deploy it:

$ apex deploy ec2-event-slack-notifier

3. Standalone

Preparing... 👷

4. Kubernetes CronJob

Set these Secrets:

name key description
dotenv AWS_ACCESS_KEY_ID AWS access key ID
dotenv AWS_SECRET_ACCESS_KEY AWS secret access key
dotenv AWS_REGION AWS region
dotenv WEBHOOK_URL Slack webhook URL
dotenv TZ timezone (tz database zone name) e.g., Asia/Tokyo

deploy CronJob resource:

kubectl create -f kubernetes/cronjob.yaml [-n NAMESPACE]

ec2-event-slack-notifier Job will be invoked at 0:30 GMT in default.

Author

Daisuke Fujita (@dtan4)

License

MIT License

About

AWS Lambda function / Docker image to notify EC2 Scheduled Events to Slack

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published