

I recommend you the t2.small for Minecraft. From the EC2 dashboard, click on Launch Instance and choose the Amazon Linux 2 AMI with the x86 option. This is the initial part, you must create a new EC2 instance.

send an e-mail to a specific and secret e-mail address, this will start the instance.

#Amazon aws minecraft server host how to#
This article will explain you how to optimize the cost 😜, based on the usage! After checking some available services (yeah not so expensive finally), I have chosen to build a server on a EC2 instance. You could have a script running on the Minecraft server that monitors the game and, after a period of inactivity, simply calls the operating system to perform a Shutdown.During the first weeks of the COVID-19 pandemic, back in april 2020 my son ask me to build a Minecraft server in order to play on the same world with his school friend. The library you referenced might be able to assist with finding a way to do this. Stopping the server after a period of non-use is a different matter. They will not provide the secret, so the server will not be started. The purpose of the secret is to avoid the server from starting if an unauthorized person (or a bot) happens to hit the API Gateway endpoint. Here is a tutorial that shows many of these concepts: Build an API Gateway API with Lambda Integration The Lambda function confirms that the secret is correct and starts the Amazon EC2 instance with Minecraft installed.The API Gateway will call the Lambda function, passing the secret.Give a URL to your friends that calls the API Gateway and passes a 'secret' (effectively a password).Create an API Gateway that triggers the Lambda function.Create an AWS Lambda function that turns on the server.Whether you willing to give your friends AWS credentials (not a good idea) that they could use to start the server directly, or whether it should be an indirect method.įrankly, I would recommend the following architecture:.Whether only authorized users should be able to trigger the Lambda function, or is it okay that anybody (eg a web crawler) might trigger it.When considering a method to use, you should consider security implications such as: Trigger an Amazon CloudWatch Alarm (which calls Lambda via SNS).Somehow put a message in an SNS topic or an SQS queue.There are a few ways you could have users trigger the AWS Lambda function: Therefore, another mechanism is required that can be used to start the server.Ĭombine that with your desire to minimise costs and the only real solution is to somehow trigger an AWS Lambda function, which could start the server. If the server is off, it would not be possible to "connect" to the server.
