mirror of
https://github.com/nmasur/dotfiles
synced 2025-11-21 18:42:42 +00:00
add bash to aws-ec2 launch script
This commit is contained in:
@@ -6,17 +6,17 @@
|
|||||||
# Specify AWS_PROFILE and AWS_REGION before running this script
|
# Specify AWS_PROFILE and AWS_REGION before running this script
|
||||||
|
|
||||||
aws ec2 describe-instances \
|
aws ec2 describe-instances \
|
||||||
--filters "Name=instance-state-name,Values=running" |
|
--filters "Name=instance-state-name,Values=running" |
|
||||||
jq -r \
|
jq -r \
|
||||||
'.Reservations[]
|
'.Reservations[]
|
||||||
| .Instances[]
|
| .Instances[]
|
||||||
| .InstanceId + " - " +
|
| .InstanceId + " - " +
|
||||||
(.PrivateIpAddress // "n/a") + " - " +
|
(.PrivateIpAddress // "n/a") + " - " +
|
||||||
(.PublicIpAddress // "n/a") + " - " +
|
(.PublicIpAddress // "n/a") + " - " +
|
||||||
(.Tags // [] | from_entries | .Name // "n/a")' |
|
(.Tags // [] | from_entries | .Name // "n/a")' |
|
||||||
fzf \
|
fzf \
|
||||||
--height 100% \
|
--height 100% \
|
||||||
--layout reverse \
|
--layout reverse \
|
||||||
--header $'Press Enter to start SSM session\nInstance ID - Private IP - Public IP - Name' \
|
--header $'Press Enter to start SSM session\nInstance ID - Private IP - Public IP - Name' \
|
||||||
--preview "aws ec2 describe-instances --instance-ids \"\$(echo {} | cut -d' ' -f1)\" | jq -r '.Reservations[].Instances[0]'" \
|
--preview "aws ec2 describe-instances --instance-ids \"\$(echo {} | cut -d' ' -f1)\" | jq -r '.Reservations[].Instances[0]'" \
|
||||||
--bind "enter:become(aws ssm start-session --target \$(echo {} | cut -d' ' -f1))"
|
--bind "enter:become(aws ssm start-session --document-name 'AWS-StartInteractiveCommand' --parameters '{\"command\": [\"bash\"]}' --target \$(echo {} | cut -d' ' -f1))"
|
||||||
|
|||||||
Reference in New Issue
Block a user