Giter VIP home page Giter VIP logo

terraform-factorio's Introduction

Headless Factorio server

Terraform modules to provision a headless Factorio server in AWS, with save game backups to S3.

Quick start

Requirements

Initial setup

  • Put AWS credentials in ~/.aws/credentials (aws_access_key_id and aws_secret_access_key).

  • Create the resources under bootstrap. These are a role and policy in order for the rest of terraform to work, and you can use this profile for all other actions with the factorio service.

  • In ~/.aws/config, set up a profile factorio, which should be pointed at a role that uses the policy inside bootstrap/:

[profile factorio]
region = us-east-1
role_arn=arn:aws:iam::YOURACCOUNT_HERE:role/factorio-tf
source_profile=default
cd instance/
terraform init
terraform apply
terraform output
  • Connect to the instance using AWS SSM

  • Commands available:

sudo service factorio-restore
sudo service factorio-headless
sudo service factorio-backup

Services

Several systemd services are provisioned to the server instance:

  • factorio-headless.service: Service to start/stop the headless game server.
  • factorio-restore.service: One shot service that restores save games from S3.
  • factorio-backup.service: One shot service that backs up save games to S3.

Limitations

Currently there is no support for creating a fresh game, just for loading existing save games. The headless Factorio server expects the --create FILE argument to create a game. The workaround is to create a game locally, export the save game, and use that.

This provisioning code populates --start-server FILE (to load a named save game) or -start-server-load-latest (to load the latest save game), depending on whether the factorio_save_game variable is set.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.