Last active
October 27, 2016 16:00
-
-
Save ukn/0b0687c34f03254b7de331551a8c86ab to your computer and use it in GitHub Desktop.
Revisions
-
ukn revised this gist
Oct 27, 2016 . 1 changed file with 2 additions and 2 deletions.There are no files selected for viewing
This file contains hidden or 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 charactersOriginal file line number Diff line number Diff line change @@ -5,8 +5,8 @@ awsls(){ temp=`aws ec2 describe-instances --profile ${1}` fi # All tags version # aws ec2 describe-instances | jq -r '.Reservations[].Instances[] | | select (.State.Name != "terminated") | .InstanceId + "\t" + .PrivateIpAddress + "\t" + .PublicIpAddress + "\t" + .InstanceType + "\t" + (reduce.Tags[] as $tag (""; . + $tag.Key + "=" + $tag.Value + " "))' echo $temp | jq -r '.Reservations[].Instances[] | select (.State.Name != "terminated") | .InstanceId + "\t" + .PrivateIpAddress + "\t" + ( if .PublicIpAddress then .PublicIpAddress else "\t" end) + "\t" + .InstanceType + "\t" + .State.Name + "\t " + (.Tags[] | select(.Key == "Name") | .Key + ":" + .Value)' unset temp -
ukn renamed this gist
Oct 27, 2016 . 1 changed file with 0 additions and 0 deletions.There are no files selected for viewing
File renamed without changes. -
ukn renamed this gist
Oct 27, 2016 . 1 changed file with 0 additions and 0 deletions.There are no files selected for viewing
File renamed without changes. -
ukn revised this gist
Oct 27, 2016 . 2 changed files with 13 additions and 1 deletion.There are no files selected for viewing
This file contains hidden or 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 charactersOriginal file line number Diff line number Diff line change @@ -1 +0,0 @@ This file contains hidden or 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 charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,13 @@ awsls(){ if [ -z ${1+x} ]; then temp=`aws ec2 describe-instances` else temp=`aws ec2 describe-instances --profile ${1}` fi # All tag version #aws ec2 describe-instances | jq -r '.Reservations[].Instances[] | | select (.State.Name != "terminated") | .InstanceId + "\t" + .PrivateIpAddress + "\t" + .PublicIpAddress + "\t" + .InstanceType + "\t" + (reduce.Tags[] as $tag (""; . + $tag.Key + "=" + $tag.Value + " "))' echo $temp | jq -r '.Reservations[].Instances[] | select (.State.Name != "terminated") | .InstanceId + "\t" + .PrivateIpAddress + "\t" + ( if .PublicIpAddress then .PublicIpAddress else "\t" end) + "\t" + .InstanceType + "\t" + .State.Name + "\t " + (.Tags[] | select(.Key == "Name") | .Key + ":" + .Value)' unset temp } -
ukn revised this gist
Oct 27, 2016 . No changes.There are no files selected for viewing
-
ukn renamed this gist
Oct 27, 2016 . 1 changed file with 0 additions and 0 deletions.There are no files selected for viewing
File renamed without changes. -
ukn renamed this gist
Oct 27, 2016 . 1 changed file with 0 additions and 0 deletions.There are no files selected for viewing
File renamed without changes. -
ukn created this gist
Oct 27, 2016 .There are no files selected for viewing
This file contains hidden or 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 charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1 @@ jq -r '.Reservations[].Instances[] | select (.State.Name != "terminated") | .InstanceId + "\t" + .PrivateIpAddress + "\t" + ( if .PublicIpAddress then .PublicIpAddress else "\t" end) + "\t" + .InstanceType + "\t" + .State.Name + "\t " + (.Tags[] | select(.Key == "Name") | .Key + ":" + .Value)'