/
ACS::ECS::AllocatePublicIpAddress.yml
78 lines (78 loc) · 2.01 KB
/
ACS::ECS::AllocatePublicIpAddress.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
FormatVersion: OOS-2019-06-01
Description:
name-en: ACS::ECS::AllocatePublicIpAddress
name-zh-cn: 为ECS实例分配一个公网IP
en: Assigns a public IP address to ECS instance
zh-cn: 为ECS实例分配一个公网IP地址
Parameters:
regionId:
Description:
en: The ID of region
zh-cn: 地域ID
Type: String
Default: '{{ ACS::RegionId }}'
instanceId:
Description:
en: The ID of ECS instance
zh-cn: ECS实例ID
Type: String
MinLength: 1
MaxLength: 30
Tasks:
- Name: checkInstanceReady
Action: ACS::CheckFor
Description:
en: Check whether the ECS instance status is Running or Stopped
zh-cn: 检查ECS实例是否处于运行中或已停止状态
Properties:
Service: ECS
API: DescribeInstances
Parameters:
RegionId: '{{ regionId }}'
InstanceIds:
- '{{ instanceId }}'
DesiredValues:
- Running
- Stopped
PropertySelector: Instances.Instance[].Status
- Name: allocatePublicIpAddress
Action: ACS::ExecuteAPI
Description:
en: Assigns a public IP address to an instance
zh-cn: 为一台ECS实例分配一个公网IP地址
Properties:
Service: ECS
API: AllocatePublicIpAddress
Parameters:
RegionId: '{{ regionId }}'
InstanceId: '{{ instanceId }}'
Outputs:
ipAddress:
Type: String
ValueSelector: IpAddress
- Name: rebootInstance
Action: ACS::ExecuteAPI
Description:
en: Restarts the ECS instance
zh-cn: 重启ECS实例
Properties:
Service: ECS
API: RebootInstance
Parameters:
RegionId: '{{ regionId }}'
InstanceId: '{{ instanceId }}'
- Name: untilInstanceReady
Action: ACS::WaitFor
Description:
en: Waits for the ECS instance to enter the Running status
zh-cn: 等待ECS实例到达运行中状态
Properties:
Service: ECS
API: DescribeInstances
Parameters:
RegionId: '{{ regionId }}'
InstanceIds:
- '{{ instanceId }}'
DesiredValues:
- Running
PropertySelector: Instances.Instance[].Status