-
Notifications
You must be signed in to change notification settings - Fork 35
/
run-command.yml
75 lines (75 loc) · 1.73 KB
/
run-command.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
ROSTemplateFormatVersion: '2015-09-01'
Description:
zh-cn: 此模板用于通过ECS RunCommand在指定实例上执行自定义脚本,支持参数化配置、超时设置及命令留存选项。
en: This template is designed for executing custom scripts on specified instances
via ECS RunCommand, featuring support for parameterized configurations, timeout
settings, and options for command retention.
Parameters:
ContentEncoding:
Type: String
Default: PlainText
AllowedValues:
- PlainText
- Base64
CommandContent:
Type: String
Default: echo {{name}}
EnableParameter:
Type: Boolean
Default: true
Parameters:
Type: Json
Default:
name: test
WorkingDir:
Type: String
Default: /root/
Timeout:
Type: Number
Default: 60
Type:
Type: String
Default: RunShellScript
InstanceIds:
Type: Json
Description: 'example: ["i-bp1gqv6byw4a31pj1qc8", "i-xxx"]'
KeepCommand:
Type: Boolean
Default: false
Resources:
RunCommand:
Type: ALIYUN::ECS::RunCommand
Properties:
InstanceIds:
Ref: InstanceIds
Parameters:
Ref: Parameters
Description: Command
Timeout:
Ref: Timeout
ContentEncoding:
Ref: ContentEncoding
Name: Name
WorkingDir:
Ref: WorkingDir
CommandContent:
Ref: CommandContent
Type:
Ref: Type
EnableParameter:
Ref: EnableParameter
KeepCommand:
Ref: KeepCommand
Outputs:
CommandId:
Description: The id of command created.
Value:
Fn::GetAtt:
- RunCommand
- CommandId
InvokeId:
Description: The invoke id of command.
Value:
Fn::GetAtt:
- RunCommand
- InvokeId