|
1 | 1 | # Valheim Terraform |
2 | 2 |
|
3 | 3 | ### Instructions: |
4 | | -- Clone this repo |
5 | | -- Create `terraform.auto.tfvars` like so: |
| 4 | +- Create a directory for your local terraform state, such as `valheim-terraform` |
| 5 | +- Create `main.tf` like so: |
6 | 6 | ``` |
7 | | -key_name = "my_ssh_key" |
8 | | -world_name = "HashiWorld" |
9 | | -world_password = "hunter2" |
| 7 | +provider "aws" { |
| 8 | + region = "us-east-1" |
| 9 | +} |
| 10 | +
|
| 11 | +module "valheim-server" { |
| 12 | + source = "github.com/kpenfound/valheim-server?ref=v0.2.0" |
| 13 | + key_name = "my_aws_keypair_name" |
| 14 | + world_name = "Valheim-friends" |
| 15 | + world_password = "hunter2" |
| 16 | +} |
10 | 17 | ``` |
11 | 18 | - terraform apply |
12 | 19 | - In Steam, go to View > Servers > Favorites > Add Server |
13 | | -- Add your server at {ECS Instance IP}:2457 |
| 20 | +- Add your server at {NLB DNS}:2457 |
14 | 21 | - Open valheim, select the server, and click connect! |
15 | 22 |
|
16 | 23 |
|
17 | 24 | ### Important notes |
18 | 25 | The default ecs_ami is the current ecs optimized ami in us-east-1. You will |
19 | 26 | have to change this for other regions. Refer to this list: https://docs.aws.amazon.com/AmazonECS/latest/developerguide/ecs-optimized_AMI.html |
20 | 27 |
|
| 28 | +This is using the docker image maintained by mbround18 at https://hub.docker.com/r/mbround18/valheim |
21 | 29 |
|
22 | | -If you do not want your game to appear in the community list, set `world_public=0` |
| 30 | +### Auto Sleep |
| 31 | +Automatically shuts off the server after 0 players have been connected for a set amount of time. |
23 | 32 |
|
| 33 | +The next time a player tries to connect through steam, the server will be started back up and will be available shortly after. Players will have to know to wait a minute after the first connection fails and to try again if the server had been sleeping. |
24 | 34 |
|
25 | | -This is using the docker image found at https://hub.docker.com/r/mbround18/valheim |
| 35 | +Override the timer value at `world_sleep_timer` (default 60 minutes). Set to an unrealistically high number to disable. |
0 commit comments