AWS Lambda can't access VPC resources
0
I have a lambda function that sends the following request to get the IDs of all instances inside the region: ec2_client = boto3.client('ec2', os.environ['region']) response = ec2_client.describe_instances(Filters=[{'Name':'instance-state-name', 'Values': ['pending', 'running','shutting-down','stopping','stopped'],}]) The lambda sends also a get request to an API REST installed inside a VPC and this API is not open to the internet: resp = requests.get(os.environ['apidsi']+'/persons/emails') I put my Lambda function inside a VPC so that I can query the API, but when I do that, the lambda times out and it does not access the EC2 instances inside other VPCs. The IAM role has all the necessary permissions : { ...