-
Notifications
You must be signed in to change notification settings - Fork 35
/
alb-7-layer-load-balancing.yml
104 lines (104 loc) · 3 KB
/
alb-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
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
ROSTemplateFormatVersion: '2015-09-01'
Description:
zh-cn: 创建ALB服务器组,附加ECS实例,配置监听器实现七层负载均衡,支持指定ECS实例与ALB实例ID,自动同步VPC设置。
en: Create an Application Load Balancer (ALB) server group, attach Elastic Compute
Service (ECS) instances, configure listeners to implement Layer-7 load balancing,
facilitate the specification of ECS instances and ALB instance IDs, and automatically
synchronize VPC configurations.
Parameters:
LoadBalancerId:
Type: String
Label:
en: ALB Instance ID
zh-cn: ALB实例ID
AssociationProperty: ALIYUN::ALB::LoadBalancer::LoadBalancerId
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 ALB instance need
to be under the same VPC</b></span>.
zh-cn: 已部署应用服务的ECS实例,<span style="background:#E7E9EB;"><b>ECS实例和ALB实例需要在同一个VPC下</b></span>。
AssociationProperty: ALIYUN::ECS::Instance::InstanceId
MinLength: 2
MaxLength: 2
Resources:
DS_LoadBalancers:
Type: DATASOURCE::ALB::LoadBalancers
Properties:
LoadBalancerIds:
- Ref: LoadBalancerId
ServerGroup:
Type: ALIYUN::ALB::ServerGroup
Properties:
VpcId:
Fn::Jq:
- First
- .[0].VpcId
- Fn::GetAtt:
- DS_LoadBalancers
- LoadBalancers
ServerGroupType: Instance
Protocol: HTTP
ServerGroupName: TrialTutorial
Scheduler: Wrr
HealthCheckConfig:
HealthCheckEnabled: true
StickySessionConfig:
StickySessionEnabled: false
BackendServerAttachment:
Type: ALIYUN::ALB::BackendServerAttachment
Properties:
ServerGroupId:
Ref: ServerGroup
Servers:
- ServerType: Ecs
ServerId:
Fn::Select:
- 0
- Ref: EcsInstanceIds
Port: 80
Weight: 100
- ServerType: Ecs
ServerId:
Fn::Select:
- 1
- Ref: EcsInstanceIds
Port: 80
Weight: 100
Listener:
Type: ALIYUN::ALB::Listener
Properties:
DefaultActions:
- Type: ForwardGroup
ForwardGroupConfig:
ServerGroupTuples:
- ServerGroupId:
Ref: ServerGroup
LoadBalancerId:
Ref: LoadBalancerId
ListenerProtocol: HTTP
ListenerPort: 80
Outputs:
AlbDnsName:
Description:
en: DNS name of the ALB instance.
zh-cn: ALB实例的DNS名称。
Value:
Fn::Jq:
- First
- .[0].DNSName
- Fn::GetAtt:
- DS_LoadBalancers
- LoadBalancers
Metadata:
ALIYUN::ROS::Interface:
ParameterGroups:
- Parameters:
- LoadBalancerId
- EcsInstanceIds
TemplateTags:
- acs:document:试用教程:实现IPv4服务的七层负载均衡