Skip to content

Instantly share code, notes, and snippets.

@MacPower
MacPower / gist:ee4bb6a873f8473d2fdff230fb936bd0
Created December 7, 2020 17:55
Retrieve the AWS zone Id from ec2 instance
aws ec2 describe-availability-zones --query "AvailabilityZones[0].ZoneId" --filter Name=zone-name,Values=$(ec2-metadata -z | awk '{print $2}')