Hello everyone,
I used to host a lot of TF2 servers on AWS, and I was having fun with Terraform + Ansible (studying for work-related things), and decided to create a Terraform module for creating an configuring TF2 servers on AWS.
This is a technical module, so it's developed to be used by other technical people. Let's say you want to create a system that will spawn tf2-servers on demand, you can use this module under the hood.
It's an open-source project, so feel free to contribute and make this better.
Link to the Module: https://registry.terraform.io/modules/sonikro/teamfortress2-server/aws
Link to the Github Project: https://github.com/sonikro/terraform-aws-teamfortress2-server
The documentation is in the project, but to summarize the purpose of this module:
- It will spawn an EC2 instance in the desired VPC
- It will create the security groups necessary for allowing the SRCDS Ports to work (both server and SourceTV)
- It will connect to the machine using Ansible, and Ansible will configure 100% of the OS dependencies necessary to get the server up and running as a SYSTEMD Service
Once the module gets applied successfully, all major information is defined in the Output of the module (IP, SSH Keys and stuff).
You should be able to connect to the server immediately after the module finishes running. The server will not have any extra CFGs/Addons added to it. Just a vanilla TF2 Server.
You can use the outputs of the module to connect to the server and finish up setting the server up as you desire.
If this projects gets traction, I can think about evolving the module to have a competitive flavor, so the server gets spawned with full competitive Addons and CFG.