aws / amazon-ssm-agent

An agent to enable remote management of your EC2 instances, on-premises servers, or virtual machines (VMs).
https://aws.amazon.com/systems-manager/
Apache License 2.0
1.04k stars 322 forks source link

DescribeInstanceInformation does not return ConnectionLost instances #407

Open tim-finnigan opened 2 years ago

tim-finnigan commented 2 years ago

Originally raised in this issue: https://github.com/boto/boto3/issues/3011

The expectation is that this service API would return all instances, even those with a PingStatus of ConnectionLost: https://docs.aws.amazon.com/systems-manager/latest/APIReference/API_DescribeInstanceInformation.html

But as soon as I stop an instance it no longer gets returned from that API call. Is that the expected behavior? If so, should that be clarified in the documentation?

VishnuKarthikRavindran commented 2 years ago

Hi @tim-finnigan, Have passed this issue to the team who own this API. Will post here if they/we have any update on this. Thanks.

yuting-fan commented 2 years ago

Hi @tim-finnigan ,

A stopped instance means its lifecycle has ended in the point of view of InstanceInformation. A ConnectionLost instance refers to the instances that are running but fail the health check from SSM, which can be caused by multiple reasons mentioned here https://aws.amazon.com/premiumsupport/knowledge-center/ssm-connection-lost-status/.

If you "start" the stopped instance again and the health check succeeds, it would show up in the DescribeInstanceInformation response.

The team is working on improving the documentation to reflect these details. Thank you for reporting the misses in the documentation!

Cheers, Yuting