forked from aliyun/ros-templates
-
Notifications
You must be signed in to change notification settings - Fork 1
/
vpc-type-of-slb.yml
192 lines (192 loc) · 4.94 KB
/
vpc-type-of-slb.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
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
ROSTemplateFormatVersion: '2015-09-01'
Description:
en: Create Vpc type of Slb.
zh-cn: 创建Vpc类型的Slb。
Parameters:
VpcCidrBlock:
Type: String
Label:
en: VPC CIDR Block
zh-cn: 专有网络网段
Description:
en: 'The IP address range of the VPC in the CIDR block form. You can use the
following IP address ranges and their subnets: 10.0.0.0/8 172.16.0.0/12 192.168.0.0/16'
zh-cn: 专有网络的网段,可选值:10.0.0.0/8,172.16.0.0/12,192.168.0.0/16。
Default: 192.168.0.0/16
AllowedValues:
- 192.168.0.0/16
- 172.16.0.0/12
- 10.0.0.0/8
VSwitchZoneId:
Type: String
Label:
en: Zone ID
zh-cn: 可用区ID
Default: Null
Description:
en: The available zone ID, you should confirm the zone support SLB or not.
zh-cn: 可用区ID,需确认所选可用区下是否支持SLB等资源。
AssociationProperty: ALIYUN::ECS::Instance::ZoneId
AssociationPropertyMetadata:
Visible:
Condition:
'Fn::Equals':
- '${LoadBalancerAddressType}'
- intranet
VSwitchCidrBlock:
Type: String
Label:
en: VSwitch CIDR Block
zh-cn: 交换机网段
Description:
en: Must be a sub-network segment of the proprietary network and is not occupied
by other VSwitches.
zh-cn: 必须是所属专有网络的子网段,并且没有被其他交换机占用。
Default: 192.168.0.0/24
AssociationPropertyMetadata:
Visible:
Condition:
'Fn::Equals':
- '${LoadBalancerAddressType}'
- intranet
LoadBalancerSpec:
Type: String
Label:
en: Specification
zh-cn: 规格
Description:
en: Load balancing specification, <a href='https://help.aliyun.com/document_detail/85939.html'
target='_blank'><font color='blue'><b>Slb spec detail</b></font>.</a>
zh-cn: 负载均衡规格,<a href='https://help.aliyun.com/document_detail/85939.html' target='_blank'><font
color='blue'><b>规格详情</b></font></a>。
Default: slb.s1.small
LoadBalancerAddressType:
Type: String
Label:
en: Address Type
zh-cn: 地址类型
Description:
en: The address type of the load balancer. "intranet" or "internet".
zh-cn: '负载均衡器的地址类型。intranet: 内网, internet: 外网。'
Default: intranet
AllowedValues:
- internet
- intranet
Conditions:
CreateVsw:
'Fn::Equals':
- Ref: LoadBalancerAddressType
- intranet
Resources:
EcsVpc:
Type: ALIYUN::ECS::VPC
Properties:
CidrBlock:
Ref: VpcCidrBlock
VpcName:
Fn::Join:
- '-'
- - StackId
- Ref: ALIYUN::StackId
Metadata:
ALIYUN::ROS::Designer:
id: 47344e64-a958-4b6b-8d48-f78de66b984c
EcsVSwitch:
Type: ALIYUN::ECS::VSwitch
Condition: CreateVsw
Properties:
ZoneId:
Ref: VSwitchZoneId
VpcId:
Ref: EcsVpc
CidrBlock:
Ref: VSwitchCidrBlock
VSwitchName:
Fn::Join:
- '-'
- - StackId
- Ref: ALIYUN::StackId
Metadata:
ALIYUN::ROS::Designer:
id: 64ca78f1-6a70-46cd-8c09-bcf7b1305bde
SlbLoadBalancer:
Type: ALIYUN::SLB::LoadBalancer
Properties:
VpcId:
Ref: EcsVpc
VSwitchId:
'Fn::If':
- CreateVsw
- Ref: EcsVSwitch
- ''
AddressType:
Ref: LoadBalancerAddressType
LoadBalancerName:
Fn::Join:
- '-'
- - StackId
- Ref: ALIYUN::StackId
LoadBalancerSpec:
Ref: LoadBalancerSpec
PayType: PayOnDemand
DependsOn: EcsVSwitch
Metadata:
ALIYUN::ROS::Designer:
id: 55709b9f-d38e-45de-9961-7c65252ce471
Outputs:
SlbLoadBalancerId:
Description:
en: The ID of load balance created.
zh-cn: 创建的负载均衡ID。
Value:
Fn::GetAtt:
- SlbLoadBalancer
- LoadBalancerId
Metadata:
ALIYUN::ROS::Interface:
ParameterGroups:
- Parameters:
- VpcCidrBlock
- VSwitchZoneId
- VSwitchCidrBlock
Label:
default:
en: VPC
zh-cn: 专有网络
- Parameters:
- LoadBalancerSpec
Label:
default:
en: SLB
zh-cn: 负载均衡
TemplateTags:
- acs:example:网络:创建VPC类型的SLB
ALIYUN::ROS::Designer:
47344e64-a958-4b6b-8d48-f78de66b984c:
embeds:
- 64ca78f1-6a70-46cd-8c09-bcf7b1305bde
position:
x: 200
y: 59
size:
height: 221
width: 194
z: 0
55709b9f-d38e-45de-9961-7c65252ce471:
position:
x: 268
y: 143
size:
height: 60
width: 60
z: 2
64ca78f1-6a70-46cd-8c09-bcf7b1305bde:
embeds:
- 55709b9f-d38e-45de-9961-7c65252ce471
position:
x: 223
y: 83
size:
height: 178
width: 144
z: 1