doctorray117 / minecraft-ondemand

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

Use amazon SNS instead of twilio #2

Closed brianherman closed 3 years ago

brianherman commented 3 years ago

Maybe to make a end to end solution where you use amazon SNS instead of twilio. I would be willing to code this solution into this project. Maybe you could point me where the notification code is and we can make the option of using amazon sns instead if twilio?

tom-sherman commented 3 years ago

The SMS get's send with twilio here:

https://github.com/doctorray117/minecraft-ondemand/blob/71d400362c5c9b42bdc67d5a814efcd98acfba7c/minecraft-ecsfargate-watchdog/watchdog.sh#L76-L78

doctorray117 commented 3 years ago

The twilio block appears twice, I added one later for a shutdown notification. Should have turned it into a function but I was taking a shortcut.

I like the idea of adding SNS, that makes it a 100% AWS solution. I only used Twilio because I had the sending code already written for another project. I'll probably research this a bit and make it an option and build it into the container, maybe over the weekend. Or feel free to find/link example api commands or code.

Remember you can easily modify the watchdog.sh file and build your own container. I was originally hosting the container in a personal ECR repo and only put it up on docker hub to make it easier for anyone to use out of the box.

duaneking commented 3 years ago

Using a aws only here does make sense.

doctorray117 commented 3 years ago

One concern about SNS is the cost associated with sending actual text messages, as opposed to emailing phonenumber@carriergateway.com. In the AWS PinPoint console, in order to send SMS messages, you need to register an origination phone number as part of a 10DLC campaign, or register a toll free number, which would increase costs. I think publishing server ready/shutdown notifications to an SNS topic would be an easy add, but where people take it from there would be up to them.

doctorray117 commented 3 years ago

Added code to cleanup notifications, optional SNS notification also added, including IAM policy to publish to a topic. It's up to the user to determine what to do with the messages coming into that topic, whether it be email, text message, or flashing a light in their house.

GalaxyBrainHuman commented 3 years ago

Oh wow thank you!