This is a strange problem i’m having trying to set a record for an aws_route53_record, has anyone seen this before?
Plan: 10 to add, 0 to change, 0 to destroy.
╷
│ Error: Incorrect attribute value type
│
│ on ../terraform-modules/route53/main.tf line 14, in resource "aws_route53_record" "private-record-docker":
│ 14: records = var.docker1["ec2_ip"]
│ ├────────────────
│ │ var.docker1["ec2_ip"] is "10.99.50.10"
│
│ Inappropriate value for attribute "records": set of string required.
The variable is:
variable "docker1" {
type = map
default = {
"ec2_ip" = "10.99.50.10/32"
}
}
in main:
module "route53" {
source = "../terraform-modules/route53"
docker1 = var.docker1
}
And in the module, variable:
variable "docker1" {
type = object({
ec2_ip = string
})
}
In the module main:
resource "aws_route53_record" "private-record-docker" {
zone_id = aws_route53_zone.private-zone.id
name = "docker.${var.tags.Environment}.${var.tags.Customer}"
type = "A"
ttl = "300"
records = var.docker1["ec2_ip"]
}