Update vultr provider

This was a pretty breaking change which required re-importing most of its state
This commit is contained in:
Jake Howard 2021-03-23 21:22:31 +00:00
parent 3c06eb748d
commit bbfe85b2c8
Signed by: jake
GPG key ID: 57AFB45680EDD477
6 changed files with 55 additions and 40 deletions

View file

@ -5,7 +5,7 @@ resource "cloudflare_zone" "orngone" {
resource "cloudflare_record" "orngone_git" { resource "cloudflare_record" "orngone_git" {
zone_id = cloudflare_zone.orngone.id zone_id = cloudflare_zone.orngone.id
name = "git" name = "git"
value = vultr_server.casey.main_ip value = vultr_instance.casey.main_ip
type = "A" type = "A"
ttl = 1 ttl = 1
} }
@ -13,7 +13,7 @@ resource "cloudflare_record" "orngone_git" {
resource "cloudflare_record" "orngone_who" { resource "cloudflare_record" "orngone_who" {
zone_id = cloudflare_zone.orngone.id zone_id = cloudflare_zone.orngone.id
name = "who" name = "who"
value = vultr_server.casey.main_ip value = vultr_instance.casey.main_ip
type = "A" type = "A"
ttl = 1 ttl = 1
} }
@ -29,7 +29,7 @@ resource "cloudflare_record" "orngone_img" {
resource "cloudflare_record" "orngone_yourls" { resource "cloudflare_record" "orngone_yourls" {
zone_id = cloudflare_zone.orngone.id zone_id = cloudflare_zone.orngone.id
name = "@" name = "@"
value = vultr_server.casey.main_ip value = vultr_instance.casey.main_ip
type = "A" type = "A"
ttl = 1 ttl = 1
} }

View file

@ -1,7 +1,6 @@
resource "vultr_server" "casey" { resource "vultr_instance" "casey" {
plan_id = 200 plan = "" # On a plan unsupported by API
region_id = 8 region = "lhr"
os_id = 159
hostname = "casey" hostname = "casey"
firewall_group_id = vultr_firewall_group.casey.id firewall_group_id = vultr_firewall_group.casey.id
} }
@ -13,54 +12,70 @@ resource "vultr_firewall_group" "casey" {
resource "vultr_firewall_rule" "casey_ping" { resource "vultr_firewall_rule" "casey_ping" {
firewall_group_id = vultr_firewall_group.casey.id firewall_group_id = vultr_firewall_group.casey.id
protocol = "icmp" 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" { resource "vultr_firewall_rule" "casey_web" {
firewall_group_id = vultr_firewall_group.casey.id firewall_group_id = vultr_firewall_group.casey.id
protocol = "tcp" protocol = "tcp"
from_port = 80 port = 80
network = "0.0.0.0/0" ip_type = "v4"
subnet = "0.0.0.0"
subnet_size = 0
} }
resource "vultr_firewall_rule" "casey_web_secure" { resource "vultr_firewall_rule" "casey_web_secure" {
firewall_group_id = vultr_firewall_group.casey.id firewall_group_id = vultr_firewall_group.casey.id
protocol = "tcp" protocol = "tcp"
from_port = 443 port = 443
network = "0.0.0.0/0" ip_type = "v4"
subnet = "0.0.0.0"
subnet_size = 0
} }
resource "vultr_firewall_rule" "casey_wireguard" { resource "vultr_firewall_rule" "casey_wireguard" {
firewall_group_id = vultr_firewall_group.casey.id firewall_group_id = vultr_firewall_group.casey.id
protocol = "udp" protocol = "udp"
from_port = 51820 port = 51820
network = "0.0.0.0/0" ip_type = "v4"
subnet = "0.0.0.0"
subnet_size = 0
} }
resource "vultr_firewall_rule" "casey_quassel" { resource "vultr_firewall_rule" "casey_quassel" {
firewall_group_id = vultr_firewall_group.casey.id firewall_group_id = vultr_firewall_group.casey.id
protocol = "tcp" protocol = "tcp"
from_port = 4242 port = 4242
network = "0.0.0.0/0" ip_type = "v4"
subnet = "0.0.0.0"
subnet_size = 0
} }
resource "vultr_firewall_rule" "casey_matrix" { resource "vultr_firewall_rule" "casey_matrix" {
firewall_group_id = vultr_firewall_group.casey.id firewall_group_id = vultr_firewall_group.casey.id
protocol = "tcp" protocol = "tcp"
from_port = 8448 port = 8448
network = "0.0.0.0/0" ip_type = "v4"
subnet = "0.0.0.0"
subnet_size = 0
} }
resource "vultr_firewall_rule" "casey_mc" { resource "vultr_firewall_rule" "casey_mc" {
firewall_group_id = vultr_firewall_group.casey.id firewall_group_id = vultr_firewall_group.casey.id
protocol = "tcp" protocol = "tcp"
from_port = 25566 port = 25566
network = "0.0.0.0/0" ip_type = "v4"
subnet = "0.0.0.0"
subnet_size = 0
} }
resource "vultr_firewall_rule" "casey_nebula" { resource "vultr_firewall_rule" "casey_nebula" {
firewall_group_id = vultr_firewall_group.casey.id firewall_group_id = vultr_firewall_group.casey.id
protocol = "udp" protocol = "udp"
from_port = 6328 port = 6328
network = "0.0.0.0/0" ip_type = "v4"
subnet = "0.0.0.0"
subnet_size = 0
} }

View file

@ -1,7 +1,7 @@
resource "local_file" "hosts" { resource "local_file" "hosts" {
content = yamlencode({ content = yamlencode({
hosts : { hosts : {
casey_ip : vultr_server.casey.main_ip casey_ip : vultr_instance.casey.main_ip
} }
}) })
filename = "${path.module}/../ansible/group_vars/all/hosts.yml" filename = "${path.module}/../ansible/group_vars/all/hosts.yml"

View file

@ -55,7 +55,7 @@ resource "cloudflare_record" "jakehowardtech_dkim_fm3" {
resource "cloudflare_record" "jakehowardtech_wallabag" { resource "cloudflare_record" "jakehowardtech_wallabag" {
zone_id = cloudflare_zone.jakehowardtech.id zone_id = cloudflare_zone.jakehowardtech.id
name = "wallabag" name = "wallabag"
value = vultr_server.casey.main_ip value = vultr_instance.casey.main_ip
type = "A" type = "A"
ttl = 1 ttl = 1
} }
@ -63,7 +63,7 @@ resource "cloudflare_record" "jakehowardtech_wallabag" {
resource "cloudflare_record" "jakehowardtech_ttrss" { resource "cloudflare_record" "jakehowardtech_ttrss" {
zone_id = cloudflare_zone.jakehowardtech.id zone_id = cloudflare_zone.jakehowardtech.id
name = "tt-rss" name = "tt-rss"
value = vultr_server.casey.main_ip value = vultr_instance.casey.main_ip
type = "A" type = "A"
ttl = 1 ttl = 1
} }
@ -71,7 +71,7 @@ resource "cloudflare_record" "jakehowardtech_ttrss" {
resource "cloudflare_record" "jakehowardtech_speed" { resource "cloudflare_record" "jakehowardtech_speed" {
zone_id = cloudflare_zone.jakehowardtech.id zone_id = cloudflare_zone.jakehowardtech.id
name = "speed" name = "speed"
value = vultr_server.casey.main_ip value = vultr_instance.casey.main_ip
type = "A" type = "A"
ttl = 1 ttl = 1
} }
@ -79,7 +79,7 @@ resource "cloudflare_record" "jakehowardtech_speed" {
resource "cloudflare_record" "jakehowardtech_quassel" { resource "cloudflare_record" "jakehowardtech_quassel" {
zone_id = cloudflare_zone.jakehowardtech.id zone_id = cloudflare_zone.jakehowardtech.id
name = "quassel" name = "quassel"
value = vultr_server.casey.main_ip value = vultr_instance.casey.main_ip
type = "A" type = "A"
ttl = 1 ttl = 1
} }
@ -87,7 +87,7 @@ resource "cloudflare_record" "jakehowardtech_quassel" {
resource "cloudflare_record" "jakehowardtech_media" { resource "cloudflare_record" "jakehowardtech_media" {
zone_id = cloudflare_zone.jakehowardtech.id zone_id = cloudflare_zone.jakehowardtech.id
name = "media" name = "media"
value = vultr_server.casey.main_ip value = vultr_instance.casey.main_ip
type = "A" type = "A"
ttl = 1 ttl = 1
} }
@ -95,7 +95,7 @@ resource "cloudflare_record" "jakehowardtech_media" {
resource "cloudflare_record" "jakehowardtech_matrix" { resource "cloudflare_record" "jakehowardtech_matrix" {
zone_id = cloudflare_zone.jakehowardtech.id zone_id = cloudflare_zone.jakehowardtech.id
name = "matrix" name = "matrix"
value = vultr_server.casey.main_ip value = vultr_instance.casey.main_ip
type = "A" type = "A"
ttl = 1 ttl = 1
} }
@ -103,7 +103,7 @@ resource "cloudflare_record" "jakehowardtech_matrix" {
resource "cloudflare_record" "jakehowardtech_intersect" { resource "cloudflare_record" "jakehowardtech_intersect" {
zone_id = cloudflare_zone.jakehowardtech.id zone_id = cloudflare_zone.jakehowardtech.id
name = "intersect" name = "intersect"
value = vultr_server.casey.main_ip value = vultr_instance.casey.main_ip
type = "A" type = "A"
ttl = 1 ttl = 1
} }
@ -111,7 +111,7 @@ resource "cloudflare_record" "jakehowardtech_intersect" {
resource "cloudflare_record" "jakehowardtech_gotify" { resource "cloudflare_record" "jakehowardtech_gotify" {
zone_id = cloudflare_zone.jakehowardtech.id zone_id = cloudflare_zone.jakehowardtech.id
name = "gotify" name = "gotify"
value = vultr_server.casey.main_ip value = vultr_instance.casey.main_ip
type = "A" type = "A"
ttl = 1 ttl = 1
} }
@ -119,7 +119,7 @@ resource "cloudflare_record" "jakehowardtech_gotify" {
resource "cloudflare_record" "jakehowardtech_calibre" { resource "cloudflare_record" "jakehowardtech_calibre" {
zone_id = cloudflare_zone.jakehowardtech.id zone_id = cloudflare_zone.jakehowardtech.id
name = "calibre" name = "calibre"
value = vultr_server.casey.main_ip value = vultr_instance.casey.main_ip
type = "A" type = "A"
ttl = 1 ttl = 1
} }
@ -127,7 +127,7 @@ resource "cloudflare_record" "jakehowardtech_calibre" {
resource "cloudflare_record" "jakehowardtech_homeassistant" { resource "cloudflare_record" "jakehowardtech_homeassistant" {
zone_id = cloudflare_zone.jakehowardtech.id zone_id = cloudflare_zone.jakehowardtech.id
name = "homeassistant" name = "homeassistant"
value = vultr_server.casey.main_ip value = vultr_instance.casey.main_ip
type = "A" type = "A"
ttl = 1 ttl = 1
} }
@ -135,7 +135,7 @@ resource "cloudflare_record" "jakehowardtech_homeassistant" {
resource "cloudflare_record" "jakehowardtech_grafana" { resource "cloudflare_record" "jakehowardtech_grafana" {
zone_id = cloudflare_zone.jakehowardtech.id zone_id = cloudflare_zone.jakehowardtech.id
name = "grafana" name = "grafana"
value = vultr_server.casey.main_ip value = vultr_instance.casey.main_ip
type = "A" type = "A"
ttl = 1 ttl = 1
} }
@ -143,7 +143,7 @@ resource "cloudflare_record" "jakehowardtech_grafana" {
resource "cloudflare_record" "jakehowardtech_bw" { resource "cloudflare_record" "jakehowardtech_bw" {
zone_id = cloudflare_zone.jakehowardtech.id zone_id = cloudflare_zone.jakehowardtech.id
name = "bw" name = "bw"
value = vultr_server.casey.main_ip value = vultr_instance.casey.main_ip
type = "A" type = "A"
ttl = 1 ttl = 1
} }

View file

@ -6,7 +6,7 @@ terraform {
} }
vultr = { vultr = {
source = "vultr/vultr" source = "vultr/vultr"
version = "1.4.1" version = "2.1.4"
} }
aws = { aws = {
source = "hashicorp/aws" source = "hashicorp/aws"

View file

@ -5,7 +5,7 @@ resource "cloudflare_zone" "theorangeonenet" {
resource "cloudflare_record" "theorangeonenet_git" { resource "cloudflare_record" "theorangeonenet_git" {
zone_id = cloudflare_zone.theorangeonenet.id zone_id = cloudflare_zone.theorangeonenet.id
name = "git" name = "git"
value = vultr_server.casey.main_ip value = vultr_instance.casey.main_ip
type = "A" type = "A"
ttl = 1 ttl = 1
} }
@ -13,7 +13,7 @@ resource "cloudflare_record" "theorangeonenet_git" {
resource "cloudflare_record" "theorangeonenet_gitea" { resource "cloudflare_record" "theorangeonenet_gitea" {
zone_id = cloudflare_zone.theorangeonenet.id zone_id = cloudflare_zone.theorangeonenet.id
name = "gitea" name = "gitea"
value = vultr_server.casey.main_ip value = vultr_instance.casey.main_ip
type = "A" type = "A"
ttl = 1 ttl = 1
} }
@ -21,7 +21,7 @@ resource "cloudflare_record" "theorangeonenet_gitea" {
resource "cloudflare_record" "theorangeonenet_whoami" { resource "cloudflare_record" "theorangeonenet_whoami" {
zone_id = cloudflare_zone.theorangeonenet.id zone_id = cloudflare_zone.theorangeonenet.id
name = "whoami" name = "whoami"
value = vultr_server.casey.main_ip value = vultr_instance.casey.main_ip
type = "A" type = "A"
ttl = 1 ttl = 1
} }
@ -168,7 +168,7 @@ resource "cloudflare_record" "theorangeonenet_notes" {
resource "cloudflare_record" "theorangeonenet_privatebin" { resource "cloudflare_record" "theorangeonenet_privatebin" {
zone_id = cloudflare_zone.theorangeonenet.id zone_id = cloudflare_zone.theorangeonenet.id
name = "bin" name = "bin"
value = vultr_server.casey.main_ip value = vultr_instance.casey.main_ip
type = "A" type = "A"
ttl = 1 ttl = 1
} }