[ aws . ssm ]

put-inventory

Description

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.

See also: AWS API Documentation

See ‘aws help’ for descriptions of global parameters.

Synopsis

  put-inventory
--instance-id <value>
--items <value>
[--cli-input-json | --cli-input-yaml]
[--generate-cli-skeleton <value>]

Options

--instance-id (string)

An instance ID where you want to add or update inventory items.

--items (list)

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

(structure)

Information collected from managed instances based on your inventory policy document

TypeName -> (string)

The name of the inventory type. Default inventory item type names start with AWS . Custom inventory type names will start with Custom. Default inventory item types include the following: AWS:AWSComponent , AWS:Application , AWS:InstanceInformation , AWS:Network , and AWS:WindowsUpdate .

SchemaVersion -> (string)

The schema version for the inventory item.

CaptureTime -> (string)

The time the inventory information was collected.

ContentHash -> (string)

MD5 hash of the inventory item type contents. The content hash is used to determine whether to update inventory information. The PutInventory API doesn’t update the inventory item type contents if the MD5 hash hasn’t changed since last update.

Content -> (list)

The inventory data of the inventory type.

(map)

key -> (string)

value -> (string)

Context -> (map)

A map of associated properties for a specified inventory type. For example, with this attribute, you can specify the ExecutionId , ExecutionType , ComplianceType properties of the AWS:ComplianceItem type.

key -> (string)

value -> (string)

Shorthand Syntax:

TypeName=string,SchemaVersion=string,CaptureTime=string,ContentHash=string,Content=[{KeyName1=string,KeyName2=string},{KeyName1=string,KeyName2=string}],Context={KeyName1=string,KeyName2=string} ...

JSON Syntax:

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

--cli-input-json | --cli-input-yaml (string) Reads arguments from the JSON string provided. The JSON string follows the format provided by --generate-cli-skeleton. If other arguments are provided on the command line, those values will override the JSON-provided values. It is not possible to pass arbitrary binary values using a JSON-provided value as the string will be taken literally. This may not be specified along with --cli-input-yaml.

--generate-cli-skeleton (string) Prints a JSON skeleton to standard output without sending an API request. If provided with no value or the value input, prints a sample input JSON that can be used as an argument for --cli-input-json. Similarly, if provided yaml-input it will print a sample input YAML that can be used with --cli-input-yaml. If provided with the value output, it validates the command inputs and returns a sample output JSON for that command.

See ‘aws help’ for descriptions of global parameters.

Examples

To assign customer metadata to an instance

This example assigns rack location information to an instance. There is no output if the command succeeds.

Command (Linux):

aws ssm put-inventory --instance-id "i-016648b75dd622dab" --items '[{"TypeName": "Custom:RackInfo","SchemaVersion": "1.0","CaptureTime": "2019-01-22T10:01:01Z","Content":[{"RackLocation": "Bay B/Row C/Rack D/Shelf E"}]}]'

Command (Windows):

aws ssm put-inventory --instance-id "i-016648b75dd622dab" --items "TypeName=Custom:RackInfo,SchemaVersion=1.0,CaptureTime=2019-01-22T10:01:01Z,Content=[{RackLocation='Bay B/Row C/Rack D/Shelf F'}]"

Output

Message -> (string)

Information about the request.