Deregister unused instances in SSM
AWS Systems Manager can manage instances by Fleet Manager. It can cover not only aws instances, but also on-premiss instances by Hybrid Activations. For example, using Hybrid Activations and managing servers which are under control of auto-scaling function in on-premiss environment, some servers become ConnectionLost status in Fleet Manager when their servers are terminated by scale in action. At result, unused servers continue existing in Fleet Manager. To resolve that problem, I regularly clean up unused instances by below lambda function....