doctorray117 / minecraft-ondemand

Templates to deploy a serverless Minecraft Server on demand in AWS
Apache License 2.0
1.68k stars 115 forks source link

Add support and instructions for ECS Exec #39

Closed thelastnatty closed 2 years ago

thelastnatty commented 2 years ago

While setting this up myself, I found that using ECS for server configuration was far easier than the other two options described in the README. So, I decided to enable ECS Exec in the CDK code as well as write instructions about how to use it.

Note: I chose to make this the new "option 1" because:

  1. I do think it's the easiest, and
  2. It's also "serverless"

If you want me to change the order, though, I'm happy to do so 🙂

doctorray117 commented 2 years ago

Hey this sounds very interesting, I'll have time to review it in the next day or so and will ping you with any questions. Thanks!

teagles commented 2 years ago

What about modifications that need to take place while the server is down? Does this need another container/task independent of the server and watchdog?

doctorray117 commented 2 years ago

@thelastnatty I like where you're going with it. Two questions, do you think it would work with the cloudshell in the AWS console? That way people that don't have the aws cli set up and configured anywhere can do it from the web. Second, are there any steps required to enable execute when the tasks are created manually with the guide? I saw the addition to the cdk configs, I want to ensure we cover the bases for manual creation.

I think maybe I'd want to expand the tutorial to use a "non linux user" text editor like nano. Try explaining insert mode and :wq to a windows user. (not that ctrl+o makes any sense for "save")

As far as editing files during runtime, supposedly there's a /reload command but I'm not sure if it would pick up all these changes. Might be worth testing?

doctorray117 commented 2 years ago

It appears that there is no way to use the console/gui to enable the execute command on a service. However it can be done easily in cloudshell with this command: aws ecs update-service --cluster minecraft --service minecraft-server --enable-execute-command

Also appears that ssmmessages perms are required, I guess that's done implicitly with the cdk enablexecutecommand attribute.

We should include instructions for that stuff for the non-cdk users. I'm testing this out a little bit and will come back with any additional comments soon.

doctorray117 commented 2 years ago

Works great in cloudshell. I'm going to do some runtime testing. Considering merging as-is and then making some modifications to account for users that have performed the manual setup.