ALIYUN::DEVOPS::HostGroup

ALIYUN::DEVOPS::HostGroup类型用于创建主机组。

语法

{
  "Type": "ALIYUN::DEVOPS::HostGroup",
  "Properties": {
    "Name": String,
    "OrganizationId": String,
    "ServiceConnectionId": Integer,
    "AliyunRegion": String,
    "EcsType": String,
    "EnvId": String,
    "EcsLabelValue": String,
    "EcsLabelKey": String,
    "MachineInfos": List,
    "Type": String,
    "TagIds": List
  }
}

属性

属性名称

类型

必须

允许更新

描述

约束

Name

String

主机组名称。

OrganizationId

String

企业标识。

您可在云效访问链接中获取。

ServiceConnectionId

Integer

服务连接ID。

AliyunRegion

String

阿里云V。

EcsType

String

ECS类型。

EnvId

String

环境ID。

EcsLabelValue

String

ECS标签值。

EcsLabelKey

String

ECS标签键。

MachineInfos

List

主机详情配置。

更多信息,请参见MachineInfos属性

Type

String

主机组类型。

目前只支持ECS。

TagIds

List

标签ID。

最多支持10个标签。

MachineInfos语法

"MachineInfos": [
  {
    "InstanceName": String,
    "MachineSn": String,
    "Ip": String,
    "AliyunRegionId": String
  }
]

MachineInfos属性

属性名称

类型

必须

允许更新

描述

约束

MachineSn

String

实例ID。

AliyunRegionId

String

实例I所在的地域ID。

InstanceName

String

实例名称。

Ip

String

实例绑定的IP。

返回值

Fn::GetAtt

HostGroupId:主机组ID

示例

YAML格式

ROSTemplateFormatVersion: '2015-09-01'
Parameters:
  ServiceConnectionId:
    Type: Number
    Description:
      en: Service connection.
    Required: true
  OrganizationId:
    Type: String
    Description:
      en: Corporate identity, also known as enterprise id, can obtain in cloud effect access links.
    Required: true
  Name:
    Type: String
    Description:
      en: Host group name.
    Required: true
Resources:
  HostGroup:
    Type: ALIYUN::DEVOPS::HostGroup
    Properties:
      ServiceConnectionId:
        Ref: ServiceConnectionId
      OrganizationId:
        Ref: OrganizationId
      Name:
        Ref: Name
Outputs:
  HostGroupId:
    Description: The id of the host group.
    Value:
      Fn::GetAtt:
        - HostGroup
        - HostGroupId

JSON格式

{
  "ROSTemplateFormatVersion": "2015-09-01",
  "Parameters": {
    "ServiceConnectionId": {
      "Type": "Number",
      "Description": {
        "en": "Service connection."
      },
      "Required": true
    },
    "OrganizationId": {
      "Type": "String",
      "Description": {
        "en": "Corporate identity, also known as enterprise id, can obtain in cloud effect access links."
      },
      "Required": true
    },
    "Name": {
      "Type": "String",
      "Description": {
        "en": "Host group name."
      },
      "Required": true
    }
  },
  "Resources": {
    "HostGroup": {
      "Type": "ALIYUN::DEVOPS::HostGroup",
      "Properties": {
        "ServiceConnectionId": {
          "Ref": "ServiceConnectionId"
        },
        "OrganizationId": {
          "Ref": "OrganizationId"
        },
        "Name": {
          "Ref": "Name"
        }
      }
    }
  },
  "Outputs": {
    "HostGroupId": {
      "Description": "The id of the host group.",
      "Value": {
        "Fn::GetAtt": [
          "HostGroup",
          "HostGroupId"
        ]
      }
    }
  }
}