ALIYUN::CMS::MonitorGroupInstances类型用于添加资源到应用分组。
语法
{
  "Type": "ALIYUN::CMS::MonitorGroupInstances",
  "Properties": {
    "Instances": List,
    "GroupId": String
  }
}属性
| 属性名称 | 类型 | 必须 | 允许更新 | 描述 | 约束 | 
| Instances | List | 是 | 否 | 资源实例。 | 更多信息,请参见Instances属性。 | 
| GroupId | String | 是 | 否 | 应用分组ID。 | 无 | 
Instances语法
"Instances": [
  {
    "InstanceName": String,
    "Category": String,
    "InstanceId": String,
    "RegionId": String
  }
]Instances属性
| 属性名称 | 类型 | 必须 | 允许更新 | 描述 | 约束 | 
| InstanceName | String | 是 | 否 | 实例名称。 | 无 | 
| Category | String | 是 | 否 | 资源实例所属的云产品名称或规格。 | 取值: 
 | 
| InstanceId | String | 是 | 否 | 资源实例ID。 | 无 | 
| RegionId | String | 是 | 否 | 实例所在的地域ID。 | 无 | 
返回值
Fn::GetAtt
GroupId:应用分组ID。
示例
YAML
ROSTemplateFormatVersion: '2015-09-01'
Parameters:
  InstanceId:
    Type: String
    AssociationProperty: ALIYUN::ECS::Instance::InstanceId
  GroupId:
    Type: String
    Description: The ID of the application group.
Resources:
  MonitorGroupInstances:
    Type: ALIYUN::CMS::MonitorGroupInstances
    Properties:
      Instances:
        - InstanceName: TestECS
          Category: ecs
          InstanceId:
            Ref: InstanceId
          RegionId:
            Ref: ALIYUN::Region
      GroupId:
        Ref: GroupId
Outputs:
  GroupId:
    Description: The ID of the application group.
    Value:
      Fn::GetAtt:
        - MonitorGroupInstances
        - GroupIdJSON
{
  "ROSTemplateFormatVersion": "2015-09-01",
  "Parameters": {
    "InstanceId": {
      "Type": "String",
      "AssociationProperty": "ALIYUN::ECS::Instance::InstanceId"
    },
    "GroupId": {
      "Type": "String",
      "Description": "The ID of the application group."
    }
  },
  "Resources": {
    "MonitorGroupInstances": {
      "Type": "ALIYUN::CMS::MonitorGroupInstances",
      "Properties": {
        "Instances": [
          {
            "InstanceName": "TestECS",
            "Category": "ecs",
            "InstanceId": {
              "Ref": "InstanceId"
            },
            "RegionId": {
              "Ref": "ALIYUN::Region"
            }
          }
        ],
        "GroupId": {
          "Ref": "GroupId"
        }
      }
    }
  },
  "Outputs": {
    "GroupId": {
      "Description": "The ID of the application group.",
      "Value": {
        "Fn::GetAtt": [
          "MonitorGroupInstances",
          "GroupId"
        ]
      }
    }
  }
}