Skip to content

Commit

Permalink
add DNS records
Browse files Browse the repository at this point in the history
  • Loading branch information
DaMandal0rian committed May 7, 2024
1 parent c62cb35 commit 05ae7c9
Showing 1 changed file with 25 additions and 19 deletions.
44 changes: 25 additions & 19 deletions templates/terraform/network-primitives/dns.tf
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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"
}

0 comments on commit 05ae7c9

Please sign in to comment.