Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/ssis/2.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Python 作为Lambda处理程序执行类方法_Python_Aws Lambda - Fatal编程技术网

Python 作为Lambda处理程序执行类方法

Python 作为Lambda处理程序执行类方法,python,aws-lambda,Python,Aws Lambda,我试图在AWS中使用类方法作为Lambda处理程序。我遵循了示例设置(创建一个virtualenv并将其压缩),但我无法得到一个有效的调用 我的包名是“cloudwatch_metrics”,这是我的包初始化文件: from exporter import Exporter from sns_exporter import SnsExporter from sqs_exporter import SqsExporter from elb_exporter import ElbExporter

我试图在AWS中使用类方法作为Lambda处理程序。我遵循了示例设置(创建一个virtualenv并将其压缩),但我无法得到一个有效的调用

我的包名是“cloudwatch_metrics”,这是我的包初始化文件:

from exporter import Exporter
from sns_exporter import SnsExporter
from sqs_exporter import SqsExporter
from elb_exporter import ElbExporter
在我压缩和部署的virtualenv中,我可以通过以下方式执行lambda处理程序的姐妹“main”函数:

 python -m cloudwatch_metrics.elb_exporter

关于我应该使用什么语法有什么建议吗?

我放弃了,添加了一些设置导入并调用到正确函数中的垫片脚本。每个类都有一个唯一的垫片文件。作为一个积极的副作用,这缩短了处理程序函数的字符串名称,并使其在AWS控制台中更具可读性。

我放弃并添加了一些设置导入并调用到正确函数中的垫片脚本。每个类都有一个唯一的垫片文件。作为一个积极的副作用,这缩短了处理程序函数的字符串名称,并使其在AWS控制台中更具可读性