Created
August 3, 2022 20:53
-
-
Save tfentonz/1820b980b76fa1c5cb23cf1c9f3dacb6 to your computer and use it in GitHub Desktop.
AWS CLI command to return EC2 instances that have Windows with SQL Server Standard platform
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-instances \ | |
--filters \ | |
"Name=instance-state-name,Values=running" \ | |
"Name=platform,Values=windows" \ | |
--query 'Reservations[*].Instances[?PlatformDetails==`Windows with SQL Server Standard`].{Name:Tags[?Key==`Name`]|[0].Value,InstanceId:InstanceId,Status:State.Name,InstanceType:InstanceType,ImageId:ImageId,Platform:Platform,PlatformDetails:PlatformDetails}|[]' \ | |
--output json |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment