forked from aliyun/ros-templates
-
Notifications
You must be signed in to change notification settings - Fork 0
/
ecs-a-record.yml
331 lines (326 loc) · 10.1 KB
/
ecs-a-record.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
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
ROSTemplateFormatVersion: '2015-09-01'
Description:
zh-cn: 创建ECS实例,配置安全组、系统盘及网络设置,绑定公网IP并关联至指定域名A记录。
en: Create an ECS instance, configure security groups, system disks, and network
settings, associate with a public IP, and link to the specified domain's A record.
Parameters:
DnsDomainName:
Type: String
Label:
en: Top-level Domain Name
zh-cn: 顶级域名
Description:
en: Top-level domain, default, do not resolve the domain name, such as “test.com”
zh-cn: 顶级域名,默认值default时不做域名解析, 如“test.com”
DomainNamePre:
Type: String
Label:
en: Host
zh-cn: 主机记录
Description:
en: Hostname refers to the prefix before the domain names:<br>www:Use www to
match www.yourdomain.tld.<br>@:Use @ to exactly match the original domain
name (for example, yourdomain.tld).<br>*:Use * (asterisk) as a wildcard to
match any prefix. For example, *.aliyun.com matches <any prefix>.aliyun.com.<br>mail:Use
mail to match mail.yourdomain.com. It is typically used for mail server resolution.<br>Second-level
domain name:For example, to match abc.yourdomain.com, enter abc.<br>Mobile
website:For example, to match m.yourdomain.com, enter m.
zh-cn: 主机记录,即域名前缀;<br>www:解析后的域名为www.aliyun.com。<br>@:直接解析主域名 aliyun.com。<br>*:泛解析,匹配其他所有域名
*.aliyun.com。<br>mail:将域名解析为mail.aliyun.com,通常用于解析邮箱服务器。<br>二级域名:如:abc.aliyun.com,填写abc。<br>手机网站:如:m.aliyun.com,填写m。
VSwitchZoneId:
Type: String
Label:
en: VSwitch Availability Zone
zh-cn: 交换机可用区
Description:
en: Availability Zone ID,<br><b>note: <font color='blue'>Before selecting, please
confirm that the Availability Zone supports the specification of creating
ECS resources</font></b>
zh-cn: 可用区ID,<br><b>注: <font color='blue'>选择可用区前请确认该可用区是否支持创建ECS资源的规格</font></b>
AssociationProperty: ALIYUN::ECS::Instance:ZoneId
EcsImageId:
Type: String
Label:
en: Image
zh-cn: 镜像
Description:
en: Image ID,see detail:<b><a href='https://www.alibabacloud.com/help/en/doc-detail/112977.html'
target='_blank'><font color='blue'>Find the mirror</font></a></b>
zh-cn: 镜像ID, 详见:<b><a href='https://help.aliyun.com/document_detail/112977.html'
target='_blank'><font color='blue'>查找镜像</font></a></b>
AssociationProperty: ALIYUN::ECS::Image::ImageId
AssociationPropertyMetadata:
InstanceType: ${EcsInstanceType}
SupportedImageOwnerAlias:
- system
- self
- others
Default: centos_7_04_64_20G_alibase_201701015.vhd
EcsInstanceType:
Type: String
Label:
en: Instance Type
zh-cn: 实例规格
Description:
en: 'Fill in the specifications that can be used under the VSwitch availability
zone;</b></font><br>recommended specifications:<font color=''red''><b>ecs.c5.large</b></font><br>note:
a few zones do not support recommended specifications<br>see detail: <a href=''https://www.alibabacloud.com/help/en/doc-detail/25378.html''
target=''_blank''><b><font color=''blue''>Instance Specification Family</font></a></b>'
zh-cn: 填写VSwitch可用区下可使用的规格;<br>推荐规格:<font color='red'><b>ecs.c5.large</b></font><br>注:可用区可能不支持推荐规格<br>规格详见:<a
href='https://help.aliyun.com/document_detail/25378.html' target='_blank'><b><font
color='blue'>实例规格族</font></a></b>
AssociationProperty: ALIYUN::ECS::Instance::InstanceType
AssociationPropertyMetadata:
ZoneId: VSwitchZoneId
EcsSystemDiskCategory:
Type: String
Label:
en: System Disk Type
zh-cn: 系统盘类型
AssociationProperty: ALIYUN::ECS::Disk::SystemDiskCategory
AssociationPropertyMetadata:
InstanceType: ${EcsInstanceType}
ZoneId: ${VSwitchZoneId}
EcsSystemDiskSize:
Type: Number
Label:
en: System Disk Space
zh-cn: 系统盘空间
Description:
en: 'System disk size, range of values: 20-500, units: GB.'
zh-cn: 系统盘大小, 取值范围:[20, 500], 单位:GB。
Default: 20
EcsPassword:
Type: String
Label:
en: Instance Password
zh-cn: 实例密码
Description:
en: Server login password, Length 8-30, must contain three(Capital letters,
lowercase letters, numbers, ()`~!@#$%^&*_-+=|{}[]:;'<>,.?/ Special symbol
in).
zh-cn: 服务器登录密码,长度8-30,必须包含三项(大写字母、小写字母、数字、 ()`~!@#$%^&*_-+=|{}[]:;'<>,.?/ 中的特殊符号)。
ConstraintDescription:
en: Length 8-30, must contain three(Capital letters, lowercase letters, numbers,
()`~!@#$%^&*_-+=|{}[]:;'<>,.?/ Special symbol in).
zh-cn: 长度8-30,必须包含三项(大写字母、小写字母、数字、 ()`~!@#$%^&*_-+=|{}[]:;'<>,.?/ 中的特殊符号)。
AllowedPattern: '[0-9A-Za-z\_\-\&:;''<>,=%`~!@#\(\)\$\^\*\+\|\{\}\[\]\.\?\/]+$'
MinLength: 8
MaxLength: 30
NoEcho: true
Resources:
EcsVpc:
Type: ALIYUN::ECS::VPC
Properties:
CidrBlock: 192.168.0.0/16
VpcName:
Fn::Join:
- '-'
- - StackId
- Ref: ALIYUN::StackId
Metadata:
ALIYUN::ROS::Designer:
id: 1cdd27e7-749b-4049-b629-fab7f28a7ac0
EcsSecurityGroup:
Type: ALIYUN::ECS::SecurityGroup
Properties:
VpcId:
Ref: EcsVpc
SecurityGroupIngress:
- IpProtocol: icmp
NicType: internet
PortRange: -1/-1
Priority: 1
SourceCidrIp: 0.0.0.0/0
- IpProtocol: tcp
NicType: internet
PortRange: 3389/3389
Priority: 1
SourceCidrIp: 0.0.0.0/0
- IpProtocol: tcp
NicType: internet
PortRange: 22/22
Priority: 1
SourceCidrIp: 0.0.0.0/0
- IpProtocol: tcp
NicType: intranet
PortRange: 80/80
Priority: 1
SourceCidrIp: 0.0.0.0/0
SecurityGroupName:
Fn::Join:
- _
- - StackId
- Ref: ALIYUN::StackId
Metadata:
ALIYUN::ROS::Designer:
id: 02591ad1-fcc3-4921-933c-3a86b72d8cb6
EcsVSwitch:
Type: ALIYUN::ECS::VSwitch
Properties:
ZoneId:
Ref: VSwitchZoneId
VpcId:
Ref: EcsVpc
CidrBlock: 192.168.0.0/24
VSwitchName:
Fn::Join:
- _
- - StackId
- Ref: ALIYUN::StackId
Metadata:
ALIYUN::ROS::Designer:
id: 22b93555-10ac-4401-8000-d08e5086c446
Server:
Type: ALIYUN::ECS::InstanceGroup
Properties:
VpcId:
Ref: EcsVpc
VSwitchId:
Ref: EcsVSwitch
SecurityGroupId:
Ref: EcsSecurityGroup
ImageId:
Ref: EcsImageId
AllocatePublicIP: true
InstanceChargeType: PostPaid
InstanceType:
Ref: EcsInstanceType
IoOptimized: optimized
MaxAmount: 1
Password:
Ref: EcsPassword
SystemDiskCategory:
Ref: EcsSystemDiskCategory
SystemDiskSize:
Ref: EcsSystemDiskSize
UserData:
Fn::Join:
- ''
- - '#!/bin/sh
'
- 'sudo yum check-update
'
- "sudo yum -y install httpd php \n"
- 'cd /var/www/html
'
- 'echo "hello world,This is ECS." > index.html
'
- 'service httpd start
'
- systemctl enable httpd.service
Metadata:
ALIYUN::ROS::Designer:
id: 60fdde9d-fa14-461c-a5ae-2d1f35aefa00
DnsDomainARecord:
Type: ALIYUN::DNS::DomainRecord
Properties:
DomainName:
Ref: DnsDomainName
RR:
Ref: DomainNamePre
TTL: 600
Type: A
Value:
Fn::Select:
- '0'
- Fn::GetAtt:
- Server
- PublicIps
DependsOn:
- Server
Metadata:
ALIYUN::ROS::Designer:
id: 0c2840a1-eabc-4d6f-8839-9b02dacb75e4
Outputs:
EcsInstanceId:
Value:
Fn::Select:
- '0'
- Fn::GetAtt:
- Server
- InstanceIds
EcsInstancePublicIp:
Value:
Fn::Select:
- '0'
- Fn::GetAtt:
- Server
- PublicIps
Metadata:
ALIYUN::ROS::Interface:
ParameterGroups:
- Parameters:
- DnsDomainName
- DomainNamePre
Label:
default: DNS
- Parameters:
- VSwitchZoneId
- EcsInstanceType
- EcsImageId
- EcsSystemDiskCategory
- EcsSystemDiskSize
- EcsPassword
Label:
default: ECS
TemplateTags:
- acs:example:网络:创建绑定A记录域名的ECS
ALIYUN::ROS::Designer:
02591ad1-fcc3-4921-933c-3a86b72d8cb6:
position:
x: 409
y: 165
size:
height: 60
width: 60
z: 1
06d6c3f2-9f00-4dcb-9ee5-e8fea5ce83bb:
source:
id: 0c2840a1-eabc-4d6f-8839-9b02dacb75e4
target:
id: 60fdde9d-fa14-461c-a5ae-2d1f35aefa00
z: 1
0c2840a1-eabc-4d6f-8839-9b02dacb75e4:
position:
x: 89
y: 165
size:
height: 60
width: 60
z: 0
1cdd27e7-749b-4049-b629-fab7f28a7ac0:
embeds:
- 22b93555-10ac-4401-8000-d08e5086c446
- 02591ad1-fcc3-4921-933c-3a86b72d8cb6
position:
x: 191
y: 50
size:
height: 288
width: 317.0537109375
z: 0
22b93555-10ac-4401-8000-d08e5086c446:
embeds:
- 60fdde9d-fa14-461c-a5ae-2d1f35aefa00
position:
x: 225
y: 125
size:
height: 140
width: 120
z: 1
3635b918-90dc-41b7-805b-3525adde7ead:
source:
id: 60fdde9d-fa14-461c-a5ae-2d1f35aefa00
target:
id: 02591ad1-fcc3-4921-933c-3a86b72d8cb6
z: 1
60fdde9d-fa14-461c-a5ae-2d1f35aefa00:
position:
x: 264
y: 165
size:
height: 60
width: 60
z: 2