diff options
-rw-r--r-- | vps.tf | 42 |
1 files changed, 21 insertions, 21 deletions
@@ -1,35 +1,35 @@ # Input variables variable "do_token" { - type = "string" + type = string description = "DigitalOcean API token." } variable "tld" { - type = "string" + type = string description = "Root Top-Level Domain. Subdomains will be derived from it." } variable "wallabag_tld_prefix" { - type = "string" + type = string description = "DNS prefix used for the Wallabag installation. Does not contain a dot at the end." } variable "nextcloud_tld_prefix" { - type = "string" + type = string description = "DNS prefix used for the Nextcloud installation. Does not contain a dot at the end." } # DigitalOcean provider "digitalocean" { - token = "${var.do_token}" + token = var.do_token version = "~> 1.1" } resource "digitalocean_ssh_key" "client" { name = "terraform-vps-client" - public_key = "${file("${path.module}/secrets/ssh/vps-box-client.pub")}" + public_key = file("${path.module}/secrets/ssh/vps-box-client.pub") } ## Droplet and volume @@ -43,7 +43,7 @@ resource "digitalocean_droplet" "vps" { ipv6 = true monitoring = true - user_data = "${file("${path.module}/generated/user-data.sh")}" + user_data = file("${path.module}/generated/user-data.sh") ssh_keys = [ "${digitalocean_ssh_key.client.fingerprint}", @@ -52,7 +52,7 @@ resource "digitalocean_droplet" "vps" { connection { user = "root" type = "ssh" - private_key = "${file("${path.module}/secrets/ssh/vps-box-client")}" + private_key = file("${path.module}/secrets/ssh/vps-box-client") timeout = "2m" } @@ -70,46 +70,46 @@ resource "digitalocean_volume" "vps_persistent_volume" { } resource "digitalocean_volume_attachment" "foobar" { - volume_id = "${digitalocean_volume.vps_persistent_volume.id}" - droplet_id = "${digitalocean_droplet.vps.id}" + volume_id = digitalocean_volume.vps_persistent_volume.id + droplet_id = digitalocean_droplet.vps.id } ## DNS and IP configuration resource "digitalocean_floating_ip" "vps_public_ip" { - region = "${digitalocean_droplet.vps.region}" + region = digitalocean_droplet.vps.region } resource "digitalocean_floating_ip_assignment" "vps_public_ip_assignment" { - ip_address = "${digitalocean_floating_ip.vps_public_ip.id}" - droplet_id = "${digitalocean_droplet.vps.id}" + ip_address = digitalocean_floating_ip.vps_public_ip.id + droplet_id = digitalocean_droplet.vps.id } output "public_floating_ip" { - value = "${digitalocean_floating_ip.vps_public_ip.ip_address}" + value = digitalocean_floating_ip.vps_public_ip.ip_address } resource "digitalocean_domain" "vps_tld" { - name = "${var.tld}" + name = var.tld } resource "digitalocean_record" "at_sign" { - domain = "${digitalocean_domain.vps_tld.name}" + domain = digitalocean_domain.vps_tld.name type = "A" name = "@" - value = "${digitalocean_floating_ip.vps_public_ip.ip_address}" + value = digitalocean_floating_ip.vps_public_ip.ip_address } resource "digitalocean_record" "wallabag" { - domain = "${digitalocean_domain.vps_tld.name}" + domain = digitalocean_domain.vps_tld.name type = "CNAME" - name = "${var.wallabag_tld_prefix}" + name = var.wallabag_tld_prefix value = "${digitalocean_domain.vps_tld.name}." } resource "digitalocean_record" "nextcloud" { - domain = "${digitalocean_domain.vps_tld.name}" + domain = digitalocean_domain.vps_tld.name type = "CNAME" - name = "${var.nextcloud_tld_prefix}" + name = var.nextcloud_tld_prefix value = "${digitalocean_domain.vps_tld.name}." } |