I am newbie to Amazon Services and their API.
Using Amazon route53Clinet class, I know there is a method getHostedZone which get the Hosted Zone information on the
I use the AWS CLI and pipe the JSON results to the jq tool:
aws route53 list-hosted-zones-by-name |
jq --arg name "example.com." \
-r '.HostedZones | .[] | select(.Name=="\($name)") | .Id'
The jq expression selects each hosted zone JSON item that contains the name "example.com". Heads up that this may return more than one record.
The output is the matching hosted zone id strings such as:
/hostedzone/ABCDEF12345678
You can then list resource record sets for a hosted zone id:
aws route53 list-resource-record-sets \
--hosted-zone-id "/hostedzone/ABCDEF12345678"