I have created an EC2 instance in a private subnet (i.e. the route table has no Internet Gateway attached).
The route table attached to the private subnet routes 0.0.0.0/0 to a NAT Gateway.
The EC2 instance has the correct SSM Role and appears in the SSM Managed Instance list.
I can initiate a session onto the instance via Session Manager.
However when I remove the NAT Gateway mapping from the route table the session connection does not connect.
My understanding was that the NAT is only for outgoing traffic. So I assume the Session Manager connection is routed via the internal AWS network not the public internet because the instance is not reachable. However I don't understand why the instance is trying to route traffic via the public internet. I would have expected maybe that to register itself as a managed instance with SSM the SSM agent on the instance would need internet access. But I do not understand why Session Manager would require the instance to have internet access?
Thanks.