I’m trying to code a lambda function that fetches a zip file from an URL in the internet.
The code is pretty simple:
try {
InputStream in = new URL( urlString ).openStream();
//do some stuff here
in.close();
} catch (Exception e) {
return e;
}
When I run it localy it works perfectly. It also works when I run it with a lambda within a VPC with nat gateway. Howerver, every time I run it within my lambda without VPC I receive a catch error.
Many tutorials state that lambda function without VPC should have internet acess.
Am I doing something wrong, or am I understanding something wrong?
Thanks
Igor Pinheiro is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.