Search

Solution : "An error occurred (TargetNotConnected) when calling the StartSession operation: {instance-id} is not connected."

Created time
2022/02/14 16:37
Last edited time
2022/11/14 13:04
Tags
aws
I have a problem accessing Instance through Session Manager in AWS.That message is "An error occurred (TargetNotConnected) when calling the StartSession operation: {instance-id} is not connected.".In this post, We deal with how to solve this problem.We entered a command similar to the command below at the local terminal of Mac.
aws ssm start-session --target i-123456 --document-name AWS-StartSSHSession --parameters 'portNumber=8373'
Plain Text
복사
We got this error message.
An error occurred (TargetNotConnected) when calling the StartSession operation: i-123456 is not connected.
Plain Text
복사
It has two solutions about the error mentioned above.
Eventually, Solutions has common reason. Link
First of all, We have to check settings for "Session Manager".
Let's check steps of solution.
1. Check instance settings of "Session Manager" to be connected.
2. Check instance settings of "Session Manager" to connect.
$ aws configure AWS Access Key ID [None]: AKIAIOSFODNN7EXAMPLE AWS Secret Access Key [None]: wJalrXUtnFEMI/K7MDENG/bPxRfiCYEXAMPLEKEY Default region name [None]: us-west-2 Default output format [None]: json
Plain Text
복사
And then, try again this command.
aws ssmstart-session --target i-123456 --document-name AWS-StartSSHSession --parameters 'portNumber=8373'
Plain Text
복사
From now, We can access instance using by Session Manager.