[{"data":1,"prerenderedAt":64},["ShallowReactive",2],{"/2026/02/09-lambda-times-out-when-getting-object-from-s3":3},{"id":4,"title":5,"body":6,"date":55,"description":52,"extension":56,"meta":57,"navigation":58,"path":59,"robots":60,"seo":61,"stem":62,"__hash__":63},"posts/2026/02/09 Lambda-times-out-when-getting-object-from-S3.md","09 Lambda Times Out When Getting Object From S3",{"type":7,"value":8,"toc":51},"minimark",[9,18,25,28,31,41,43,46,48],[10,11,13],"post-title",{":date":12},"date",[14,15,17],"h1",{"id":16},"lambda-times-out-when-getting-object-from-s3","Lambda Times Out When Getting Object from S3",[19,20,21],"notes",{},[22,23,24],"p",{},"This is a repost from my old blog. First posted in 12/10/2024.",[26,27],"br",{},[22,29,30],{},"I had the issue where Lambda function launched in private network times out when trying to get object from S3 bucket. Typically, there are two solutions:",[32,33,34,38],"ol",{},[35,36,37],"li",{},"Use S3 VPC endpoint (either gateway or interface) since it resolves s3 endpoint to private IP.",[35,39,40],{},"Attach public IP. This is done using NAT Gateway with Elastic IP (EIP).",[26,42],{},[22,44,45],{},"The problem is, in my case, the S3 bucket is in different region, different account, than the Lambda function while the first solution, even though S3 is a global service, the VPC endpoint can't resolve to S3 in different region. In short, the first solution only works when S3 bucket and Lambda function are in the same region.",[26,47],{},[22,49,50],{},"That left us with solution 2 which is more expensive but works. Also I need to make sure that the S3 bucket policy allows cross account access.",{"title":52,"searchDepth":53,"depth":53,"links":54},"",2,[],"2026-02-09T00:00:00.000Z","md",{},true,"/2026/02/09-lambda-times-out-when-getting-object-from-s3",null,{"title":5,"description":52},"2026/02/09 Lambda-times-out-when-getting-object-from-S3","UPHWCuOLF5tPx4RuYRtADg6wMr0kvEjyBgLlUsNEVyM",1785167451512]