Skip to content

Instantly share code, notes, and snippets.

@tfentonz
Created September 7, 2021 07:56
Show Gist options
  • Save tfentonz/39a0ff2136a724bc634fc491c95139d1 to your computer and use it in GitHub Desktop.
Save tfentonz/39a0ff2136a724bc634fc491c95139d1 to your computer and use it in GitHub Desktop.
AWS CLI get instance ID by name
aws ec2 describe-instances \
--filters "Name=tag:Name,Values=some-name" \
--query 'Reservations[].Instances[].[InstanceId]' \
--output text
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment