Build an Slack bot can use for manage Instances or Service on AWS
-
Basic Actions with an Instance
- Turn-on
- Turn-off
- Get status
- Get all tag of RDS and EC2 instances
- Set schedule for turn-on and turn-off instance
- Approval for turn-on and turn-off instance
-
Actions with a System have same name convention
- Turn-on
- Turn-off
- Get status
- Approval for turn-on and turn-off system
- Set schedule for turn-on and turn-off system
- Receive alert when abnormal action
-
Get detail monitoring information
-
Basic Actions with an Instance
- Turn-on
- Turn-off
- Get status
- Set schedule for turn-on and turn-off instance
- Approval for turn-on and turn-off instance
-
Actions with a System have same name convention
- Turn-on
- Turn-off
- Get status
- Approval for turn-on and turn-off system
- Set schedule for turn-on and turn-off system
- Receive alert when abnormal action
-
Get detail monitoring information
Login to your workspace on Slack and go to https://api.slack.com
. In this page, click to button Start Building
to start create new Slack App.
You will see an pop-up like below:
Input the App Name
and select the Workspace
you will use the Slack App. After that, click Create App
button
- In app management page, Select
Slash Commands
in left menu and clickCreate Slash
command
- You will see as below image:
- Input the command like below image:
- The result after create like below:
- In API page click
Install App
in left menu and click to buttonInstall App to Workspace
- Click
Install
button to install app to workspace
- After that you will see as below:
- On Lambda page, click
Create function
- The page will display as below, you must create an role for lambda function
- After create successful you will see the result as below:
- In API Gateway page click to
Create API
button
- Input infomation for API and click
Create API
button
- Create
method
for API by clickCreate Method
button as image below
- Select
POST
method
- You will see result as below
- You can also can see result in the
Design
block from Lambda like below
-
Copy webhook value of Slack channel that you want to make it become Confirmation channel
-
Place this webhook value to
SLACK_APPROVAL_ROOM_WEEBHOOK
constant inconstants.py
file (Aws-Lambda Functions)
- Python 3.6
- AWS CLI