Move to being a terraform module
You should move this to be a terraform module. If you are comfortable with it how it runs, I can probably do it relatively quickly.
You need to move the code around a little bit and add some extra details and you can then submit it here: https://registry.terraform.io/
I did a similar thing here: https://registry.terraform.io/modules/willhallonline/rtmp-server/aws/latest