ALIYUN::IOT::Product类型用于创建产品。

支持在以下地域创建产品:
  • 上海
  • 新加坡
  • 日本(东京)
  • 德国(法兰克福)
  • 美国(硅谷)
  • 美国(弗吉尼亚)

语法

{
  "Type": "ALIYUN::IOT::Product",
  "Properties": {
    "AuthType": String,
    "NodeType": Integer,
    "Description": String,
    "CategoryKey": String,
    "IotInstanceId": String,
    "ProtocolType": String,
    "PublishAuto": Boolean,
    "Id2": Boolean,
    "ProductName": String,
    "ResourceGroupId": String,
    "DataFormat": Integer,
    "AliyunCommodityCode": String,
    "JoinPermissionId": String,
    "NetType": String
  }
}

属性

属性名称 类型 必须 允许更新 描述 约束
AuthType String 产品下的设备接入物联网平台的认证方式。 取值:
  • secret:使用设备密钥进行设备身份认证。
  • id2:使用物联网设备身份认证ID²。
  • x509:使用设备X.509证书进行设备身份认证。
NodeType Integer 产品的节点类型。 此参数为使用物模型的产品(AliyunCommodityCode=iothub_senior)特有参数。
取值:
  • 0:设备。设备不能挂载子设备。可以直连物联网平台,也可以作为网关的子设备连接物联网平台。
  • 1:网关。网关可以挂载子设备,具有子设备管理模块,维持子设备的拓扑关系,和将拓扑关系同步到物联网平台。
Description String 产品描述信息。
CategoryKey String 产品品类的标识符。 如果传入此参数,创建的产品将使用指定品类的物模型;不传入,则不使用任何品类的标准物模型。
IotInstanceId String 实例ID。 公共实例不传入此参数
ProtocolType String 设备接入网关的协议类型。 使用物模型的产品(AliyunCommodityCode=iothub_senior),且产品下的设备需通过网关接入物联网平台,需传入此参数。
取值:
  • modbus:Modbus协议
  • opc-ua:OPC UA协议
  • customize:自定义协议
  • ble:BLE协议
  • zigbee:ZigBee协议
PublishAuto Boolean 是否在产品创建后自动发布物模型。 取值:
  • true(默认值)
  • false
Id2 Boolean 是否使用ID²认证。 取值:
  • true
  • false(默认值)
仅华东2(上海)地域支持ID²认证方式。如果此参数值设置为true,但传入的AuthType参数值不是id2,系统将以AuthType参数值为准。
ProductName String 新建产品名称。 长度4~30位,可包含中文、大写字母、小写字母、数字和下划线(_)。
说明 一个中文字符占两位。
ResourceGroupId String 资源组ID。
DataFormat Integer 产品类型数据格式。 此参数为使用物模型的产品(AliyunCommodityCode=iothub_senior)特有参数。取值:
  • 0:透传或自定义格式(CUSTOM_FORMAT)
  • 1:Alink协议(ALINK_FORMAT)
AliyunCommodityCode String 产品类型。 取值:
  • iothub_senior:使用物模型
  • iothub:不使用物模型
JoinPermissionId String LoRaWAN入网凭证ID。 连网方式NetType选择为LORA时,该参数必选。
NetType String 连网方式。 使用物模型的产品(AliyunCommodityCode=iothub_senior),且产品下的设备为网关或不接入网关的设备时,需传入此参数。
取值:
  • WIFI(默认值): WiFi
  • CELLULAR:蜂窝网
  • ETHERNET:以太网
  • LORA:LoRaWAN
  • OTHER:其他

返回值

Fn::GetAtt

  • ProductKey:产品的标识符。
  • IotInstanceId:实例ID。

示例

JSON格式

{
  "ROSTemplateFormatVersion": "2015-09-01",
  "Resources": {
    "Product": {
      "Type": "ALIYUN::IOT::Product",
      "Properties": {
        "AuthType": {
          "Ref": "AuthType"
        },
        "NodeType": {
          "Ref": "NodeType"
        },
        "Description": {
          "Ref": "Description"
        },
        "CategoryKey": {
          "Ref": "CategoryKey"
        },
        "IotInstanceId": {
          "Ref": "IotInstanceId"
        },
        "ProtocolType": {
          "Ref": "ProtocolType"
        },
        "PublishAuto": {
          "Ref": "PublishAuto"
        },
        "Id2": {
          "Ref": "Id2"
        },
        "ProductName": {
          "Ref": "ProductName"
        },
        "ResourceGroupId": {
          "Ref": "ResourceGroupId"
        },
        "DataFormat": {
          "Ref": "DataFormat"
        },
        "AliyunCommodityCode": {
          "Ref": "AliyunCommodityCode"
        },
        "JoinPermissionId": {
          "Ref": "JoinPermissionId"
        },
        "NetType": {
          "Ref": "NetType"
        }
      }
    }
  },
  "Parameters": {
    "AuthType": {
      "Type": "String",
      "Description": "Authentication device to access the Internet of Things platform under the product. Optional:\nsecret: using a device key for device authentication.\nDetails can be found MQTT-TCP connection communication.\nid2: Use things device authentication ID.\nx509: X.509 certificates using the device for device authentication.\nThe use of X.509 certificates device side configuration instructions, see Using X.509 certificate authentication.\nIf this parameter is passed, the default value is secret."
    },
    "NodeType": {
      "Type": "Number",
      "Description": "The node type of the product. Values:\n0: Device. A device cannot be mounted with sub-devices. It can connect to IoT Platform\neither directly or as a sub-device of a gateway.\n1: Gateway. A gateway can be mounted with sub-devices. It can manage sub-devices, maintain\nthe topological relationships with sub-devices, and synchronize the topological relationships\nto IoT Platform.",
      "AllowedValues": [
        0,
        1
      ]
    },
    "Description": {
      "Type": "String",
      "Description": "A description of the product. The description can be a maximum of 100 characters in\nlength."
    },
    "CategoryKey": {
      "Type": "String",
      "Description": "Identifier Product category. If you pass this parameter, the product will be created using the object model specified category; not passed, the standard model is not used in any category.\nCall ListThingTemplates, view of things platform predefined category information from the returned results, get the value of CategoryKey."
    },
    "IotInstanceId": {
      "Type": "String",
      "Description": "Public instance does not pass this parameter; instance that you need to buy the incoming instance ID."
    },
    "ProtocolType": {
      "Type": "String",
      "Description": "The protocol that devices of this product use to connect to gateways.\nSet this parameter only if you are creating a product whose devices will be connected\nto gateways.\nOptions:\nmodbus: Modbus.\nopc-ua: OPC UA.\ncustomize: Customized protocol.\nble: BLE.\nzigbee: ZigBee.",
      "AllowedValues": [
        "ble",
        "customize",
        "modbus",
        "opc-ua",
        "zigbee"
      ]
    },
    "PublishAuto": {
      "Type": "Boolean",
      "Description": "Whether to automatically model publication after the product is created.\ntrue: publishing.\nfalse: not released.\nThis parameter is not passed, the default value true.",
      "AllowedValues": [
        "True",
        "true",
        "False",
        "false"
      ]
    },
    "Id2": {
      "Type": "Boolean",
      "Description": "Whether ID2 certification.\nOptional values:\ntrue: the opening of ID2 certification.\nfalse: do not open ID2 certification.\nDo not pass this parameter, the default is not opened.\nExplanation\nOnly 2 East China (Shanghai) regional support ID2 authentication.\nIf this parameter value is set to true, but passed AuthType parameter value is not id2, the system will AuthType parameter values prevail.",
      "AllowedValues": [
        "True",
        "true",
        "False",
        "false"
      ]
    },
    "ProductName": {
      "Type": "String",
      "Description": "The name of the product. A product name can be 4 to 30 characters in length and can\ncontain Chinese characters, English letters, digits, and underscores (_).\nNote A product name must be unique in an account."
    },
    "ResourceGroupId": {
      "Type": "String",
      "Description": "Resource group ID (group ID to view the resource in the resource management console), specify the product is classified as a resource group.\nIf this parameter is passed, the product will be classified as a default resource group."
    },
    "DataFormat": {
      "Type": "Number",
      "Description": "You must specify this parameter if the value of AliyunCommodityCode is iothub_senior.\nThis parameter is only available and required when you create a Pro Edition product.\nOptions:\n0: Do not parse/Custom.\n1: Alink JSON.",
      "AllowedValues": [
        0,
        1
      ]
    },
    "AliyunCommodityCode": {
      "Type": "String",
      "Description": "The edition of the product that you want to create. There are two options:\niothub_senior: Pro Edition.\niothub: Basic Edition.\nIf you do not input this parameter, the default value is used, which is iothub (Basic\nEdition)."
    },
    "JoinPermissionId": {
      "Type": "String",
      "Description": "LoRaWAN network credential ID. When networking mode NetType chosen LORA, the necessary parameters.\nPlease call QueryLoRaJoinPermissions query JoinPermissionId network credentials LoRaWAN under your account.\nIf you do not LoRaWAN network credentials, visit the network management platform to create things together."
    },
    "NetType": {
      "Type": "String",
      "Description": "Networking mode.\nSet this parameter only if you are creating a product whose devices directly connect\nto IoT Platform.\nOptions:\nWIFI\nCELLULAR\nETHERNET\nOTHER\nThe default value is WIFI.",
      "AllowedValues": [
        "CELLULAR",
        "ETHERNET",
        "LORA",
        "OTHER",
        "WIFI"
      ]
    }
  },
  "Outputs": {
    "ProductKey": {
      "Description": "The globally unique identifier of the product issued by IoT Platform.",
      "Value": {
        "Fn::GetAtt": [
          "Product",
          "ProductKey"
        ]
      }
    },
    "IotInstanceId": {
      "Description": "IOT instance ID.",
      "Value": {
        "Fn::GetAtt": [
          "Product",
          "IotInstanceId"
        ]
      }
    }
  }
}

YAML格式

ROSTemplateFormatVersion: '2015-09-01'
Resources:
  Product:
    Type: 'ALIYUN::IOT::Product'
    Properties:
      AuthType:
        Ref: AuthType
      NodeType:
        Ref: NodeType
      Description:
        Ref: Description
      CategoryKey:
        Ref: CategoryKey
      IotInstanceId:
        Ref: IotInstanceId
      ProtocolType:
        Ref: ProtocolType
      PublishAuto:
        Ref: PublishAuto
      Id2:
        Ref: Id2
      ProductName:
        Ref: ProductName
      ResourceGroupId:
        Ref: ResourceGroupId
      DataFormat:
        Ref: DataFormat
      AliyunCommodityCode:
        Ref: AliyunCommodityCode
      JoinPermissionId:
        Ref: JoinPermissionId
      NetType:
        Ref: NetType
Parameters:
  AuthType:
    Type: String
    Description: >-
      Authentication device to access the Internet of Things platform under the
      product. Optional:

      secret: using a device key for device authentication.

      Details can be found MQTT-TCP connection communication.

      id2: Use things device authentication ID.

      x509: X.509 certificates using the device for device authentication.

      The use of X.509 certificates device side configuration instructions, see
      Using X.509 certificate authentication.

      If this parameter is passed, the default value is secret.
  NodeType:
    Type: Number
    Description: >-
      The node type of the product. Values:

      0: Device. A device cannot be mounted with sub-devices. It can connect to
      IoT Platform

      either directly or as a sub-device of a gateway.

      1: Gateway. A gateway can be mounted with sub-devices. It can manage
      sub-devices, maintain

      the topological relationships with sub-devices, and synchronize the
      topological relationships

      to IoT Platform.
    AllowedValues:
      - 0
      - 1
  Description:
    Type: String
    Description: >-
      A description of the product. The description can be a maximum of 100
      characters in

      length.
  CategoryKey:
    Type: String
    Description: >-
      Identifier Product category. If you pass this parameter, the product will
      be created using the object model specified category; not passed, the
      standard model is not used in any category.

      Call ListThingTemplates, view of things platform predefined category
      information from the returned results, get the value of CategoryKey.
  IotInstanceId:
    Type: String
    Description: >-
      Public instance does not pass this parameter; instance that you need to
      buy the incoming instance ID.
  ProtocolType:
    Type: String
    Description: >-
      The protocol that devices of this product use to connect to gateways.

      Set this parameter only if you are creating a product whose devices will
      be connected

      to gateways.

      Options:

      modbus: Modbus.

      opc-ua: OPC UA.

      customize: Customized protocol.

      ble: BLE.

      zigbee: ZigBee.
    AllowedValues:
      - ble
      - customize
      - modbus
      - opc-ua
      - zigbee
  PublishAuto:
    Type: Boolean
    Description: |-
      Whether to automatically model publication after the product is created.
      true: publishing.
      false: not released.
      This parameter is not passed, the default value true.
    AllowedValues:
      - 'True'
      - 'true'
      - 'False'
      - 'false'
  Id2:
    Type: Boolean
    Description: >-
      Whether ID2 certification.

      Optional values:

      true: the opening of ID2 certification.

      false: do not open ID2 certification.

      Do not pass this parameter, the default is not opened.

      Explanation

      Only 2 East China (Shanghai) regional support ID2 authentication.

      If this parameter value is set to true, but passed AuthType parameter
      value is not id2, the system will AuthType parameter values prevail.
    AllowedValues:
      - 'True'
      - 'true'
      - 'False'
      - 'false'
  ProductName:
    Type: String
    Description: >-
      The name of the product. A product name can be 4 to 30 characters in
      length and can

      contain Chinese characters, English letters, digits, and underscores (_).

      Note A product name must be unique in an account.
  ResourceGroupId:
    Type: String
    Description: >-
      Resource group ID (group ID to view the resource in the resource
      management console), specify the product is classified as a resource
      group.

      If this parameter is passed, the product will be classified as a default
      resource group.
  DataFormat:
    Type: Number
    Description: >-
      You must specify this parameter if the value of AliyunCommodityCode is
      iothub_senior.

      This parameter is only available and required when you create a Pro
      Edition product.

      Options:

      0: Do not parse/Custom.

      1: Alink JSON.
    AllowedValues:
      - 0
      - 1
  AliyunCommodityCode:
    Type: String
    Description: >-
      The edition of the product that you want to create. There are two options:

      iothub_senior: Pro Edition.

      iothub: Basic Edition.

      If you do not input this parameter, the default value is used, which is
      iothub (Basic

      Edition).
  JoinPermissionId:
    Type: String
    Description: >-
      LoRaWAN network credential ID. When networking mode NetType chosen LORA,
      the necessary parameters.

      Please call QueryLoRaJoinPermissions query JoinPermissionId network
      credentials LoRaWAN under your account.

      If you do not LoRaWAN network credentials, visit the network management
      platform to create things together.
  NetType:
    Type: String
    Description: >-
      Networking mode.

      Set this parameter only if you are creating a product whose devices
      directly connect

      to IoT Platform.

      Options:

      WIFI

      CELLULAR

      ETHERNET

      OTHER

      The default value is WIFI.
    AllowedValues:
      - CELLULAR
      - ETHERNET
      - LORA
      - OTHER
      - WIFI
Outputs:
  ProductKey:
    Description: The globally unique identifier of the product issued by IoT Platform.
    Value:
      'Fn::GetAtt':
        - Product
        - ProductKey
  IotInstanceId:
    Description: IOT instance ID.
    Value:
      'Fn::GetAtt':
        - Product
        - IotInstanceId