-
Notifications
You must be signed in to change notification settings - Fork 17
/
Copy pathACS-ECS-RunInstancesWithApproval.json
174 lines (174 loc) · 4.06 KB
/
ACS-ECS-RunInstancesWithApproval.json
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
{
"FormatVersion": "OOS-2019-06-01",
"Description": {
"en": "Creates one or more ECS instances with approval",
"zh-cn": "通过审批后创建ECS实例",
"name-en": "ACS-ECS-RunInstancesWithApproval",
"name-zh-cn": "通过审批后创建ECS实例",
"categories": [
"cost_manage"
]
},
"Parameters": {
"accessToken": {
"Label": {
"en": "AccessToken",
"zh-cn": "钉钉访问令牌"
},
"Type": "String",
"AllowedPattern": "[A-Za-z0-9]*"
},
"imageId": {
"Label": {
"en": "ImageId",
"zh-cn": "镜像ID"
},
"Type": "String",
"AssociationProperty": "ALIYUN::ECS::Image::ImageId"
},
"instanceType": {
"Label": {
"en": "InstanceType",
"zh-cn": "实例类型"
},
"Type": "String",
"AssociationProperty": "ALIYUN::ECS::Instance::InstanceType",
"AllowedPattern": "ecs\\.[A-Za-z0-9\\.\\-]*"
},
"securityGroupId": {
"Label": {
"en": "SecurityGroupId",
"zh-cn": "安全组ID"
},
"Type": "String",
"AssociationProperty": "ALIYUN::ECS::SecurityGroup::SecurityGroupId"
},
"vSwitchId": {
"Label": {
"en": "VSwitchId",
"zh-cn": "交换机ID"
},
"Type": "String",
"AssociationProperty": "ALIYUN::VPC::VSwitch::VSwitchId",
"AssociationPropertyMetadata": {
"Filters": [
{
"SecurityGroupId": "securityGroupId"
}
]
}
},
"amount": {
"Label": {
"en": "Amount",
"zh-cn": "实例数量"
},
"Type": "Number",
"Default": 1
},
"OOSAssumeRole": {
"Label": {
"en": "OOSAssumeRole",
"zh-cn": "OOS扮演的RAM角色"
},
"Type": "String",
"Default": ""
}
},
"RamRole": "{{ OOSAssumeRole }}",
"Tasks": [
{
"Name": "approvalForRunInstances",
"Action": "ACS::Approve",
"Description": {
"en": "Approval to lunch ECS instances",
"zh-cn": "钉钉审批"
},
"Properties": {
"NotifyType": "WebHook",
"WebHook": {
"URI": "https://oapi.dingtalk.com/robot/send?access_token={{ accessToken }}",
"Headers": {
"Content-Type": "application/json"
},
"Content": {
"msgtype": "text",
"text": {
"content": "The ECS instances will be created"
}
}
}
}
},
{
"Name": "runInstances",
"Action": "ACS::ECS::RunInstances",
"Description": {
"en": "Creates one or more ECS instances",
"zh-cn": "创建实例"
},
"Properties": {
"imageId": "{{ imageId }}",
"instanceType": "{{ instanceType }}",
"securityGroupId": "{{ securityGroupId }}",
"vSwitchId": "{{ vSwitchId }}",
"amount": "{{ amount }}"
},
"Outputs": {
"instanceId": {
"ValueSelector": "instanceIds[0]",
"Type": "String"
}
}
}
],
"Outputs": {
"instanceId": {
"Type": "String",
"Value": "{{ runInstances.instanceId }}"
}
},
"Metadata": {
"ALIYUN::OOS::Interface": {
"ParameterGroups": [
{
"Parameters": [
"accessToken"
],
"Label": {
"default": {
"zh-cn": "钉钉访问令牌",
"en": "Dingtalk Access Token"
}
}
},
{
"Parameters": [
"imageId",
"instanceType",
"securityGroupId",
"vSwitchId",
"amount"
],
"Label": {
"default": {
"zh-cn": "创建实例选型",
"en": "Run Command Options"
}
}
},
{
"Parameters": [
"OOSAssumeRole"
],
"Label": {
"default": {
"zh-cn": "高级选项",
"en": "Control Options"
}
}
}
]
}
}
}