I'm trying to create multiple a-records. I populate an array with values:
locals {
he_net_test = {
"test1" = {
Hostname = "test1"
Domainname = "subdomain.domain.tld
IPAddress = "192.168.88.35"
}
"test2" = {
Hostname = "test2"
Domainname = "subdomain.domain.tld"
IPAddress = "192.168.88.36"
}
}
}
resource "dns-he-net_a" "containers" {
for_each = local.he_net_test
zone_id = 123456
domain = format("%s.%s", each.value.Hostname, each.value.Domainname)
ttl = 86400
data = each.value.IPAddress
}
| Error: Invalid A record configuration
│
│ with dns-he-net_a.containers,
│ on dns.tf line 37, in resource "dns-he-net_a" "containers":
│ 37: resource "dns-he-net_a" "containers" {
│
│ Static A records must have Data configured.
resource "dns-he-net_a" "containers" {
for_each = local.he_net_test
zone_id = 123456
domain = format("%s.%s", each.value.Hostname, each.value.Domainname)
ttl = 86400
data = "192.168.1.2"
}