简体   繁体   English

AWS Lambda无法从S3中读取

[英]AWS Lambda doesn't read from S3

I have an AWS Lambda function which fully works when tested locally using ATOM, within this it reads and writes to my s3 bucket. 我有一个AWS Lambda函数,当使用ATOM在本地进行测试时,该函数可以完全正常工作,在此函数中,该函数可以读写我的s3存储桶。 However when I upload the function to Lambda it doesn't seem to have access to S3. 但是,当我将函数上传到Lambda时,似乎无法访问S3。 Whenever I try to read from S3 it simply times out after 3 minutes, even on simple requests like listing buckets. 每当我尝试从S3读取内容时,即使在简单的请求(例如列出存储桶)时,它也会在3分钟后立即超时。

I have increased the access of "Lambda Basic Execution" to have full admin access, and it still doesn't work. 我已经增加了对“ Lambda基本执行”的访问权限,以具有完全的管理员访问权限,但它仍然无法正常工作。

Any ideas would be greatly appreciated. 任何想法将不胜感激。

According to information provided you have troubles with communication between deployed to server lambda and S3 . 根据提供的信息,您在部署到服务器lambdaS3之间的通信时遇到麻烦。 When running on the local machine, where you have direct access to S3 , there is no problem, because it is not isolated environment as in VPC . 在可以直接访问S3的本地计算机上运行时,没有问题,因为它不是像VPC那样的隔离环境。

Please check your network configuration (especially when lambda runs in VPC , for tests purposes you can disable that in AWS console -> Lambda -> yourLambdaFunction -> Network -> choose No VPC ). 请检查您的网络配置(尤其是当lambda在运行VPC ,用于测试目的,你可以禁用,在AWS console - > Lambda - > yourLambdaFunction - > Network - > choose No VPC )。 Image below shows the lambda config for those tests: Lambda console no VPC config 下图显示了这些测试的lambda配置: Lambda控制台没有VPC配置

It was mentioned before. 之前提到过。 Answers included should solve your problem: 包含的答案应该可以解决您的问题:

Lambda Timeout while communicating with S3 与S3通信时Lambda超时

Please let us know if it helps. 请告诉我们是否有帮助。

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

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