Skip to content

Instantly share code, notes, and snippets.

@tfentonz
Created August 3, 2022 20:53
Show Gist options
  • Save tfentonz/1820b980b76fa1c5cb23cf1c9f3dacb6 to your computer and use it in GitHub Desktop.
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
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