2 Answers
- Newest
- Most votes
- Most comments
1
Hi,
I recommend that you take a look at the following Knowledge Center article which describes how to grant internet access to an AWS Lambda function that's connected to a VPC, since it may be that the VPC or subnet are not correctly configured and you do not have access to that public website.
0
When you connect your function to a VPC, you loose internet access. To access the internet, you will need to deploy a NAT Gateway into the VPC. Note that this will add cost.
To overcome this cost, consider moving the configuration to S3, and run the function not attached to the VPC.
Relevant content
- asked 7 months ago
- asked 7 years ago
- asked a year ago
- How can I use a Lambda function to automatically start an AWS Glue job when a crawler run completes?AWS OFFICIALUpdated 2 years ago
- AWS OFFICIALUpdated a year ago
- AWS OFFICIALUpdated 3 years ago
- AWS OFFICIALUpdated 2 years ago
Hi, thanks for the advice. I created a new VPC with internet access and I'm now able to run requests.get(). However, I made a new EFS as well using the new VPC but now I'm unable to attach it to my lambda function. When I try to test my function, I get the following error: Calling the invoke API action failed with this message: The function couldn't connect to the Amazon EFS file system
This error is usually related with the security group and routing configuration for the VPC subnets. Can you check that it is correctly configured as described in the attached documentation?
Turns out I just didn't change the network VPC of the EFS to the new VPC I created. Doing so allowed me to mount it successfully to the Lambda function. Thanks!