Open Eviltoastey opened 6 months ago
Small update on the matter.
As runtime you should use:
runtime: php-82
It seems like it will go a step further then. Only problem after adding this is that I will get the following error:
{
"errorMessage": "app/EventBridgeHandlers/CreateVacancyInCraftHandler/CreateVacancyInCraftHandler",
"errorType": "Illuminate\\Container\\EntryNotFoundException",
"stackTrace": [
"#0 /var/task/vendor/bref/laravel-bridge/src/HandlerResolver.php(46): Illuminate\\Container\\Container->get('app/EventBridge...')",
"#1 /var/task/vendor/bref/bref/src/FunctionRuntime/Main.php(27): Bref\\LaravelBridge\\HandlerResolver->get('app/EventBridge...')",
"#2 /opt/bref/bootstrap.php(17): Bref\\FunctionRuntime\\Main::run()",
"#3 {main}"
]
}
It seems like the entry now cant be found? The App folder is autoloaded and all namespaces is correct. I'm wondering why it can't find the handler.
Regarding the 1st point: runtime: php-82
is the correct configuration, yes. That's something I thought was obvious when writing the docs, but actually isn't at all. This is because the EventBridge docs (like SQS and others) have been split up from a long page that told you to use this runtime. It's not the case anymore, so I understand how confusing this is.
TL/DR: the documentation should be fixed, thank you for the report 👍
Regarding the 2nd issue: App/EventBridgeHandlers/ImportVacanciesFromCluen/ImportVacanciesFromCluenHandler
isn't a valid class name. You might want to use \
instead of /
as the namespace separator.
the documentation states implementing this will create a lambda called events and create an eventRule too:
However when I add my handlers (I gave 2 examples) I walk into two issues:
My example code:
What am I doing wrong here? Serverless creates the correct eventRule and couples the lambda correctly. I can see in cloudwatch that the lambda actually gets fired but the result is always the same: Handler can not be found.
I hope someone can help me out! Thanks in advance :)