The Problem

I recently asked Ops Twitter for some input on a problem I've been putting off solving for a while: how can I use nice, modern tooling like Terraform to manage multiple domain's DNS records?

Now, before we get started: I know how to do this!

I can happily manage a Terraform definition file made up of repeated versions of resources looking like this:

resource "aws_route53_record" "www" {
  zone_id = "${aws_route53_zone.primary.zone_id}"
  name    = ""
  type    = "A"
  ttl     = "300"
  records = [","]

But imagine the situation where one has multiple domains, each with a fair few records … that's going to get pretty verbose, pretty quickly.

So what I was asking Ops Twitter was slightly more nuanced: how can I use Terraform (or equivalent) to manage these records - but without having to manage the resource definitions manually?

The Solution?

A bunch of folks gave me some pointers and opinions:

Over the next couple of weeks I'm going to take a look at the practicalities of using each of these, along with any other relevant tools that pop up.

Stay tuned for some more posts in this area …