This bundle provides tooling for using Lambda to run Symfony code. Your application will run as a custom Lambda runtime
This is based on bref's console example bootstrap script and removes the need to use only console commands. It also boots the Symfony kernel once for the lifetime of the Lambda worker.
bref provides a Lambda runtime API client implementation. This handles communication with the Lambda runtime API
composer require dayspring-tech/lambda-bundleBootstrap/service.php to your image as /var/run/bootstrap, and make it executable. This is the foundation of your custom Lambda runtime.
# this is really what does the magic
COPY symfony/vendor/dayspring-tech/lambda-bundle/Bootstrap/service.php /var/runtime/bootstrap
RUN chmod a+x /var/runtime/bootstrap
LambdaHandlerServiceInterfaceLambdaHandlerServiceInterface and register it with Symfony's dependency injection container. It should be marked as public so it can be fetched by name.handle() function
handle() function for each Lambda event, passing the event object as the $event argument.$context argument.OutputInterface object with which you can provide any output that should be returned from the Lambda function.If there's a /var/run/bootstrap file in your docker image, Lambda will execute it. This is your custom runtime.
/next API to request the next event.handle() function on the LambdaHandlerServiceInterface specified via the Lambda function's command parameter./response API and POSTs the function's response./error API with details of the error.See also:
The following handlers are provided as examples or common implementations of LambdaHandlerServiceInterface
This handler will echo the event body value to Lambda's output. Useful for testing your container and Lambda configuration.
{
"body": "hello world"
}
This handler can handle lambda events and call any public function on any service available via Symfony's dependency injection container.
It expects a lambda event in the format:
{
"serviceName": "AppBundle\\Service\\EchoService",
"function": "echo",
"args": [
"hello"
]
}
serviceName: any service identifier valid with Container::get(). This will likely be a service class name.function: the function nameargs: an array of arguments to the functionThis handler does the same thing as ServiceFunctionHandlerService but for messages sent via SQS
It expects payloads to be sent via SQS instead of directly to Lambda.
How can I help you explore Laravel packages today?