On AWS, I created a new lambda function. I added a role to the lambda that has the policy, AWSLambdaVPCAccessExecutionRole. I placed the lambda in the same VPC as my EC2 instance and made sure the security group assigned to the lambda and EC2 instance have the same default VPC security group created by AWS which allows all traffic within the vpc. On my EC2 instance, I have a tomcat app running on port 8080. I tried to hit the URL by two methods in my lambda function:
- Using my load balancer, which has the same assigned security group
- Hitting the IP address of the EC2 box with port 8080
Both of these options do not work for the lambda function. I tried it on my local computer and it is fine.
Any suggestions?
Security Group for Inbound
- Type = All Traffic
- Protocol = All
- Port Range = All
- Source = Group ID of Security Group