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 回答
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
专家
Matt-B
已回答 2 年前
profile pictureAWS
专家
Chris_G
已审核 2 年前

您未登录。 登录 发布回答。

一个好的回答可以清楚地解答问题和提供建设性反馈,并能促进提问者的职业发展。

回答问题的准则