Menu
AWS Systems Manager
API Reference (API Version 2014-11-06)

PutInventory

Bulk update custom inventory items on one more instance. The request adds an inventory item, if it doesn't already exist, or updates an inventory item, if it does exist.

Request Syntax

{ "InstanceId": "string", "Items": [ { "CaptureTime": "string", "Content": [ { "string" : "string" } ], "ContentHash": "string", "Context": { "string" : "string" }, "SchemaVersion": "string", "TypeName": "string" } ] }

Request Parameters

For information about the parameters that are common to all actions, see Common Parameters.

The request accepts the following data in JSON format.

InstanceId

One or more instance IDs where you want to add or update inventory items.

Type: String

Pattern: (^i-(\w{8}|\w{17})$)|(^mi-\w{17}$)

Required: Yes

Items

The inventory items that you want to add or update on instances.

Type: Array of InventoryItem objects

Array Members: Minimum number of 1 item. Maximum number of 30 items.

Required: Yes

Response Elements

If the action is successful, the service sends back an HTTP 200 response with an empty HTTP body.

Errors

For information about the errors that are common to all actions, see Common Errors.

CustomSchemaCountLimitExceededException

You have exceeded the limit for custom schemas. Delete one or more custom schemas and try again.

HTTP Status Code: 400

InternalServerError

An error occurred on the server side.

HTTP Status Code: 400

InvalidInstanceId

The following problems can cause this exception:

You do not have permission to access the instance.

The SSM Agent is not running. On managed instances and Linux instances, verify that the SSM Agent is running. On EC2 Windows instances, verify that the EC2Config service is running.

The SSM Agent or EC2Config service is not registered to the SSM endpoint. Try reinstalling the SSM Agent or EC2Config service.

The instance is not in valid state. Valid states are: Running, Pending, Stopped, Stopping. Invalid states are: Shutting-down and Terminated.

HTTP Status Code: 400

InvalidInventoryItemContextException

You specified invalid keys or values in the Context attribute for InventoryItem. Verify the keys and values, and try again.

HTTP Status Code: 400

InvalidItemContentException

One or more content items is not valid.

HTTP Status Code: 400

InvalidTypeNameException

The parameter type name is not valid.

HTTP Status Code: 400

ItemContentMismatchException

The inventory item has invalid content.

HTTP Status Code: 400

ItemSizeLimitExceededException

The inventory item size has exceeded the size limit.

HTTP Status Code: 400

SubTypeCountLimitExceededException

The sub-type count exceeded the limit for the inventory type.

HTTP Status Code: 400

TotalSizeLimitExceededException

The size of inventory data has exceeded the total size limit for the resource.

HTTP Status Code: 400

UnsupportedInventoryItemContextException

The Context attribute that you specified for the InventoryItem is not allowed for this inventory type. You can only use the Context attribute with inventory types like AWS:ComplianceItem.

HTTP Status Code: 400

UnsupportedInventorySchemaVersionException

Inventory item type schema version has to match supported versions in the service. Check output of GetInventorySchema to see the available schema version for each type.

HTTP Status Code: 400

See Also

For more information about using this API in one of the language-specific AWS SDKs, see the following: