Is there any way to make an AWS lambda receive an inbound TCP connection (for instance from another lambda)?
EDIT: I'm not asking whether it's possible to call a lambda from another.
AWS blocks outbound traffic on port 25 (SMTP) of all EC2 instances and Lambda functions by default.
Amazon Alexa. Amazon API Gateway. Amazon CloudFront (Lambda@Edge) Amazon Kinesis Data Firehose.
By default, Lambda runs your functions in an internal virtual private cloud (VPC) with connectivity to AWS services and the internet. To access local network resources, you can configure your function to connect to a VPC in your account.
No not directly. You can only make a connection to Lambda by going through API gateway via HTTP/HTTPS. Your lambda function will be given an HTTP endpoint but the IP address this resolves to is still API gateway and not your lambda function. Invoke a AWS Lambda function by a http request
Why?
I suspect its because each lambda function shares its IP address with lots of other lambda functions located on the VM. They run on containers on top of EC2 instances so you would have several customers running on the same IP address. I've seen no documentation detailing what AWS is really doing but I would guess each container runs on a different port so for you to connect directly to your container you'd need to know the "current" port and not just the IP address. Ontop of that, theres no reason to give the containers public IP addresses. They all probably live in a private subnet.
If you want more confirmation you can explore the AWS lambda console and find no lambda properties other than the HTTP endpoint for API gateway. And if you google the SDK docs you won't come across any IP address retrieval functions.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With