forked from aliyun/ros-templates
-
Notifications
You must be signed in to change notification settings - Fork 1
/
entire-ecs-clone.yml
179 lines (179 loc) · 4.62 KB
/
entire-ecs-clone.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
ROSTemplateFormatVersion: '2015-09-01'
Description:
en: Clone an ECS Instance.
zh-cn: 克隆一台ECS实例。
Conditions:
CreateNewDisk:
Fn::Equals:
- Ref: CloneMode
- CloneEcsDisk
CreateNewEcsInstance:
Fn::Equals:
- Ref: CloneMode
- CloneEcsInstance
Parameters:
CloneMode:
Type: String
Label:
en: Clone Mode
zh-cn: 克隆模式
AllowedValues:
- CloneEcsDisk
- CloneEcsInstance
SourceEcsDiskId:
Type: String
Label:
en: Source ECS Disk ID
zh-cn: 源ECS磁盘ID
Description:
en: Create a new disk based on the source ECS disk
zh-cn: 基于源ECS磁盘创建新磁盘
AssociationProperty: ALIYUN::ECS::Disk::DiskId
AssociationPropertyMetadata:
Visible:
Condition:
Fn::Equals:
- ${CloneMode}
- CloneEcsDisk
Default: null
SourceEcsInstanceId:
Type: String
Label:
en: Source ECS Instance ID
zh-cn: 源ECS实例ID
Description:
en: Source ECS Instance
zh-cn: 源ECS实例ID
AssociationProperty: ALIYUN::ECS::Instance::InstanceId
AssociationPropertyMetadata:
Visible:
Condition:
Fn::Equals:
- ${CloneMode}
- CloneEcsInstance
Default: null
ZoneId:
Type: String
Label:
en: Create an Availability Zone for the disk
zh-cn: 新建磁盘的可用区
AssociationProperty: ALIYUN::ECS::Instance::ZoneId
AssociationPropertyMetadata:
Visible:
Condition:
Fn::Equals:
- ${CloneMode}
- CloneEcsDisk
Default: null
ECSDiskCategory:
Type: String
Label:
en: Disk Type
zh-cn: 磁盘类型
AssociationProperty: ALIYUN::ECS::Disk::DataDiskCategory
AssociationPropertyMetadata:
ZoneId: ${ZoneId}
Visible:
Condition:
Fn::Equals:
- ${CloneMode}
- CloneEcsDisk
Default: null
NumberOfClonedEcs:
Type: Number
Label:
en: Number of Cloned ECS
zh-cn: 将克隆的节点数
Description:
en: The number of nodes will be cloned
zh-cn: 将克隆的节点数
AssociationPropertyMetadata:
Visible:
Condition:
Fn::Equals:
- ${CloneMode}
- CloneEcsInstance
Default: 1
MinValue: 1
MaxValue: 100
LoginPassword:
Type: String
Label:
en: ECS Instance Password
zh-cn: 实例密码
Description:
en: The 8-30 long login password of instance, consists of the uppercase, lowercase
letter and number. <br> special characters include()'~!@#$%^&*_-+=|{}[]:;'<>,.?/.
zh-cn: 长度8-30,必须包含大写字母、小写字母、数字、特殊符号三个;<br>特殊字符包括:()'~!@#$%^&*_-+=|{}[]:;'<>,.?/
ConstraintDescription:
en: 'Length 8-30, must contain upper case letters, lower case letters, Numbers,
special symbols three; special characters include: ()`~!@#$%^&*_-+=|{}[]:;''<>,.?/'
zh-cn: 长度8-30,必须包含大写字母、小写字母、数字、特殊符号三种;特殊字符包括:()`~!@#$%^&*_-+=|{}[]:;' <>,.?/
AssociationPropertyMetadata:
Visible:
Condition:
Fn::Equals:
- ${CloneMode}
- CloneEcsInstance
Default: null
AllowedPattern: '[a-zA-Z0-9-\(\)\`\~\!@\#\$%\^&\*-+=\|\{\}\[\]\:\;\‘\,\.\?\/]*'
MinLength: '8'
MaxLength: '30'
NoEcho: true
Resources:
DiskSnapshot:
Type: ALIYUN::ECS::Snapshot
Condition: CreateNewDisk
Properties:
DiskId:
Ref: SourceEcsDiskId
CloneEcsDisk:
Type: ALIYUN::ECS::Disk
Condition: CreateNewDisk
Properties:
ZoneId:
Ref: ZoneId
DiskCategory:
Ref: ECSDiskCategory
SnapshotId:
Fn::GetAtt:
- DiskSnapshot
- SnapshotId
CloneEcsInstance:
Type: ALIYUN::ECS::InstanceGroupClone
Condition: CreateNewEcsInstance
Properties:
MaxAmount:
Ref: NumberOfClonedEcs
Password:
Ref: LoginPassword
SourceInstanceId:
Ref: SourceEcsInstanceId
Outputs:
NewDiskId:
Condition: CreateNewDisk
Value:
Fn::GetAtt:
- CloneEcsDisk
- DiskId
NewEcsInstanceIds:
Condition: CreateNewEcsInstance
Value:
Fn::GetAtt:
- CloneEcsInstance
- InstanceIds
Metadata:
ALIYUN::ROS::Interface:
ParameterGroups:
- Parameters:
- CloneMode
- SourceEcsDiskId
- SourceEcsInstanceId
- ZoneId
- ECSDiskCategory
- NumberOfClonedEcs
- LoginPassword
Label:
default: ECS
TemplateTags:
- acs:example:弹性计算:克隆一台ECS实例