-
Notifications
You must be signed in to change notification settings - Fork 35
/
clb-7-layer-load-balancing.yml
87 lines (87 loc) · 2.41 KB
/
clb-7-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
84
85
86
87
ROSTemplateFormatVersion: '2015-09-01'
Description:
zh-cn: 创建SLB负载均衡器监听器及VServer组,关联指定ECS实例,提供HTTP健康检查,输出CLB IP地址。
en: Create an SLB load balancer listener and VServer group, associate specified
ECS instances, provide HTTP health checks, and output the CLB IP address.
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: http
ListenerPort: 81
HealthCheck:
Switch: 'on'
URI: /
HealthCheckMethod: head
Timeout: 5
HealthyThreshold: 2
UnhealthyThreshold: 2
Interval: 2
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负载均衡