I'm trying to figure out the following:
- I have an API service deployed in the default VPC, and I have a ELB configured to access the service.
- The ELB is attached to a security group
sg-XXXXXXXX1to restrict inbound traffic (open to all for outbound) - I'm now trying to create a lambda function that can call the API service. (using python requests)
I've tried the following and failed to succeed:
- In the configuration > VPC section, I added
sg-XXXXXXXX1as the security group and the 4 default subnets - Added
AWSLambdaVPCAccessExecutionRoleto lambda role - Created a new security group
sg-XXXXXXXX2(all traffic for inbound and outbound), attached it to lambda, and addedsg-XXXXXXXX2to the inbound list (all traffic) forsg-XXXXXXXX1
Any ideas on what I did wrong? and how I can fix it?