feat: new load balancer, with dns via route 53
This commit is contained in:
21
terraform/ingress.tf
Normal file
21
terraform/ingress.tf
Normal 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]
|
||||
}
|
||||
Reference in New Issue
Block a user