Using a Lambda function to connect to the internet (from within a VPC) without NAT Gateway or a NAT instance is not supported.
Note that you can choose not to associate the Lambda function with a VPC - it will have direct internet access then.
Is there some other reason for using the Lambda function in a VPC? One option I've seen other customers use is to decouple the Lambda functions - have one that accesses APIs/data on the internet; and another to access private resources.
Maybe the Lambda URLs would be a good solution for your use case:
- see documentation https://docs.aws.amazon.com/lambda/latest/dg/lambda-urls.html
- see announcement blog post https://aws.amazon.com/blogs/aws/announcing-aws-lambda-function-urls-built-in-https-endpoints-for-single-function-microservices/
This is only possible if you Lambda is called from the Internet to answer some requests and not if it needs to connect to other services on the Internet to get some data. I was unsure of what you mean by "am connecting to the internet using NAT"
Hope it helps!
- AWS 官方已更新 1 年前
- AWS 官方已更新 8 個月前
- AWS 官方已更新 2 年前
- AWS 官方已更新 3 年前