michaeljwright / laravel-aws-lambda
Allows php to respond to http requests on aws lambda
Requires
- php: >=7.1.0
- gisostallenberg/file-permission-calculator: ^1.0
- illuminate/console: ^5.4
- illuminate/filesystem: ^5.4
- illuminate/http: ^5.4
- illuminate/pipeline: ^5.4
- illuminate/support: ^5.4
- symfony/process: ^3.3
Requires (Dev)
- composer/composer: ^1.4
- phpunit/phpunit: ^6.2
- symfony/var-dumper: ^3.3
Suggests
- ext-openssl: Enabling the openssl extension allows you to access https URLs for repositories and packages
- ext-zip: Enabling the zip extension allows you to unzip archives
- ext-zlib: Allow gzip compression of HTTP requests
This package is not auto-updated.
Last update: 2023-08-23 08:32:54 UTC
README
Want to build PHP applications comprised of microservices that run in response to events, auto-scale for you, and only charge you when they run. So do we! This Laravel Pluging lowers the total cost of maintaining our apps, enabling us to build more logic, faster. That right, more ... faster ... Laravel ... PHP ... does it get any better!?
Our company has a significant investment in PHP development as well as Amazon Web Services (AWS). We desire the ability to run Laravel/Lumen Applications in AWS Lambda despite the fact that PHP isn't formally supported.
We created a system for easily building PHP Executables that will run properly in AWS Lambda Functions. Then we set about the task of creating this plugin to allow easily integrating our application with the Lambda Runtime in order to enjoy serverless Lumen/Laravel apps.
Requirements
PHP Version 7.1 - Because I enjoy writing PHP 7.1 code and do not want to write something that is backward compatible.
Installation
composer require stechstudio/laravel-aws-lambda
Register the Provider:
For Lumen services, add:
$app->register(STS\Serverless\ServiceProvider::class);
to bootstrap/app.php
. For Laravel applications, add:
STS\Serverless\ServiceProvider::class,
to the providers
array in config/app.php
.
Configuration
// @todo Actually fill this in.
artisan aws-lambda:install
- Copy all the PHP executable, libraries, and node.js stuff into place.
artisan aws-lambda:package
- Creates a zip archive that can be uploaded to AWS Lambda.
Use It
// @todo Actually fill this in. Local test with lambda-local if you have installed it.
lambda-local -l resources/nodejs/gateway.js -h handler -e resources/nodejs/event-samples/test-data.js