ponkio-o/ec2x

Use the SSM API along with the EC2 API

Closed this issue · 0 comments

Summary

Should to use Systems Manager API to find EC2 instances. Because, EC2 instances that can use session-manager are not always found use with EC2 API.

Solution

Use the DescribeInstanceInformation along with the EC2 API.
https://docs.aws.amazon.com/systems-manager/latest/APIReference/API_DescribeInstanceInformation.html

This API can get AssociationStatus.
https://docs.aws.amazon.com/systems-manager/latest/APIReference/API_InstanceInformation.html#systemsmanager-Type-InstanceInformation-AssociationStatus