The APIs, which are called any time you interact with the web-based application, execute actions on your EC2 instances based on EC2 Tags applied to them so you can add these Tags to additional hosts in your AWS account and control them all with a single click in the application.Īll the source code for this solution is located in Github here. By supplying a different BASH script on launching this solution you can feasibly host any dedicated game server, and continue swapping out the BASH scripts like you would a game cartridge. The solution provided here has defaults that launch a Valheim server from a BASH script and have the server firewall (EC2 Security Groups) opened on ports specific to Valheim. You can use this solution to control other game servers with some additional scripting. The solution in this blog post is also extensible. You can add scripts to your Valheim server to further automate certain tasks like updating the server version, or you can just forget about modifying any of it and simply hit some buttons on the pre-built webpage to start/stop/resize the server and play some Valheim! You can dig into the Lambda code (Python if you’re interested) and make it do other interesting stuff. You can choose to have as much or as little control over this solution as you choose. We include some guides on how to do this later on. Similarly, you can change the backup frequency and duration that backups are kept via the AWS Backup service in the AWS console after deploying the solution via the AWS CloudFormation script. You can choose the time the server will shutdown each day either when running the initial setup or afterwards via the Amazon Eventbridge service in the AWS console. We setup a regular backup service to take incremental backups of your server every day and to store those for 7 days just in case you want to restore your server to a previous state. We also create an optional rule to shutdown your server at a certain time every day just in case you forget to ensure you don’t pay for resources you are not using. Security of this webpage is controlled by Amazon Cognito with user accounts created directly in Amazon Cognito after the solution is deployed using AWS CloudFormation. information about server status) are accessible through a webpage that is created and deployed for you by the CloudFormation script. Resize server – this allows you to change the EC2 instance type so that you can only use (and therefore pay for) the instance size you need at that point in time.Īll the API actions above along with the current server metadata (i.e. You will still incur costs for the EBS volume storage and backup storageģ. Stop server – this stops the server and means you stop incurring costs for the EC2 instance. Start server – this boots up the server and updates the DNS entry with the new public IP address of the serverĢ. The solution we have designed adds a serverless control layer to the gaming server with an API to allow 3 actions:ġ. We use the popular game Valheim in this example, however this solution is applicable to any game and just requires some parameter changes – details on how to do this are covered later in this guide. We will also show you how to easily start or stop your server so that you only pay for what you use and benefit from cloud elasticity. This allows one to scale up for a party session on the weekend and then back down again in just a few clicks. In this post we will show you how to achieve both a low cost and high security solution while also providing the added benefit of flexibility to resize the server from a single core and 0.5 GiB of memory all the way to the biggest servers AWS has to offer and back down again. To overcome these challenges players often look to dedicated game-server companies which provide varying degrees of control over the underlying server such as requiring fixed server sizes, giving limited access to mods, or simply charging you a flat monthly fee no matter how much you utilize the server. Playing a game while also hosting the server for it can be a heavy task for any computer, so often players see the best performance while running a server and client on separate machines. To achieve low cost many people host a server on their home computer, requiring them to open up their home network firewall ports in the process and exposing their computer to the wider internet and the associated security risks. Hosting your own personal gaming server is increasingly common given all the benefits and flexibility it provides, however, doing so in a secure, flexible, and cost-effective manner is not simple. Authored by Duncan Parsons and Patrick Palmer
0 Comments
Leave a Reply. |