-
Notifications
You must be signed in to change notification settings - Fork 35
/
scaling-group-enable.yml
172 lines (172 loc) · 4.57 KB
/
scaling-group-enable.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
ROSTemplateFormatVersion: '2015-09-01'
Description:
zh-cn: 创建弹性伸缩组与配置,自动调整实例数量,配置安全组、实例类型等,支持实例监控与自动扩展事件输出。
en: Create auto-scaling groups and configurations, automatically adjust the number of instances, configure security groups, instance types, etc., and support instance monitoring and automatic expansion event output.
Parameters:
VpcId:
Type: String
Description: VPC Id.
VSwitchId:
Type: String
Description: VSW Id.
SecurityGroupId:
Type: String
Description: Security Group Id.
ScalingConfigurationName:
Type: String
Default: mytest
Password:
Type: String
SystemDiskSize:
Type: Number
Default: 100
SystemDiskCategory:
Type: String
Default: cloud_essd
InstanceType:
Type: String
Default: ecs.c5.large
ImageId:
Type: String
Default: centos_7_04_64_20G_alibase_201701015.vhd
Resources:
ScalingGroup:
Type: ALIYUN::ESS::ScalingGroup
Properties:
VpcId:
Ref: VpcId
VSwitchId:
Ref: VSwitchId
MaxSize: 3
MinSize: 0
DefaultCooldown: 15
DependsOn: InstanceGroup
ScalingConfiguration:
Type: ALIYUN::ESS::ScalingConfiguration
Properties:
SecurityGroupId:
Ref: SecurityGroupId
ImageId:
Ref: ImageId
InstanceType:
Ref: InstanceType
SystemDiskCategory:
Ref: SystemDiskCategory
SystemDiskSize:
Ref: SystemDiskSize
ScalingConfigurationName:
Ref: ScalingConfigurationName
ScalingGroupId:
Ref: ScalingGroup
DependsOn: ScalingGroup
InstanceGroup:
Type: ALIYUN::ECS::InstanceGroup
Properties:
VpcId:
Ref: VpcId
VSwitchId:
Ref: VSwitchId
SecurityGroupId:
Ref: SecurityGroupId
ImageId:
Ref: ImageId
IoOptimized: optimized
AllocatePublicIP: false
InstanceType:
Ref: InstanceType
SystemDiskCategory:
Ref: SystemDiskCategory
Password:
Ref: Password
MaxAmount: 3
ScalingRule:
Type: ALIYUN::ESS::ScalingRule
Properties:
AdjustmentType: QuantityChangeInCapacity
ScalingGroupId:
Fn::GetAtt:
- ScalingGroup
- ScalingGroupId
AdjustmentValue: 10
DependsOn: ScalingGroup
ScalingGroupEnable:
Type: ALIYUN::ESS::ScalingGroupEnable
Properties:
InstanceIds:
Fn::GetAtt:
- InstanceGroup
- InstanceIds
ScalingConfigurationId:
Ref: ScalingConfiguration
ScalingGroupId:
Ref: ScalingGroup
ScalingRuleAris:
- Fn::GetAtt:
- ScalingRule
- ScalingRuleAri
ScalingRuleArisExecuteVersion: 0
Outputs:
ScalingInstanceDetails:
Description: Detail information of auto created scaling instances
Value:
Fn::GetAtt:
- ScalingGroupEnable
- ScalingInstanceDetails
ScalingRuleArisExecuteResultNumberOfAddedInstances:
Description: The number of added vm via the execution of scaling rule aris
Value:
Fn::GetAtt:
- ScalingGroupEnable
- ScalingRuleArisExecuteResultNumberOfAddedInstances
ScalingRuleArisExecuteErrorInfoScalingRuleArisExecuteErrorInfo:
Description: The error info of the execution of scaling rule aris
Value:
Fn::GetAtt:
- ScalingGroupEnable
- ScalingRuleArisExecuteErrorInfo
ScalingGroupId:
Description: The scaling group id
Value:
Fn::GetAtt:
- ScalingGroupEnable
- ScalingGroupId
ScalingRuleArisExecuteResultInstancesRemoved:
Description: Instances removed via the execution of scaling rule aris
Value:
Fn::GetAtt:
- ScalingGroupEnable
- ScalingRuleArisExecuteResultInstancesRemoved
ScalingInstances:
Description: The auto created scaling instances
Value:
Fn::GetAtt:
- ScalingGroupEnable
- ScalingInstances
LifecycleState:
Description: The scaling group status
Value:
Fn::GetAtt:
- ScalingGroupEnable
- LifecycleState
ScalingRuleArisExecuteResultInstancesAdded:
Description: Instances added via the execution of scaling rule aris
Value:
Fn::GetAtt:
- ScalingGroupEnable
- ScalingRuleArisExecuteResultInstancesAdded
ScalingConfigurationId:
Description: The scaling configuration id
Value:
Fn::GetAtt:
- ScalingConfiguration
- ScalingConfigurationId
ScalingRuleAri:
Value:
Fn::GetAtt:
- ScalingRule
- ScalingRuleAri
ScalingRuleId:
Value:
Fn::GetAtt:
- ScalingRule
- ScalingRuleId