Lambda in VPC can't access S3

0

Can't access the S3 file from Lambda in VPC. When trying to access file in S3 from Lambda VPC, it throws timeout error.

Below setup we are done in AWS.

  • Created VPC with Private and Public subnets
  • Created VPC Endpoints for Private subnets
  • Added Lambda (.net core 3.1) in VPC with AWS S3 full access

S3 full access in AWS lambda has given, even though its not access file from S3.

3개 답변
2

I would doublecheck the security group config - If you have added an s3 gateway endpoint the most common misconfiguration I see is forgetting to allow outbound to the s3 prefix list for the region within the security group. See here - "Security group outbound rules" section. If you have used an s3 interface endpoint you need to allow outbound to the interface endpoint itself

AWS
전문가
Peter_G
답변함 2년 전
0

Are you sure you have 1) deployed lambda into your PRIVATE subnets AND 2) there is route from private subnet to internet via NAT GW in public subnet(s). Even if you have a route to S3 via endpoint, I think you still need internet access as well for lambda to work properly (or maybe you can provide this with additional interface endpoints(?). You can also test sample VPC setups from https://docs.aws.amazon.com/lambda/latest/dg/configuration-vpc.html

profile picture
전문가
Kallu
답변함 2년 전
0

Security Groups (SG)

  • The SG that the Lambda is in has to have Outbound access to the SG containing the VPC Endpoint (VPCE) - outbound is usually ALL for a SG
  • The SG that VPCE is in has to have Inbound permission from the SF containing the Lambda

The above applies even if the Lambda and VPCE are in the same SG -- that is you need an inbound rule from the SG to itself.

Routing

  • By Default you should have a local route in all your route tables. If you changed this, then that could be an issue
profile pictureAWS
답변함 2년 전

로그인하지 않았습니다. 로그인해야 답변을 게시할 수 있습니다.

좋은 답변은 질문에 명확하게 답하고 건설적인 피드백을 제공하며 질문자의 전문적인 성장을 장려합니다.

질문 답변하기에 대한 가이드라인

관련 콘텐츠