diff --git a/templates/terraform/network-primitives/dns.tf b/templates/terraform/network-primitives/dns.tf index 50b0e28..7ed9403 100644 --- a/templates/terraform/network-primitives/dns.tf +++ b/templates/terraform/network-primitives/dns.tf @@ -10,48 +10,38 @@ resource "cloudflare_record" "rpc" { type = "A" } -# Remove system domain -# resource "cloudflare_record" "system-domain" { -# count = length(local.domain_node_ip_v4) -# zone_id = data.cloudflare_zone.cloudflare_zone.id -# name = "${var.domain-node-config.domain-prefix}-${count.index}.system.${var.network_name}" -# value = local.domain_node_ip_v4[count.index] -# type = "A" -# } - -resource "cloudflare_record" "core-domain" { +resource "cloudflare_record" "nova" { count = length(local.domain_nodes_ip_v4) zone_id = data.cloudflare_zone.cloudflare_zone.id - name = "${var.domain-node-config.domain-prefix}.${var.network_name}" + name = "${var.domain-node-config.domain-prefix[0]}-${var.domain-node-config.domain-id[0]}.${var.network_name}" value = local.domain_nodes_ip_v4[count.index] type = "A" } -resource "cloudflare_record" "core-domain_ipv6" { +resource "cloudflare_record" "nova_ipv6" { count = length(local.domain_nodes_ip_v4) zone_id = data.cloudflare_zone.cloudflare_zone.id - name = "${var.domain-node-config.domain-prefix}.${var.network_name}" + name = "${var.domain-node-config.domain-prefix[0]}-${var.domain-node-config.domain-id[0]}.${var.network_name}" value = local.domain_nodes_ip_v6[count.index] type = "AAAA" } -resource "cloudflare_record" "nova" { +resource "cloudflare_record" "auto" { count = length(local.domain_nodes_ip_v4) zone_id = data.cloudflare_zone.cloudflare_zone.id - name = "${var.domain-node-config.domain-prefix}-${count.index}.${var.network_name}" - value = local.domain_nodes_ip_v6[count.index] + name = "${var.domain-node-config.domain-prefix[1]}-${var.domain-node-config.domain-id[1]}.${var.network_name}" + value = local.domain_nodes_ip_v4[count.index] type = "A" } -resource "cloudflare_record" "nova_ipv6" { +resource "cloudflare_record" "auto_ipv6" { count = length(local.domain_nodes_ip_v4) zone_id = data.cloudflare_zone.cloudflare_zone.id - name = "${var.domain-node-config.domain-prefix}-${count.index}.${var.network_name}" + name = "${var.domain-node-config.domain-prefix[1]}-${var.domain-node-config.domain-id[1]}.${var.network_name}" value = local.domain_nodes_ip_v6[count.index] type = "AAAA" } - resource "cloudflare_record" "bootstrap" { count = length(local.bootstrap_nodes_ip_v4) zone_id = data.cloudflare_zone.cloudflare_zone.id @@ -83,3 +73,19 @@ resource "cloudflare_record" "bootstrap_evm_ipv6" { value = local.bootstrap_nodes_evm_ip_v6[count.index] type = "AAAA" } + +resource "cloudflare_record" "bootstrap_auto" { + count = length(local.bootstrap_nodes_evm_ip_v4) + zone_id = data.cloudflare_zone.cloudflare_zone.id + name = "bootstrap-${count.index}.auto.${var.network_name}" + value = local.bootstrap_nodes_evm_ip_v6[count.index] + type = "A" +} + +resource "cloudflare_record" "bootstrap_auto_ipv6" { + count = length(local.bootstrap_nodes_evm_ip_v4) + zone_id = data.cloudflare_zone.cloudflare_zone.id + name = "bootstrap-${count.index}.auto.${var.network_name}" + value = local.bootstrap_nodes_evm_ip_v6[count.index] + type = "AAAA" +}