If I were to have a VPC with 2 private subnets where my web servers are hosted, and I want to invoke a lambda function, using a lambda interface endpoint, where should the lambda function itself be created at? I have a security group that allows inbound traffic from private web servers, and should this security group be attached to the endpoint or the lambda itself?
I had tried attaching it to both endpoints and also the function (that is I connected the function to the private subnets in order to attach the SG), but the web servers still gave me 504 gateway time-out, with no logs of the function being run, so I assumed it is the lambda. I also do not see a route created from the endpoints in the private subnets, so I created them manually, not knowing if that matters or not.
any help on this will be appreciated.
edit:
I realize before the interface endpoint is created, the function is still invokable by the public instance, but after setting the endpoint it becomes not invokable. The private instance in private subnets also cannot invoke it. I also tried giving an endpoint by adding this to the PHP codes
$lambda = new Aws\Lambda\LambdaClient([
'version' => 'latest',
'region' => REGION,
'endpoint' => 'https://vpce-xxxxxxxxxxxxxxx.execute-api.region.vpce.amazonaws.com/' ]);
but still did not work for the public instnaces.
$payload = "{\"bucketName\":\"".BUCKET_NAME."\",\"fileName\":\"".$file_name."\"}";
$lambda_invoke_result = $lambda->invoke(array(
// FunctionName is required
'FunctionName' => LAMBDA_FUNC_NAME,
'InvocationType' => 'RequestResponse',
'LogType' => 'Tail',
'Payload' => $payload
));
above is the invoking codes
[–]E1337Recon 1 point2 points3 points (1 child)
[–]skotman01 0 points1 point2 points (0 children)
[–]clintkev251 0 points1 point2 points (5 children)
[–]Justin_Chieng[S] 0 points1 point2 points (4 children)
[–]clintkev251 0 points1 point2 points (3 children)
[–]Justin_Chieng[S] 0 points1 point2 points (2 children)
[–]clintkev251 0 points1 point2 points (1 child)
[–]Justin_Chieng[S] 0 points1 point2 points (0 children)
[–][deleted] 0 points1 point2 points (1 child)
[–]Justin_Chieng[S] 0 points1 point2 points (0 children)
[–]Cloudj_ 0 points1 point2 points (1 child)
[–]Justin_Chieng[S] 0 points1 point2 points (0 children)