/valheim start
and /valheim stop
to start/stop the server.Clone Repo and commit to a private repo on Github.
Adjust the config in Serverless.yml under Custom > Config. You will need to adjust
bucketName
region
serverName
instanceType
(optional)Add the following secrets to GitHub Actions Secrets
AWS_ACCESS_KEY_ID
AWS_SECRET_ACCESS_KEY
DISCORD_PUBLIC_TOKEN
SERVER_PASSWORD # Valheim Server Password
SERVER_WEBHOOK # Discord Server Webhook URL
Run the workflow. Profit.
You can remove the Elastic IP option if you want to save a bit more money. Just delete all configuration with ElasticIP
in it from the serverless.yml
file. It will spit out the designated IP on every start.
You can setup Slash commands for your server here: https://discord.com/developers/docs/interactions/application-commands. Use the URL from the API Gateway path as the action endpoint for Discord. It will appear in the action's logs like this:
endpoints:
POST - https://RANDOMID.execute-api.REGION.amazonaws.com/dev/interactions
{
"name": "valheim",
"description": "start or stop the valheim server",
"options": [
{
"name": "start",
"description": "Start the valheim server",
"type": 1
},
{
"name": "stop",
"description": "Stop the valheim server",
"type": 1
}
],
"default_permission": false
}
If you don't wish to use the Discord Slash Command integration you can invoke the start/stop Lambdas using the AWS CLI. eg.
aws lambda invoke \
--function-name valheim-dev-start-server \
--invocation-type Event \
--payload '{}'