Last active
October 30, 2023 22:08
-
-
Save sebsto/62c66d17d097a87a480723cc86d6ee17 to your computer and use it in GitHub Desktop.
AWS Amazon EC2 Mac : find macOS AMI IDs
This file contains hidden or 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
# list all the AMIs for a major macOS version | |
REGION=us-east-1 | |
MACOS_VERSION=14 | |
aws ec2 describe-images \ | |
--region $REGION \ | |
--filters Name=name,Values="amzn-ec2-macos-$MACOS_VERSION*" \ | |
--owners amazon \ | |
--query 'Images[*].[Architecture,Description,ImageId]' \ | |
--output text | |
# list the most recent AMI for a major macOS version. | |
aws ec2 describe-images \ | |
--region $REGION \ | |
--filters "Name=architecture,Values=arm64_mac" "Name=name,Values=amzn-ec2-macos-$MACOS_VERSION.*-arm64" \ | |
--owners amazon \ | |
--query 'sort_by(Images, &CreationDate)[-1].[ImageId]' \ | |
--output text |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment