I'm getting timeout errors when trying to create AWS Batch jobs using the AWS Javascript SDK from a Lambda.
How can I connect to AWS Batch from a Lambda instance besides creating public/private subnets with a NAT gateway?
CodePudding user response:
The only other way is to not put your lambda in VPC. If you really need your function to be in VPC, the only way is to place it in private subnet and then use NAT in public subnet. This is because there is no VPC interface endpoint for AWS Batch.
You could also have second lambda function, not in VPC. So the main function in the VPC, invokes the second one which operates on AWS Batch. This will work, because AWS Lambda has interface endpoint which allows you to invoke functions from VPC without internet access.