diff --git a/fish/theme-t31m/ssm_tunnel.fish b/fish/theme-t31m/ssm_tunnel.fish index bc43066..09e34c2 100644 --- a/fish/theme-t31m/ssm_tunnel.fish +++ b/fish/theme-t31m/ssm_tunnel.fish @@ -22,13 +22,14 @@ function ssm_tunnel --description 'access private AWS ressources via Bastion Hos # Ports to bind for forwarding set LOCAL_PORT $argv[2] set REM_PORT (math (random) % 65535 + 2000) + set TIMEOUT 21600 #seconds until forwarding session times out (48h max) # make sure jq is installed # Start socat on the remote server set CMD "'sudo socat TCP4-LISTEN:$REM_PORT,fork TCP4:$REMOTE_HOST'" set CMD_INVOC_ID (aws ssm send-command --instance-ids $INSTANCE_ID \ --document-name 'AWS-RunShellScript' \ - --parameters commands=$CMD --output json | jq -r '.Command.CommandId') + --parameters "commands=$CMD,executionTimeout=$TIMEOUT" --output json | jq -r '.Command.CommandId') # Start tunnel session echo "Starting Tunnel"