In starting a session using the aws-sdk-go-v2 library I have tried various settings for changing the websocket timeout value (30 seconds is the current timeout I see). In the AWS documentation they suggested the following:
ctx, _ := context.WithTimeout(context.Background(), time.Hour)
ses, err := ssm.NewFromConfig(cfg).StartSession(ctx, in)
But this timeout is for your request processing, not the steady state communications link. The SDK is effectively setting up a websocket that is to be maintained. I was able to work around this while setting up an RDP session as I could create layer 7 application traffic to keep the socket alive for an hour or more. But in another case I want to use the same SDK to connect to a database and in this case there is no layer 7 that I have access to.
The questions I have are:
- Is there a configuration parameter for keeping the SDK websocket alive for more than 30 seconds?
- Is this SDK websocket only for transient data exchanges and is therefore designed to terminate within 30 seconds?
- Are there any workarounds for a database connection scenario where I might inject layer 7 traffic to keep the websocket alive?