Created
December 7, 2020 17:55
-
-
Save MacPower/ee4bb6a873f8473d2fdff230fb936bd0 to your computer and use it in GitHub Desktop.
Retrieve the AWS zone Id from ec2 instance
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
aws ec2 describe-availability-zones --query "AvailabilityZones[0].ZoneId" --filter Name=zone-name,Values=$(ec2-metadata -z | awk '{print $2}') |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment