Access AWS S3 from Lambda within VPC

前端 未结 6 1638
旧巷少年郎
旧巷少年郎 2020-12-08 06:57

Overall, I\'m pretty confused by using AWS Lambda within a VPC. The problem is Lambda is timing out while trying to access an S3 bucket. The solution seems to be a VPC Endpo

6条回答
  •  囚心锁ツ
    2020-12-08 07:20

    I just wanted to add one other answer amongst the others, which might affect those running functions with slow cold start times.

    I'd followed all the instructions about setting up a gateway for S3, but still it didn't work. I created a test Node.js function which simply listed the buckets - I verified that this didn't work without the S3 gateway, but did once the gateway was established. So I knew that part of things was working fine.

    As I was debugging this I was changing the timeout of the function to ensure the function was updated and I was using the latest version of the code when invoking and testing.

    I'd reduced the timeout to 10s, only it turned out my function needed more like 15s on cold boot. Once I'd increased the timeout again, it worked.

提交回复
热议问题