Route53 weighted routing policy
Great project,
I was wondering if weighted routing is to be included into dnscontrol. We manage 5400+ domains using dnscontrol via a git action pipeline, so the domains source of truth is git and not route53.
We have projects that are coming up that require us to migrate many systems from one CDN provider to CF, we would wish to be able to migrate traffic over gradually using weighted routing policies. Currently in Route53 you can create multiple CNAME's of the same name that point to different destinations and assign a weight value. So for example I created 2 CNAMES named weight, where first entry points to host1.example.co.uk with a weight of 50 and a second entry points to host2.example.co.uk also with a weight of 50 (sending 50% of traffic to each host). When extracting this hosted zone using dnscontrol it extracts both entries successfully but only extracts the CNAME and the destination (no weight value or record ID etc). So appears no way to manage CNAME weighted routing records.
Hoping I could work around this I added the weighted entries directly into Route53 and placing the naked CNAME entries into the dnsconfig.js file I was hoping the preview would see no changes in the records as it seems to have so concept of weight values and thus allow us to leave both the entries in route53 and in the dnsconfig.js file (this would allow further updates to be applied to those domains) and just manually update the weight values directly in route53 to lower/increase weight to a specific host, but dnscontrol errored stating 2 CNAMES of the same value cannot be added.
I apologise now if there is a way to do this that I have not found and also for the long explanation but just wanted you to get an exact feel for what I was trying to achieve so hoping your response would be more accurate and not leave anything open for questioning. Many thanks in advance.
Fundamentally what you are trying to do is a gradual shift to a different CDN, which is a good idea. (Much better than switching all at once!).
Sadly DNSControl doesn't currently support weighted CNAMEs. I'd be open to a PR that adds such a feature.
DNSControl does support R53_ALIAS() which might be able to do what you need. The weights would have to be controlled using the AWS control panel. See https://stackexchange.github.io/dnscontrol/js
Have you considered controlling this at the DNS level? You could send the DNS records to both AWS and CF, but use the number of NS records from each provider. This is explained in the last example on this page: https://stackexchange.github.io/dnscontrol/nameservers
Since you have many domains, I'm guessing you may be automating some or all of this. The docs we're writing about the new -v key=value flag might be useful: Docs are still in progress but the draft is here: https://github.com/StackExchange/dnscontrol/pull/918
Hope that helps!
This issue has grown stale. Closing. Please re-open if still needed.