Skip to content

Instantly share code, notes, and snippets.

@crashGoBoom
Last active July 1, 2020 19:58
Show Gist options
  • Save crashGoBoom/9b7cb71623c34dcfb9d912d2f1d2a096 to your computer and use it in GitHub Desktop.
Save crashGoBoom/9b7cb71623c34dcfb9d912d2f1d2a096 to your computer and use it in GitHub Desktop.
Local Port Forwarding with AWS SSM
#!/bin/bash
# Usage: ./ssm_local.sh i-xxxxxxxxxx 80
_instance_id="${1}"
_instance_port="${2}"
aws ssm start-session --target "${_instance_id}" \
--document-name AWS-StartPortForwardingSession \
--parameters "{\"portNumber\":[\"${_instance_port}\"],\"localPortNumber\":[\"9000\"]}"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment