Last active
March 18, 2019 07:30
-
-
Save tamakiii/c5b6b932e9662722ae74c040b411df68 to your computer and use it in GitHub Desktop.
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 characters
# ssm start-session with fzf | |
aws ssm start-session --target $(aws ec2 describe-instances | jq -cC '.Reservations[].Instances[] | select(.Tags[].Key == "Name") | {Name: .Tags[].Value, InstanceId: .InstanceId }' | fzf --ansi | jq -r '.InstanceId') | |
# get instances which have publicDnsName | |
aws ec2 describe-instances | jq -c '.Reservations[].Instances[] | select(.Tags[].Key == "Name") | select(.PublicDnsName != "") | select(.State.Name == "running") | {"Name": .Tags[].Value, "InstanceId": .InstanceId, "PublicDnsName": .PublicDnsName }' | fzf | jq -r '.PublicDnsName' | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment