Get all A Records from route 53 using CLI and export to CSV

0

I've been trying to get all the listed A records on our system due to us having a mismatch between our instances and the number of A records we have. I have asked in numerous places and look online and it seems to be quite difficult to do. I either get only a partial listing or a listing with out extraneous information.

What would be an aws cli command to get only a records

1 Antwort
2

There isnt a way to do this natively

You can try this cli command (from here)

aws route53 list-resource-record-sets --hosted-zone-id "/hostedzone/Z#################" | jq -r '.ResourceRecordSets[] | [.Name, .Type, (.ResourceRecords[]? | .Value), .AliasTarget.DNSName?] | @csv'

You may have issues if there are more than 1000 record sets as you will hit the pagination limit.

You can also try a third party too like cli53 that can export the zone to BIND format

profile pictureAWS
EXPERTE
Matt-B
beantwortet vor 2 Jahren
profile pictureAWS
EXPERTE
Chris_G
überprüft vor 2 Jahren

Du bist nicht angemeldet. Anmelden um eine Antwort zu veröffentlichen.

Eine gute Antwort beantwortet die Frage klar, gibt konstruktives Feedback und fördert die berufliche Weiterentwicklung des Fragenstellers.

Richtlinien für die Beantwortung von Fragen