Sometimes back I was working on a free notification system using Telegram Bot (https://telegram.org/blog/bot-revolution), and I wrote a simple function in PowerShell, which could be use in various ways for sending instant notification to any smartphone for free (http://bit.ly/2ys1gF5).
I thought what else we could do with it, and I have got an idea to use it as AWS Automation Bot to perform simple tasks. I have created a set of instructions for a Bot using PowerShell script which we could use to perform the following tasks instantly instead of doing it from AWS console.
- Getting instance details using instance name.
- Getting attached volume details using instance name.
- Getting list of the available snapshots for a instances using instance name.
- Getting the console screenshot for troubleshooting using instance name.
- Getting the console log for troubleshooting using instance name.
- Start an instance using instance name.
- Stop an instance using instance name.
- Restart an instance using instance name.
Note: Start/Stop/Restart option will not be available for all, this Bot will be part of a Telegram Group, and only existing user who already have the permission for this can grant these permission to someone else. This is additional layer security control I have created to avoid unauthorized system state modification.
If you really interested to give it a try, please follow the steps bellow.
- Download Telegram on your mobile from marketplace (available on all the platform)
- Visit the following link to join the Demo Group.
- As soon as you are in the group, use /help to get what are the instruction you can give to the bot.
- Please provide feedback here.
Tips: Since I am using free AWS environment, I am limited to use 30 GB of volume, so, I have created three AWS Linux instances in three different regions (Sydney/Virginia/Oregon), name of them are TELTSTSYD for Sydney, TELTSTVIR for Virginia and TELTSTORE for Oregon. All the instructions are applicable against instance name, not the instance ID, e.g. /info=TELTSTSYD to know the instance details. Currently there is no snapshot available for any of the instances as it will be beyond my free limit. Always make sure your executing the commands on correct region. Additionally, this demo environment currently available during 8:00 AM AEST to 10:00 PM AEST to avoid unnecessary changes on my Azure Subscription.
Note: This bot is running from my own server hosted on my personal Azure Subscription, also the AWS environment where the demo configured is my personal AWS Account. Only purpose I have created this environment is to demonstrate this feature and usability of this bot and the automation process.
If you are interested further, then please do let me know here in the comments, I will share my code and configuration details if I see the demand.
UPDATE 1: Added a new video demo.
UPDATE 2: This project now open source, and available under GitHub : https://github.com/iAmSaugata/TelegramBotForAWS
Disclaimer: All posts and opinions on this site are provided AS IS with no warranties. These are our own personal opinions and do not represent our employer’s view in any way.
This article currently have 6,847 views
I am an IT Professional with 12+ years of experience in Windows, Storage, Backup, AWS and Azure. I love writing scripts using PowerShell. I loved to share my experience with rest of the world via this blog. I love my Echo Dot (3G). I love playing PUBG on my mobile.
This work is licensed under a Creative Commons Attribution-NoDerivatives 4.0 International License.