Roadworker
Route 53Manage Route 53 DNS records as code with a Ruby DSL
- Manages
- Amazon Route 53
- Language
- Ruby
- Package
- roadworker
- CLI
- roadwork
- Config file
- Routefile
hosted_zone "winebarrel.jp." do
rrset "winebarrel.jp.", "A" do
ttl 300
resource_records(
"127.0.0.1",
"127.0.0.2"
)
end
rrset "winebarrel.jp.", "MX" do
ttl 300
resource_records(
"10 mx.winebarrel.jp",
"10 mx2.winebarrel.jp"
)
end
end
Roadworker is a command-line tool that manages Amazon Route 53 DNS as code. You keep your zones and records in a Ruby file called a Routefile, then apply it to update Route 53. It exports live DNS, shows a dry-run diff, and applies changes idempotently.
What is Roadworker?
Roadworker manages Amazon Route 53 as code. You write your DNS in a Ruby file called a Routefile. The roadwork command then makes Route 53 match that file.
Editing DNS by hand is risky. One wrong record can take a site offline, and the console keeps no history of who changed what. Roadworker puts your DNS in version control instead. Every change gets a diff and a dry-run before it goes live. That is the core idea behind codenization.
The Routefile can hold your whole DNS setup:
- Record sets like A, MX, CNAME, and TXT records
- Routing policies such as weighted and failover
- Health checks and private hosted zones tied to a VPC
It suits teams that want safe, repeatable DNS without a heavy framework. Roadworker started in the codenize-tools family and is now maintained by Cookpad, like its sibling Miam for IAM permissions.
- Manages Amazon Route 53 DNS zones and records as code.
- All config sits in one Routefile tracked in Git.
- Handles weighted routing, failover, health checks, and private hosted zones.
- A built-in test mode checks that records really resolve as written.
- Re-running a dry-run works as drift detection for console edits.
- Still maintained by Cookpad, so it is safe for active use.
Install and run Roadworker
Install
Install the roadworker gem (Ruby required).
$ gem install roadworkerExport current state
Pull the live Route 53 configuration into a Routefile.
$ roadwork -e -o RoutefileDry-run, then apply
Preview the diff, then apply the change for real.
$ roadwork -a --dry-runRoadworker uses a simple loop: export, review, dry-run, apply. Start by running roadwork -e to dump your live zones into a Routefile. Add --split for one file per zone. Commit it to Git so your DNS has a history from day one. This is the classic export, review, apply workflow.
After that, changes happen in the file. Edit the Routefile in a branch and open a pull request. Run roadwork -a --dry-run to see which records would be added, changed, or removed. Once it looks right, roadwork -a applies it. Running apply again does nothing, since Roadworker is idempotent. You can also run roadwork -t to query real nameservers and confirm records resolve as declared.
Run roadwork -e on a schedule and diff it against your committed Routefile. Any difference means someone changed DNS in the console, so you catch drift early.
What Roadworker can do
Export existing zones
Run roadwork -e to dump your live zones into a Routefile. Add --split for one file per zone. You can adopt Roadworker without recreating anything.
Dry-run diffs
roadwork -a --dry-run prints exactly which record sets would be created, changed, or deleted. Nothing moves until you approve the plan.
DNS test mode
roadwork -t queries real nameservers and compares the answers to your Routefile. It acts as a built-in acceptance test for your zones.
Templates and Ruby logic
Define reusable record patterns with template and include_template. Plain Ruby lets you generate repetitive records in a loop.
Zone filtering
The --target-zone and --exclude-zone options accept regular expressions. That lets you work on a subset of zones in busy accounts.
Health checks and routing policies
The DSL covers HTTP, TCP, calculated, and CloudWatch health checks. It also handles weighted and failover routing and private hosted zones.
When teams reach for Roadworker
Code review for DNS changes
Every record change goes through a pull request, not a console click. Reviewers see the exact rrset diff. The dry-run confirms what will happen before merge, catching typos in ALIAS targets and TTLs.
Managing many zones at scale
Platform teams often run hundreds of zones in one account. With --split, each zone gets its own file, and --target-zone works on a subset. Templates keep SPF and DKIM records consistent across domains.
Auditing and migrating existing DNS
An export gives you a complete, greppable snapshot of Route 53. Teams use it to find stale records, compare environments, or plan a zone move between accounts.
CI-verified DNS deployments
Run the dry-run in CI on every pull request, then apply on merge. After that, roadwork -t queries real nameservers to prove the records resolve as declared.