I've started a session with the command
aws ssm start-session --target <instance id> --region <my region>
, and when I do that I get Starting session with SessionId <sessionid>
and am logged into the ec2 instance. I then left my computer and the connection timed out. Now I want to return to that session.
I tried the command
aws ssm resume-session --session-id <sessionid from above> --region <my region>
which returns something like
{ "SessionId": "<sessionid from above>", "TokenValue": "", "StreamUrl": "<url here>" }
. But how do I actually connect again? That leaves me on my local computer, whereas the start session
command puts me on the aws instance. If I try the start-session command again, I get a brand new session. I feel like I am missing something obvious!
as the aws cli docs state you'll need to be sure that you've configured the following:
For more information, see Install the Session Manager Plugin for the AWS CLI in the AWS Systems Manager User Guide: https://docs.aws.amazon.com/systems-manager/latest/userguide/session-manager-working-with-install-plugin.html
Also please be aware of the following:
anyhoo, I've you started a session and timeout/disconnect the resume session command will provide you with a new instance that you can immediately use as per the docs: