简体   繁体   English

如何转换现有的多模块 python 脚本以在 AWS Lambda 中使用?

[英]How to convert existing multi module python script to be used in AWS Lambda?

As directed, I have configured the handler as directed.按照指示,我已按指示配置处理程序。 For eg single_file.lambda_handler例如single_file.lambda_handler

def lambda_handler(event, context):
    hubspot_api()
    sheet_clear()
    hubspot_properties()
    remaining code

But it does the code does not execute and returns time out error.但它确实代码不执行并返回超时错误。 The configured time is apt for the running code.配置的时间适合运行代码。 Kindly suggest.请建议。

AWS Lambda execution timeout mostly means, that Your lambda do not have permission to do what You want. AWS Lambda 执行超时主要意味着您的 lambda 无权执行您想要的操作。 I'll check if external HTTP communication hubspot_api is reachable.我将检查外部 HTTP 通信 hubspot_api 是否可达。 Also, I strongly suggest using simple logging or AWS X-Ray with segments that can help to figure out where the problem is.此外,我强烈建议使用简单的日志记录或 AWS X-Ray 以及可以帮助找出问题所在的分段。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM