-
Notifications
You must be signed in to change notification settings - Fork 17
/
ACS::TAG::TagResources.json
86 lines (86 loc) · 2.05 KB
/
ACS::TAG::TagResources.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
{
"FormatVersion": "OOS-2019-06-01",
"Description": {
"name-en": "ACS::TAG::TagResources",
"name-zh-cn": "给指定的资源集打标",
"en": "Tag resources",
"zh-cn": "给指定的资源集打标"
},
"Parameters": {
"resources": {
"Type": "Json",
"Label": {
"en": "Resources",
"zh-cn": "资源集"
}
},
"tags": {
"Label": {
"en": "Tags",
"zh-cn": "标签"
},
"Type": "Json"
}
},
"Tasks": [
{
"Name": "tagResources",
"Action": "ACS::ExecuteAPI",
"Description": {
"en": "Tag the resources it manages through resource management",
"zh-cn": "通过资源管理给其管理的资源打标签"
},
"Properties": {
"Service": "TAG",
"API": "TagResources",
"Parameters": {
"RegionId": {
"Fn::Jq": [
"First",
".[] | .RegionId",
"{{ resources }}"
]
},
"ResourceARN": {
"Fn::Jq": [
"All",
".[] | .RegionId as $regionId | .ResourceId as $resourceId | .ResourceType | ascii_downcase |split(\"::\") | \"arn:acs:\"+.[1]+\":\"+$regionId+\":{{ ACS::AccountId }}:\"+.[2]+\"/\" + $resourceId",
"{{ resources }}"
]
},
"Tags": "{{ tags }}"
}
},
"Outputs": {
"errorMessage": {
"Type": "List",
"ValueSelector": ".FailedResources.FailedResource[]"
},
"errorNumber": {
"Type": "Number",
"ValueSelector": ".FailedResources.FailedResource | length"
}
}
}
],
"Outputs": {
"errorMessage": {
"Type": "List",
"Value": "{{ tagResources.errorMessage }}"
},
"errorNumber": {
"Type": "Number",
"Value": "{{ tagResources.errorNumber }}"
},
"allNumber": {
"Type": "Number",
"Value": {
"Fn::Jq": [
"First",
". | length",
"{{ resources }}"
]
}
}
}
}