

本文属于机器翻译版本。若本译文内容与英语原文存在差异，则一律以英文原文为准。

# 将事物类型与事物相关联
<a name="associate-thing-type"></a>

创建事物时，可以使用 **CreateThing** 命令指定事物类型：

```
$ aws iot create-thing --thing-name "MyLightBulb" --thing-type-name "LightBulb" --attribute-payload "{\"attributes\": {\"wattage\":\"75\", \"model\":\"123\"}}"
```

您随时可以使用 **UpdateThing** 命令更改与某个事物关联的事物类型：

```
$ aws iot update-thing --thing-name "MyLightBulb"
                --thing-type-name "LightBulb" --attribute-payload  "{\"attributes\": {\"wattage\":\"75\", \"model\":\"123\"}}"
```

您还可以使用 **UpdateThing** 命令取消事物与事物类型之间的关联。