r/aws•
Mallachar

Route53 Boto3: List all A records only?

Hello All,

I am currently using R53 boto3 to try to get a list of all of my FQDNs, but I only want to return A records.

Here is a sample of what I am doing right now. (Actual resources are obstructed)

r53_resources = r53.list_resource_record_sets(HostedZoneId='XXXXXXXXXXXX')

list_fqdns = [rr['Name'] for rrs in r53_resources['ResourceRecordSets'] for rr in rrs ['ResourceRecords']]

Right now, this sort of works, problem is, it returns my NS and SOA. How can I change this so that it only returns A records?

Here is my sample output.

['my-fqdn.com.', 'my-fqdn.com.', 'test1.my-fqdn.com.', 'test2.my-fqdn.com.']

The only ones I want to show up are test1 and test2

Posted Aug 29, 2016, 11:16 PM UTC

118
Loading comments…