TargetNotConnected when opening a SSM session on EC2

0

Hi all, I'm a beginner and I apologize for the silly question. I have two EC2 instances on the same availability zone, to which I attached the same IAM role containing the policy AmazonSSMManagedInstanceCore. This policy should allow working with SSM. While I can start and open a session for tunnel forwarding via AWS CLI with the first instance, I cannot do the same for the second one, and I don't understand why. When I start the first instance, I see it under the target instances in the session manager. If I do it for the second one, this isn't the case. I went through this -> https://docs.aws.amazon.com/systems-manager/latest/userguide/session-manager-troubleshooting.html#ssh-target-not-connected, but I couldn't solve the issue. It might be a simple solution, but I cannot see it without help. Regards

AP.

asked 2 years ago4991 views
2 Answers
0

could you please check if SSM agent is installed. I am not sure which OS you are using. Hence here is the link that might help https://docs.aws.amazon.com/systems-manager/latest/userguide/ssm-agent.html

profile picture
Sri
answered 2 years ago
0

Hi!

If one instance works and the other doesn't, could you check the following:

  • Are both instances started from the same OS (and from the same Amazon Machine Image)?
  • Do they both have similar configuration, specifically the instance profile (IAM) for the ec2 instances?
  • Is the SSM Agent installed on the troublesome EC2 instance?
  • Do the instances have the proper outbound connectivity? (Outbound to some AWS services including ec2messages.region.amazonaws.com, ssm.region.amazonaws.com, ssmmessages.region.amazonaws.com)

Check out the prerequisites here: https://docs.aws.amazon.com/systems-manager/latest/userguide/session-manager-prerequisites.html

jsonc
answered 2 years ago

You are not logged in. Log in to post an answer.

A good answer clearly answers the question and provides constructive feedback and encourages professional growth in the question asker.

Guidelines for Answering Questions