From bbfe85b2c82aa0846b5450bc9ab3cb73f7a60fc4 Mon Sep 17 00:00:00 2001 From: Jake Howard Date: Tue, 23 Mar 2021 21:22:31 +0000 Subject: [PATCH] Update vultr provider This was a pretty breaking change which required re-importing most of its state --- terraform/0rng.one.tf | 6 ++-- terraform/casey_vps.tf | 53 ++++++++++++++++++++++------------- terraform/context.tf | 2 +- terraform/jakehoward.tech.tf | 24 ++++++++-------- terraform/terraform.tf | 2 +- terraform/theorangeone.net.tf | 8 +++--- 6 files changed, 55 insertions(+), 40 deletions(-) diff --git a/terraform/0rng.one.tf b/terraform/0rng.one.tf index fed4dca..b0afa45 100644 --- a/terraform/0rng.one.tf +++ b/terraform/0rng.one.tf @@ -5,7 +5,7 @@ resource "cloudflare_zone" "orngone" { resource "cloudflare_record" "orngone_git" { zone_id = cloudflare_zone.orngone.id name = "git" - value = vultr_server.casey.main_ip + value = vultr_instance.casey.main_ip type = "A" ttl = 1 } @@ -13,7 +13,7 @@ resource "cloudflare_record" "orngone_git" { resource "cloudflare_record" "orngone_who" { zone_id = cloudflare_zone.orngone.id name = "who" - value = vultr_server.casey.main_ip + value = vultr_instance.casey.main_ip type = "A" ttl = 1 } @@ -29,7 +29,7 @@ resource "cloudflare_record" "orngone_img" { resource "cloudflare_record" "orngone_yourls" { zone_id = cloudflare_zone.orngone.id name = "@" - value = vultr_server.casey.main_ip + value = vultr_instance.casey.main_ip type = "A" ttl = 1 } diff --git a/terraform/casey_vps.tf b/terraform/casey_vps.tf index 42e85c9..fb0c872 100644 --- a/terraform/casey_vps.tf +++ b/terraform/casey_vps.tf @@ -1,7 +1,6 @@ -resource "vultr_server" "casey" { - plan_id = 200 - region_id = 8 - os_id = 159 +resource "vultr_instance" "casey" { + plan = "" # On a plan unsupported by API + region = "lhr" hostname = "casey" firewall_group_id = vultr_firewall_group.casey.id } @@ -13,54 +12,70 @@ resource "vultr_firewall_group" "casey" { resource "vultr_firewall_rule" "casey_ping" { firewall_group_id = vultr_firewall_group.casey.id protocol = "icmp" - network = "0.0.0.0/0" + ip_type = "v4" + subnet = "0.0.0.0" + subnet_size = 0 } resource "vultr_firewall_rule" "casey_web" { firewall_group_id = vultr_firewall_group.casey.id protocol = "tcp" - from_port = 80 - network = "0.0.0.0/0" + port = 80 + ip_type = "v4" + subnet = "0.0.0.0" + subnet_size = 0 } resource "vultr_firewall_rule" "casey_web_secure" { firewall_group_id = vultr_firewall_group.casey.id protocol = "tcp" - from_port = 443 - network = "0.0.0.0/0" + port = 443 + ip_type = "v4" + subnet = "0.0.0.0" + subnet_size = 0 } resource "vultr_firewall_rule" "casey_wireguard" { firewall_group_id = vultr_firewall_group.casey.id protocol = "udp" - from_port = 51820 - network = "0.0.0.0/0" + port = 51820 + ip_type = "v4" + subnet = "0.0.0.0" + subnet_size = 0 } resource "vultr_firewall_rule" "casey_quassel" { firewall_group_id = vultr_firewall_group.casey.id protocol = "tcp" - from_port = 4242 - network = "0.0.0.0/0" + port = 4242 + ip_type = "v4" + subnet = "0.0.0.0" + subnet_size = 0 } resource "vultr_firewall_rule" "casey_matrix" { firewall_group_id = vultr_firewall_group.casey.id protocol = "tcp" - from_port = 8448 - network = "0.0.0.0/0" + port = 8448 + ip_type = "v4" + subnet = "0.0.0.0" + subnet_size = 0 } resource "vultr_firewall_rule" "casey_mc" { firewall_group_id = vultr_firewall_group.casey.id protocol = "tcp" - from_port = 25566 - network = "0.0.0.0/0" + port = 25566 + ip_type = "v4" + subnet = "0.0.0.0" + subnet_size = 0 } resource "vultr_firewall_rule" "casey_nebula" { firewall_group_id = vultr_firewall_group.casey.id protocol = "udp" - from_port = 6328 - network = "0.0.0.0/0" + port = 6328 + ip_type = "v4" + subnet = "0.0.0.0" + subnet_size = 0 } diff --git a/terraform/context.tf b/terraform/context.tf index 0397fc7..b9393bf 100644 --- a/terraform/context.tf +++ b/terraform/context.tf @@ -1,7 +1,7 @@ resource "local_file" "hosts" { content = yamlencode({ hosts : { - casey_ip : vultr_server.casey.main_ip + casey_ip : vultr_instance.casey.main_ip } }) filename = "${path.module}/../ansible/group_vars/all/hosts.yml" diff --git a/terraform/jakehoward.tech.tf b/terraform/jakehoward.tech.tf index 8a32c61..3b87359 100644 --- a/terraform/jakehoward.tech.tf +++ b/terraform/jakehoward.tech.tf @@ -55,7 +55,7 @@ resource "cloudflare_record" "jakehowardtech_dkim_fm3" { resource "cloudflare_record" "jakehowardtech_wallabag" { zone_id = cloudflare_zone.jakehowardtech.id name = "wallabag" - value = vultr_server.casey.main_ip + value = vultr_instance.casey.main_ip type = "A" ttl = 1 } @@ -63,7 +63,7 @@ resource "cloudflare_record" "jakehowardtech_wallabag" { resource "cloudflare_record" "jakehowardtech_ttrss" { zone_id = cloudflare_zone.jakehowardtech.id name = "tt-rss" - value = vultr_server.casey.main_ip + value = vultr_instance.casey.main_ip type = "A" ttl = 1 } @@ -71,7 +71,7 @@ resource "cloudflare_record" "jakehowardtech_ttrss" { resource "cloudflare_record" "jakehowardtech_speed" { zone_id = cloudflare_zone.jakehowardtech.id name = "speed" - value = vultr_server.casey.main_ip + value = vultr_instance.casey.main_ip type = "A" ttl = 1 } @@ -79,7 +79,7 @@ resource "cloudflare_record" "jakehowardtech_speed" { resource "cloudflare_record" "jakehowardtech_quassel" { zone_id = cloudflare_zone.jakehowardtech.id name = "quassel" - value = vultr_server.casey.main_ip + value = vultr_instance.casey.main_ip type = "A" ttl = 1 } @@ -87,7 +87,7 @@ resource "cloudflare_record" "jakehowardtech_quassel" { resource "cloudflare_record" "jakehowardtech_media" { zone_id = cloudflare_zone.jakehowardtech.id name = "media" - value = vultr_server.casey.main_ip + value = vultr_instance.casey.main_ip type = "A" ttl = 1 } @@ -95,7 +95,7 @@ resource "cloudflare_record" "jakehowardtech_media" { resource "cloudflare_record" "jakehowardtech_matrix" { zone_id = cloudflare_zone.jakehowardtech.id name = "matrix" - value = vultr_server.casey.main_ip + value = vultr_instance.casey.main_ip type = "A" ttl = 1 } @@ -103,7 +103,7 @@ resource "cloudflare_record" "jakehowardtech_matrix" { resource "cloudflare_record" "jakehowardtech_intersect" { zone_id = cloudflare_zone.jakehowardtech.id name = "intersect" - value = vultr_server.casey.main_ip + value = vultr_instance.casey.main_ip type = "A" ttl = 1 } @@ -111,7 +111,7 @@ resource "cloudflare_record" "jakehowardtech_intersect" { resource "cloudflare_record" "jakehowardtech_gotify" { zone_id = cloudflare_zone.jakehowardtech.id name = "gotify" - value = vultr_server.casey.main_ip + value = vultr_instance.casey.main_ip type = "A" ttl = 1 } @@ -119,7 +119,7 @@ resource "cloudflare_record" "jakehowardtech_gotify" { resource "cloudflare_record" "jakehowardtech_calibre" { zone_id = cloudflare_zone.jakehowardtech.id name = "calibre" - value = vultr_server.casey.main_ip + value = vultr_instance.casey.main_ip type = "A" ttl = 1 } @@ -127,7 +127,7 @@ resource "cloudflare_record" "jakehowardtech_calibre" { resource "cloudflare_record" "jakehowardtech_homeassistant" { zone_id = cloudflare_zone.jakehowardtech.id name = "homeassistant" - value = vultr_server.casey.main_ip + value = vultr_instance.casey.main_ip type = "A" ttl = 1 } @@ -135,7 +135,7 @@ resource "cloudflare_record" "jakehowardtech_homeassistant" { resource "cloudflare_record" "jakehowardtech_grafana" { zone_id = cloudflare_zone.jakehowardtech.id name = "grafana" - value = vultr_server.casey.main_ip + value = vultr_instance.casey.main_ip type = "A" ttl = 1 } @@ -143,7 +143,7 @@ resource "cloudflare_record" "jakehowardtech_grafana" { resource "cloudflare_record" "jakehowardtech_bw" { zone_id = cloudflare_zone.jakehowardtech.id name = "bw" - value = vultr_server.casey.main_ip + value = vultr_instance.casey.main_ip type = "A" ttl = 1 } diff --git a/terraform/terraform.tf b/terraform/terraform.tf index 4f7aa89..c319a6d 100644 --- a/terraform/terraform.tf +++ b/terraform/terraform.tf @@ -6,7 +6,7 @@ terraform { } vultr = { source = "vultr/vultr" - version = "1.4.1" + version = "2.1.4" } aws = { source = "hashicorp/aws" diff --git a/terraform/theorangeone.net.tf b/terraform/theorangeone.net.tf index bcff0ba..3648d5b 100644 --- a/terraform/theorangeone.net.tf +++ b/terraform/theorangeone.net.tf @@ -5,7 +5,7 @@ resource "cloudflare_zone" "theorangeonenet" { resource "cloudflare_record" "theorangeonenet_git" { zone_id = cloudflare_zone.theorangeonenet.id name = "git" - value = vultr_server.casey.main_ip + value = vultr_instance.casey.main_ip type = "A" ttl = 1 } @@ -13,7 +13,7 @@ resource "cloudflare_record" "theorangeonenet_git" { resource "cloudflare_record" "theorangeonenet_gitea" { zone_id = cloudflare_zone.theorangeonenet.id name = "gitea" - value = vultr_server.casey.main_ip + value = vultr_instance.casey.main_ip type = "A" ttl = 1 } @@ -21,7 +21,7 @@ resource "cloudflare_record" "theorangeonenet_gitea" { resource "cloudflare_record" "theorangeonenet_whoami" { zone_id = cloudflare_zone.theorangeonenet.id name = "whoami" - value = vultr_server.casey.main_ip + value = vultr_instance.casey.main_ip type = "A" ttl = 1 } @@ -168,7 +168,7 @@ resource "cloudflare_record" "theorangeonenet_notes" { resource "cloudflare_record" "theorangeonenet_privatebin" { zone_id = cloudflare_zone.theorangeonenet.id name = "bin" - value = vultr_server.casey.main_ip + value = vultr_instance.casey.main_ip type = "A" ttl = 1 }