Route53 uses a custom record type for SPF (#787)

Much like OVH Route53 when queried returns SPF records as their own
type. This small change transcribes the SPF type to TXT

See: https://github.com/StackExchange/dnscontrol/issues/446
See: 644ba70e87/providers/ovh/ovhProvider.go (L169-L172)
This commit is contained in:
Blake Bourque 2020-07-17 13:02:42 -04:00 committed by GitHub
parent 644ba70e87
commit ea328263c7
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -377,10 +377,14 @@ func nativeToRecords(set *r53.ResourceRecordSet, origin string) []*models.Record
switch rtype := *set.Type; rtype {
case "SOA":
continue
case "SPF":
// route53 uses a custom record type for SPF
rtype = "TXT"
fallthrough
default:
rc := &models.RecordConfig{TTL: uint32(*set.TTL)}
rc.SetLabelFromFQDN(unescape(set.Name), origin)
if err := rc.PopulateFromString(*set.Type, *rec.Value, origin); err != nil {
if err := rc.PopulateFromString(rtype, *rec.Value, origin); err != nil {
panic(fmt.Errorf("unparsable record received from R53: %w", err))
}
results = append(results, rc)