-
Notifications
You must be signed in to change notification settings - Fork 17
/
ACS::ECS::TagInstanceByRunCommandResult.json
117 lines (117 loc) · 3.09 KB
/
ACS::ECS::TagInstanceByRunCommandResult.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
{
"FormatVersion": "OOS-2019-06-01",
"Description": {
"name-en": "ACS::ECS::TagInstanceByRunCommandResult",
"name-zh-cn": "以执行执行云助手命令的结果为标签值为实例打标签",
"en": "Tag a Linux ECS using RunCommand invocation result as tag value",
"zh-cn": "以执行执行云助手命令的结果为标签值为实例打标签"
},
"Parameters": {
"regionId": {
"Description": {
"en": "The ID of region",
"zh-cn": "地域ID"
},
"Type": "String",
"Default": "{{ ACS::RegionId }}"
},
"instanceId": {
"Description": {
"en": "Instance ID of the Linux ECS instance",
"zh-cn": "Linux类型的实例的ID"
},
"Type": "String",
"MaxLength": 30,
"MinLength": 1
},
"tagKey": {
"Description": {
"en": "The tag key",
"zh-cn": "标签键"
},
"Type": "String"
},
"commandContent": {
"Description": {
"en": "Command content to run in Linux ECS Instance",
"zh-cn": "在linux类型实例中运行的云助手命令"
},
"Type": "String"
}
},
"Tasks": [
{
"Name": "checkInstanceReady",
"Action": "ACS::CheckFor",
"Description": {
"en": "Checks ECS instance is in the Running status",
"zh-cn": "检查ECS实例是否处于运行中状态"
},
"Properties": {
"Service": "ECS",
"API": "DescribeInstances",
"Parameters": {
"RegionId": "{{ regionId }}",
"InstanceIds": [
"{{ instanceId }}"
]
},
"DesiredValues": [
"Running"
],
"PropertySelector": "Instances.Instance[].Status"
}
},
{
"Name": "queryInstanceCommandOutput",
"Action": "ACS::ECS::RunCommand",
"Description": {
"en": "Invokes cloud assisant command and gets invocation output",
"zh-cn": "执行云助手命令的并获取执行结果"
},
"Properties": {
"regionId": "{{ regionId }}",
"commandContent": "{{ commandContent }}",
"instanceId": "{{ instanceId }}",
"commandType": "RunShellScript"
},
"Outputs": {
"commandOutput": {
"Type": "String",
"ValueSelector": "invocationOutput"
}
}
},
{
"Name": "tagResources",
"Action": "ACS::ExecuteApi",
"Description": {
"en": "Creates and attaches tag to ECS instance",
"zh-cn": "创建标签并挂载到ECS实例"
},
"Properties": {
"Service": "ECS",
"API": "TagResources",
"Parameters": {
"RegionId": "{{ regionId }}",
"ResourceIds": [
"{{ instanceId }}"
],
"ResourceType": "Instance",
"Tags": [
{
"Key": "{{ tagKey }}",
"Value": "{{ queryInstanceCommandOutput.commandOutput }}"
}
]
}
}
}
],
"Outputs": {
"tagValue": {
"Type": "String",
"Value": "{{ queryInstanceCommandOutput.commandOutput }}"
}
}
}