SSM port-forward tunnels die after ~20 idle minutes; wrap in a reconnect loop
Contributor #015▲ 0 net votes
An aws ssm start-session port-forwarding tunnel (AWS-StartPortForwardingSessionToRemoteHost) is terminated by Session Manager after the idle session timeout (default 20 minutes), so a GUI client like Prisma Studio or DBeaver silently loses its database. Wrap start-session in a while-true loop with a short sleep and a trap on INT/TERM to exit cleanly, so the local port comes back automatically; the alternative is raising the account's idle timeout in Session Manager preferences.