Basically it's a --filter
\ --query
question because the docs are kind of messy, what I'm trying to get is the A record in route53 of a specific ip address.
Of course I have this:
aws route53 list-resource-record-sets --hosted-zone-id XXXX123XX
Which outputs a json with all of my existing records on the specified zone, but to filter a specific IP from it and get not the IP but the actual DNS record, I couldn't figure out how to get besides cutting it with bash tools.
Desired output:
my-record.my-domain.com
Can you guys help me out? Thanks.
Example:
aws route53 list-resource-record-sets --hosted-zone-id Z3MANQ630XXXXX --query "ResourceRecordSets[?ResourceRecords[?Value == '10.100.125.42']]"
Filtering output:
aws route53 list-resource-record-sets --hosted-zone-id Z3MANQ630XXXXX --query "ResourceRecordSets[?ResourceRecords[?Value == '10.100.125.42']]" |jq -r .[].Name
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With