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
9446 9447 9448 9449 9450 9451 9452 9453 9454 9455 9456 9457 9458 9459 9460 9461 9462 9463 9464 9465 9466 9467 9468 9469 9470 9471 9472 9473 9474 9475 9476 9477 9478 9479 9480 9481 9482 9483 9484 9485 9486 9487 9488 9489 9490 9491 9492 9493 9494 9495 9496 9497 9498 9499 9500 9501 9502 9503 9504 9505 9506 9507 9508 9509 9510 9511 9512 9513 9514 9515 9516 9517 9518 9519 | |