22 lines
563 B
HCL
22 lines
563 B
HCL
// 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]
|
|
}
|