I'm trying to get the availability zone by instance type in was.
let's say I know the Region: us-west-2
and I also know which instance type I want: c5n.large.
is there a way to get the Availability Zones if I know the Region and the instance type?
I'm looking for a way to do it with JS or Ruby code, and without authication .
what I found so far is running a command inside the instance but this is not helping me because I don't want to run the instance, I want the info before I run it.
az=$(curl -s http://169.254.169.254/latest/meta-data/placement/availability-zone)
echo ${az}
I'm looking for something more dynamic, like giving the Region and instance type and get result of the availability-zone the instance can run on.
thank you!