parent directory.. | ||||
View all files | ||||
| Services | Lambda, API Gateway |
| Integrations | AWS CDK, Bref, PHP |
| Categories | Serverless; PHP |
A PHP/Bref serverless application using a shared Lambda layer deployable with AWS CDK to LocalStack. The application implements a typed PHP Lambda handler as an HTTP handler class for serving API Gateway HTTP events. Bref turns API Gateway events into PSR-7 requests for PHP processing.
The script bootstraps and deploys the CDK app locally, then invokes the HTTP endpoint via curl. You should see output similar to:
Bref also supports running web applications on AWS Lambda via php-fpm, enabling traditional PHP frameworks like Laravel and Symfony. To deploy a php-fpm Laravel project from brefphp/examples to LocalStack:
Install the serverless-localstack plugin:
Add serverless-localstack to plugins in serverless.yml:
Add custom properties:
Deploy:
This code is available under the Apache 2.0 license.