-
Notifications
You must be signed in to change notification settings - Fork 17
/
ACS::ECS::TagInstanceByOSType.yml
63 lines (63 loc) · 1.54 KB
/
ACS::ECS::TagInstanceByOSType.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
FormatVersion: OOS-2019-06-01
Description:
name-en: ACS::ECS::TagInstanceByOSType
name-zh-cn: 以ECS实例操作系统类型为标签值给实例打标签
en: Tag an ECS instance using OS type as tag value
zh-cn: 以ECS实例操作系统类型为标签值给实例打标签
Parameters:
regionId:
Description:
en: The ID of region
zh-cn: 地域ID
Type: String
Default: '{{ ACS::RegionId }}'
instanceId:
Description:
en: Instance ID of the ECS
zh-cn: ECS实例ID
Type: String
MaxLength: 30
MinLength: 1
tagKey:
Description:
en: The tag key
zh-cn: 标签键
Type: String
Default: OSType
Tasks:
- Name: queryInstanceOSType
Action: ACS::ExecuteApi
Description:
en: Queries ECS instance OS type
zh-cn: 获取ECS实例系统类型
Properties:
Service: ECS
API: DescribeInstances
Parameters:
RegionId: '{{ regionId }}'
InstanceIds:
- '{{ instanceId }}'
Outputs:
osType:
Type: String
ValueSelector: Instances.Instance[].OSType
- 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: '{{ queryInstanceOsType.osType }}'
Outputs:
osType:
Type: String
Value: '{{ queryInstanceOsType.osType }}'