Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

I made a terraform implementation #69

Open
shiouen opened this issue Jan 27, 2024 · 9 comments
Open

I made a terraform implementation #69

shiouen opened this issue Jan 27, 2024 · 9 comments

Comments

@shiouen
Copy link

shiouen commented Jan 27, 2024

Hi, your project inspired me to work on a Terraform implementation instead of using the AWS CDK. I have worked with CloudFormation for a couple of years, I can hardly bring up the patience for its quirks and features anymore. Terraform isn't perfect either, but it gives a whole lot of options that CFN just doesn't bring to the table. I happily imported my EFS file system from the CDK stack into my terraform state.

Everything has been implemented except for the Twilio variables. I'm looking to add discord integration as well.

Appreciate the work you've put into this, it's a great setup.

@rafalfigura
Copy link

It's really great to hear that someone implemented a terraform version of this. I will try to run that and maybe do some quirks like GitHub actions, so users will be able to fork & deploy. It would be awesome :)

@shiouen
Copy link
Author

shiouen commented Jan 28, 2024

It's really great to hear that someone implemented a terraform version of this. I will try to run that and maybe do some quirks like GitHub actions, so users will be able to fork & deploy. It would be awesome :)

Let me know if it goes smooth for ya, I still need to add documentation. It also features multi-email subscriptions for SNS, VPC reuse has been implemented and most if not all resources are properly tagged - something the CDK setup struggles with due to CloudFormation limitations. I use my tags to keep an eye on costs.

@rafalfigura
Copy link

I've already made some changes and merged your version with something else I've found: https://github.com/JKolios/minecraft-ondemand-terraform

Your approach is missing some permissions for the route53 zone, so it didn't trigger the lambda function. Don't know if I fixed it yet, but I will be posting a new version soon.

I want to do something like fork, config, deploy & play

You don't need to tag every single resource. You can use default tags in the terraform AWS provider: https://registry.terraform.io/providers/hashicorp/aws/latest/docs/data-sources/default_tags#dynamically-apply-default-tags-to-auto-scaling-group

@shiouen
Copy link
Author

shiouen commented Jan 29, 2024

I've already made some changes and merged your version with something else I've found: https://github.com/JKolios/minecraft-ondemand-terraform

Your approach is missing some permissions for the route53 zone, so it didn't trigger the lambda function. Don't know if I fixed it yet, but I will be posting a new version soon.

I want to do something like fork, config, deploy & play

You don't need to tag every single resource. You can use default tags in the terraform AWS provider: https://registry.terraform.io/providers/hashicorp/aws/latest/docs/data-sources/default_tags#dynamically-apply-default-tags-to-auto-scaling-group

Could you share logs of the permission error? I just launched 10 servers in a fresh account, the lambda triggers successfully. All of them are using subdomains though, that could be a reason - my setup depends on having a subdomain and it expects a domain to already exist. Something to improve.

@rafalfigura
Copy link

Sorry, I don't remember what was the error. Maybe it was my mistake by changing route53 query logging region. Which is only supported in use1. Take a look at my stuff here: https://github.com/rafalfigura/mc-on-demand

@stephenmond
Copy link

stephenmond commented Feb 2, 2024

Thanks for the awesome tf implementations, everyone! What do you think the level of effort would be on using ipv6 instead of ipv4 due to AWS's changes to start charging for ipv4? Do you think it even possible to use ipv6 with this setup?

Also asked here #68

@anthonytwh
Copy link

anthonytwh commented Feb 3, 2024

I've been looking into your Terraform implementations for my own service, they have been quite helpful. Curious how do you manage the server when it starts?

@shiouen
Copy link
Author

shiouen commented Feb 10, 2024

Thanks for the awesome tf implementations, everyone! What do you think the level of effort would be on using ipv6 instead of ipv4 due to AWS's changes to start charging for ipv4? Do you think it even possible to use ipv6 with this setup?

Also asked here #68

I currently haven't seen any public ipv4 charges on the account where I host my servers with the terraform code I linked here. The ipv4 changes are live since 1st of February 2024. Perhaps ECS fargate public IPs are not being charged yet?

That being said, I expect it to be fairly straightforward in the Terraform code. Not sure if Minecraft itself is ready to use ipv6. I'll have a look.

@g-otn
Copy link

g-otn commented Nov 24, 2024

I also made a Terraform implementation inspired by this repo!

To avoid costs even further, and make use of always free offers and 12-month free tier offers, I used:

  • EC2 instead of ECS
  • Free DDNS service instead of Route 53 / etc
  • Discord integration as the only way to start the server outside of AWS console, instead of DNS querying

That way a 8GB Minecraft server should cost less than 1 dollar for 30h of gameplay.

It's also a more generic implementation, so it already supports a few other games as well:

https://github.com/g-otn/GameServerEC2Discord

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants