My lambda code simply do this but always timeout
exports.handler = async function(event, context) {
const response = await fetch("https://www.google.com/");
console.log(response);
return response;
};
I am trying to find an issue with my configuration to reach the internet. I am trying to setup a simple connection using the egress-only internet gateway. What am I doing wrong?
VPC:
Private Subnet
Route table on private subnet
ACL Inbound and Outbound
Lambda security inbound
Lambda security group outbound
egress-only internet gateway
is for IPv6. For lambda to access internet you need NAT gateway which is for IPv4. From docs:
To give your function access to the internet, route outbound traffic to a NAT gateway in a public subnet. The NAT gateway has a public IP address and can connect to the internet through the VPC's internet gateway.