As you have already replaced the url and hosted it ec2 at aws but when calling it from lambda functions, outcome has been null or no value.
It might be due to aws service configuration, try running the function and ec2 in same VPC network.
For ec2 check the security for inbound rules as by default its restricted by aws - any outside request.
Check for Role to access EC2 by lambda functions for Auth.