rileydakota / valheim-ecs-fargate-cdk

AWS CDK/Cloudformation to deploy a Valheim Server using ECS Fargate!
78 stars 24 forks source link

Assistance: Modifying Environment after already starting up the server #21

Closed samuelzapote closed 3 years ago

samuelzapote commented 3 years ago

Hello Team, big thanks to all the work you do! I really appreciate it. I was hoping to get some assistance or documentation on some doubts i'm having.

I am trying to add the environment variable event hooks documented here on docker hub. But I believe in order to do so I need to modify the docker environment variables.

I was wondering if anyone could help me by pointing me in the right direction or with some documentation I can read up on to accomplish the following.

  1. I want to be able to stop the docker container without losing my game files / saved world.
  2. My understanding is that once I stop the container, I can then go in to "modify" the docker environment variables. I read on another issue posted that I can access the ECS files / docker container using AWS Transfer Family . I can handle that part, but will accessing this file system allow me to modify the docker file, and will I be able to ensure that I modify those files while the task/docker container is stopped?

Big thanks for any help in advance. 😄 spectacular work on this project!

rileydakota commented 3 years ago

Hi @samuelzapote - thanks for using the template! You can add new environment variables by modifying the code here: https://github.com/rileydakota/valheim-ecs-fargate-cdk/blob/876180c3e6ff6dc39e0cf58558e707ea5ef6275c/lib/valheim-server-aws-cdk-stack.ts#L68

If you only change the environment variables - you shouldn't experience any loss of game files/world - as the server save file is saved on the EFS volume. In addition to this - the EFS volume has a deletion policy on it so it will not be lost in the event you decide to delete the cloudformation stack. You shouldn't need to modify anything on the container itself to accomplish this. Let me know if you run into issues!

samuelzapote commented 3 years ago

This really helped! Thank You. Closing this issue given that it's been resolved.