This terraform code accompanies this post on my blog about spinning up a Reverse Shell in the DigitalOcean with Terraform.
The tl;dr
if you just want to fire this up right away
git clone https://github.com/ronamosa/do-reverse-shell
cd do-reverse-shell/
set environment variables
export TF_VAR_do_token=<paste your DigitalOcean API key here>
export TF_VAR_ssh_fingerprint=<paste your ssh fingerprint here>
terraform go!
terraform init
terraform apply
terraform destroy