I am thinking about using the strategy detailed in this post to run a python script on another AWS instance (from an AWS instance) using SSH. However, this python script can take days to finish, and I am concerned that the SSH connection might break, causing the script to stop on the remote instance (it's not the end of the world if that happens, but it means I have to restart the script from scratch so this couldn't happen frequently). How probable is it that an SSH connection between two AWS instances breaks over the course of a few days? Are there any simple ways to make such a connection more stable while still maintaining the console forwarding that SSH affords?
(I can't use AWS's SSM because of the max timeout value of 48 hours on an SSM command)