Last active
March 20, 2017 22:25
-
-
Save sidewinder12s/2bc679e738d5eeec35fa0946d524f9aa to your computer and use it in GitHub Desktop.
Lists out instances that have been user shutdown. Display's Instance ID, Shutdown Date, Contact & Name tags.
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 --region us-west-2 --output text --filters Name=state-reason-code,Values=Client.UserInitiatedShutdown --query 'sort_by(Reservations[*].Instances[], &StateTransitionReason)[*].[InstanceId,`,`, StateTransitionReason,`,`, [Tags[?Key==`Name`].Value] [0][0],`,`, [Tags[?Key==`Contact`].Value] [0][0] ]' > shutdown_instances.csv |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment