infrastructure/modules/infrastructure/main.tf

38 lines
964 B
HCL

terraform {
required_providers {
aws = {
source = "hashicorp/aws"
version = "~> 5.0"
}
hcloud = {
source = "hetznercloud/hcloud"
version = "~> 1.59.0"
}
healthchecksio = {
source = "kristofferahl/healthchecksio"
version = "~> 1.6.0"
}
netbird = {
source = "netbirdio/netbird"
version = "0.0.7"
}
ovh = {
source = "ovh/ovh"
version = "~> 0.48.0"
}
scaleway = {
source = "scaleway/scaleway"
version = "~> 2.53.0"
}
}
}
locals {
services_s3 = {for key, val in var.services : key => (val.s3_buckets != null) ? val.s3_buckets : [key] if (val.s3 == "external")}
buckets_s3 = merge([for key, val in local.services_s3 : {for bucket in val : bucket => key}]...)
hetzner_hosts = {for key, val in var.hosts : key => val if val.provider == "hetzner"}
services_storage_box = {for key, val in var.services : key => val if val.storage_box}
}