ALIYUN::ThreatDetection::Group

更新时间:
复制为 MD 格式

ALIYUN::ThreatDetection::Group类型用于修改资产与资产分组关系。

语法

{
  "Type": "ALIYUN::ThreatDetection::Group",
  "Properties": {
    "GroupName": String,
    "GroupId": Integer
  }
}

属性

属性名称

类型

必须

允许更新

描述

约束

GroupId

Integer

要添加或删除服务器的服务器组ID。

若调用此操作时未配置此参数,则会创建一个资产组。

GroupName

String

要创建的服务器组名称,或要添加或删除服务器的服务器组名称。

若调用此操作时未配置GroupID,则会创建一个服务器组。在此情况下,您必须配置GroupName。

返回值

Fn::GetAtt

  • GroupName:要创建的服务器组名称,或要添加或删除服务器的服务器组名称。

  • GroupFlag:服务器组类型。

  • GroupId:要添加或删除服务器的服务器组ID。

示例

ROSTemplateFormatVersion: '2015-09-01'
Parameters:
  GroupName:
    Type: String
    Description:
      en: |-
        The name of the server group that you want to create or the server group for which you want to add or remove a server.
        >  To modify the mapping between a server and a server group, you must provide the name of the server group. You can call the [DescribeAllGroups](~~DescribeAllGroups~~) operation to query the names of server groups. If you do not configure GroupID when you call this operation, a server group is created. In this case, you must configure GroupName.
    Default: Null
    Required: false
  GroupId:
    Type: Number
    Description:
      en: |-
        The ID of the server group for which you want to add to or remove servers.
        >  To modify the mapping between an asset and an asset group, you must provide the ID of the asset group. You can call the [DescribeAllGroups](~~DescribeAllGroups~~) to query the IDs of asset groups. If you do not configure this parameter when you call this operation, an asset group is created.
    Default: Null
    Required: false
Resources:
  ExtensionResource:
    Type: ALIYUN::ThreatDetection::Group
    Properties:
      GroupName:
        Ref: GroupName
      GroupId:
        Ref: GroupId
Outputs:
  GroupName:
    Value:
      Fn::GetAtt:
        - ExtensionResource
        - GroupName
    Description: The name of the server group that you want to create or the server group for which you want to add or remove a server.
  GroupId:
    Value:
      Fn::GetAtt:
        - ExtensionResource
        - GroupId
    Description: The ID of the server group for which you want to add to or remove servers.
  GroupFlag:
    Value:
      Fn::GetAtt:
        - ExtensionResource
        - GroupFlag
    Description: The type of the server group.
{
  "ROSTemplateFormatVersion": "2015-09-01",
  "Parameters": {
    "GroupName": {
      "Type": "String",
      "Description": {
        "en": "The name of the server group that you want to create or the server group for which you want to add or remove a server.\n>  To modify the mapping between a server and a server group, you must provide the name of the server group. You can call the [DescribeAllGroups](~~DescribeAllGroups~~) operation to query the names of server groups. If you do not configure GroupID when you call this operation, a server group is created. In this case, you must configure GroupName."
      },
      "Default": null,
      "Required": false
    },
    "GroupId": {
      "Type": "Number",
      "Description": {
        "en": "The ID of the server group for which you want to add to or remove servers.\n>  To modify the mapping between an asset and an asset group, you must provide the ID of the asset group. You can call the [DescribeAllGroups](~~DescribeAllGroups~~) to query the IDs of asset groups. If you do not configure this parameter when you call this operation, an asset group is created."
      },
      "Default": null,
      "Required": false
    }
  },
  "Resources": {
    "ExtensionResource": {
      "Type": "ALIYUN::ThreatDetection::Group",
      "Properties": {
        "GroupName": {
          "Ref": "GroupName"
        },
        "GroupId": {
          "Ref": "GroupId"
        }
      }
    }
  },
  "Outputs": {
    "GroupName": {
      "Value": {
        "Fn::GetAtt": [
          "ExtensionResource",
          "GroupName"
        ]
      },
      "Description": "The name of the server group that you want to create or the server group for which you want to add or remove a server."
    },
    "GroupId": {
      "Value": {
        "Fn::GetAtt": [
          "ExtensionResource",
          "GroupId"
        ]
      },
      "Description": "The ID of the server group for which you want to add to or remove servers."
    },
    "GroupFlag": {
      "Value": {
        "Fn::GetAtt": [
          "ExtensionResource",
          "GroupFlag"
        ]
      },
      "Description": "The type of the server group."
    }
  }
}