clan-infra/terraform/web01/dns.tf

47 lines
1.1 KiB
Terraform
Raw Normal View History

2023-07-04 15:23:29 +00:00
resource "netlify_dns_zone" "server" {
2023-07-04 14:43:31 +00:00
site_id = ""
name = var.netlify_dns_zone
}
2023-07-04 15:23:29 +00:00
resource "netlify_dns_record" "server_a" {
zone_id = netlify_dns_zone.server.id
2023-07-04 14:43:31 +00:00
hostname = var.domain
type = "A"
2023-07-04 15:23:29 +00:00
value = hcloud_server.server.ipv4_address
2023-07-04 14:43:31 +00:00
}
2023-07-04 15:23:29 +00:00
resource "netlify_dns_record" "server_aaaa" {
zone_id = netlify_dns_zone.server.id
2023-07-04 14:43:31 +00:00
hostname = var.domain
type = "AAAA"
2023-07-04 15:23:29 +00:00
value = hcloud_server.server.ipv6_address
2023-07-04 14:43:31 +00:00
}
2023-07-05 09:13:05 +00:00
2023-07-04 17:40:45 +00:00
resource "netlify_dns_record" "www_a" {
zone_id = netlify_dns_zone.server.id
hostname = "www.${var.domain}"
type = "A"
value = hcloud_server.server.ipv4_address
}
resource "netlify_dns_record" "www_aaaa" {
zone_id = netlify_dns_zone.server.id
hostname = "www.${var.domain}"
type = "AAAA"
value = hcloud_server.server.ipv6_address
}
2023-07-04 17:56:58 +00:00
resource "netlify_dns_record" "git_a" {
zone_id = netlify_dns_zone.server.id
hostname = "git.${var.domain}"
type = "A"
value = hcloud_server.server.ipv4_address
}
resource "netlify_dns_record" "git_aaaa" {
zone_id = netlify_dns_zone.server.id
hostname = "git.${var.domain}"
type = "AAAA"
value = hcloud_server.server.ipv6_address
}