在这里,我尝试从AWSLIMITCHECKER
模块获取AWS限制检查ID,然后我需要检查categorywise
。
这是我的示例代码:
from awslimitchecker.checker import AwsLimitChecker
from awslimitchecker.trustedadvisor import TrustedAdvisor
#from awslimitchecker.services.base import _AwsService
res = TrustedAdvisor(all_services={},
region='my region',
account_id='myacct id',
account_role='my role'
)
这里我需要传递all_services的这些参数。我需要通过这本词典的所有内容?如何使用函数_get_limit_check_id
获取检查ID。
以下是awslimitchecker
:https://awslimitchecker.readthedocs.io/en/latest/_modules/awslimitchecker/trustedadvisor.html#TrustedAdvisor._get_limit_check_id
我也检查了boto api,但是否可以使用awslimitcheckermodule本身获取检查ID并检查aws trusted advisor?
提前致谢
答案 0 :(得分:0)
Hi i have resolved this,but when i getting check ids it shows the following
错误:
mycode:
d = TrustedAdvisor(services,
region='myregion',
account_id='none',
account_role='none'
)
e = d._get_limit_check_id()
error:
File "/usr/lib/python2.6/site- packages/awslimitchecker/trustedadvisor.py", line 190, in _get_limit_check_id
checks = self.conn.describe_trusted_advisor_checks(
AttributeError: 'NoneType' object has no attribute 'describe_trusted_advisor_checks'