ALIYUN::IOT::DeviceGroup类型用于创建分组。

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

语法

{
  "Type": "ALIYUN::IOT::DeviceGroup",
  "Properties": {
    "SuperGroupId": String,
    "GroupName": String,
    "GroupDesc": String,
    "IotInstanceId": String
  }
}

属性

属性名称 类型 必须 允许更新 描述 约束
SuperGroupId String 父组ID。若要创建一级分组,则不传入此参数。
GroupName String 分组名称。 长度为4~30个字符,可包含中文、大写字母、小写字母、数字和下划线(_)。
说明 一个中文占两个字符。
GroupDesc String 分组描述 长度不超过100个字符。
说明 一个中文占两个字符。
IotInstanceId String 实例ID 公共实例不传入此参数

返回值

Fn::GetAtt

  • GroupId:分组ID,系统为分组生成的全局唯一标识符。
  • IotInstanceId:实例ID。

示例

JSON格式

{
  "ROSTemplateFormatVersion": "2015-09-01",
  "Resources": {
    "DeviceGroup": {
      "Type": "ALIYUN::IOT::DeviceGroup",
      "Properties": {
        "IotInstanceId": {
          "Ref": "IotInstanceId"
        },
        "SuperGroupId": {
          "Ref": "SuperGroupId"
        },
        "GroupDesc": {
          "Ref": "GroupDesc"
        },
        "GroupName": {
          "Ref": "GroupName"
        }
      }
    }
  },
  "Parameters": {
    "IotInstanceId": {
      "Type": "String",
      "Description": "Public instance does not pass this parameter; instance that you need to buy the incoming instance ID."
    },
    "SuperGroupId": {
      "Type": "String",
      "Description": "The ID of the parent group.\nIf you want to create a first-level group, do not enter this parameter."
    },
    "GroupDesc": {
      "Type": "String",
      "Description": "The description of the group. You can enter a description with up to 100 characters."
    },
    "GroupName": {
      "Type": "String",
      "Description": "The name of the group. The name can contain Chinese characters, English letters, digits, and underscores (_). The length must be 4 to 30 characters (a Chinese character counts as two characters)."
    }
  },
  "Outputs": {
    "GroupId": {
      "Description": "Packet, ID, System for the globally unique identifier generated packet.",
      "Value": {
        "Fn::GetAtt": [
          "DeviceGroup",
          "GroupId"
        ]
      }
    },
    "IotInstanceId": {
      "Description": "IOT instance ID.",
      "Value": {
        "Fn::GetAtt": [
          "DeviceGroup",
          "IotInstanceId"
        ]
      }
    }
  }
}

YAML格式

ROSTemplateFormatVersion: '2015-09-01'
Resources:
  DeviceGroup:
    Type: 'ALIYUN::IOT::DeviceGroup'
    Properties:
      IotInstanceId:
        Ref: IotInstanceId
      SuperGroupId:
        Ref: SuperGroupId
      GroupDesc:
        Ref: GroupDesc
      GroupName:
        Ref: GroupName
Parameters:
  IotInstanceId:
    Type: String
    Description: >-
      Public instance does not pass this parameter; instance that you need to
      buy the incoming instance ID.
  SuperGroupId:
    Type: String
    Description: |-
      The ID of the parent group.
      If you want to create a first-level group, do not enter this parameter.
  GroupDesc:
    Type: String
    Description: >-
      The description of the group. You can enter a description with up to 100
      characters.
  GroupName:
    Type: String
    Description: >-
      The name of the group. The name can contain Chinese characters, English
      letters, digits, and underscores (_). The length must be 4 to 30
      characters (a Chinese character counts as two characters).
Outputs:
  GroupId:
    Description: 'Packet, ID, System for the globally unique identifier generated packet.'
    Value:
      'Fn::GetAtt':
        - DeviceGroup
        - GroupId
  IotInstanceId:
    Description: IOT instance ID.
    Value:
      'Fn::GetAtt':
        - DeviceGroup
        - IotInstanceId