Goodbye Contabo

This commit is contained in:
Tobias Reisinger 2024-10-31 03:17:55 +01:00
parent 56885d70b6
commit 428de8040a
Signed by: serguzim
GPG key ID: 13AD60C237A28DFE
8 changed files with 7 additions and 76 deletions
modules/infrastructure

View file

@ -1,4 +0,0 @@
resource "contabo_instance" "nodes" {
for_each = local.contabo_hosts
display_name = each.value.hostname
}

View file

@ -4,10 +4,6 @@ terraform {
source = "hashicorp/aws"
version = "~> 5.0"
}
contabo = {
source = "contabo/contabo"
version = "~> 0.1.26"
}
hcloud = {
source = "hetznercloud/hcloud"
version = "~> 1.45.0"
@ -37,6 +33,5 @@ locals {
services_database = {for key, val in var.services : key => val if val.database}
services_s3 = {for key, val in var.services : key => val if val.s3}
contabo_hosts = {for key, val in var.hosts : key => val if val.provider == "contabo"}
hetzner_hosts = {for key, val in var.hosts : key => val if val.provider == "hetzner"}
}

View file

@ -1,24 +1,12 @@
locals {
server_addresses = flatten([
[
for key, host in contabo_instance.nodes : [
{
key = key
hostname = host.display_name
ipv4_address = host.ip_config[0].v4[0].ip
ipv6_address = host.ip_config[0].v6[0].ip
},
]
],
[
for key, host in hcloud_server.nodes : [
{
key = key
hostname = host.name
ipv4_address = host.ipv4_address
ipv6_address = host.ipv6_address
},
]
for key, host in hcloud_server.nodes : [
{
key = key
hostname = host.name
ipv4_address = host.ipv4_address
ipv6_address = host.ipv6_address
},
]
])