SSM Port Forwarding fails on multiple simultaneous connections #1653
-
Confirm by changing [ ] to [x] below to ensure that it's a bug:
Describe the bug
on terminal 1 and
on terminal 2. If I try to handlee the first command with
It will create session that appears in SessionManager, but then it disappears and mongodump fails with
and it does exit 1 Version of AWS SDK for Go? Version of Go ( To Reproduce (observed behavior) Expected behavior
instead of
Additional context Current work-around is to execute awscli command from golang code. |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments
-
I think you may be misunderstanding how the SSM Session API works, or there is some other detail left out of the report. The StartSession API call merely returns some credentials and a websocket endpoint for you to communicate with. It does not actually establish a connection with the host. The disconnect you are seeing is likely the timeout once AWS closes the connection because you aren't following up with the necessary websocket connection. Take a look at my ssm-session-client repo for how this should be handled. |
Beta Was this translation helpful? Give feedback.
-
Hello! Reopening this discussion to make it searchable. |
Beta Was this translation helpful? Give feedback.
I think you may be misunderstanding how the SSM Session API works, or there is some other detail left out of the report. The StartSession API call merely returns some credentials and a websocket endpoint for you to communicate with. It does not actually establish a connection with the host. The disconnect you are seeing is likely the timeout once AWS closes the connection because you aren't following up with the necessary websocket connection.
Take a look at my ssm-session-client repo for how this should be handled.
One note, my code doesn't handle multiplexed port forwarding either. However, the AWS CLI SSM plugin does