variable "do_token" {} variable "ssh_fingerprint" {} variable "floating_ip" {} provider "digitalocean" { token = "${var.do_token}" version = "~> 1.1" } resource "digitalocean_droplet" "vps" { image = "ubuntu-18-04-x64" name = "sovereignty" region = "nyc3" size = "s-1vcpu-1gb" backups = true ipv6 = true monitoring = true ssh_keys = [ "${var.ssh_fingerprint}", ] connection { user = "root" type = "ssh" private_key = "${file("${path.module}/secrets/vps_box")}" timeout = "2m" } provisioner "remote-exec" { script = "./deploy.sh" } } resource "digitalocean_floating_ip_assignment" "vps" { ip_address = "${var.floating_ip}" droplet_id = "${digitalocean_droplet.vps.id}" }