forked from aliyun/ros-templates
-
Notifications
You must be signed in to change notification settings - Fork 1
/
ecs-clone-join-sls.yml
137 lines (137 loc) · 4.75 KB
/
ecs-clone-join-sls.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
ROSTemplateFormatVersion: '2015-09-01'
Description:
en: Clone the ECS instance, direct the IP to the new machine group created in the
Log Service, and apply the specified rules.
zh-cn: 克隆ECS实例,将IP指向日志服务中新建的机器组,应用指定的规则。
Parameters:
SourceInstanceId:
Type: String
Label: Source Instance ID
Description:
en: The source ID of ECS instance to be cloned
zh-cn: 要克隆的ECS实例的源ID
InstanceName:
Type: String
Label: Instance Name
Description:
en: ECS Instance Name, [2, 128] English or Chinese characters, must start with
a letter or Chinese in size, can contain numbers, '_' or '.', '-'.
zh-cn: ECS实例名,[2,128]英文或中文字符,必须以字母或中文开头,可以包含数字、下划线或“.”、“-”。
ConstraintDescription: '[2, 128] English or Chinese characters'
Default: DefaultECSInstance
MinLength: 2
MaxLength: 128
MaxAmount:
Type: Number
Label: Number of ECS
Description:
en: Number of ECS instances to be created.
zh-cn: 需要创建的ECS实例数量。
ConstraintDescription: The length is in [1, 100]
Default: 1
MinValue: 1
MaxValue: 100
Password:
Type: String
Label: Instance Password
Description:
en: The root password of ECS instance. The password is a string of 8 to 30 characters
and must contain uppercase/lowercase letters, numbers.
zh-cn: ECS实例密码。密码是一个8到30个字符的字符串,必须包含大写/小写字母和数字。
ConstraintDescription: The password is a string of 8 to 30 characters and must
contain uppercase/lowercase letters, numbers.
AllowedPattern: '[a-zA-Z0-9-\(\)\`\~\!@\#\$%\^&\*-+=\|\{\}\[\]\:\;\‘\,\.\?\/]*'
MinLength: '8'
MaxLength: '30'
NoEcho: true
SlsGroupName:
Type: String
Label: Group Name
Description:
en: The machine group name to be created in SLS, which not be repeated with
any exising name., [2, 128] English or Chinese characters, must start with
a letter or Chinese in size, can contain numbers, '_' or '.', '-'.
zh-cn: 将在SLS中创建的机器组名称,该名称不能重复,[2,128]英文或中文字符,必须以字母或中文开头,可以包含数字、下划线或“.”、“-”。
Default: DefaultSLSGroupTest
SlsProjectName:
Type: String
Label: Project Name
Description:
en: The existing project name in SlS, [2, 128] English or Chinese characters,
must start with a letter or Chinese in size, can contain numbers, '_' or '.',
'-'.
zh-cn: SLS中已有的项目名称,[2,128]英文或中文字符,必须以字母或中文开头,可以包含数字、下划线或“.”、“-”。
SlsConfigName:
Type: String
Label: Config Name
Description:
en: The existing logtail name in SlS, which is the name of configuration to
apply the machine group, which not be repeated with any exising name., [2,
128] English or Chinese characters, must start with a letter or Chinese in
size, can contain numbers, '_' or '.', '-'.
zh-cn: SLS中的已有的logtail名称,它是应用机器组的配置的名称,[2,128]英文或中文字符,必须以字母或中文开头,可以包含数字、下划线或“.”、“-”。
Resources:
ecsInstanceGroup:
Type: ALIYUN::ECS::InstanceGroupClone
Properties:
InstanceName:
Ref: InstanceName
MaxAmount:
Ref: MaxAmount
Password:
Ref: Password
SourceInstanceId:
Ref: SourceInstanceId
MachineGroup:
Type: ALIYUN::SLS::MachineGroup
Properties:
GroupAttribute: ''
GroupName:
Ref: SlsGroupName
MachineIdentifyType: ip
MachineList:
Fn::GetAtt:
- ecsInstanceGroup
- PublicIps
ProjectName:
Ref: SlsProjectName
ApplyConfigToMachineGroup:
Type: ALIYUN::SLS::ApplyConfigToMachineGroup
Properties:
ConfigName:
Ref: SlsConfigName
GroupName:
Fn::GetAtt:
- MachineGroup
- GroupName
ProjectName:
Ref: SlsProjectName
Outputs:
publicIps:
Value:
Fn::GetAtt:
- ecsInstanceGroup
- PublicIps
SlsGroupName:
Value:
Fn::GetAtt:
- MachineGroup
- GroupName
Metadata:
ALIYUN::ROS::Interface:
ParameterGroups:
- Parameters:
- SourceInstanceId
- InstanceName
- MaxAmount
- Password
Label:
default: ECS
- Parameters:
- SlsGroupName
- SlsProjectName
- SlsConfigName
Label:
default: SLS
TemplateTags:
- acs:example:弹性计算:克隆ECS并将IP指向日志服务中新创建的机器组