Berkmann18 / DiscordBot

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

AWS-Discord-Bot

Discord bot used for managing AWS instances including status and toggling on or off via chat commands in a Discord text channel. This is based on https://github.com/JamesMatchett/AWS-Discord-Bot.

Setup

Create a .env file with the following keys (make sure to replace the values with your AWS and Discord ones):

BOT_TOKEN=Your_Discord_bot_Token_here
ROLEID=Discord_Role_ID_for_the_role_that_can_use_the_bot
CHANNELID=Discord_Channel_ID_of_the_text_channel_where_the_bot_will_be_controlled_from
ACCESSKEY=AWS_Access_Key
SECRETKEY=AWS_Secret_Key
INSTANCE=EC2_instance_ID
MESSAGELOGGING=F #Or T for specific error messages logged tp the Discord channel which may contain sensitive info like keys and instance IDs

Usage

Run the following in the target CLI:

npm start

Discord commands

Commands:

/aws start (Starts the specified instance)
/aws stop (Stops the specified instance)
/aws status (Returns status information about the instance, i.e. if it is running, it's IP, it's last startTime)
/aws info (General information about the instance)

You, and anyone else you give the role and channel access to, should be able to toggle the selected AWS instance on or off when needed as well as view instance information on demand.

About

License:MIT License


Languages

Language:JavaScript 55.7%Language:HCL 40.2%Language:Shell 4.0%