Services or capabilities described in Amazon Web Services documentation might vary by Region. To see the differences applicable to the China Regions,
see Getting Started with Amazon Web Services in China
(PDF).
Amazon Systems Manager Change Manager is no longer open to new customers. Existing customers can continue to use the service as normal. For more information, see
Amazon Systems Manager Change Manager availability change.
Use DescribePatchGroupState with a CLI
The following code examples show how to use DescribePatchGroupState.
- CLI
-
- Amazon CLI
-
To get the state of a patch group
The following describe-patch-group-state example retrieves the high-level patch compliance summary for a patch group.
aws ssm describe-patch-group-state \
--patch-group "Production"
Output:
{
"Instances": 21,
"InstancesWithCriticalNonCompliantPatches": 1,
"InstancesWithFailedPatches": 2,
"InstancesWithInstalledOtherPatches": 3,
"InstancesWithInstalledPatches": 21,
"InstancesWithInstalledPendingRebootPatches": 2,
"InstancesWithInstalledRejectedPatches": 1,
"InstancesWithMissingPatches": 3,
"InstancesWithNotApplicablePatches": 4,
"InstancesWithOtherNonCompliantPatches": 1,
"InstancesWithSecurityNonCompliantPatches": 1,
"InstancesWithUnreportedNotApplicablePatches": 2
}
For more information, see About patch groups <https://docs.aws.amazon.com/systems-manager/latest/userguide/sysman-patch-patchgroups.html>__ and Understanding patch compliance state values in the Amazon Systems Manager User Guide.
- PowerShell
-
- Tools for PowerShell V4
-
Example 1: This example gets the high-level patch compliance summary for a patch group.
Get-SSMPatchGroupState -PatchGroup "Production"
Output:
Instances : 4
InstancesWithFailedPatches : 1
InstancesWithInstalledOtherPatches : 4
InstancesWithInstalledPatches : 3
InstancesWithMissingPatches : 0
InstancesWithNotApplicablePatches : 0
- Tools for PowerShell V5
-
Example 1: This example gets the high-level patch compliance summary for a patch group.
Get-SSMPatchGroupState -PatchGroup "Production"
Output:
Instances : 4
InstancesWithFailedPatches : 1
InstancesWithInstalledOtherPatches : 4
InstancesWithInstalledPatches : 3
InstancesWithMissingPatches : 0
InstancesWithNotApplicablePatches : 0
For a complete list of Amazon SDK developer guides and code examples, see
Using this service with an Amazon SDK.
This topic also includes information about getting started and details about previous SDK versions.