Credstash: 'module' 对象没有属性 'get': AttributeError

Credstash: 'module' object has no attribute 'get': AttributeError

我正在尝试使用 credstash 访问存储在 KMS 中的凭据,但是,甚至在访问它们之前,aws 上的 python 2.7 lambda 运行时就给我一个错误:

'module' object has no attribute 'get': AttributeError
Traceback (most recent call last):
  File "/var/task/lambda_function.py", line 12, in lambda_handler
    print '%s' %(credstash.get('tv.forecaster.dev.cms.username'))
AttributeError: 'module' object has no attribute 'get'

由于那里几乎没有任何信息,我徒劳地为这个问题苦苦挣扎。如果有人能帮助我解决问题,我将不胜感激。以下是我的 requirements.txt:

credstash==1.13.1
cryptography==2.0.3

我正在这样访问我的凭据:

import credstash

string cred = credstash.get('name_of_the_stored_cred_in_dynamodb')

我使用 credstash 访问凭据的方式有误吗?

我在阅读credstash.py的源代码时发现了错误。基本上是 credstash.getSecret('name_of_cred') 而不是 .get()。之后它神奇地起作用了。另外,我不得不将它打包在亚马逊 linux 容器中,而不是 mac