feat: new load balancer, with dns via route 53

This commit is contained in:
2025-12-31 12:10:52 -05:00
parent b8938983dc
commit a916da7d45
6 changed files with 105 additions and 29 deletions

21
terraform/ingress.tf Normal file
View File

@@ -0,0 +1,21 @@
// Create load balancer for ingress.
resource "hcloud_load_balancer" "lb" {
name = "lb"
load_balancer_type = "lb11"
network_zone = "eu-central"
}
# The Route53 DNS zone.
data "aws_route53_zone" "main" {
name = local.domain
}
# Push all domain traffic through the reverse proxy.
resource "aws_route53_record" "domain" {
for_each = toset(["*.${local.domain}", "${local.domain}"])
zone_id = data.aws_route53_zone.main.zone_id
name = each.value
type = "A"
ttl = "60"
records = [hcloud_load_balancer.lb.ipv4]
}