put_compliance_items
async
¶
put_compliance_items(
resource_id: ComplianceResourceId,
resource_type: ComplianceResourceType,
compliance_type: ComplianceTypeName,
execution_summary: ComplianceExecutionSummary,
items: ComplianceItemEntryList,
*,
config_overrides: Optional[AsyncSSMClientConfig] = None,
item_content_hash: Optional[ComplianceItemContentHash] = None,
upload_type: Optional[ComplianceUploadType] = None,
) -> PutComplianceItemsResult
Registers a compliance type and other compliance details on a designated resource. This operation lets you register custom compliance details with a resource. This call overwrites existing compliance information on the resource, so you must provide a full list of compliance items each time that you send the request.
ComplianceType can be one of the following:
-
ExecutionId: The execution ID when the patch, association, or custom compliance item was applied.
-
ExecutionType: Specify patch, association, or Custom:
string. -
ExecutionTime. The time the patch, association, or custom compliance item was applied to the managed node.
For State Manager associations, this represents the time when compliance status was captured by the Systems Manager service during its internal compliance aggregation workflow, not necessarily when the association was executed on the managed node. State Manager updates compliance information for all associations on an instance whenever any association executes, which may result in multiple associations showing the same execution time.
-
Id: The patch, association, or custom compliance ID.
-
Title: A title.
-
Status: The status of the compliance item. For example,
approvedfor patches, orFailedfor associations. -
Severity: A patch severity. For example,
Critical. -
DocumentName: An SSM document name. For example,
AWS-RunPatchBaseline. -
DocumentVersion: An SSM document version number. For example, 4.
-
Classification: A patch classification. For example,
security updates. -
PatchBaselineId: A patch baseline ID.
-
PatchSeverity: A patch severity. For example,
Critical. -
PatchState: A patch state. For example,
InstancesWithFailedPatches. -
PatchGroup: The name of a patch group.
-
InstalledTime: The time the association, patch, or custom compliance item was applied to the resource. Specify the time by using the following format:
yyyy-MM-dd'T'HH:mm:ss'Z'
Parameters:
-
resource_id(ComplianceResourceId) –Specify an ID for this resource. For a managed node, this is the node ID.
-
resource_type(ComplianceResourceType) –Specify the type of resource.
ManagedInstanceis currently the only supported resource type. -
compliance_type(ComplianceTypeName) –Specify the compliance type. For example, specify Association (for a State Manager association), Patch, or Custom:
string. -
execution_summary(ComplianceExecutionSummary) –A summary of the call execution that includes an execution ID, the type of execution (for example,
Command), and the date/time of the execution using a datetime object that is saved in the following format:yyyy-MM-dd'T'HH:mm:ss'Z' -
items(ComplianceItemEntryList) –Information about the compliance as defined by the resource type. For example, for a patch compliance type,
Itemsincludes information about the PatchSeverity, Classification, and so on. -
item_content_hash(Optional[ComplianceItemContentHash], default:None) –MD5 or SHA-256 content hash. The content hash is used to determine if existing information should be overwritten or ignored. If the content hashes match, the request to put compliance information is ignored.
-
upload_type(Optional[ComplianceUploadType], default:None) –The mode for uploading compliance items. You can specify
COMPLETEorPARTIAL. InCOMPLETEmode, the system overwrites all existing compliance information for the resource. You must provide a full list of compliance items each time you send the request.In
PARTIALmode, the system overwrites compliance information for a specific association. The association must be configured withSyncComplianceset toMANUAL. By default, all requests useCOMPLETEmode.This attribute is only valid for association compliance.
Raises:
-
ComplianceTypeCountLimitExceededException–You specified too many custom compliance types. You can specify a maximum of 10 different types.
-
InternalServerError–An error occurred on the server side.
-
InvalidItemContentException–One or more content items isn't valid.
-
InvalidResourceId–The resource ID isn't valid. Verify that you entered the correct ID and try again.
-
InvalidResourceType–The resource type isn't valid. For example, if you are attempting to tag an EC2 instance, the instance must be a registered managed node.
-
ItemSizeLimitExceededException–The inventory item size has exceeded the size limit.
-
TotalSizeLimitExceededException–The size of inventory data has exceeded the total size limit for the resource.
-
UnknownServiceError–The service returned an error code this client does not model.
Source code in docs_src/capo_ssm/_services/async_ssm.py
9565 9566 9567 9568 9569 9570 9571 9572 9573 9574 9575 9576 9577 9578 9579 9580 9581 9582 9583 9584 9585 9586 9587 9588 9589 9590 9591 9592 9593 9594 9595 9596 9597 9598 9599 9600 9601 9602 9603 9604 9605 9606 9607 9608 9609 9610 9611 9612 9613 9614 9615 9616 9617 9618 9619 9620 9621 9622 9623 9624 9625 9626 9627 9628 9629 9630 9631 9632 9633 9634 9635 9636 9637 9638 9639 | |