put_compliance_items
¶
put_compliance_items(
resource_id: ComplianceResourceId,
resource_type: ComplianceResourceType,
compliance_type: ComplianceTypeName,
execution_summary: ComplianceExecutionSummary,
items: ComplianceItemEntryList,
*,
config_overrides: Optional[SSMClientConfig] = 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/ssm.py
9381 9382 9383 9384 9385 9386 9387 9388 9389 9390 9391 9392 9393 9394 9395 9396 9397 9398 9399 9400 9401 9402 9403 9404 9405 9406 9407 9408 9409 9410 9411 9412 9413 9414 9415 9416 9417 9418 9419 9420 9421 9422 9423 9424 9425 9426 9427 9428 9429 9430 9431 9432 9433 9434 9435 9436 9437 9438 9439 9440 9441 9442 9443 9444 9445 9446 9447 9448 9449 9450 9451 9452 9453 9454 | |