EC2 Starter is a Discord bot which starts your stopped EC2 instance on command.
I built this bot to allow my friends to start my Minecraft server from our Discord server. With that end in mind, it is meant to be lightweight, so it can run 24/7 with little cost; thus, you may find it missing some features you'd like. You are welcome to request these, but they may not get implemented.
If you need to quickly and easily start up an EC2 instance, this service may be for you.
This project is in early development. You are welcome to try it out, but expect things to break.
- Create a Discord application and a bot user for the app.
- Generate a bot token for the user. Copy this token and store it securely.
- Create an IAM user.
At minimum, this user needs the
StartInstances
andStopInstances
permissions for EC2. Generate an access key pair, and store the secret token somewhere securely. - Clone this repository.
git clone [email protected]:merenze/EC2Launcher.git cd EC2Launcher
- Configure your application. Copy config.example.yml to config.yml.
Paste your bot's token into the
token
field. Paste your IAM user's access key ID into theaccessKeyId
field. Paste your IAM user's secret access key into theaccessKeySecret
field. Enter your AWS region into theregion
field.Under thetoken: "your-bot-token" accessKeyId: "your-access-key-id" accessKeySecret: "your-secret-access-key" region: "us-east-1"
instances
field, name each instance with a key and provide the ID for that instance.instances: uno: id: `my-ec2-instance-id-1` dos: id: `my-ec2-instance-id-2`
- Build and run the application with Docker.
Alternatively, you can build and run with
docker build -t ec2starter . docker run -d ec2starter
npm
:npm i npm start
- Invite your bot to your server, with permission to read and send messages.
- In a channel your bot has permission to view, execute
/start <instance key>
, with theinstance
option set to a key defined in your config. Your bot should start the EC2 instance.
This project is only accepting pull requests for issues with the help wanted
label.
Feel free to open discussions, report bugs, and request features.