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