-
Notifications
You must be signed in to change notification settings - Fork 35
/
clb-4-layer-load-balancing.yml
83 lines (83 loc) · 2.46 KB
/
clb-4-layer-load-balancing.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
ROSTemplateFormatVersion: '2015-09-01'
Description:
zh-cn: 该模板用于在指定CLB实例下,添加两个ECS实例到VServerGroup,并配置TCP监听器进行健康检查,最后输出CLB的IP地址。要求ECS与CLB同VPC。
en: This template is designed to add two ECS instances to the specified VServerGroup
under a given CLB instance, configure a TCP listener for health checks, and ultimately
outputs the IP address of the CLB. It is mandatory that the ECS instances and
the CLB reside within the same VPC.
Parameters:
LoadBalancerId:
Type: String
Label:
en: CLB Instance ID
zh-cn: CLB实例ID
AssociationProperty: ALIYUN::SLB::Instance::InstanceId
EcsInstanceIds:
Type: CommaDelimitedList
Label:
en: ECS Instance ID List
zh-cn: ECS实例ID列表
Description:
en: The ECS instance where the application service has been deployed, <span
style="background:#E7E9EB;"><b>the ECS instance and the CLB instance need
to be under the same VPC</b></span>.
zh-cn: 已部署应用服务的ECS实例,<span style="background:#E7E9EB;"><b>ECS实例和CLB实例需要在同一个VPC下</b></span>。
AssociationProperty: ALIYUN::ECS::Instance::InstanceId
MinLength: 2
MaxLength: 2
Resources:
DS_LoadBalancers:
Type: DATASOURCE::SLB::LoadBalancers
Properties:
LoadBalancerId:
Ref: LoadBalancerId
ServerGroup:
Type: ALIYUN::SLB::VServerGroup
Properties:
LoadBalancerId:
Ref: LoadBalancerId
VServerGroupName: TrialTutorial
BackendServers:
- ServerId:
Fn::Select:
- 0
- Ref: EcsInstanceIds
Port: 80
- ServerId:
Fn::Select:
- 1
- Ref: EcsInstanceIds
Port: 80
Listener:
Type: ALIYUN::SLB::Listener
Properties:
VServerGroupId:
Ref: ServerGroup
LoadBalancerId:
Ref: LoadBalancerId
Protocol: tcp
ListenerPort: 80
HealthCheck:
Switch: 'on'
Bandwidth: -1
StartListener: true
Outputs:
CLBIp:
Description:
en: The IpAddress of CLB.
zh-cn: CLB的IP地址。
Value:
Fn::Jq:
- First
- .[0].Address
- Fn::GetAtt:
- DS_LoadBalancers
- LoadBalancers
Metadata:
ALIYUN::ROS::Interface:
ParameterGroups:
- Parameters:
- LoadBalancerId
- EcsInstanceIds
TemplateTags:
- acs:document:试用教程:四层CLB负载均衡