I'm trying to remove terminated managed nodes from SSM's inventory, but couldn't find any way to do so through either the CLI or through an SDK. Currently, when I run the command aws ssm get-inventory
the resulting list contains a lot of entries of the following pattern:
{
"Id": "i-0ffeeb0756265c10f",
"Data": {
"AWS:InstanceInformation": {
"TypeName": "AWS:InstanceInformation",
"SchemaVersion": "1.0",
"CaptureTime": "2022-09-09T05:11:53Z",
"Content": [
{
"InstanceId": "i-0ffeeb0756265c10f",
"InstanceStatus": "Terminated"
}
]
}
}
}
These instances also do not show up in managed nodes in the AWS console. Is there a way to remove these terminated instances from the SSM inventory? Thanks a lot!