aws iot create-thing
Creates a thing record in the registry. AWS CLI reference
2 examples 4 options Its page in the AWS CLI reference
Examples
Example 1: To create a thing record in the registry
The following create-thing example creates an entry for a device in the AWS IoT thing registry.
aws iot create-thing --thing-name SampleIoTThingIdentify--thing-nameThe name of the thing to create.Its output
{
"thingName": "SampleIoTThing",
"thingArn": "arn:aws:iot:us-west-2: 123456789012:thing/SampleIoTThing",
"thingId": " a1b2c3d4-5678-90ab-cdef-EXAMPLE11111 "
}Example 2: To define a thing that is associated with a thing type
The following create-thing example create a thing that has the specified thing type and its attributes.
aws iot create-thing --thing-name "MyLightBulb" --thing-type-name "LightBulb" --attribute-payload '{"attributes": {"wattage":"75", "model":"123"}}'Identify--thing-nameThe name of the thing to create.--thing-type-nameThe name of the thing type associated with the new thing.--attribute-payloadThe attribute payload, which consists of up to three name/value pairs in a JSON document.Its output
{
"thingName": "MyLightBulb",
"thingArn": "arn:aws:iot:us-west-2:123456789012:thing/MyLightBulb",
"thingId": "a1b2c3d4-5678-90ab-cdef-EXAMPLE22222"
}For more information, see How to Manage Things with the Registry and Thing Types in the AWS IoT Developers Guide.
Options
--attribute-payloadThe attribute payload, which consists of up to three name/value pairs in a JSON document.--billing-group-nameThe name of the billing group the thing will be added to.--thing-nameThe name of the thing to create.--thing-type-nameThe name of the thing type associated with the new thing.