forked from cloud-custodian/cloud-custodian
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathtest_costhub.py
32 lines (29 loc) · 957 Bytes
/
test_costhub.py
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
# Copyright The Cloud Custodian Authors.
# SPDX-License-Identifier: Apache-2.0
def test_cost_hub_ebs(test):
factory = test.replay_flight_data('cost_opt_hub_ebs')
p = test.load_policy(
{
'name': 'cost-opt-ec2',
'resource': 'aws.ebs',
'filters': [
{
'type': 'cost-optimization',
'efforts': ['VeryLow', 'Low', 'Medium'],
'attrs': [
{
'type': 'value',
'key': 'estimatedSavingsPercentage',
'value': 15,
'op': 'gte',
},
],
}
],
},
session_factory=factory,
config={'account_id': '644160558196'}
)
resources = p.run()
assert len(resources) == 1
assert resources[0]['c7n:cost_optimize']