Assign custom compliance metadata using the AWS CLI
The following procedure walks you through the process of using the AWS Command Line Interface (AWS CLI) to call the AWS Systems Manager PutComplianceItems API operation to assign custom compliance metadata to a resource. You can also use this API operation to manually assign patch or association compliance metadata to a managed nodes, as shown in the following walkthrough. For more information about custom compliance, see About custom compliance.
To assign custom compliance metadata to a managed instance (AWS CLI)
Install and configure the AWS Command Line Interface (AWS CLI), if you haven't already.
For information, see Installing or updating the latest version of the AWS CLI.
-
Run the following command to assign custom compliance metadata to a managed node. Replace each
example resource placeholder
with your own information. TheResourceType
parameter only supports a value ofManagedInstance
. Specify this value even if you are assigning custom compliance metadata to a managed AWS IoT Greengrass core device. -
Repeat the previous step to assign additional custom compliance metadata to one or more nodes. You can also manually assign patch or association compliance metadata to managed nodes by using the following commands:
Association compliance metadata
Patch compliance metadata
-
Run the following command to view a list of compliance items for a specific managed node. Use filters to drill down into specific compliance data.
The following examples show you how to use this command with filters.
-
Run the following command to view a summary of compliance statuses. Use filters to drill down into specific compliance data.
aws ssm list-resource-compliance-summaries --filters
One or more filters.
The following examples show you how to use this command with filters.
-
Run the following command to view a summary count of compliant and non-compliant resources for a compliance type. Use filters to drill down into specific compliance data.
aws ssm list-compliance-summaries --filters
One or more filters.
The following examples show you how to use this command with filters.