MusicBot
MusicBot copied to clipboard
[Wiki] Add Terraform setup in docs
Is your feature request related to a problem? Please describe.
It would be nice if there was a example to use the terraform in the documentation.
What is your ideal solution to the problem?
This is an example of the aws provider.
Please put appropriate values in the 'region' , 'profile.' and 'ami'
# main.tf
provider "aws" {
region = "ap-northeast-2"
profile = "jmusic-bot"
}
resource "aws_instance" "JMusicBot" {
ami = "ami-0ba5cd124d7a79612"
instance_type = "t2.micro"
vpc_security_group_ids = [aws_security_group.public.id]
user_data = <<-EOF
#!/bin/bash
sudo apt-get -y update
sudo apt-get -y install openjdk-8-jdk
wget https://github.com/jagrosh/MusicBot/releases/download/0.3.6/JMusicBot-0.3.6.jar
{ echo "${var.token}"; echo "${var.owner}"; } | java -Dnogui=true -jar JMusicBot-0.3.6.jar
EOF
tags = {
Name = "JMusicBot"
}
}
resource "aws_security_group" "public" {
name = "public"
egress {
from_port = 0
to_port = 0
protocol = "-1"
cidr_blocks = ["0.0.0.0/0"]
}
}
# vars.tf
variable "token" {
description = "The token for the bot to log in with"
}
variable "owner" {
description = "The owner of the bot"
}
How would this feature be used?
- It is useful for people who want to use JMusicBot using the cloud.
- You can use JMusicBot with a single command.
Additional Info
content is also here.
Checklist
- [X] I have checked the documentation to make sure this feature doesn't already exist
- [X] I have searched for similar feature requests
- [X] I have confirmed that my requests is not on the list of things that will not be added
- [X] I am running the latest version of the bot: