An open API service indexing awesome lists of open source software.

https://github.com/pajaydev/aws-chatbot-custom-notifications-example

Send custom notification from AWS Step function to Slack using AWS Chatbot
https://github.com/pajaydev/aws-chatbot-custom-notifications-example

aws aws-chatbot aws-step-functions chatbot notifications slack

Last synced: about 2 months ago
JSON representation

Send custom notification from AWS Step function to Slack using AWS Chatbot

Awesome Lists containing this project

README

          

# AWS Chatbot Custom Notification

This project demonstrates how to customize and send a [custom notification](https://docs.aws.amazon.com/chatbot/latest/adminguide/custom-notifs.html) message from AWS Step function to slack via AWS Chatbot.

## Prerequisite

* Configure [AWS CLI](https://aws.amazon.com/cli/) and configured it with your credentials
* Should have an AWS account and have set up your [AWS credentials](https://docs.aws.amazon.com/cli/latest/userguide/cli-configure-files.html)
* Go to AWS Chatbot(https://console.aws.amazon.com/chatbot/) and perform OAuth to configure a slack workspace. Kindly follow this instructions in [step 1](https://docs.aws.amazon.com/chatbot/latest/adminguide/slack-setup.html#slack-client-setup)

## Setup

Clone this repo:
```bash
git clone https://github.com/pajaydev/aws-chatbot-custom-notifications-example.git
```

Build this app using below commands:
```bash
npm install -g aws-cdk
npm install
npm run build
```

Configure environment variables - Replace `.env` file in this project with slack workspace Id and channel Id

## Deployment

Synthesize the CloudFormation template using below command:
```bash
cdk synth
```

Deploy the stack using below command:
```bash
cdk deploy
```

## Trigger a Notification

Trigger the deployed step function using below command

```bash
./scripts/trigger-step-function.sh
```

## Result

## Clean Up

To clean up, issue this command:
```bash
cdk destroy
```

## Troubleshooting

Kindly create an issue if you face any issues

## Useful commands

* `npm run build` compile typescript to js
* `npm run watch` watch for changes and compile
* `npm run test` perform the jest unit tests
* `cdk deploy` deploy this stack to your default AWS account/region
* `cdk diff` compare deployed stack with current state
* `cdk synth` emits the synthesized CloudFormation template