diff --git a/terraform/main.tf b/terraform/main.tf index 70de4cca917a86eae345dce98abe1ba0d56b3373..0ca1045c71d0a0dd54609337bf54b1c4cb708fb4 100644 --- a/terraform/main.tf +++ b/terraform/main.tf @@ -13,48 +13,48 @@ module "ignition" { } module "bootstrap" { - source = "./modules/hcloud_coreos" - instance_count = var.bootstrap == true ? 1 : 0 - location = var.location - name = "bootstrap" - dns_domain = var.dns_domain - dns_zone_id = var.dns_zone_id - dns_internal_ip = false - image = data.hcloud_image.image.id - image_name = var.image - server_type = "cx41" - subnet = hcloud_network_subnet.subnet.id - ignition_url = var.bootstrap == true ? "http://${cloudflare_record.dns_a_ignition[0].name}/bootstrap.ign" : "" + source = "./modules/hcloud_coreos" + instance_count = var.bootstrap == true ? 1 : 0 + location = var.location + name = "bootstrap" + dns_domain = var.dns_domain + dns_zone_id = var.dns_zone_id + dns_internal_ip = false + image = data.hcloud_image.image.id + image_name = var.image + server_type = "cx41" + subnet = hcloud_network_subnet.subnet.id + ignition_url = var.bootstrap == true ? "http://${cloudflare_record.dns_a_ignition[0].name}/bootstrap.ign" : "" } module "master" { - source = "./modules/hcloud_coreos" - instance_count = var.replicas_master - location = var.location - name = "master" - dns_domain = var.dns_domain - dns_zone_id = var.dns_zone_id - dns_internal_ip = false - image = data.hcloud_image.image.id - image_name = var.image - server_type = "cx41" - subnet = hcloud_network_subnet.subnet.id - ignition_url = "https://api-int.${var.dns_domain}:22623/config/master" - ignition_cacert = local.ignition_master_cacert + source = "./modules/hcloud_coreos" + instance_count = var.replicas_master + location = var.location + name = "master" + dns_domain = var.dns_domain + dns_zone_id = var.dns_zone_id + dns_internal_ip = false + image = data.hcloud_image.image.id + image_name = var.image + server_type = "cx41" + subnet = hcloud_network_subnet.subnet.id + ignition_url = "https://api-int.${var.dns_domain}:22623/config/master" + ignition_cacert = local.ignition_master_cacert } module "worker" { - source = "./modules/hcloud_coreos" - instance_count = var.replicas_worker - location = var.location - name = "worker" - dns_domain = var.dns_domain - dns_zone_id = var.dns_zone_id - dns_internal_ip = false - image = data.hcloud_image.image.id - image_name = var.image - server_type = "cx41" - subnet = hcloud_network_subnet.subnet.id - ignition_url = "https://api-int.${var.dns_domain}:22623/config/worker" - ignition_cacert = local.ignition_worker_cacert + source = "./modules/hcloud_coreos" + instance_count = var.replicas_worker + location = var.location + name = "worker" + dns_domain = var.dns_domain + dns_zone_id = var.dns_zone_id + dns_internal_ip = false + image = data.hcloud_image.image.id + image_name = var.image + server_type = "cx41" + subnet = hcloud_network_subnet.subnet.id + ignition_url = "https://api-int.${var.dns_domain}:22623/config/worker" + ignition_cacert = local.ignition_worker_cacert } diff --git a/terraform/modules/hcloud_coreos/variables.tf b/terraform/modules/hcloud_coreos/variables.tf index ff5497b70684ecac3e6b39428d4cff6c0aabd103..43e060b2f160465e95c865d5232c6b3d237458d8 100644 --- a/terraform/modules/hcloud_coreos/variables.tf +++ b/terraform/modules/hcloud_coreos/variables.tf @@ -42,7 +42,7 @@ variable "user_data" { } variable "ssh_keys" { - type = list + type = list(any) description = "SSH key IDs or names which should be injected into the server at creation time" default = [] } diff --git a/terraform/modules/hcloud_instance/main.tf b/terraform/modules/hcloud_instance/main.tf index b2e2ea236eee954017713b39d04653b2a046fa0a..f315787af07a3427a9d9a9fb21b5febc7fdebb4a 100644 --- a/terraform/modules/hcloud_instance/main.tf +++ b/terraform/modules/hcloud_instance/main.tf @@ -19,7 +19,7 @@ resource "cloudflare_record" "dns-a" { name = element(hcloud_server.server.*.name, count.index) value = element(hcloud_server.server.*.ipv4_address, count.index) type = "A" - ttl = 1 + ttl = 120 } resource "cloudflare_record" "dns-aaaa" { @@ -28,7 +28,7 @@ resource "cloudflare_record" "dns-aaaa" { name = element(hcloud_server.server.*.name, count.index) value = "${element(hcloud_server.server.*.ipv6_address, count.index)}1" type = "AAAA" - ttl = 1 + ttl = 120 } resource "hcloud_rdns" "dns-ptr-ipv4" { diff --git a/terraform/modules/hcloud_instance/variables.tf b/terraform/modules/hcloud_instance/variables.tf index 51566330f95f73d151ad272d2a4d063dd08a7695..bab208984f17c66e8ded36fad0b6dd8100fc6f5d 100644 --- a/terraform/modules/hcloud_instance/variables.tf +++ b/terraform/modules/hcloud_instance/variables.tf @@ -42,7 +42,7 @@ variable "user_data" { } variable "ssh_keys" { - type = list + type = list(any) description = "SSH key IDs or names which should be injected into the server at creation time" default = [] } diff --git a/terraform/versions.tf b/terraform/versions.tf index 3fc08e4c15f751a87f1f23cd6ccd76c4d2c1c3a5..03d603756a084cf53e2e682b43c3e49485fc8464 100644 --- a/terraform/versions.tf +++ b/terraform/versions.tf @@ -1,23 +1,23 @@ terraform { required_providers { cloudflare = { - source = "cloudflare/cloudflare" + source = "cloudflare/cloudflare" version = "2.14.0" } hcloud = { - source = "hetznercloud/hcloud" + source = "hetznercloud/hcloud" version = "1.23.0" } template = { - source = "hashicorp/template" + source = "hashicorp/template" version = "2.2.0" } local = { - source = "hashicorp/local" + source = "hashicorp/local" version = "1.4.0" } random = { - source = "hashicorp/random" + source = "hashicorp/random" version = "2.3.1" } }