Counter Strike: Global Offensive
This repository contains the required code to be able to spin up a game server, in a DevOps way.
At the end you will got an ec2 instance in your configured AWS account with an installed Counter Strike: Global Offensive server, in automatic way. This code was used to create a virtual team-building.
- Automatic Games Server - Counter Strike: Global Offensive server
- Table of contents
AWS account (has free tier - credit card required) is a requirement, as this terraform code will create resources on it. Please pay attention for PRE-REQUIRED! section at the end of this readme (Inputs), especially:
- key_name
- shared_credentials_file
- private_key
Check the following markdown documentation.
Before you start to use this code, terraform must to be installed. Please follow official guides about how to install it. If it was done, please apply "terraform init" command (in this repository's folder) to initialize required providers.
As a result you will got a plan what you can apply with "terraform apply" command. When you finished the game, you can destroy all created resource with "terraform destroy" command.
To be able to build a CS:GO server provided by steam, you need a GSLT code. For more information, please visit this page.
After it please add you personaized GSLT code to csgoserver.cfg.
Terraform creates infrastructure under applications. In this example AWS provider is in use.
Terraform code was tested and use with following versions:
- Terraform = v0.12.26
- provider.aws: version = v2.10.0
- provider.null: version = v2.1.2
Ansible installs automatically applications / adjust OS settings.
This IDE was used to prepare and handle all of the code.
Vagrant is a hashicorp tool which provides you a way to spin up a virtual machine in your local computer (via virtualbox). It is ideal to reproduce the server in your local computer, without any cloud provider.
Try / Check / Adjust and fine-tune the game server without any additional price.
Change your directory to the vagrant folder (in IDE / terminal) and execute vagrant up
command which will create a virtual machine based on configured "Vagrantfile".
After that you can connect to your dedicated Counter Strike: Global Offensive server in 192.168.56.56
address, port 27015 (default).
Store provider(s) like AWS. This is a terraform plugin which "provide" classes.
Adjust network settings, required to create any instance within in. Most of the parameters are variables to use them during instance creation (servers.tf)
Define output values, displayed at the end of terraform's running.
Describe instances & bootstrap code.
Definition of variables, created / used in code for terraform.
The text below was generated by an automatic document mechanism.
Name | Description | Type | Default |
---|---|---|---|
readme | NOT PART OF CODE Readme information. This readme was generated with terraform-docs. terraform-docs --with-aggregate-type-defaults --no-required --no-sort markdown . | string | "terraform-docs" |
key_name | PRE-REQUIRED! SSH key name, used for linux instances. Must to be exist on AWS account before apply terraform code. | string | "csgo" |
shared_credentials_file | PRE-REQUIRED! Path of your AWS credentials file. Do NOT store it under version control system! | string | "./secrets/credentials" |
private_key | PRE-REQUIRED! Path of your private SSH key. Required to connect target instance via SSH. | string | "./secrets/csgo_priv.key" |
region | AWS region. Where to deploy with this Infrastructure-As-A-Code - terraform. | string | "eu-west-1" |
profile | AWS Credential(s) profile. Define the name of the profile as defined in your aws credentials file. | string | "default" |
instance_type | AWS instance type. Define size of machine. https://aws.amazon.com/ec2/instance-types/ | string | "t3a.medium" |
ami_user | SSH user, used for login to linux instance. Depends on used AMI. | string | "ec2-user" |
Name | Description |
---|---|
Counter_Strike_Global_Offensive_server_address | IP address of created cs go server. |
All fine-tune and modifications are in:
You have multiple way, how to connect to your customer server. Here is an example.
Check the following markdown documentation.
MIT
Peter Mikaczo - [email protected]