Lambda 函数是否预装了 AWS 库? (boto3,botocore)

Does Lambda functions comes preinstalled with AWS libraries? (boto3, botocore)

我的 lambda 函数失败(没有错误消息,只是说任务已超时)但是 运行 具有相同权限的相同函数在本地工作正常。我能想到的唯一区别是我需要安装 boto3 和 botocore,而在 lambda 中,我没有做任何这些,因为我希望它们是预装的。但是功能失败让我怀疑:是否有可能 botocore.exceptions 或 boto3 没有预装?

根据官方的说法,它们是预装的 documentation:

Your code runs in an environment that includes the SDK for Python (Boto3), with credentials from an AWS Identity and Access Management (IAM) role that you manage.

关于您的任务超时问题,请尝试在 Lambda 设置的 常规配置 部分中增加 Lambda 函数的超时。它默认为 3 秒,这可能太短了。