Setup guide
Set up the challenge
- Create a new project on GCP and note down the
project_id - Download the gcloud sdk on your machine and run
gcloud auth application-default login - Update terraform/terraform.tfvars with the
project_idfrom step 1 and give two bucket names that haven't been used yet - Update bot-src/index.js and update line 25 and 26 with the bucket names from step 3
Running the terraform
- Move into the terraform folder and run
./terraform init - Run
./terraform planand verify everything is ok - Run
./terraform applyand type yes to create the infrastructure - If some fail wait a few minutes and run
./terraform applyagain to wait for the API's to be enabled properly
These steps are so the token isn't leaked (best effort)
- SSH into the machine with
gcloud compute ssh discord-bot - Run
docker psand note the name of the container - Run
docker attach <container_name>and then paste the Discord Bot Token in and hit enter - CTRL+P, CTRL+Q to detach and then you can exit
Disable SSH on the machine
- Change line 107 in
terraform.tfto true and run./terraform applyto disallow ssh on the machine (DO THIS ONLY ONCE YOU HAVE CONFIRMED THE CHALLENGE IS UP AND RUNNING GOODLY)