bref icon indicating copy to clipboard operation
bref copied to clipboard

Feedback for “PHP functions runtime for AWS Lambda”

Open bryanzarzuela opened this issue 9 months ago • 0 comments

In the documentation, it is suggested that whatever function name you configured in serverless.yml should be used when invoking the function from another PHP application.

$result = $lambda->invoke([
    'FunctionName' => '<function-name>',
    'InvocationType' => 'RequestResponse',
    'LogType' => 'None',
    'Payload' => json_encode(/* event data */),
]);

However, this is not the case. You must use the name as it appears in the list of Lambda functions in the AWS console. I suggest the documentation be updated to explain this.

Also, if your Lambda function was created from another account and you want another IAM user to call that function, you'll need to remember to define a resource-based policy on the Lambda function itself to allow the lambda:InvokeFunction to the ARN of that other IAM user.

bryanzarzuela avatar Mar 11 '25 21:03 bryanzarzuela