Skip to content

Instantly share code, notes, and snippets.

@Console32
Last active October 9, 2019 15:58
Show Gist options
  • Save Console32/749e662f58e0d3b6d7499403b27e4e48 to your computer and use it in GitHub Desktop.
Save Console32/749e662f58e0d3b6d7499403b27e4e48 to your computer and use it in GitHub Desktop.
alias instances='aws ec2 describe-instances \
--query "Reservations[*].Instances[*]. \
{ \
name: Tags[?Key=='\''Name'\''] |[0].Value, \
instance_id: InstanceId, \
ip_address: PrivateIpAddress, \
state: State.Name \
}" \
--output table'
beam() {
aws ssm start-session --target $1
}
tunnel() {
aws ssm start-session --target $1
--document-name AWS-StartPortForwardingSession
--parameters '{"portNumber":["'$2'"], "localPortNumber":["'$3'"]}'
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment