My task is to clear out our Route 53
from all the old Domain names. We have 700 records but only 200 running instances.
I have tried AWS CLI to get the EC2
instances IP address which worked fine.
I can't seem to make a correct query on Route 53
CLI to get just the Domain Names plus the A records.
Ideally, I'd get both in a CSV format then use python to compare them.
Here is one of the Route 53
queries I tried:
aws route53 list-resource-record-sets --hosted-zone-id XXXX --output text --query 'ResourceRecordSets[*].[Name,ResourceRecords[*]]' | sed -E 's/\s+/,/g' > domains.csv