-
Notifications
You must be signed in to change notification settings - Fork 35
/
ecs-instance-group-join-sls.yml
176 lines (176 loc) · 4.76 KB
/
ecs-instance-group-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
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
ROSTemplateFormatVersion: '2015-09-01'
Description:
zh-cn: 创建ECS实例组,配置安全组,接入SLS指定项目日志采集,自动应用日志配置。
en: Create an ECS instance group, configure security groups, integrate with the
designated project in SLS for log collection, and automatically apply log configurations.
Parameters:
InstanceType:
Type: String
Label: Instance Type
Description: The ECS instance type, <a href='https://www.alibabacloud.com/help/doc-detail/25378.html'
target='_blank'>View instance types</a>
AssociationProperty: ALIYUN::ECS::Instance::InstanceType
ImageId:
Type: String
Label: Image ID
Description: Image ID, represents the image resource to startup one ECS instance,
<a href='https://www.alibabacloud.com/help/doc-detail/112977.html' target='_blank'>View
image resources</a>.
Default: centos_7
MaxAmount:
Type: Number
Label: Max Amount
Description: The maximum of ECS instances, must be greater than or equal to the
minimum.
ConstraintDescription: The integer within [1, 100]
MinValue: 1
MaxValue: 100
SystemDiskCategory:
Type: String
Label: System Disk Category
Description: System disk category.
Default: cloud_ssd
AllowedValues:
- cloud_efficiency
- cloud_ssd
AllocatePublicIP:
Type: Boolean
Label: Allocate Public IP
Description: Whether allocate the public internet IP or not.
Default: true
SecurityGroupName:
Type: String
Label: Security Group Name
Description: Security Group Name
InstanceName:
Type: String
Label: Instance Name
Description: The ECS instance name
Default: ecsInstance
Password:
Type: String
Label: Logon Password
Description: The login password of ECS instance
ConstraintDescription: Consist of 8 to 30 characters of alphanumeric characters
MinLength: 8
MaxLength: 30
NoEcho: true
SlsProjectName:
Type: String
Label: Project Name
Description: The existing project name in SLS
SlsGroupName:
Type: String
Label: Group Name
Description: The machine group name to be created in SLS, which not be repeated
with any exising name.
SlsConfigName:
Type: String
Label: Config Name
Description: The existing logtail name in SlS, which is the name of configuration
to apply the machine group.
Resources:
securityGroup:
Type: ALIYUN::ECS::SecurityGroup
Properties:
SecurityGroupName:
Ref: SecurityGroupName
ecsInstanceGroup:
Type: ALIYUN::ECS::InstanceGroup
Properties:
SecurityGroupId:
Fn::GetAtt:
- securityGroup
- SecurityGroupId
ImageId:
Ref: ImageId
AllocatePublicIP:
Ref: AllocatePublicIP
InstanceName:
Ref: InstanceName
InstanceType:
Ref: InstanceType
InternetChargeType: PayByBandwidth
MaxAmount:
Ref: MaxAmount
Password:
Ref: Password
SystemDiskCategory:
Ref: SystemDiskCategory
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:
SecurityGroupId:
Value:
Fn::GetAtt:
- securityGroup
- SecurityGroupId
InstanceIds:
Description: The instance id list of created ecs instance
Value:
Fn::GetAtt:
- ecsInstanceGroup
- InstanceIds
PublicIps:
Description: Public IP address list of created ecs instance.
Value:
Fn::GetAtt:
- ecsInstanceGroup
- PublicIps
ZoneIds:
Description: Zone id of created instance.
Value:
Fn::GetAtt:
- ecsInstanceGroup
- ZoneIds
InnerIps:
Description: Inner IP address list of the specified instance. Only for classical
instance.
Value:
Fn::GetAtt:
- ecsInstanceGroup
- InnerIps
Metadata:
ALIYUN::ROS::Interface:
ParameterGroups:
- Parameters:
- InstanceType
- ImageId
- MaxAmount
- SystemDiskCategory
- AllocatePublicIP
- SecurityGroupName
- InstanceName
- Password
Label:
default: ECS
- Parameters:
- SlsProjectName
- SlsGroupName
- SlsConfigName
Label:
default: SLS
TemplateTags:
- acs:example:弹性计算:创建一组ECS并将其作为指定的SLS中相关project的logtail的机器组