variable "domain_name" {
  description = "The domain name to create the DNS record for."
  type        = string
}

variable "domain_zone_name" {
  description = "The name of the DNS zone."
  type        = string
}

variable "record_name" {
  description = "The name of the DNS record to create."
  type        = string
}

data "aws_route53_zone" "primary" {
  name         = var.domain_zone_name
  private_zone = false
}

resource "aws_route53_record" "www" {
  zone_id = data.aws_route53_zone.primary.zone_id
  name    = var.domain_name
  type    = "A"
  ttl     = 300
  records = [var.record_name]
}
