Created
February 22, 2018 10:45
-
-
Save krishnan-mani/ee599fdb068112a9d33bbaff756c0461 to your computer and use it in GitHub Desktop.
Describe EC2 instances by filtering on tag values, then stop a list of instances by instance-id
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=tag:Name,Values=CodeDeployDemo" \ | |
--query "Reservations[*].Instances[*].InstanceId" \ | |
--output text | |
$ aws ec2 stop-instances --instance-ids i-abc17charsid01 i-def17charsid02 i-pqr17charsid-03 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment