79195950

Date: 2024-11-16 19:57:12
Score: 0.5
Natty:
Report link

You Lambda resides within a VPC, so it doesn't have a direct connection to the internet. and S3 is an external service. Without the internet access, your Lambda hangs becaues it cannot reach S3.

Other service can work out without any issue because AWS offers VPC endpoint, however S3 requires an additional steps if your Lambda resides in the VPC.

To solve this out you need to:

  1. Add an S3 VPC Endpoint

    • Create an S3 VPC Endpoint in the VPC where your Lambda function runs.

    • This allows your Lambda to connect to S3 privately without needing internet access.

or

  1. Use a NAT Gateway or NAT Instance

    • If you want your Lambda to have full internet access, deploy a NAT Gateway or NAT Instance in a public subnet.

    • Ensure your Lambda’s private subnet route table points to the NAT gateway for internet traffic.

Reasons:
  • Long answer (-0.5):
  • No code block (0.5):
  • Low reputation (0.5):
Posted by: Fedi Bounouh