Programmatically get AWS Route 53 Hosted Zone ID from AWS Region using AWS CLI

289 views Asked by At

Currently I'm using https://docs.aws.amazon.com/general/latest/gr/elb.html as reference:

if [ $AWS_REGION = "us-west-1" ]; then f AWS_HOSTED_ZONE_ID__ELB "Z368ELLRRE2KJ0"; fi
if [ $AWS_REGION = "us-west-2" ]; then f AWS_HOSTED_ZONE_ID__ELB "Z1H1FL5HABSF5"; fi
if [ $AWS_REGION = "us-east-1" ]; then f AWS_HOSTED_ZONE_ID__ELB "Z35SXDOTRQ7X7K"; fi
if [ $AWS_REGION = "us-east-2" ]; then f AWS_HOSTED_ZONE_ID__ELB "Z3AADJGX6KTTL2"; fi

Is there a better way to do this?

0

There are 0 answers