EC2へのssh接続を名前でできるようにするためのconfigを作るためのコマンド


UserとIdentityFileは適宜変更してください。

aws ec2 describe-instances | jq -r '[ .Reservations[].Instances[] | [ .InstanceId, (.Tags[]? | select(.Key == "Name")).Value, .PublicDnsName ]] | sort_by(.[1]) | .[] | "Host \(.[1])\nHostName \(.[2])\nUser hoge\nPort 22\nIdentityFile /path/to/key\n"'