This repo is for generating a minecraft-server using Terraform with Azure.
Azure CLI
Terraform
Azure CLI installation
Terraform installation
Clone the repo
git clone [email protected]:kaffikaffi/minecraft-tf.git
cd minecraft-tf
Generate variable file
touch terraform.tvars
Paste the text below in terraform.tvars
, and replace the values with your Azure info To generate this info you need to make a Service Principal. DO NOT PUSH THIS FILE TO GITHUB! So make sure it is mentioned in your .gitignore
subscription_id = "XXX XXX XXX XXX XXX"
client_id = "XXX XXX XXX XXX XXX"
client_secret = "XXX XXX XXX XXX XXX"
tenant_id = "XXX XXX XXX XXX XXX"
Log in to Azure
az login
If you have made changes to the terraform version or Azurerm version etc. Make sure to run
terraform init
Now you can check the resources that is going to be made in Azure with the command
terraform plan
To make terraform setup the plan on your Azure-account, run the command
terraform apply
The minecraft server is based on the docker-image itzg/minecraft-server. Which always downloads the newest stable version of minecraft-server. Checkout their documentation on github to understand more of how you can control your server etc.