aws ssm describe-instance-patch-states-for-patch-group
Retrieves the high-level patch state for the managed nodes in the specified patch group. AWS CLI reference
3 examples 4 options Its page in the AWS CLI reference
Examples
Example 1: To get the instance states for a patch group
The following describe-instance-patch-states-for-patch-group example retrieves details about the patch summary states per-instance for the specified patch group.
aws ssm describe-instance-patch-states-for-patch-group --patch-group "Production"Identify--patch-groupThe name of the patch group for which the patch state information should be retrieved.Its output, shortened
{
"InstancePatchStates": [
{
"InstanceId": "i-02573cafcfEXAMPLE",
"PatchGroup": "Production",
"BaselineId": "pb-0c10e65780EXAMPLE",
"SnapshotId": "a1b2c3d4-5678-90ab-cdef-EXAMPLE11111",
"OwnerInformation": "",
"InstalledCount": 32,
"InstalledOtherCount": 1,
"InstalledPendingRebootCount": 0,
"InstalledRejectedCount": 0,
"MissingCount": 2,
"FailedCount": 0,
"UnreportedNotApplicableCount": 2671,
"NotApplicableCount": 400,
"OperationStartTime": "2021-08-04T11:03:50.590000-07:00",
"OperationEndTime": "2021-08-04T11:04:21.555000-07:00",
"Operation": "Scan",
"RebootOption": "NoReboot",
"CriticalNonCompliantCount": 0,
"SecurityNonCompliantCount": 1,
"OtherNonCompliantCount": 0
},
{
"InstanceId": "i-0471e04240EXAMPLE",
"PatchGroup": "Production",
"BaselineId": "pb-09ca3fb51fEXAMPLE",
"SnapshotId": "a1b2c3d4-5678-90ab-cdef-EXAMPLE22222",
"OwnerInformation": "",
… 18 more linesExample 2: To get the instance states for a patch group with more than five missing patches
The following describe-instance-patch-states-for-patch-group example retrieves details about the patch summary states for the specified patch group for instances with more than five missing patches.
aws ssm describe-instance-patch-states-for-patch-group --filters Key=MissingCount,Type=GreaterThan,Values=5 --patch-group "Production"Identify--filtersEach entry in the array is a structure containing: Key (string between 1 and 200 characters) Values (array containing a single string) Type (string "Equal", "NotEqual", "LessThan", "GreaterThan")--patch-groupThe name of the patch group for which the patch state information should be retrieved.Its output
{
"InstancePatchStates": [
{
"InstanceId": "i-02573cafcfEXAMPLE",
"PatchGroup": "Production",
"BaselineId": "pb-0c10e65780EXAMPLE",
"SnapshotId": "a1b2c3d4-5678-90ab-cdef-EXAMPLE11111",
"OwnerInformation": "",
"InstalledCount": 46,
"InstalledOtherCount": 4,
"InstalledPendingRebootCount": 1,
"InstalledRejectedCount": 1,
"MissingCount": 7,
"FailedCount": 0,
"UnreportedNotApplicableCount": 232,
"NotApplicableCount": 654,
"OperationStartTime": "2021-08-04T11:03:50.590000-07:00",
"OperationEndTime": "2021-08-04T11:04:21.555000-07:00",
"Operation": "Scan",
"RebootOption": "NoReboot",
"CriticalNonCompliantCount": 0,
"SecurityNonCompliantCount": 1,
"OtherNonCompliantCount": 1
}
]
}Example 3: To get the instance states for a patch group with fewer than ten instances that require a reboot
The following describe-instance-patch-states-for-patch-group example retrieves details about the patch summary states for the specified patch group for instances with fewer than ten instances requiring a reboot.
aws ssm describe-instance-patch-states-for-patch-group --filters Key=InstalledPendingRebootCount,Type=LessThan,Values=10 --patch-group "Production"Identify--filtersEach entry in the array is a structure containing: Key (string between 1 and 200 characters) Values (array containing a single string) Type (string "Equal", "NotEqual", "LessThan", "GreaterThan")--patch-groupThe name of the patch group for which the patch state information should be retrieved.Its output
{
"InstancePatchStates": [
{
"InstanceId": "i-02573cafcfEXAMPLE",
"BaselineId": "pb-0c10e65780EXAMPLE",
"SnapshotId": "a1b2c3d4-5678-90ab-cdef-EXAMPLE11111",
"PatchGroup": "Production",
"OwnerInformation": "",
"InstalledCount": 32,
"InstalledOtherCount": 1,
"InstalledPendingRebootCount": 4,
"InstalledRejectedCount": 0,
"MissingCount": 2,
"FailedCount": 0,
"UnreportedNotApplicableCount": 846,
"NotApplicableCount": 212,
"OperationStartTime": "2021-08-06T11:03:50.590000-07:00",
"OperationEndTime": "2021-08-06T11:04:21.555000-07:00",
"Operation": "Scan",
"RebootOption": "NoReboot",
"CriticalNonCompliantCount": 0,
"SecurityNonCompliantCount": 1,
"OtherNonCompliantCount": 0
}
]
}For more information, see Understanding patch compliance state values in the AWS Systems Manager User Guide.
Options
--filtersEach entry in the array is a structure containing: Key (string between 1 and 200 characters) Values (array containing a single string) Type (string "Equal", "NotEqual", "LessThan", "GreaterThan")--max-resultsThe maximum number of patches to return (per page).--next-tokenThe token for the next set of items to return.--patch-groupThe name of the patch group for which the patch state information should be retrieved.