All Products
Search
Document Center

Resource Orchestration Service:ALIYUN::DEVOPS::HostGroup

Last Updated:Aug 12, 2024

ALIYUN::DEVOPS::HostGroup is used to create a host group.

Syntax

{
  "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
  }
}

Properties

Property

Type

Required

Editable

Description

Constraint

Name

String

Yes

Yes

The name of the host group.

None

OrganizationId

String

Yes

No

The ID of the organization.

You can visit Apsara Devops to obtain the organization ID.

ServiceConnectionId

Integer

Yes

No

The ID of the service connection.

None

AliyunRegion

String

No

No

The region of Alibaba Cloud.

None

EcsType

String

No

No

The Elastic Compute Service (ECS) instance type.

None

EnvId

String

No

No

The ID of the environment.

None

EcsLabelValue

String

No

No

The tag value that is added to the ECS instance type.

None

EcsLabelKey

String

No

No

The tag key that is added to the ECS instance type.

None

MachineInfos

List

No

No

The configuration information of the host.

For more information, see MachineInfos properties.

Type

String

No

No

The type of the host group.

Only host groups of the ECS type are supported.

TagIds

List

No

No

The IDs of tags.

You can specify up to 10 tags.

MachineInfos syntax

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

MachineInfos properties

Property

Type

Required

Editable

Description

Constraint

MachineSn

String

Yes

No

The ID of the instance.

None

AliyunRegionId

String

No

No

The region ID of the instance.

None

InstanceName

String

No

No

The name of the instance.

None

Ip

String

No

No

The IP address that is bound to the instance.

None

Return values

Fn::GetAtt

HostGroupId: the ID of the host group.

Examples

YAML format

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 format

{
  "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"
        ]
      }
    }
  }
}