ALIYUN::SLB::MasterSlaveServerGroup

更新时间:
复制 MD 格式

ALIYUN::SLB::MasterSlaveServerGroup creates a primary/secondary server group.

Important

A primary/secondary server group contains exactly two ECS instances: one primary and one secondary.

Syntax

{
  "Type": "ALIYUN::SLB::MasterSlaveServerGroup",
  "Properties": {
    "MasterSlaveServerGroupName": String,
    "MasterSlaveBackendServers": List,
    "LoadBalancerId": String
  }
}

Properties

Property

Type

Required

Editable

Description

Constraint

MasterSlaveServerGroupName

String

No

No

The name of the primary/secondary server group.

None.

MasterSlaveBackendServers

List

Yes

No

The backend servers in the primary/secondary server group.

Maximum: two backend servers. If not specified, an empty primary/secondary server group is created.

LoadBalancerId

String

Yes

No

The ID of the Server Load Balancer (SLB) instance.

None.

MasterSlaveBackendServers syntax

"MasterSlaveBackendServers": [
  {
    "ServerId": String,
    "Port": Integer,
    "Weight": Integer,
    "ServerType": String,
    "Type": String,
    "ServerIp": String
  }
]

MasterSlaveBackendServers properties

Property

Type

Required

Editable

Description

Constraint

ServerId

String

Yes

No

The ID of the ECS instance or elastic network interface (ENI) to add.

None.

ServerType

String

No

No

The server type.

Valid values:

  • Master (default): primary

  • Slave: secondary

Port

Integer

Yes

No

The port used by the backend server.

Valid values: 1 to 65535.

Weight

Integer

Yes

No

The weight of the backend server.

Valid values: 0 to 100.

Type

String

No

No

The backend server instance type.

Valid values:

  • ecs: ECS instance

  • eni: ENI

ServerIp

String

No

No

The IP address of the ECS instance or ENI.

None.

Return values

Fn::GetAtt

MasterSlaveServerGroupId: the ID of the primary/secondary server group.

Examples

{
  "ROSTemplateFormatVersion": "2015-09-01",
  "Resources": {
    "MasterSlaveServerGroup": {
      "Type": "ALIYUN::SLB::MasterSlaveServerGroup",
      "Properties": {
        "MasterSlaveServerGroupName": "Group1",
        "MasterSlaveBackendServers": [
          {
            "ServerId": "vm****",
            "Port": "80",
            "Weight": "100",
            "ServerType": "Master"
          },
          {
            "ServerId": "vm****",
            "Port": "90",
            "Weight": "100",
            "ServerType": "Slave"
          }
        ],
        "LoadBalancerId": "lb-bp1hv944r69al4j9j****"
      }
    }
  },
  "Outputs": {
    "MasterSlaveServerGroupId": {
      "Value": {
        "Fn::GetAtt": [
          "MasterSlaveServerGroup",
          "MasterSlaveServerGroupId"
        ]
      }
    }
  }
}