Obrigado @ CS3
Nossa solução é Route53 por enquanto.
Veja como o configuramos (PHP). Usamos essa biblioteca: link
private function getDomain() {
$sub = "e-".substr(md5($this->instance->dnsName), 2, 4);
$domain = $sub.".domain.com";
$dnsRecords = $this->route53->listResourceRecordSets('/hostedzone/123');
$exists = false;
foreach($dnsRecords["ResourceRecordSets"] as $dnsRecord) {
if($dnsRecord["Name"] == $domain."."
AND $dnsRecord["Type"] == "CNAME") {
$exists = true;
break;
}
}
if(!$exists) {
$change = $this->route53->prepareChange('CREATE', $domain.".", 'CNAME', 300, $this->instance->dnsName);
$this->route53->changeResourceRecordSets('/hostedzone/123', $change);
}
return $domain;
}
private function removeDomain() {
$change = $this->route53->prepareChange('DELETE', $this->domain.".", 'CNAME', 300, $this->instance->dnsName);
$this->route53->changeResourceRecordSets('/hostedzone/123', $change);
$this->domain = null;
}