forked from aliyun/oos-templates
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathACS-ECS-RunInstancesWithApproval.yml
91 lines (91 loc) · 2.54 KB
/
ACS-ECS-RunInstancesWithApproval.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
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:
Description:
en: Dingtalk access_token to be notified.
zh-cn: 钉钉访问令牌。
Type: String
AllowedPattern: '[A-Za-z0-9]*'
imageId:
Description:
en: The image ID for the ECS instances.
ah_cn: 镜像ID。
Type: String
AssociationProperty: 'ALIYUN::ECS::Image::ImageId'
instanceType:
Description:
en: The instance type for the ECS instances.
zh-cn: 实例类型。
Type: String
AssociationProperty: 'ALIYUN::ECS::Instance::InstanceType'
AllowedPattern: ecs\.[A-Za-z0-9\.\-]*
securityGroupId:
Description:
en: The security group ID for the ECS instances.
zh-cn: 安全组ID。
Type: String
AssociationProperty: 'ALIYUN::ECS::SecurityGroup::SecurityGroupId'
vSwitchId:
Description:
en: The virtual switch ID for the ECS instances。
zh-cn: 交换机ID。
Type: String
AssociationProperty: 'ALIYUN::VPC::VSwitch::VSwitchId'
AssociationPropertyMetadata:
Filters:
- SecurityGroupId: securityGroupId
amount:
Description:
en: The specified number of instances you want to create.
zh-cn: 实例数量。
Type: Number
Default: 1
OOSAssumeRole:
Description:
en: The RAM role to be assumed by OOS.
zh-cn: OOS扮演的RAM角色。
Type: String
Default: OOSServiceRole
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 }}'