It was querying two record sets and assuming both were A records, which I don't think is possible. The Route 53 UI errors if I try to create two A records with the same name, at least. So, not sure what the intention was there.
Instead, this queries one record, and errors if it isn't an A record. Since the query starts at A records, it'll find the one and only A record if it exists.
The zone apex (aka root domain) has multiple record sets:
A
,NS
andSOA
at least.For example:
It was querying two record sets and assuming both were A records, which I don't think is possible. The Route 53 UI errors if I try to create two A records with the same name, at least. So, not sure what the intention was there.
Instead, this queries one record, and errors if it isn't an A record. Since the query starts at A records, it'll find the one and only A record if it exists.