infrastructure/modules/infrastructure/main.tf

38 lines
1,023 B
HCL

terraform {
required_providers {
aws = {
source = "hashicorp/aws"
version = "~> 5.0"
}
hcloud = {
source = "hetznercloud/hcloud"
version = "~> 1.45.0"
}
healthchecksio = {
source = "kristofferahl/healthchecksio"
version = "~> 1.6.0"
}
ovh = {
source = "ovh/ovh"
version = "~> 0.48.0"
}
scaleway = {
source = "scaleway/scaleway"
version = "~> 2.53.0"
}
tailscale = {
source = "tailscale/tailscale"
version = "~> 0.16.0"
}
}
}
locals {
services_auth = {for key, val in var.services : key => val if val.auth}
services_database = {for key, val in var.services : key => val if val.database}
services_s3 = {for key, val in var.services : key => (val.s3_buckets != null) ? val.s3_buckets : [key] if val.s3}
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"}
}