Lambda VPC integration is only for lambda to access VPC resources, not for VPC resources (e.g. ec2 instance in private subnet) to invoke lambda function. The reason is that Lambda invocation can come from only AWS Lambda API.
Also since lambda does not have VPC endpoint, you can't call it from a private subnet without a NAT gateway.
对我来说,这不是直接的方法。
Lambda VPC integration is only for lambda to access VPC resources, not for VPC resources (e.g. ec2 instance in private subnet) to invoke lambda function. The reason is that Lambda invocation can come from only AWS Lambda API.
Also since lambda does not have VPC endpoint, you can't call it from a private subnet without a NAT gateway.
Yes you can, take a read at Lambda with VPC Networking.
这样,将在您的VPC中指定的子网内创建一个ENI。此ENI将绑定到任何Lambda调用,以确保仅从这些VPC驻留网络传输。
将其放入VPC后,您可以将其放在内部ALB后面,从而允许Python脚本与ALB进行交互,该交互将私下调用Lambda。