-
Notifications
You must be signed in to change notification settings - Fork 17
/
Copy pathACS::ECS::DescribeSavingsPlanPrice.yml
87 lines (87 loc) · 2.27 KB
/
ACS::ECS::DescribeSavingsPlanPrice.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
79
80
81
82
83
84
85
86
87
FormatVersion: OOS-2019-06-01
Description:
name-en: ACS::ECS::DescribeSavingsPlanPrice
name-zh-cn: 预付费转按量付费并SavingsPlan询价
en: Describe exchange to post pay And savings plan price
zh-cn: 预付费转按量付费并做SP询价
Parameters:
regionId:
Type: String
Label:
en: RegionId
zh-cn: 地域ID
AssociationProperty: RegionId
Default: '{{ ACS::RegionId }}'
targetInstanceGroup:
Type: Json
Label:
en: TargetInstanceGroup
zh-cn: 目标实例组
Tasks:
- Name: describeSavingsPlanPrice
Action: ACS::ExecuteAPI
Description:
en: Describe exchange to post pay and savings plan price
zh-cn: 预付费转按量付费的SP询价
Properties:
Service: ECS
API: DescribeSavingsPlanPrice
Parameters:
RegionId: '{{ regionId }}'
ResourceId:
Fn::Jq:
- All
- .[].ResourceId
- '{{ targetInstanceGroup }}'
PlanType:
Fn::Jq:
- First
- .[].PlanType
- '{{ targetInstanceGroup }}'
OfferingType:
Fn::Jq:
- First
- .[].OfferingType
- '{{ targetInstanceGroup }}'
CommittedAmount:
Fn::Jq:
- First
- 'reduce .[] as $num (0; . + ($num * 1000)) / 1000'
- Fn::Jq:
- All
- .[].CommittedAmount
- '{{ targetInstanceGroup }}'
PeriodUnit:
Fn::Jq:
- First
- .[].PeriodUnit
- '{{ targetInstanceGroup }}'
Period:
Fn::Jq:
- First
- .[].Period
- '{{ targetInstanceGroup }}'
InstanceTypeFamily:
Fn::Jq:
- First
- .[].InstanceTypeFamily
- '{{ targetInstanceGroup }}'
InstanceTypeFamilyGroup:
Fn::Jq:
- First
- .[].InstanceTypeFamilyGroup
- '{{ targetInstanceGroup }}'
Outputs:
result:
Type: Json
ValueSelector: .
Outputs:
results:
Type: Json
Value:
InstanceIds:
Fn::Jq:
- All
- .[].ResourceId
- '{{ targetInstanceGroup }}'
SP: '{{ describeSavingsPlanPrice.result }}'