This is a minecraft server, but also an excuse to use a bunch of different AWS services to learn them.
This is a basic server behind API gateway. It handles starting/stopping the EC2 instance running the Minecraft server, as well as querying the current status of the server.
This lambda gets triggered by Cloudwatch Logs whenever the Minecraft server logs a message matching "___ (joined|left) the server". It triggers a "shutdown procedure" when the last player disconnects from the server, and handles cancelling the procedure if someone re-joins before shutdown completes.
This is a very small function that makes a POST /stop
request to mc-api
. The lambda gets triggered by AWS Step Functions, after a 5-minute delay (that is the "shutdown procedure").
There is a very basic static website that makes calls to mc-api
to display the server status, and start/stop it on command. It is built using Svelte.
The docker-compose.yml
contains the configuration for the minecraft server. It controls what modpack to load, what ports to expose, etc.